@yamada-ui/utils
Advanced tools
Comparing version 1.3.1-next-20240704080818 to 1.3.1
@@ -51,3 +51,5 @@ "use strict"; | ||
var isFunction = (value) => typeof value === "function"; | ||
var isUnit = (value) => /[0-9].*[px|rem|em|%|vw|vh]$/.test(value); | ||
var isUnit = (value) => /[0-9].*(em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cm|mm|Q|in|pc|pt|px|%|cqw|cqh|cqi|cqb|cqmin|cqmax)$/.test( | ||
value | ||
); | ||
var cast = (value) => value; | ||
@@ -54,0 +56,0 @@ // Annotate the CommonJS export names for ESM import in node: |
@@ -63,2 +63,4 @@ "use strict"; | ||
var isNumber = (value) => typeof value === "number"; | ||
var isString = (value) => Object.prototype.toString.call(value) === "[object String]"; | ||
var isUndefined = (value) => typeof value === "undefined" && value === void 0; | ||
var isArray = (value) => Array.isArray(value); | ||
@@ -68,3 +70,3 @@ | ||
var getObject = (obj, path, fallback, i) => { | ||
const k = typeof path === "string" ? path.split(".") : [path]; | ||
const k = isString(path) ? path.split(/\[(.*?)\]|\./).filter(Boolean) : [path]; | ||
for (i = 0; i < k.length; i += 1) { | ||
@@ -79,3 +81,3 @@ if (!obj) break; | ||
const memoizedFunc = (obj, path, fallback, i) => { | ||
if (typeof obj === "undefined") return func(obj, path, fallback); | ||
if (isUndefined(obj)) return func(obj, path, fallback); | ||
if (!cache.has(obj)) cache.set(obj, /* @__PURE__ */ new Map()); | ||
@@ -82,0 +84,0 @@ const map = cache.get(obj); |
@@ -176,3 +176,5 @@ "use strict"; | ||
var isFunction = (value) => typeof value === "function"; | ||
var isUnit = (value) => /[0-9].*[px|rem|em|%|vw|vh]$/.test(value); | ||
var isUnit = (value) => /[0-9].*(em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cm|mm|Q|in|pc|pt|px|%|cqw|cqh|cqi|cqb|cqmin|cqmax)$/.test( | ||
value | ||
); | ||
var cast = (value) => value; | ||
@@ -290,3 +292,3 @@ | ||
var getObject = (obj, path, fallback, i) => { | ||
const k = typeof path === "string" ? path.split(".") : [path]; | ||
const k = isString(path) ? path.split(/\[(.*?)\]|\./).filter(Boolean) : [path]; | ||
for (i = 0; i < k.length; i += 1) { | ||
@@ -301,3 +303,3 @@ if (!obj) break; | ||
const memoizedFunc = (obj, path, fallback, i) => { | ||
if (typeof obj === "undefined") return func(obj, path, fallback); | ||
if (isUndefined(obj)) return func(obj, path, fallback); | ||
if (!cache.has(obj)) cache.set(obj, /* @__PURE__ */ new Map()); | ||
@@ -304,0 +306,0 @@ const map = cache.get(obj); |
@@ -42,2 +42,3 @@ "use strict"; | ||
var isString = (value) => Object.prototype.toString.call(value) === "[object String]"; | ||
var isUndefined = (value) => typeof value === "undefined" && value === void 0; | ||
var isObject = (value) => value !== null && (typeof value === "object" || typeof value === "function") && !isArray(value); | ||
@@ -157,3 +158,3 @@ var isArray = (value) => Array.isArray(value); | ||
var getObject = (obj, path, fallback, i) => { | ||
const k = typeof path === "string" ? path.split(".") : [path]; | ||
const k = isString(path) ? path.split(/\[(.*?)\]|\./).filter(Boolean) : [path]; | ||
for (i = 0; i < k.length; i += 1) { | ||
@@ -168,3 +169,3 @@ if (!obj) break; | ||
const memoizedFunc = (obj, path, fallback, i) => { | ||
if (typeof obj === "undefined") return func(obj, path, fallback); | ||
if (isUndefined(obj)) return func(obj, path, fallback); | ||
if (!cache.has(obj)) cache.set(obj, /* @__PURE__ */ new Map()); | ||
@@ -171,0 +172,0 @@ const map = cache.get(obj); |
{ | ||
"name": "@yamada-ui/utils", | ||
"version": "1.3.1-next-20240704080818", | ||
"version": "1.3.1", | ||
"description": "Yamada UI utils", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
383326
4454
0