New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

shouldbe

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shouldbe

Error-throwing type-checking for JavaScript

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

shouldbe

shouldbe is a type-checking utility for JavaScript code that lives write in your code and throws up if underscore says the value is not of the given type.

Example

shouldbe("string", str) // throws if _.isString(str) would return false

Dependencies

Underscore is the only dependency right now.

How to add more types

Just add the relevant mixin to underscore.

For example:

_.mixin({
    isEvenValue: function (val) { return !(val % 2); }
});
shouldbe("even-value", 3); // throws up!

Keywords

FAQs

Package last updated on 27 Apr 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc