UNPKG

445 BJavaScriptView Raw
1import { isArray } from "./is-array.js";
2import { isString } from "./is-string.js";
3const ILLEGAL_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
4const isIllegalKey = (x) => ILLEGAL_KEYS.has(x);
5const isProtoPath = (path) => isArray(path) ? path.some(isIllegalKey) : isString(path) ? path.indexOf(".") !== -1 ? path.split(".").some(isIllegalKey) : isIllegalKey(path) : false;
6export {
7 isIllegalKey,
8 isProtoPath
9};