HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/design.system/node_modules/@rushstack/node-core-library/lib/Enum.js.map
{"version":3,"file":"Enum.js","sourceRoot":"","sources":["../src/Enum.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAa,IAAI;IACf,gBAAuB,CAAC;IAExB;;;;;;;;;;;;;;;;;OAiBG;IACI,MAAM,CAAC,gBAAgB,CAC5B,UAGC,EACD,GAAW;QAEX,8DAA8D;QAC9D,OAAO,UAAU,CAAC,GAAG,CAAQ,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,aAAa,CACzB,UAGC,EACD,GAAW;QAEX,8DAA8D;QAC9D,MAAM,MAAM,GAA2B,UAAU,CAAC,GAAG,CAAQ,CAAC;QAC9D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACI,MAAM,CAAC,iBAAiB,CAC7B,UAAuB,EACvB,KAAa;QAEb,8DAA8D;QAC9D,OAAO,UAAU,CAAC,KAAK,CAAQ,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,cAAc,CAC1B,UAAuB,EACvB,KAAa;QAEb,8DAA8D;QAC9D,MAAM,MAAM,GAAwC,UAAU,CAAC,KAAK,CAAQ,CAAC;QAC7E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,aAAa,KAAK,gCAAgC,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA/GD,oBA+GC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * A helper for looking up TypeScript `enum` keys/values.\n *\n * @remarks\n * TypeScript enums implement a lookup table for mapping between their keys and values:\n *\n * ```ts\n * enum Colors {\n *   Red = 1\n * }\n *\n * // Prints \"Red\"\n * console.log(Colors[1]);\n *\n * // Prints \"1\"\n * console.log(Colors[\"Red]);\n * ```\n *\n * However the compiler's \"noImplicitAny\" validation has trouble with these mappings, because\n * there are so many possible types for the map elements:\n *\n * ```ts\n * function f(s: string): Colors | undefined {\n *   // (TS 7015) Element implicitly has an 'any' type because\n *   // index expression is not of type 'number'.\n *   return Colors[s];\n * }\n * ```\n *\n * The `Enum` helper provides a more specific, strongly typed way to access members:\n *\n * ```ts\n * function f(s: string): Colors | undefined {\n *   return Enum.tryGetValueByKey(Colors, s);\n * }\n * ```\n *\n * @public\n */\nexport class Enum {\n  private constructor() {}\n\n  /**\n   * Returns an enum value, given its key. Returns `undefined` if no matching key is found.\n   *\n   * @example\n   *\n   * Example usage:\n   * ```ts\n   * enum Colors {\n   *   Red = 1\n   * }\n   *\n   * // Prints \"1\"\n   * console.log(Enum.tryGetValueByKey(Colors, \"Red\"));\n   *\n   * // Prints \"undefined\"\n   * console.log(Enum.tryGetValueByKey(Colors, \"Black\"));\n   * ```\n   */\n  public static tryGetValueByKey<TEnumValue>(\n    enumObject: {\n      [key: string]: TEnumValue | string;\n      [key: number]: TEnumValue | string;\n    },\n    key: string\n  ): TEnumValue | undefined {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return enumObject[key] as any;\n  }\n\n  /**\n   * This API is similar to {@link Enum.tryGetValueByKey}, except that it throws an exception\n   * if the key is undefined.\n   */\n  public static getValueByKey<TEnumValue>(\n    enumObject: {\n      [key: string]: TEnumValue | string;\n      [key: number]: TEnumValue | string;\n    },\n    key: string\n  ): TEnumValue {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const result: TEnumValue | undefined = enumObject[key] as any;\n    if (result === undefined) {\n      throw new Error(`The lookup key ${JSON.stringify(key)} is not defined`);\n    }\n    return result;\n  }\n\n  /**\n   * Returns an enum string key, given its numeric value.  Returns `undefined` if no matching value\n   * is found.\n   *\n   * @remarks\n   * The TypeScript compiler only creates a reverse mapping for enum members whose value is numeric.\n   * For example:\n   *\n   * ```ts\n   * enum E {\n   *   A = 1,\n   *   B = 'c'\n   * }\n   *\n   * // Prints \"A\"\n   * console.log(E[1]);\n   *\n   * // Prints \"undefined\"\n   * console.log(E[\"c\"]);\n   * ```\n   *\n   * @example\n   *\n   * Example usage:\n   * ```ts\n   * enum Colors {\n   *   Red = 1,\n   *   Blue = 'blue'\n   * }\n   *\n   * // Prints \"Red\"\n   * console.log(Enum.tryGetKeyByNumber(Colors, 1));\n   *\n   * // Prints \"undefined\"\n   * console.log(Enum.tryGetKeyByNumber(Colors, -1));\n   * ```\n   */\n  public static tryGetKeyByNumber<TEnumValue, TEnumObject extends { [key: string]: TEnumValue }>(\n    enumObject: TEnumObject,\n    value: number\n  ): keyof typeof enumObject | undefined {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return enumObject[value] as any;\n  }\n\n  /**\n   * This API is similar to {@link Enum.tryGetKeyByNumber}, except that it throws an exception\n   * if the key is undefined.\n   */\n  public static getKeyByNumber<TEnumValue, TEnumObject extends { [key: string]: TEnumValue }>(\n    enumObject: TEnumObject,\n    value: number\n  ): keyof typeof enumObject {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const result: keyof typeof enumObject | undefined = enumObject[value] as any;\n    if (result === undefined) {\n      throw new Error(`The value ${value} does not exist in the mapping`);\n    }\n    return result;\n  }\n}\n"]}