Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@code.gov/cautious

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code.gov/cautious

Cautious Utility Functions in JavaScript

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
3
Created
Source

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)
}

FAQs

Package last updated on 05 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts