{"version":3,"file":"is-empty.mjs","names":[],"sources":["../src/is-empty.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 { 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"],"mappings":";;;;;;;;;;;;;;AA+BA,MAAa,WAAW,UAAmB;AACzC,KAAI;AACF,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACpC;AACN,SAAO;;;AAIX,MAAa,mBAAmB,UAAe;AAC7C,KAAI,UAAU,QAAQ,UAAU,MAAO,QAAO;AAC9C,KAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,KAAI,SAAS,MAAM,CAAE,QAAO,UAAU;AACtC,KAAI,OAAO,MAAM,CAAE,QAAO,OAAO,MAAM,MAAM,SAAS,CAAC;AACvD,KAAI,WAAW,MAAM,CAAE,QAAO;AAC9B,KAAI,SAAS,MAAM,CAAE,QAAO;CAC5B,MAAM,EAAE,WAAW;AACnB,KAAI,SAAS,OAAO,CAAE,QAAO,WAAW;CACxC,MAAM,EAAE,SAAS;AACjB,KAAI,SAAS,KAAK,CAAE,QAAO,SAAS;AAGpC,QAFa,OAAO,KAAK,MAAM,CAAC,WAEhB"}