99525c9dfdaf68f1a0ffa5d2e89a7fc9cca3ba19a8dcd85e48bcc134a53f4733.json raw

   1  {"ast":null,"code":"import { v4 as uuidv4 } from 'uuid';\nimport { EntityId } from './entity-id';\n/**\n * Strongly-typed identifier for Identity entities.\n * Prevents accidental mixing with other ID types.\n */\nexport class IdentityId extends EntityId {\n  _brand = 'IdentityId';\n  constructor(value) {\n    super(value);\n  }\n  /**\n   * Generate a new unique IdentityId.\n   */\n  static generate() {\n    return new IdentityId(uuidv4());\n  }\n  /**\n   * Create an IdentityId from an existing string value.\n   * Use this when reconstituting from storage.\n   */\n  static from(value) {\n    return new IdentityId(value);\n  }\n  /**\n   * Type guard to check if two IDs are equal.\n   */\n  equals(other) {\n    return other instanceof IdentityId && this._value === other._value;\n  }\n}","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}