{"version":3,"file":"is-set-object-CgrHXibA.mjs","names":[],"sources":["../../type-checks/src/is-function.ts","../../type-checks/src/is-null.ts","../../type-checks/src/is-empty.ts","../../type-checks/src/is-set.ts","../../type-checks/src/is-non-null-object.ts","../../type-checks/src/is-set-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\nexport function isSyncFunction(value?: any): value is AnyFunction {\n  return getObjectTag(value) === \"[object Function]\";\n}\n\nexport function isAsyncFunction(value?: any): value is AnyFunction {\n  return getObjectTag(value) === \"[object AsyncFunction]\";\n}\n\n/**\n * Check if the provided value's type is `Function`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Function`\n */\nexport const isFunction = (value: unknown): value is AnyFunction => {\n  try {\n    return (\n      value instanceof Function ||\n      typeof value === \"function\" ||\n      Boolean(\n        value?.constructor && (value as any)?.call && (value as any)?.apply\n      ) ||\n      isSyncFunction(value) ||\n      isAsyncFunction(value)\n    );\n  } catch {\n    return false;\n  }\n};\n","/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isNull = (value: unknown): value is null => {\n  try {\n    return value === null;\n  } catch {\n    return false;\n  }\n};\n","/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n  try {\n    return isUndefined(value) || isNull(value);\n  } catch {\n    return false;\n  }\n};\n\nexport const isEmptyAnything = (value: any) => {\n  if (value === true || value === false) return true;\n  if (value === null || value === undefined) return true;\n  if (isNumber(value)) return value === 0;\n  if (isDate(value)) return Number.isNaN(value.getTime());\n  if (isFunction(value)) return false;\n  if (isSymbol(value)) return false;\n  const { length } = value;\n  if (isNumber(length)) return length === 0;\n  const { size } = value;\n  if (isNumber(size)) return size === 0;\n  const keys = Object.keys(value).length;\n\n  return keys === 0;\n};\n","/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n  try {\n    return !isEmpty(value);\n  } catch {\n    return false;\n  }\n};\n","/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isObject } from \"./is-object\";\nimport { isSet } from \"./is-set\";\n\n/**\n * Check if the provided value's type is `Object` and is not `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n */\nexport const isNonNullObject = (value: any): value is NonNullable<object> => {\n  return isSet(value) && isObject(value);\n};\n","/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isNonNullObject } from \"./is-non-null-object\";\n\n/**\n * Check if the provided value's type is an object with some fields set\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is an object with some fields se\n */\nexport const isSetObject = (value: unknown): value is NonNullable<object> => {\n  try {\n    return isNonNullObject(value) && Object.keys(value).length > 0;\n  } catch {\n    return false;\n  }\n};\n"],"mappings":";;;;;AAqBA,SAAgB,eAAe,OAAmC;AAChE,QAAO,aAAa,MAAM,KAAK;;AAGjC,SAAgB,gBAAgB,OAAmC;AACjE,QAAO,aAAa,MAAM,KAAK;;;;;;;;AASjC,MAAa,cAAc,UAAyC;AAClE,KAAI;AACF,SACE,iBAAiB,YACjB,OAAO,UAAU,cACjB,QACE,OAAO,eAAgB,OAAe,QAAS,OAAe,MAC/D,IACD,eAAe,MAAM,IACrB,gBAAgB,MAAM;SAElB;AACN,SAAO;;;;;;AC7BX,MAAa,UAAU,UAAkC;AACvD,KAAI;AACF,SAAO,UAAU;SACX;AACN,SAAO;;;;;;;;;;;;ACSX,MAAa,WAAW,UAAmB;AACzC,KAAI;AACF,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACpC;AACN,SAAO;;;;;;;;;;;;ACTX,MAAa,SAAS,UAAkD;AACtE,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM;SAChB;AACN,SAAO;;;;;;;;;;;;ACHX,MAAa,mBAAmB,UAA6C;AAC3E,QAAO,MAAM,MAAM,IAAI,SAAS,MAAM;;;;;;;;;;;ACFxC,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,gBAAgB,MAAM,IAAI,OAAO,KAAK,MAAM,CAAC,SAAS;SACvD;AACN,SAAO"}