space-separated-tokens
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -5,11 +5,11 @@ /** | ||
* @param {string} value Space separated tokens | ||
* @returns {string[]} Tokens | ||
* @returns {Array.<string>} Tokens | ||
*/ | ||
export function parse(value: string): string[]; | ||
export function parse(value: string): Array<string>; | ||
/** | ||
* Serialize an array of strings as space separated tokens. | ||
* | ||
* @param {string[]} values Tokens | ||
* @param {Array.<string|number>} values Tokens | ||
* @returns {string} Space separated tokens | ||
*/ | ||
export function stringify(values: string[]): string; | ||
export function stringify(values: Array<string | number>): string; |
@@ -5,6 +5,6 @@ /** | ||
* @param {string} value Space separated tokens | ||
* @returns {string[]} Tokens | ||
* @returns {Array.<string>} Tokens | ||
*/ | ||
export function parse(value) { | ||
var input = String(value || '').trim() | ||
const input = String(value || '').trim() | ||
return input ? input.split(/[ \t\n\r\f]+/g) : [] | ||
@@ -16,3 +16,3 @@ } | ||
* | ||
* @param {string[]} values Tokens | ||
* @param {Array.<string|number>} values Tokens | ||
* @returns {string} Space separated tokens | ||
@@ -19,0 +19,0 @@ */ |
{ | ||
"name": "space-separated-tokens", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Parse and stringify space separated tokens", | ||
@@ -34,3 +34,4 @@ "license": "MIT", | ||
"devDependencies": { | ||
"c8": "^7.6.0", | ||
"@types/tape": "^4.0.0", | ||
"c8": "^7.0.0", | ||
"prettier": "^2.0.0", | ||
@@ -42,3 +43,3 @@ "remark-cli": "^9.0.0", | ||
"typescript": "^4.0.0", | ||
"xo": "^0.38.0" | ||
"xo": "^0.39.0" | ||
}, | ||
@@ -45,0 +46,0 @@ "scripts": { |
@@ -12,2 +12,5 @@ # space-separated-tokens | ||
This package is ESM only: Node 12+ is needed to use it and it must be `import`ed | ||
instead of `require`d. | ||
[npm][]: | ||
@@ -33,4 +36,3 @@ | ||
`space-separated-tokens` exports the following identifiers: `parse`, | ||
`stringify`. | ||
This package exports the following identifiers: `parse`, `stringify`. | ||
There is no default export. | ||
@@ -37,0 +39,0 @@ |
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
6109
86
9