Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "spdx", | ||
"description": "SPDX License Expression Syntax parser", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (http://kemitchell.com)", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/kemitchell/spdx.js/issues", |
@@ -55,2 +55,10 @@ spdx.js | ||
Strict Whitespace Rules | ||
----------------------- | ||
```js | ||
spdx.valid('MIT '); // => false | ||
spdx.valid(' MIT'); // => false | ||
spdx.valid('MIT AND BSD-3-Clause'); // => false | ||
``` | ||
Identifier Lists | ||
@@ -57,0 +65,0 @@ ---------------- |
@@ -14,3 +14,11 @@ // spdx.js | ||
var containsRepeatedSpace = /\s{2,}/; | ||
exports.valid = function(argument) { | ||
if ( | ||
argument.trim() !== argument || | ||
containsRepeatedSpace.test(argument) | ||
) { | ||
return false; | ||
} | ||
try { | ||
@@ -35,3 +43,3 @@ parser.parse(argument); | ||
// This module's semantic version | ||
exports.version = '0.2.0'; | ||
exports.version = '0.2.1'; | ||
@@ -38,0 +46,0 @@ // The SPDX Package Data Exchange Specification version |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48997
1575
125
0