antv-l7/node_modules/space-separated-tokens
thinkinggis f7e5376b7d fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
..
index.js fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
license fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
package.json fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
readme.md fix(fix css): fix css png 2019-11-22 18:04:14 +08:00

readme.md

space-separated-tokens

Build Coverage Downloads Size

Parse and stringify space-separated tokens according to the spec.

Installation

npm:

npm install space-separated-tokens

Usage

var spaceSeparated = require('space-separated-tokens')

spaceSeparated.parse(' foo\tbar\nbaz  ')
//=> ['foo', 'bar', 'baz']

spaceSeparated.stringify(['foo', 'bar', 'baz'])
//=> 'foo bar baz'

API

spaceSeparated.parse(value)

Parse space-separated tokens to an array of strings, according to the spec.

Parameters
  • value (string) — space-separated tokens.
Returns

Array.<string> — List of tokens.

spaceSeparated.stringify(values)

Compile an array of strings to space-separated tokens. Note that its not possible to specify empty or white-space only values.

Parameters
  • values (Array.<string>) — List of tokens.
Returns

string — Space-separated tokens.

License

MIT © Titus Wormer