@tokey/css-value-parser
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -17,7 +17,13 @@ "use strict"; | ||
if (type === `space`) { | ||
const firstSpace = value.indexOf(` `); | ||
let firstSpace = value.indexOf(` `); | ||
if (firstSpace === -1) { | ||
firstSpace = value.indexOf(`\n`); | ||
} | ||
if (firstSpace === -1) { | ||
firstSpace = value.indexOf(`\t`); | ||
} | ||
const before = firstSpace !== -1 ? value.substring(0, firstSpace) : ``; | ||
const after = firstSpace !== -1 ? value.substring(firstSpace + 1) : value.substring(1); | ||
ast.push((0, ast_types_1.space)({ | ||
value: firstSpace !== -1 ? ` ` : value[0], | ||
value: firstSpace !== -1 ? value[firstSpace] : value[0], | ||
start, | ||
@@ -24,0 +30,0 @@ end, |
{ | ||
"name": "@tokey/css-value-parser", | ||
"description": "value parser for css", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"main": "dist/index.js", | ||
@@ -11,3 +11,3 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@tokey/core": "^1.3.0" | ||
"@tokey/core": "^1.4.0" | ||
}, | ||
@@ -14,0 +14,0 @@ "keywords": [ |
@@ -53,3 +53,9 @@ import { | ||
if (type === `space`) { | ||
const firstSpace = value.indexOf(` `); | ||
let firstSpace = value.indexOf(` `); | ||
if (firstSpace === -1) { | ||
firstSpace = value.indexOf(`\n`); | ||
} | ||
if (firstSpace === -1) { | ||
firstSpace = value.indexOf(`\t`); | ||
} | ||
const before = firstSpace !== -1 ? value.substring(0, firstSpace) : ``; | ||
@@ -59,3 +65,3 @@ const after = firstSpace !== -1 ? value.substring(firstSpace + 1) : value.substring(1); | ||
space({ | ||
value: firstSpace !== -1 ? ` ` : value[0], | ||
value: firstSpace !== -1 ? value[firstSpace] : value[0], | ||
start, | ||
@@ -62,0 +68,0 @@ end, |
Sorry, the diff of this file is not supported yet
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
140886
2844
Updated@tokey/core@^1.4.0