40b6777c36ae1ff0766266d1959088dabe9e6eebb3549b37f2bdb9e135e95eeb.json raw

   1  {"ast":null,"code":"/**\n * Base class for strongly-typed entity IDs.\n * Prevents mixing up different ID types (e.g., IdentityId vs PermissionId).\n */\nexport class EntityId {\n  _value;\n  constructor(_value) {\n    this._value = _value;\n    if (!_value || _value.trim() === '') {\n      throw new Error(`${this.constructor.name} cannot be empty`);\n    }\n  }\n  get value() {\n    return this._value;\n  }\n  equals(other) {\n    if (!(other instanceof this.constructor)) {\n      return false;\n    }\n    return this._value === other._value;\n  }\n  toString() {\n    return this._value;\n  }\n  toJSON() {\n    return this._value;\n  }\n}","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}