@modern-kit/utils
Version:
1 lines • 1.03 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../src/validator/isPlainObject/index.ts"],"sourcesContent":["import { isReference } from '../isReference';\n\n/**\n * @description 주어진 값이 순수 객체(Plain Object)인지 확인합니다.\n *\n * @param {unknown} value - 순수 객체인지 확인할 값.\n * @returns {value is Record<PropertyKey, any>} - 값이 순수 객체이면 `true`, 그렇지 않으면 `false`를 반환합니다.\n *\n * @example\n * isPlainObject({}); // true\n * isPlainObject(new Object()); // true\n *\n * @example\n * isPlainObject([]); // false\n * isPlainObject(() => {}); // false\n * isPlainObject(null); // false\n */\nexport function isPlainObject(\n value: unknown\n): value is Record<PropertyKey, any> {\n return (\n isReference(value) &&\n Object.prototype.toString.call(value) === '[object Object]'\n );\n}\n"],"names":[],"mappings":";;;AAiBO,SAAS,cACd,KAAA,EACmC;AACnC,EAAA,OACE,WAAA,CAAY,KAAK,CAAA,IACjB,MAAA,CAAO,UAAU,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA,KAAM,iBAAA;AAE9C;;;;"}