zss-engine 0.2.63 → 0.2.65

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.
@@ -2,15 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.genBase36Hash = genBase36Hash;
4
4
  function deepNormalize(obj) {
5
- if (obj === null || obj === undefined)
5
+ if (obj === null)
6
6
  return 'null';
7
+ if (obj === undefined)
8
+ return 'undefined';
7
9
  if (typeof obj !== 'object')
8
10
  return String(obj);
9
11
  if (Array.isArray(obj)) {
10
12
  return '[' + obj.map(deepNormalize).join(',') + ']';
11
13
  }
12
- const keys = Object.keys(obj).sort();
13
- const pairs = keys.map(key => `"${key}":${deepNormalize(obj[key])}`);
14
+ const recordObj = obj;
15
+ const keys = Object.keys(recordObj).sort();
16
+ const pairs = keys.map(key => `"${key}":${deepNormalize(recordObj[key])}`);
14
17
  return '{' + pairs.join(',') + '}';
15
18
  }
16
19
  function murmurhash3_32(str, seed = 0) {
@@ -34,8 +34,8 @@ function processAtomicProps(flatProps, atomicHashes, allStyleSheets, parentAtRul
34
34
  const CSSProp = (0, index_js_1.camelToKebabCase)(property);
35
35
  const normalizedValue = (0, index_js_1.applyCssValue)(value, CSSProp);
36
36
  const singlePropObj = { [property]: normalizedValue };
37
- const hashInput = parentAtRule ? { [parentAtRule]: singlePropObj } : singlePropObj;
38
- const atomicHash = (0, index_js_1.genBase36Hash)(hashInput, 1, 8);
37
+ const styleObj = parentAtRule ? { [parentAtRule]: singlePropObj } : singlePropObj;
38
+ const atomicHash = (0, index_js_1.genBase36Hash)(styleObj, 1, 8);
39
39
  if (atomicHashes.has(atomicHash))
40
40
  return;
41
41
  atomicHashes.add(atomicHash);
@@ -1,13 +1,16 @@
1
1
  function deepNormalize(obj) {
2
- if (obj === null || obj === undefined)
2
+ if (obj === null)
3
3
  return 'null';
4
+ if (obj === undefined)
5
+ return 'undefined';
4
6
  if (typeof obj !== 'object')
5
7
  return String(obj);
6
8
  if (Array.isArray(obj)) {
7
9
  return '[' + obj.map(deepNormalize).join(',') + ']';
8
10
  }
9
- const keys = Object.keys(obj).sort();
10
- const pairs = keys.map(key => `"${key}":${deepNormalize(obj[key])}`);
11
+ const recordObj = obj;
12
+ const keys = Object.keys(recordObj).sort();
13
+ const pairs = keys.map(key => `"${key}":${deepNormalize(recordObj[key])}`);
11
14
  return '{' + pairs.join(',') + '}';
12
15
  }
13
16
  function murmurhash3_32(str, seed = 0) {
@@ -30,8 +30,8 @@ function processAtomicProps(flatProps, atomicHashes, allStyleSheets, parentAtRul
30
30
  const CSSProp = camelToKebabCase(property);
31
31
  const normalizedValue = applyCssValue(value, CSSProp);
32
32
  const singlePropObj = { [property]: normalizedValue };
33
- const hashInput = parentAtRule ? { [parentAtRule]: singlePropObj } : singlePropObj;
34
- const atomicHash = genBase36Hash(hashInput, 1, 8);
33
+ const styleObj = parentAtRule ? { [parentAtRule]: singlePropObj } : singlePropObj;
34
+ const atomicHash = genBase36Hash(styleObj, 1, 8);
35
35
  if (atomicHashes.has(atomicHash))
36
36
  return;
37
37
  atomicHashes.add(atomicHash);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zss-engine",
3
- "version": "0.2.63",
3
+ "version": "0.2.65",
4
4
  "description": "Zero-runtime StyleSheet Engine",
5
5
  "keywords": [
6
6
  "zero-runtime",