{"version":3,"file":"index.modern.mjs","sources":["../src/methods/instanceof.method.ts","../src/methods/array.method.ts","../src/methods/bigInt.method.ts","../src/methods/compare.method.ts","../src/methods/string.method.ts","../src/methods/null.method.ts","../src/methods/object.method.ts","../src/methods/empty.method.ts","../src/methods/falsy.method.ts","../src/methods/infinity.method.ts","../src/methods/number.method.ts","../src/methods/symbol.method.ts","../src/methods/function.method.ts","../src/config.ts","../src/methods/numeric.method.ts","../src/methods/len.method.ts","../src/methods/index.ts","../src/methods/boolean.method.ts","../src/methods/char.method.ts","../src/methods/even.method.ts","../src/methods/false.method.ts","../src/methods/int.method.ts","../src/methods/ipv4.method.ts","../src/methods/ipv6.method.ts","../src/methods/mac-address.method.ts","../src/methods/negative.method.ts","../src/methods/odd.method.ts","../src/methods/positive.method.ts","../src/methods/primitive.method.ts","../src/methods/promise.method.ts","../src/methods/true.method.ts","../src/methods/truthy.method.ts","../src/methods/undefined.method.ts","../src/methods/word.method.ts","../src/methods/zero.method.ts","../src/proxy/recursive/apply.recursive.proxy.engine.ts","../src/proxy/recursive/index.ts","../src/proxy/generator/get.generator.proxy.engine.ts","../src/index.ts","../src/decorators/register-in-is.decorator.ts"],"sourcesContent":["/**\n *\n * @method instanceof\n * @param argument object\n * @param classRef link to model\n */\nexport function InstanceofMethod<T>(argument: unknown, classRef?: new (...args: any) => T): argument is T {\n  if (classRef instanceof Function) {\n    return argument instanceof classRef;\n  }\n  return false;\n}\n","import { InstanceofMethod } from './instanceof.method';\n\nexport function ArrayMethod<T>(argument: unknown, classRef?: new () => T): argument is Array<T> {\n  if (argument instanceof Array) {\n    if (InstanceofMethod(classRef, Function)) {\n      if (argument.length) {\n        return argument.every((item: T) => item instanceof (classRef as any));\n      } else {\n        return false;\n      }\n    }\n    return true;\n  }\n  return false;\n}\n","export function BigIntMethod(argument: unknown): argument is bigint {\n  return typeof argument === 'bigint';\n}\n","import { ArrayMethod } from './array.method';\n\nexport enum TypeOfValueEnum {\n  object = 'object',\n}\n\nexport function CompareMethod<T>(objectOne: T, objectTwo: T): boolean {\n  try {\n    const keysOfObjectOne: string[] = Object.keys(objectOne ?? {}) ?? [];\n    const keysOfObjectTwo: string[] = Object.keys(objectTwo ?? {}) ?? [];\n\n    if (!ArrayMethod(keysOfObjectOne) || !ArrayMethod(keysOfObjectTwo)) {\n      return false;\n    }\n\n    if (keysOfObjectOne.length !== keysOfObjectTwo.length) {\n      return false;\n    }\n\n    if (!keysOfObjectOne.length && !keysOfObjectTwo.length) {\n      return true;\n    }\n\n    for (const keyOfObjectOne of keysOfObjectTwo) {\n      switch (typeof (objectOne as any)[keyOfObjectOne]) {\n        case TypeOfValueEnum.object:\n          if (!CompareMethod((objectOne as any)[keyOfObjectOne], (objectTwo as any)[keyOfObjectOne])) {\n            return false;\n          }\n          break;\n        default:\n          if ((objectOne as any)[keyOfObjectOne] !== (objectTwo as any)[keyOfObjectOne]) {\n            return false;\n          }\n          break;\n      }\n    }\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n","export function StringMethod(argument: unknown): argument is string {\n  return typeof argument === 'string';\n}\n","export function NullMethod(argument: unknown): argument is null {\n  return argument === null;\n}\n","import { ArrayMethod } from './array.method';\nimport { NullMethod } from './null.method';\n\nexport function ObjectMethod<T extends object>(argument: unknown): argument is T {\n  return typeof argument === 'object' && !ArrayMethod(argument) && !NullMethod(argument);\n}\n","import { StringMethod } from './string.method';\nimport { ObjectMethod } from './object.method';\nimport { ArrayMethod } from './array.method';\n\nexport function EmptyMethod<T extends object>(argument: unknown): boolean {\n  if (StringMethod(argument)) {\n    return argument.trim()[0] === undefined;\n  }\n\n  if (ObjectMethod<T>(argument) || ArrayMethod<T>(argument)) {\n    if (Reflect.has(argument, 'size')) {\n      // @ts-ignore\n      return argument.size <= 0;\n    }\n    for (const key in argument) {\n      if (argument.hasOwnProperty(key)) {\n        return false;\n      }\n    }\n    return true;\n  }\n  return false;\n}\n","export function FalsyMethod(argument: unknown): argument is false {\n  return !argument;\n}\n","const INFINITY: number = 1 / 0;\nexport function InfinityMethod(argument: unknown): argument is number {\n  return argument === INFINITY || argument === -INFINITY;\n}\n","import { InfinityMethod } from './infinity.method';\n\nexport function NumberMethod(argument: unknown): argument is number {\n  return typeof argument === 'number' && !isNaN(argument) && !InfinityMethod(argument);\n}\n","export function SymbolMethod(argument: unknown): argument is symbol {\n  return typeof argument === 'symbol';\n}\n","const toString: typeof Object.prototype.toString = Object.prototype.toString;\n\nexport function FunctionMethod<T extends typeof Function>(argument: unknown): argument is T {\n  try {\n    return (\n      toString.call(argument) === '[object Function]' ||\n      AsyncFunctionMethod(argument) ||\n      GeneratorFunctionMethod(argument)\n    );\n  } catch (e) {\n    if (e instanceof TypeError) {\n      if (e.message === 'Cannot create proxy with a non-object as target or handler') {\n        return true;\n      }\n    }\n    return false;\n  }\n}\n\nexport function AsyncFunctionMethod(argument: unknown): argument is '[object AsyncFunction]' {\n  try {\n    return toString.call(argument) === '[object AsyncFunction]';\n  } catch (e) {\n    return false;\n  }\n}\n\nexport function GeneratorFunctionMethod(argument: unknown): argument is '[object Generator]' {\n  try {\n    return toString.call(argument) === '[object Generator]';\n  } catch (e) {\n    return false;\n  }\n}\n","export const isConfig = {\n  useGlobalContext: true,\n  error: {\n    enabled: true,\n  },\n  regex: {\n    bigint: /(\\d+)n/,\n    word: /^[a-zA-Z]+$/,\n    ipv6: /^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?$/,\n    ipv4: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,\n    macAddress: /^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$/,\n  },\n};\n","import { NumberMethod } from './number.method';\nimport { BigIntMethod } from './bigInt.method';\nimport { isConfig } from '../config';\nimport { EmptyMethod } from './empty.method';\nimport { SymbolMethod } from './symbol.method';\n\nexport function NumericMethod(argument: any): boolean {\n  if (SymbolMethod(argument)) {\n    return false;\n  }\n  argument = '' + argument;\n  if (EmptyMethod(argument)) {\n    return false;\n  }\n  return (\n    NumberMethod(+argument) || (isConfig.regex.bigint.test(argument) && BigIntMethod(BigInt(argument.slice(0, -1))))\n  );\n}\n","import { NumberMethod } from './number.method';\nimport { isConfig } from '../config';\nimport { NumericMethod } from './numeric.method';\n\nfunction toNumber(argument: any): number {\n  argument = +argument;\n  if (!NumberMethod(argument) && isConfig.error.enabled) {\n    console?.error?.(`\n            Bad data in the method name, good examples: \n            is.len_10\n            is.len_gt_10\n            is.len_lt_10\n            is.len_gt_8_lt_10\n            is.len_gte_10\n            is.len_gte_8_lt_10\n            is.len_gte_8_lte_10\n            is.len_lte_10\n            is.len_gt_8_lte_10\n        `);\n  }\n  return argument;\n}\n\nfunction operation(command: string, target: number, value: number): boolean {\n  if (command === 'gt') {\n    return target > value;\n  } else if (command === 'gte') {\n    return target >= value;\n  } else if (command === 'lt') {\n    return target < value;\n  } else if (command === 'lte') {\n    return target <= value;\n  }\n  return false;\n}\n\n/**\n * Why N:\n * - Note that the symbol \"N\" is also sometimes used to represent the set of positive integers, but this can be\n *   ambiguous, as some definitions of \"N\" include zero, while others do not.\n *\n * is.len_N\n * is.len_gt_N\n * is.len_lt_N\n * is.len_gt_N_lt_N\n * is.len_gte_N\n * is.len_gte_N_lt_N\n * is.len_gte_N_lte_N\n * is.len_lte_N\n * is.len_gt_N_lte_N\n *\n * @param argument - string\n * @param configList - ['10'] || ['gt', '10']\n */\nexport function LenMethod(argument: string, ...configList: string[]): boolean {\n  const length: number = argument?.length ?? 0;\n  if (NumericMethod(configList[0])) {\n    return length === toNumber(configList[0]);\n  } else {\n    for (let index = 0; index < configList.length; index++) {\n      if (operation(configList[index], length, toNumber(configList[index + 1]))) {\n        if (index + 2 === configList.length) {\n          return true;\n        } else {\n          index++;\n        }\n      } else {\n        return false;\n      }\n    }\n  }\n  return false;\n}\n","import { ArrayMethod } from './array.method';\nimport { BigIntMethod } from './bigInt.method';\nimport { BooleanMethod } from './boolean.method';\nimport { CompareMethod } from './compare.method';\nimport { EmptyMethod } from './empty.method';\nimport { FalseMethod } from './false.method';\nimport { FalsyMethod } from './falsy.method';\nimport { InstanceofMethod } from './instanceof.method';\nimport { NullMethod } from './null.method';\nimport { NumberMethod } from './number.method';\nimport { ObjectMethod } from './object.method';\nimport { StringMethod } from './string.method';\nimport { SymbolMethod } from './symbol.method';\nimport { TrueMethod } from './true.method';\nimport { TruthyMethod } from './truthy.method';\nimport { UndefinedMethod } from './undefined.method';\nimport { ZeroMethod } from './zero.method';\nimport { PrimitiveMethod } from './primitive.method';\nimport { PromiseMethod } from './promise.method';\nimport { AsyncFunctionMethod, FunctionMethod, GeneratorFunctionMethod } from './function.method';\nimport { PositiveMethod } from './positive.method';\nimport { NegativeMethod } from './negative.method';\nimport { InfinityMethod } from './infinity.method';\nimport { HTMLElementsMethodsInterface } from '../interfaces/methods/HTML-elements.methods.interface';\nimport { ExternalMethodsInterface } from '../interfaces/methods/external.methods.interface';\nimport { Ipv6Method } from './ipv6.method';\nimport { Ipv4Method } from './ipv4.method';\nimport { MacAddressMethod } from './mac-address.method';\nimport { WordMethod } from './word.method';\nimport { OddMethod } from './odd.method';\nimport { EvenMethod } from './even.method';\nimport { LenMethod } from './len.method';\nimport { NumericMethod } from './numeric.method';\nimport { IntMethod } from './int.method';\nimport { CharMethod } from './char.method';\n\ntype mixTypes<T> = T & AllMethodsInterface;\n\nexport type ConvertTypeToGenericMixTypes<T> = {\n  [key in keyof T]: mixTypes<T[key]>;\n};\n\ntype instanceofType<T = () => void> = (argument: unknown) => argument is T;\ntype instanceofTypeMix<T = () => void> = mixTypes<instanceofType<T>>;\n\nexport type ConvertTypeToGenericInstanceOf<T> = {\n  [key in keyof T]: instanceofTypeMix<T[key]>;\n};\n\ntype LengthMethodType = typeof LenMethod;\n\nexport const predefinedMethods = {\n  len: LenMethod,\n  array: ArrayMethod,\n  asyncFunction: AsyncFunctionMethod,\n  bigInt: BigIntMethod,\n  boolean: BooleanMethod,\n  char: CharMethod,\n  compare: CompareMethod,\n  empty: EmptyMethod,\n  even: EvenMethod,\n  false: FalseMethod,\n  falsy: FalsyMethod,\n  function: FunctionMethod,\n  generatorFunction: GeneratorFunctionMethod,\n  infinity: InfinityMethod,\n  instanceof: InstanceofMethod,\n  int: IntMethod,\n  ipv4: Ipv4Method,\n  ipv6: Ipv6Method,\n  macAddress: MacAddressMethod,\n  negative: NegativeMethod,\n  null: NullMethod,\n  number: NumberMethod,\n  numeric: NumericMethod,\n  object: ObjectMethod,\n  odd: OddMethod,\n  positive: PositiveMethod,\n  primitive: PrimitiveMethod,\n  promise: PromiseMethod,\n  string: StringMethod,\n  symbol: SymbolMethod,\n  true: TrueMethod,\n  truthy: TruthyMethod,\n  undefined: UndefinedMethod,\n  word: WordMethod,\n  zero: ZeroMethod,\n};\n\nexport interface AllMethodsInterface\n  extends ConvertTypeToGenericMixTypes<typeof predefinedMethods>,\n    ConvertTypeToGenericInstanceOf<ExternalMethodsInterface>,\n    ConvertTypeToGenericInstanceOf<HTMLElementsMethodsInterface>,\n    Omit<CallableFunction, 'length'> {\n  Function: instanceofType;\n  or: AllMethodsInterface;\n  not: AllMethodsInterface;\n\n  // Predefined interfaces of methods which has some options\n  len_N: LengthMethodType;\n  len_gt_N_lt_N: LengthMethodType;\n  len_lt_N: LengthMethodType;\n  len_gt_N: LengthMethodType;\n  len_gte_N_lt_N: LengthMethodType;\n  len_gte_N_lte_N: LengthMethodType;\n  len_lte_N: LengthMethodType;\n  len_gte_N: LengthMethodType;\n  len_gt_N_lte_N: LengthMethodType;\n\n  [key: string]: instanceofType | AllMethodsInterface | any;\n}\n","export function BooleanMethod(argument: unknown): argument is boolean {\n  return typeof argument === 'boolean';\n}\n","import { StringMethod } from './string.method';\n\nexport function CharMethod(target: unknown): target is string {\n  return StringMethod(target) && target.length === 1;\n}\n","import { NumberMethod } from './number.method';\nimport { BigIntMethod } from './bigInt.method';\n\nexport function EvenMethod(argument: unknown): argument is number {\n  if (NumberMethod(argument)) {\n    return argument % 2 === 0;\n  } else if (BigIntMethod(argument)) {\n    return argument % BigInt(2) === BigInt(0);\n  }\n  return false;\n}\n","export function FalseMethod(argument: unknown): argument is false {\n  return argument === false;\n}\n","import { NumberMethod } from './number.method';\n\nexport function IntMethod(target: unknown): target is number {\n  return NumberMethod(target) && Math.floor(target) === target;\n}\n","import { SymbolMethod } from './symbol.method';\nimport { isConfig } from '../config';\n\nexport function Ipv4Method(argument: string): argument is string {\n  if (SymbolMethod(argument)) {\n    return false;\n  }\n  return isConfig.regex.ipv4.test(argument);\n}\n","import { SymbolMethod } from './symbol.method';\nimport { isConfig } from '../config';\n\nexport function Ipv6Method(argument: string): argument is string {\n  if (SymbolMethod(argument)) {\n    return false;\n  }\n  return isConfig.regex.ipv6.test(argument);\n}\n","import { SymbolMethod } from './symbol.method';\nimport { isConfig } from '../config';\n\nexport function MacAddressMethod(argument: string): argument is string {\n  if (SymbolMethod(argument)) {\n    return false;\n  }\n  return isConfig.regex.macAddress.test(argument);\n}\n","import { NumberMethod } from './number.method';\n\nexport function NegativeMethod(argument: unknown): argument is number {\n  return NumberMethod(argument) && argument < 0;\n}\n","import { NumberMethod } from './number.method';\nimport { BigIntMethod } from './bigInt.method';\n\nexport function OddMethod(argument: unknown): argument is number {\n  if (NumberMethod(argument)) {\n    return argument % 2 === 1 || argument % 2 === -1;\n  } else if (BigIntMethod(argument)) {\n    return argument % BigInt(2) === BigInt(1) || argument % BigInt(2) === BigInt(-1);\n  }\n  return false;\n}\n","import { NumberMethod } from './number.method';\n\nexport function PositiveMethod(argument: unknown): argument is number {\n  return NumberMethod(argument) && argument > 0;\n}\n","export function PrimitiveMethod(argument: unknown): boolean {\n  if (argument === null) {\n    return true;\n  }\n\n  if (typeof argument === 'object' || typeof argument === 'function') {\n    return false;\n  } else {\n    return true;\n  }\n}\n","import { ObjectMethod } from './object.method';\nimport { InstanceofMethod } from './instanceof.method';\n\nexport function PromiseMethod<T>(argument: unknown): argument is Promise<T> {\n  if (ObjectMethod(argument) && Reflect.has(argument, 'then') && Reflect.has(argument, 'catch')) {\n    return InstanceofMethod((argument as any)?.then, Function) && InstanceofMethod((argument as any)?.catch, Function);\n  }\n  return false;\n}\n","export function TrueMethod(argument: unknown): argument is true {\n  return argument === true;\n}\n","import { FalsyMethod } from './falsy.method';\n\nexport function TruthyMethod(argument: unknown): argument is true {\n  return !FalsyMethod(argument);\n}\n","export function UndefinedMethod(argument: unknown): argument is undefined {\n  return argument === undefined;\n}\n","import { StringMethod } from './string.method';\nimport { isConfig } from '../config';\n\nexport function WordMethod(argument: string): argument is string {\n  if (StringMethod(argument)) {\n    return isConfig.regex.word.test(argument);\n  }\n  return false;\n}\n","export function ZeroMethod(argument: unknown): argument is 0 {\n  return argument === 0;\n}\n","import { ParamsProxyEngineInterface } from '../../interfaces/engine/proxy/params.proxy.engine.interface';\nimport { InstanceofMethod } from '../../methods/instanceof.method';\nimport { CommandMixType, CommandType } from '../../types/commands.type';\nimport { predefinedMethods } from '../../methods';\nimport { isConfig } from '../../config';\n\nexport function proxyRecursiveApply(params: ParamsProxyEngineInterface): ReturnType<any> {\n  return (notUsedTargetApply: any, thisArg: unknown, argumentList: unknown[] | unknown[][]): boolean => {\n    try {\n      return getDecide(params.commandList, argumentList);\n    } catch (e) {\n      if (InstanceofMethod(e, SyntaxError)) {\n        throw e;\n      }\n      return false;\n    }\n  };\n}\n\nfunction findInGlobalContext(command: string): string | CommandType {\n  try {\n    if (isConfig.useGlobalContext) {\n      return globalThis?.[command] ?? self?.[command] ?? window?.[command] ?? global?.[command] ?? command;\n    }\n  } catch (e) {\n    return command;\n  }\n  return command;\n}\n\nfunction tryTodoWithTheCommand(commandName: string = '', argumentList: unknown[] = [], context: any = {}): boolean {\n  if (!commandName.length || !argumentList.length) {\n    return false;\n  }\n  const pieces: string[] = commandName.split('_');\n  if (pieces.length > 1) {\n    const command: CommandType | undefined = predefinedMethods[pieces.shift() as string];\n    if (command) {\n      return command.apply(context, [argumentList[0], ...pieces]);\n    }\n  }\n  return false;\n}\n\nfunction getResult(command: CommandType | string, argumentList: unknown[], context: any = {}): boolean {\n  if (typeof command === 'string') {\n    command = findInGlobalContext(command);\n    if (typeof command === 'string') {\n      return tryTodoWithTheCommand(command, argumentList, context);\n    }\n  } else {\n    const result: any = command.apply(context, argumentList);\n    if (typeof result === 'boolean') {\n      return result;\n    } else {\n      command = result.classRef;\n    }\n  }\n  return InstanceofMethod.apply({}, [argumentList[0], command as unknown as any]);\n}\n\nfunction getDecide(list: ParamsProxyEngineInterface['commandList'], argumentList: unknown[]): boolean {\n  const lastCommand = list.pop() as CommandMixType;\n  let context: any = {};\n\n  const indexNot: number = list.indexOf('not');\n  const foundIndexNot: boolean = indexNot > -1;\n  let result: boolean;\n\n  // Config variables of initialize data\n  if (lastCommand === 'apply') {\n    context = argumentList[0];\n    argumentList = argumentList[1] as unknown[];\n  } else if (lastCommand === 'call') {\n    context = argumentList.shift();\n  } else if (lastCommand === 'bind') {\n    // TODO in this way need return Function with given context\n    throw new SyntaxError(\n      `Please do not use 'bind' with the package, we will try to fix this in the future. If you know how to fix this, please create an 'issue'`,\n    );\n  } else {\n    list.push(lastCommand);\n  }\n\n  for (let index = 0; index < list.length; index++) {\n    if (indexNot === index) {\n      continue;\n    }\n    /**\n     * Examples:\n     * 1. [v] is.object()\n     * 2. [v] is.not.object()\n     * 3. [v] is.object.empty()\n     * 4. [v] is.object.or.string()\n     * 5. [v] is.not.object.or.string()\n     * 6. [v] is.object.not.empty.or.null({a: 1})\n     * 7. [v] is.null.or.undefined.or.empty()\n     * 8. [v] is.object.or.string.not.empty()\n     */\n    result = getResult(list[index], argumentList, context);\n    if (list.length - 1 === index) {\n      // Is last interaction\n      // Negative cases for examples #1 and #2.\n      // And\n      // Success cases for examples: #1, #2, #3.\n      return foundIndexNot && index > indexNot ? !result : result;\n    } else {\n      // Negative case for example #3.\n      if (list[index + 1] === 'or') {\n        // If we have \"not\" before \"or\" then we need to have only one negative result\n        // If we don't have \"not\" before \"or\" then we need to have only one positive\n        if (result) {\n          if (foundIndexNot) {\n            if (index > indexNot) {\n              return false;\n            } else {\n              index = indexNot;\n            }\n          } else {\n            return true;\n          }\n        } else {\n          index = index + 1;\n        }\n      } else {\n        if (result) {\n          if (foundIndexNot) {\n            // Example #6\n            index = indexNot;\n          }\n        } else {\n          return false;\n        }\n      }\n    }\n  }\n  return true;\n}\n","import { predefinedMethods } from '../../methods';\nimport { proxyRecursiveApply } from './apply.recursive.proxy.engine';\nimport { ParamsProxyEngineInterface } from '../../interfaces/engine/proxy/params.proxy.engine.interface';\nimport { CommandMixType } from '../../types/commands.type';\n\ntype proxyRecursiveGetType = (targetGet: any, nameGet: string) => ReturnType<typeof proxyRecursive>;\n\nexport function proxyRecursiveGet(params: ParamsProxyEngineInterface): proxyRecursiveGetType {\n  return (targetGet, nameGet) => {\n    return proxyRecursive(targetGet[nameGet], nameGet, params);\n  };\n}\n\n/**\n *\n * @param target object for next proxy\n * @param name of current part of command is.object.not.empty() ['is', 'object', 'not', 'empty']\n * @param params ParamsProxyEngineInterface\n */\nexport function proxyRecursive(target: object | string, name: string, params: ParamsProxyEngineInterface): object {\n  target = predefinedMethods[name] ?? name;\n  params.commandList.push(target as CommandMixType);\n\n  if (typeof target === 'string') {\n    if (['not', 'or'].includes(target)) {\n      target = predefinedMethods;\n    } else {\n      target = () => {};\n    }\n  }\n\n  return new Proxy(target, {\n    get: proxyRecursiveGet(params),\n    apply: proxyRecursiveApply(params),\n  });\n}\n","import { proxyRecursive } from '../recursive';\nimport { SymbolMethod } from '../../methods/symbol.method';\n\ntype proxyGeneratorGetType = (target: object, name: string, receiver: unknown) => ReturnType<typeof proxyRecursive>;\n\nexport const packageName = '@p4ck493/ts-is';\n\nexport function proxyGeneratorGet(): proxyGeneratorGetType {\n  return (target, name, receiver) => {\n    if (SymbolMethod(name)) {\n      return undefined as any;\n    }\n    if (['valueOf', 'toString'].includes(name)) {\n      return packageName[name].bind(packageName);\n    }\n    return proxyRecursive(target, name, {\n      commandList: [],\n    });\n  };\n}\n","import { registerInIsDecorator } from './decorators/register-in-is.decorator';\nimport { AllMethodsInterface } from './methods';\nimport { proxyGeneratorGet } from './proxy/generator/get.generator.proxy.engine';\nimport { isConfig } from './config';\n\nexport const RegisterInIs = registerInIsDecorator;\nexport const IsConfig = isConfig;\n\nfunction defaultFunction(argument: unknown): unknown {\n  // TODO return typeof argument or make something cool\n  return argument;\n}\n\nexport const is: AllMethodsInterface = new Proxy<any>(defaultFunction, {\n  get: proxyGeneratorGet(),\n  apply: (\n    target: (...arg: unknown[]) => boolean,\n    thisArg: unknown,\n    argumentList: unknown[],\n  ): ReturnType<typeof target> => {\n    return target(...argumentList);\n  },\n});\n","import {\n  registerInIsArgumentDecoratorType,\n  registerInIsConstructorDecoratorType,\n} from '../types/decorators/register-in-is.decorator.type';\nimport { RegisterInIsDecoratorInterface } from '../interfaces/decorators/register-in-is.decorator.interface';\nimport { predefinedMethods } from '../methods';\n\nexport function registerInIsDecorator(configuration?: RegisterInIsDecoratorInterface): any {\n  return (constructor: registerInIsConstructorDecoratorType): void => {\n    let value: any = constructor;\n    if (configuration?.customMethod) {\n      value = value?.[configuration.customMethod];\n      if (!value) {\n        throw new Error(`Not found customMethod with name: ${configuration.customMethod}`);\n      }\n    } else {\n      value = () => {\n        return {\n          classRef: constructor,\n        };\n      };\n    }\n    let className: string | undefined = configuration?.className;\n    if (!className) {\n      const object: registerInIsArgumentDecoratorType = new constructor();\n      className = object.constructor.name;\n    }\n    Object.defineProperty(predefinedMethods, className, {\n      configurable: true,\n      enumerable: true,\n      writable: true,\n      value,\n    });\n  };\n}\n"],"names":["argument","classRef","Function","ArrayMethod","Array","InstanceofMethod","length","every","item","BigIntMethod","StringMethod","ObjectMethod","NullMethod","undefined","trim","Reflect","has","size","key","hasOwnProperty","InfinityMethod","NumberMethod","isNaN","SymbolMethod","TypeOfValueEnum","toString","Object","prototype","AsyncFunctionMethod","call","e","GeneratorFunctionMethod","isConfig","useGlobalContext","error","enabled","regex","bigint","word","ipv6","ipv4","macAddress","EmptyMethod","test","BigInt","slice","toNumber","_console","console","predefinedMethods","len","configList","_argument$length","NumericMethod","index","command","target","value","array","asyncFunction","bigInt","boolean","char","CharMethod","compare","CompareMethod","objectOne","objectTwo","_Object$keys","_Object$keys2","keys","keysOfObjectTwo","keysOfObjectOne","keyOfObjectOne","object","empty","even","EvenMethod","false","falsy","FalsyMethod","function","TypeError","message","generatorFunction","infinity","instanceof","int","Math","floor","negative","null","number","numeric","odd","OddMethod","positive","primitive","PrimitiveMethod","promise","PromiseMethod","then","catch","string","symbol","true","truthy","zero","proxyRecursiveApply","params","notUsedTargetApply","thisArg","argumentList","list","lastCommand","pop","context","indexNot","indexOf","foundIndexNot","result","shift","SyntaxError","push","getResult","getDecide","commandList","_ref","_ref2","_ref3","_globalThis$command","_self","_window","_global","globalThis","global","self","window","findInGlobalContext","commandName","pieces","split","apply","tryTodoWithTheCommand","proxyRecursiveGet","targetGet","nameGet","proxyRecursive","name","_predefinedMethods$na","includes","Proxy","get","packageName","RegisterInIs","registerInIsDecorator","configuration","constructor","customMethod","_value","Error","className","defineProperty","configurable","enumerable","writable","is","receiver","bind"],"mappings":"AAMgB,WAAoBA,EAAmBC,GACrD,OAAIA,aAA4BC,UACvBF,aACRC,CAEH,CCTgBE,SAAAA,EAAeH,EAAmBC,GAChD,OAAID,aAAyBI,SACvBC,EAAiBJ,EAAUC,aACzBF,EAASM,QACIN,EAACO,MAAOC,GAAYA,gBAQ3C,CCdM,SAAsBC,EAACT,GAC3B,MAA2B,iBAALA,CACxB,CCAA,MCFM,SAAsBU,EAACV,GAC3B,MAA2B,iBAALA,CACxB,CCFM,WAAqBA,GACzB,OAAoB,OAALA,CACjB,CCCM,SAAsBW,EAAmBX,GAC7C,MAA2B,iBAALA,IAAkBG,EAAYH,KAAcY,EAAWZ,EAC/E,CCDM,WAAwCA,GAC5C,GAAIU,EAAaV,GACf,YAA8Ba,IAAf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