@pandacss/shared 0.5.0 → 0.5.1

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.js CHANGED
@@ -72,7 +72,7 @@ function isObject(value) {
72
72
  var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
73
73
  var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
74
74
  var astish = (val, tree = [{}]) => {
75
- const block = newRule.exec(val.replace(ruleClean, ""));
75
+ const block = newRule.exec((val ?? "").replace(ruleClean, ""));
76
76
  if (!block)
77
77
  return tree[0];
78
78
  if (block[4])
@@ -170,6 +170,7 @@ function mergeProps(...sources) {
170
170
  }
171
171
 
172
172
  // src/walk-object.ts
173
+ var isNotNullish = (element) => element != null;
173
174
  function walkObject(target, predicate, options = {}) {
174
175
  const { stop, getKey } = options;
175
176
  function inner(value, path = []) {
@@ -181,7 +182,10 @@ function walkObject(target, predicate, options = {}) {
181
182
  if (stop?.(value, childPath)) {
182
183
  return predicate(value, path);
183
184
  }
184
- result[key] = inner(child, childPath);
185
+ const next = inner(child, childPath);
186
+ if (isNotNullish(next)) {
187
+ result[key] = next;
188
+ }
185
189
  }
186
190
  return result;
187
191
  }
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ function isObject(value) {
9
9
  var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
10
10
  var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
11
11
  var astish = (val, tree = [{}]) => {
12
- const block = newRule.exec(val.replace(ruleClean, ""));
12
+ const block = newRule.exec((val ?? "").replace(ruleClean, ""));
13
13
  if (!block)
14
14
  return tree[0];
15
15
  if (block[4])
@@ -107,6 +107,7 @@ function mergeProps(...sources) {
107
107
  }
108
108
 
109
109
  // src/walk-object.ts
110
+ var isNotNullish = (element) => element != null;
110
111
  function walkObject(target, predicate, options = {}) {
111
112
  const { stop, getKey } = options;
112
113
  function inner(value, path = []) {
@@ -118,7 +119,10 @@ function walkObject(target, predicate, options = {}) {
118
119
  if (stop?.(value, childPath)) {
119
120
  return predicate(value, path);
120
121
  }
121
- result[key] = inner(child, childPath);
122
+ const next = inner(child, childPath);
123
+ if (isNotNullish(next)) {
124
+ result[key] = next;
125
+ }
122
126
  }
123
127
  return result;
124
128
  }
package/dist/shared.js CHANGED
@@ -47,7 +47,7 @@ function isObject(value) {
47
47
  var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
48
48
  var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
49
49
  var astish = (val, tree = [{}]) => {
50
- const block = newRule.exec(val.replace(ruleClean, ""));
50
+ const block = newRule.exec((val ?? "").replace(ruleClean, ""));
51
51
  if (!block)
52
52
  return tree[0];
53
53
  if (block[4])
@@ -119,6 +119,7 @@ function mergeProps(...sources) {
119
119
  }
120
120
 
121
121
  // src/walk-object.ts
122
+ var isNotNullish = (element) => element != null;
122
123
  function walkObject(target, predicate, options = {}) {
123
124
  const { stop, getKey } = options;
124
125
  function inner(value, path = []) {
@@ -130,7 +131,10 @@ function walkObject(target, predicate, options = {}) {
130
131
  if (stop?.(value, childPath)) {
131
132
  return predicate(value, path);
132
133
  }
133
- result[key] = inner(child, childPath);
134
+ const next = inner(child, childPath);
135
+ if (isNotNullish(next)) {
136
+ result[key] = next;
137
+ }
134
138
  }
135
139
  return result;
136
140
  }
package/dist/shared.mjs CHANGED
@@ -7,7 +7,7 @@ function isObject(value) {
7
7
  var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
8
8
  var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
9
9
  var astish = (val, tree = [{}]) => {
10
- const block = newRule.exec(val.replace(ruleClean, ""));
10
+ const block = newRule.exec((val ?? "").replace(ruleClean, ""));
11
11
  if (!block)
12
12
  return tree[0];
13
13
  if (block[4])
@@ -79,6 +79,7 @@ function mergeProps(...sources) {
79
79
  }
80
80
 
81
81
  // src/walk-object.ts
82
+ var isNotNullish = (element) => element != null;
82
83
  function walkObject(target, predicate, options = {}) {
83
84
  const { stop, getKey } = options;
84
85
  function inner(value, path = []) {
@@ -90,7 +91,10 @@ function walkObject(target, predicate, options = {}) {
90
91
  if (stop?.(value, childPath)) {
91
92
  return predicate(value, path);
92
93
  }
93
- result[key] = inner(child, childPath);
94
+ const next = inner(child, childPath);
95
+ if (isNotNullish(next)) {
96
+ result[key] = next;
97
+ }
94
98
  }
95
99
  return result;
96
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/shared",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Shared utilities for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",