rn-css 2.0.1 → 2.0.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.
@@ -26,7 +26,7 @@ function buildCSSString(chunks, functs, props, shared) {
26
26
  .map((chunk, i) => ([chunk, (functs[i] instanceof Function) ? functs[i]({ shared, theme: shared, ...props }) : functs[i]]))
27
27
  .flat()
28
28
  // Convert the objects to string if the result is not a primitive
29
- .map(chunk => typeof chunk === 'object' ? (0, rnToCss_1.default)(chunk) : chunk)
29
+ .map(chunk => chunk && typeof chunk === 'object' ? (0, rnToCss_1.default)(chunk) : chunk)
30
30
  .join('');
31
31
  if (props.rnCSS)
32
32
  computedString += props.rnCSS.replace(/=/gm, ':') + ';';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-css",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/index.js",
@@ -44,7 +44,7 @@ function buildCSSString<T extends { rnCSS?: string }> (chunks: TemplateStringsAr
44
44
  .map((chunk, i) => ([chunk, (functs[i] instanceof Function) ? (functs[i] as Functs<T>)({ shared, theme: (shared as DefaultTheme), ...props }) : functs[i]]))
45
45
  .flat()
46
46
  // Convert the objects to string if the result is not a primitive
47
- .map(chunk => typeof chunk === 'object' ? rnToCSS(chunk as Partial<CompleteStyle>) : chunk)
47
+ .map(chunk => chunk && typeof chunk === 'object' ? rnToCSS(chunk as Partial<CompleteStyle>) : chunk)
48
48
  .join('')
49
49
  if (props.rnCSS) computedString += props.rnCSS.replace(/=/gm, ':') + ';'
50
50
  return computedString