sugar-high 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +0 -1
  2. package/lib/index.js +13 -16
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Sugar High
2
2
 
3
3
  [![Build][build-badge]][build]
4
- [![Coverage][coverage-badge]][coverage]
5
4
 
6
5
  ### Introduction
7
6
 
package/lib/index.js CHANGED
@@ -304,9 +304,6 @@ function tokenize(code, options) {
304
304
  * @param {string} token_
305
305
  */
306
306
  const append = (type_, token_) => {
307
- if (type_ || token_) {
308
- const nType = TokenTypes[type_]
309
- }
310
307
  if (token_) {
311
308
  current = token_
312
309
  }
@@ -460,26 +457,26 @@ function tokenize(code, options) {
460
457
  if (next === '-' && !inStringContent() && !inJsxLiterals()) {
461
458
  if (current) {
462
459
  append(T_PROPERTY, current + curr + next)
463
- i += 1
460
+ i++
464
461
  continue
465
462
  }
466
463
  }
467
464
  // `=` in property=<value>
468
465
  if (next === '=' && !inStringContent()) {
469
466
  // if current is not a space, ensure `prop` is a property
470
- if (isSpaces(current)) {
471
- append(T_SPACE, current)
472
- current = ''
467
+ if (!isSpaces(curr)) {
468
+ // If there're leading spaces, append them first
469
+ if (isSpaces(current)) {
470
+ append()
471
+ }
472
+
473
+ // Now check if the accumulated token is a property
474
+ const prop = current + curr
475
+ if (isIdentifier(prop)) {
476
+ append(T_PROPERTY, prop)
477
+ continue
478
+ }
473
479
  }
474
- const prop = current ? (current + curr) : curr
475
- if (isIdentifier(prop)) {
476
- current = prop
477
- append(T_PROPERTY)
478
- } else if (prop === ' ') {
479
- current = prop
480
- append(T_SPACE)
481
- }
482
- continue
483
480
  }
484
481
  }
485
482
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sugar-high",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "type": "module",
5
5
  "types": "./lib/index.d.ts",
6
6
  "main": "./lib/index.js",
@@ -27,7 +27,7 @@
27
27
  "devDependencies": {
28
28
  "@types/node": "22.10.7",
29
29
  "@types/react": "19.0.7",
30
- "codice": "^1.0.0",
30
+ "codice": "^1.3.1",
31
31
  "dom-to-image": "^2.6.0",
32
32
  "next": "15.1.5",
33
33
  "react": "^19.0.0",