@geometra/tw 1.10.0 → 1.10.2

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.
package/dist/index.d.ts CHANGED
@@ -10,7 +10,8 @@ export type TwResult = FlexProps & StyleProps;
10
10
  * ```
11
11
  *
12
12
  * Accepts one or more class strings. Last class wins on conflicts.
13
- * Unknown classes are silently ignored.
13
+ * Unknown classes are silently ignored. Non-string arguments are skipped at runtime so corrupt spreads
14
+ * (e.g. `Symbol` values) cannot make `Array#join` throw.
14
15
  */
15
16
  export declare function tw(...classes: string[]): TwResult;
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,oEAAoE;AACpE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAA;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,QAAQ,CAEjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,oEAAoE;AACpE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAA;AAE7C;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,QAAQ,CAMjD"}
package/dist/index.js CHANGED
@@ -7,9 +7,15 @@ import { parseClasses } from './parser.js';
7
7
  * ```
8
8
  *
9
9
  * Accepts one or more class strings. Last class wins on conflicts.
10
- * Unknown classes are silently ignored.
10
+ * Unknown classes are silently ignored. Non-string arguments are skipped at runtime so corrupt spreads
11
+ * (e.g. `Symbol` values) cannot make `Array#join` throw.
11
12
  */
12
13
  export function tw(...classes) {
13
- return parseClasses(classes.join(' '));
14
+ const parts = [];
15
+ for (const c of classes) {
16
+ if (typeof c === 'string')
17
+ parts.push(c);
18
+ }
19
+ return parseClasses(parts.join(' '));
14
20
  }
15
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAK1C;;;;;;;;;GASG;AACH,MAAM,UAAU,EAAE,CAAC,GAAG,OAAiB;IACrC,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACxC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAK1C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,EAAE,CAAC,GAAG,OAAiB;IACrC,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAQpD"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CASpD"}
package/dist/parser.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { resolveToken } from './resolver.js';
2
2
  /** Parse a class string into tokens and resolve each to props. */
3
3
  export function parseClasses(input) {
4
+ if (typeof input !== 'string')
5
+ return {};
4
6
  const tokens = input.split(/\s+/).filter(Boolean);
5
7
  const result = {};
6
8
  for (const token of tokens) {
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjD,MAAM,MAAM,GAA4B,EAAE,CAAA;IAC1C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;QACpC,IAAI,QAAQ;YAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;IACD,OAAO,MAAkB,CAAA;AAC3B,CAAC"}
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAc,CAAA;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjD,MAAM,MAAM,GAA4B,EAAE,CAAA;IAC1C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;QACpC,IAAI,QAAQ;YAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;IACD,OAAO,MAAkB,CAAA;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geometra/tw",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "Tailwind-style utility classes for Geometra",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,7 +34,7 @@
34
34
  "check": "tsc --noEmit"
35
35
  },
36
36
  "dependencies": {
37
- "@geometra/core": "^1.10.0",
38
- "textura": "^1.10.0"
37
+ "@geometra/core": "^1.10.2",
38
+ "textura": "^1.10.2"
39
39
  }
40
40
  }