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

is-too

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-too - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

28

is-too.js

@@ -35,3 +35,3 @@ /*!

VERSION: '2.1.0',
VERSION: '2.2.0',

@@ -206,6 +206,2 @@ // OPERATORS

regex: function(x) {
return Object.prototype.toString.call(x) == '[object RegExp]'
},
/**

@@ -242,3 +238,25 @@ * Is the subject an arguments object?

// REGULAR EXPRESSIONS
/**
* Is the subject a regular expression?
*
* @method regex
* @param {RegEx} subject, required
*/
regex: function(x) {
return Object.prototype.toString.call(x) == '[object RegExp]'
},
/**
* Does the subject match the provided regular expression?
*
* @method match
* @param {String} subject, required
* @param {RegExp} standard, required
*/
match: function(x, rx) {
return is.rx(rx) && rx.test(x)
},
// STRINGS

@@ -245,0 +263,0 @@

2

package.json
{
"name": "is-too",
"description": "simple validations",
"version": "2.1.0",
"version": "2.2.0",
"keywords": [

@@ -6,0 +6,0 @@ "is",

var asserts = require('./_asserts')
var assert = require('assert')
var is = require('../is-too')
var regexs = ['regex', 'newRegExp']
var rx = /foo/

@@ -15,2 +18,11 @@ describe('regular expressions', function(){

it('is.match', function(){
assert.equal(true, is.match('foo', rx))
})
it('is.not.match', function(){
assert.equal(true, is.not.match('bar', rx))
assert.equal(true, is.not.match(new Date(), rx))
})
})

Sorry, the diff of this file is not supported yet

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