is-whitespace
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -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); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6928
68