@neko-os/ui 0.6.0 → 0.6.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.
@@ -30,6 +30,8 @@ export function useGetResponsiveValue() {
30
30
 
31
31
 
32
32
 
33
+
34
+
33
35
  var bpNames = breakpoints.map(function (b) {return b.name;});
34
36
  var isResponsiveKey = function isResponsiveKey(k) {return (
35
37
  k === 'df' ||
@@ -39,7 +41,8 @@ export function useGetResponsiveValue() {
39
41
  k === 'android' ||
40
42
  bpNames.includes(k) ||
41
43
  /^(\w+)[du]$/.test(k) && bpNames.includes(k.slice(0, -1)));};
42
- if (!Object.keys(value).some(isResponsiveKey)) return value;
44
+ var objKeys = Object.keys(value);
45
+ if (objKeys.length > 0 && !objKeys.some(isResponsiveKey)) return value;
43
46
 
44
47
  if (value[screen]) return value[screen];
45
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neko-os/ui",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "author": "Christian Storch <ccstorch@gmail.com>",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -28,8 +28,10 @@ export function useGetResponsiveValue() {
28
28
  if (!isObj) return value
29
29
 
30
30
  // Only treat the object as a responsive descriptor when it actually
31
- // carries breakpoint / platform / df keys. Otherwise it is a plain
32
- // object prop (e.g. titleProps) and must pass through untouched.
31
+ // carries breakpoint / platform / df keys. A non-empty plain object
32
+ // (e.g. titleProps) passes through untouched. An empty object carries
33
+ // no info either way, so it falls through to the df (undefined) result
34
+ // instead of returning itself truthy.
33
35
  const bpNames = breakpoints.map((b) => b.name)
34
36
  const isResponsiveKey = (k) =>
35
37
  k === 'df' ||
@@ -39,7 +41,8 @@ export function useGetResponsiveValue() {
39
41
  k === 'android' ||
40
42
  bpNames.includes(k) ||
41
43
  (/^(\w+)[du]$/.test(k) && bpNames.includes(k.slice(0, -1)))
42
- if (!Object.keys(value).some(isResponsiveKey)) return value
44
+ const objKeys = Object.keys(value)
45
+ if (objKeys.length > 0 && !objKeys.some(isResponsiveKey)) return value
43
46
 
44
47
  if (value[screen]) return value[screen]
45
48