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

is-whitespace

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-whitespace - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

6

index.js

@@ -10,7 +10,9 @@ /*!

var regex = new RegExp('^[\\s\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF"]+$');
module.exports = function isWhitespace(value) {
if (typeof value === 'string') {
return (/^\s+$/).test(value);
return regex.test(value);
}
return false;
};
};
{
"name": "is-whitespace",
"description": "Returns true if the value passed is all whitespace",
"version": "0.1.0",
"version": "0.2.0",
"homepage": "https://github.com/jonschlinkert/is-whitespace",

@@ -24,9 +24,11 @@ "author": {

"keywords": [
"docs",
"documentation",
"generate",
"generator",
"markdown",
"templates",
"verb"
"whitespace",
"white space",
"white-space",
"check",
"tabs",
"spaces",
"nl",
"newline",
"newlines"
],

@@ -33,0 +35,0 @@ "main": "index.js",

@@ -33,2 +33,2 @@ # is-whitespace [![NPM version](https://badge.fury.io/js/is-whitespace.png)](http://badge.fury.io/js/is-whitespace)

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 15, 2014._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 02, 2014._

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

var read = function(name) {
return fs.readFileSync(('test/fixtures/' + name), 'utf8');
return fs.readFileSync(('test/fixtures/' + name), 'utf8');
};

@@ -53,2 +53,13 @@

});
});
});
describe('ES5-compliant whitespace', function () {
it('should be true for all expected whitespace values', function () {
var actual = isWhitespace("\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF");
expect(actual).to.eql(true);
});
it('should not be true for the zero-width space', function () {
expect(isWhitespace('\u200b')).to.eql(false);
});
});
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