This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@code.gov/cautious

0.3.0 • Public • Published

alpha version

This code should not be used in production. It is prone to breaking changes.

cautious

Cautious Utility Functions in JavaScript

why?

We deal with a lot of dirty data. We have found ourselves rewriting a lot of the same null-checking and try-catching patterns because we can't guarantee that the data we are processing is clean. Instead of rewriting again and again, lets write just once some convience functions with null-checking and try-catching inside of them and use those throughout our tech stack.

when not to use this

Your data is clean and reliably sticks to a certain schema

examples

before

if (Array.isArray(languages) && language.length > 1) {
  console.log("languages are", languages)
}

after

if (some(languages)) {
  console.log("languages are", languages)
}

Readme

Keywords

none

Package Sidebar

Install

npm i @code.gov/cautious

Weekly Downloads

0

Version

0.3.0

License

CC0-1.0

Unpacked Size

5.8 kB

Total Files

3

Last publish

Collaborators

  • jrcastle
  • sarassassin
  • skstarne