@chakra-ui/styled-system
Advanced tools
Comparing version 0.0.0-dev-20230528194103 to 0.0.0-dev-20230528200306
@@ -727,11 +727,15 @@ "use strict"; | ||
// src/get.ts | ||
function get(obj, path, fallback, index) { | ||
const key = typeof path === "string" ? path.split(".") : [path]; | ||
for (index = 0; index < key.length; index += 1) { | ||
if (!obj) | ||
var isSafeKey = (key) => key !== "__proto__" && key !== "prototype" && key !== "constructor"; | ||
var get = (obj, path, fallback) => { | ||
const keys2 = Array.isArray(path) ? path : path.split("."); | ||
for (let i = 0; i < keys2.length; i++) { | ||
const key = keys2[i]; | ||
if (!obj || !Object.prototype.hasOwnProperty.call(obj, key) || !isSafeKey(key)) { | ||
obj = void 0; | ||
break; | ||
obj = obj[key[index]]; | ||
} | ||
obj = obj[key]; | ||
} | ||
return obj === void 0 ? fallback : obj; | ||
} | ||
return obj != null ? obj : fallback; | ||
}; | ||
var memoize = (fn) => { | ||
@@ -738,0 +742,0 @@ const cache = /* @__PURE__ */ new WeakMap(); |
{ | ||
"name": "@chakra-ui/styled-system", | ||
"version": "0.0.0-dev-20230528194103", | ||
"version": "0.0.0-dev-20230528200306", | ||
"description": "Style function for css-in-js building component libraries", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
210984
6377