{"version":3,"names":["existValueInEnum","type","value","Object","keys","filter","k","isNaN","Number","length","isEmpty","isNil","isNull","isUndefined","undefined","isNullOrUndefined","isNullOrUndefinedOrEmpty","isNullOrUndefinedOrNil","startsWith","input","search","substr","isTrue","toString","toLowerCase","isFalse","xor","a","b"],"sources":["src/utils/collection.ts"],"sourcesContent":["/**\n * Check if a value exists in an enumerable\n * @param   {any}       type    The enumerable\n * @param   {unknown}   value   The value\n * @returns {boolean}           Whether or not the value exists in the enumerable\n * @hidden\n */\nexport const existValueInEnum = (type: any, value: unknown): boolean => {\n  return (\n    Object.keys(type)\n      .filter((k) => isNaN(Number(k)))\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      .filter((k) => type[k] === value).length > 0\n  );\n};\n\n/**\n * Verify whether or not a value is empty\n * @param   {string}    value   The value to check\n * @returns {boolean}           Whether or not a value is empty\n */\nexport const isEmpty = (value: string): boolean => {\n  return value === '';\n};\n\n/**\n * Verify whether or not a value is 'nil'\n * @param   {number}    value   The value to check\n * @returns {boolean}           Whether or not the value is null\n */\nexport const isNil = (value: number): boolean => {\n  return value === 0;\n};\n\n/**\n * Verify whether or not a value is 'null'\n * @param   {unknown}   value   The value to check\n * @returns {boolean}           Whether or not the value is null\n */\nexport const isNull = (value: unknown): boolean => {\n  return typeof value === null || value === null;\n};\n\n/**\n * Verify whether or not a value is 'undefined'\n * @param   {unknown}   value   The value to check\n * @returns {boolean}           Whether or not the value is 'undefined'\n */\nexport const isUndefined = (value: unknown): boolean => {\n  return typeof value === undefined || value === undefined;\n};\n\n/**\n * Verify whether or not a value is 'null' or 'undefined'\n * @param   {unknown}   value   The value to check\n * @returns {boolean}           Whether or not the value is 'null' or 'undefined'\n */\nexport const isNullOrUndefined = (value: unknown): boolean => {\n  return isNull(value) || isUndefined(value);\n};\n\n/**\n * Verify whether or not a value is 'null' or 'undefined'\n * @param   {string}    value   The value to check\n * @returns {boolean}           Whether or not the value is 'null' or 'undefined'\n */\nexport const isNullOrUndefinedOrEmpty = (value: string): boolean => {\n  return isNull(value) || isUndefined(value) || isEmpty(value);\n};\n\n/**\n * Verify whether or not a value is 'null' or 'undefined'\n * @param   {number}    value   The value to check\n * @returns {boolean}           Whether or not the value is 'null' or 'undefined'\n */\nexport const isNullOrUndefinedOrNil = (value: number): boolean => {\n  return isNull(value) || isUndefined(value) || isNil(value);\n};\n\n/**\n * Whether or not a string starts with a given string\n * @param   {string}  input     The string to validate\n * @param   {string}  search    The keyword to be used in the validation\n * @returns {boolean}           Whether or not a string starts with a given string\n * @hidden\n */\nexport const startsWith = (input: string, search: string): boolean => {\n  return input.substr(0, search.length) === search;\n};\n\n/**\n * Returns whether or not a given value is 'true'\n * @param {boolean|string}  value   The value to check whether or not it is true\n * @returns {boolean}               Whether or not the value is true\n */\nexport function isTrue(value: boolean | string): boolean {\n  return value !== undefined && value !== null && value.toString().toLowerCase() === 'true';\n}\n\n/**\n * Return whether or not a given value is 'false'\n * @param {boolean|string}  value   The value to check whether or not it is false\n * @returns {boolean}               Whether or not the value is false\n */\nexport function isFalse(value: boolean | string): boolean {\n  return value !== undefined && value !== null && value.toString().toLowerCase() === 'false';\n}\n\n/**\n * Logical XOR\n * @param {boolean} a The first condition\n * @param {boolean} b The second condition\n * @returns  {boolean} XOR\n */\nexport const xor = (a: boolean, b: boolean): boolean => (a && !b) || (!a && b);\n"],"mappings":"MAOaA,EAAmB,CAACC,EAAWC,IAExCC,OAAOC,KAAKH,GACTI,QAAQC,GAAMC,MAAMC,OAAOF,MAE3BD,QAAQC,GAAML,EAAKK,KAAOJ,IAAOO,OAAS,E,MASpCC,EAAWR,GACfA,IAAU,G,MAQNS,EAAST,GACbA,IAAU,E,MAQNU,EAAUV,UACPA,IAAU,MAAQA,IAAU,K,MAQ/BW,EAAeX,UACZA,IAAUY,WAAaZ,IAAUY,U,MAQpCC,EAAqBb,GACzBU,EAAOV,IAAUW,EAAYX,G,MAQzBc,EAA4Bd,GAChCU,EAAOV,IAAUW,EAAYX,IAAUQ,EAAQR,G,MAQ3Ce,EAA0Bf,GAC9BU,EAAOV,IAAUW,EAAYX,IAAUS,EAAMT,G,MAUzCgB,EAAa,CAACC,EAAeC,IACjCD,EAAME,OAAO,EAAGD,EAAOX,UAAYW,E,SAQ5BE,EAAOpB,GACrB,OAAOA,IAAUY,WAAaZ,IAAU,MAAQA,EAAMqB,WAAWC,gBAAkB,MACrF,C,SAOgBC,EAAQvB,GACtB,OAAOA,IAAUY,WAAaZ,IAAU,MAAQA,EAAMqB,WAAWC,gBAAkB,OACrF,C,MAQaE,EAAM,CAACC,EAAYC,IAAyBD,IAAMC,IAAQD,GAAKC,E"}