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

types.js

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

types.js - npm Package Compare versions

Comparing version 1.2.8 to 1.2.9

3

package.json
{
"name": "types.js",
"version": "1.2.8",
"version": "1.2.9",
"description": "A tiny (1.7kb), but essential Javascript type-check library",

@@ -19,3 +19,2 @@ "main": "types.min.js",

"check",
"validation",
"force"

@@ -22,0 +21,0 @@ ],

@@ -62,16 +62,18 @@ types.js

Client= function( name ){
// if name is not set or not String, this.name will be set to: 'no name given yet'
this.name= _.forceString( name, 'no name given yet' );
}
var unborn= new Client();
console.log( unborn.name ); // 'no name given yet'
var func= null;
// call a function that might not exist anymore:
_.forceFunction( func )( funcArgs );
_.forceFunction( func )( 'some arguments', 'for func' );
// no crash, default empty function is called, returns undefined
// or add a replacement function in case the first one fails:
_.forceFunction( func, function(){
return 'replacement function used';
})( funcArgs );
var message= _.forceFunction( func, function(args){
return 'replacement function used '+ args;
})( 'with some arguments' );
console.log( message );
// replacement function used with some arguments

@@ -78,0 +80,0 @@ // some default type checking:

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