Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

functionality

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

functionality - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

5

lib/Masquerade.js

@@ -40,2 +40,5 @@ var _ = require('lodash');

return new Masquerade(function(value) {
// /regex/ => "a regex string"
if(mask instanceof RegExp) return mask.test(value || '');
// String => "string"

@@ -79,4 +82,2 @@ if(mask === String) return typeof value == 'string';

// /regex/ => "a regex string"
if(mask instanceof RegExp) return mask.test(value || '');

@@ -83,0 +84,0 @@ // Masquerade => new Masquerade()

2

package.json
{
"name": "functionality",
"version": "1.3.1",
"version": "1.3.2",
"description": "Simple function overloading for JavaScript",

@@ -5,0 +5,0 @@ "author": "Sierra Softworks",

@@ -115,2 +115,14 @@ var Masquerade = require('../lib/Masquerade.js');

});
it('should support RegExp masks', function() {
Masquerade.match(/^str$/, "str").should.be.true;
Masquerade.match(/^str$/, "astr").should.be.false;
Masquerade.match(/^str$/, 1).should.be.false;
Masquerade.match(/^str$/, new Date()).should.be.false;
Masquerade.match(/^str$/, /regex/).should.be.false;
Masquerade.match(/^str$/, []).should.be.false;
Masquerade.match(/^str$/, {}).should.be.false;
Masquerade.match(/^str$/, true).should.be.false;
Masquerade.match(/^str$/, { a: 1 }).should.be.false;
});
});

@@ -117,0 +129,0 @@

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