You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
Within 21Gram we only use "string" identifiers. Numbers are not ok internally as they open the doors for exploits such as intel guesswork (autoincrements). Instead, we always stick to GUID, UUID, etc. expressed as string ¯_(ツ)_/¯
If someone out there in the wilderness would like to have number support, just hit a thumbs up or smthn, we don't have issues with voluntarily shooting yourselves in the foot.
Reminder:
/** * @summary Represents the identifier of a REST resource. * @description * This weirdo type makes sure that the identifier of a * REST resource is a `string` but keeps the door open for * more strongly typed identifiers. * @example * The most basic "untyped" string example: * ```ts * // This is a valid identifier * const id: Identifier<string> = 'foo'; * // This is not a valid identifier * const id: Identifier<string> = 42; * ``` * @example * A more advanced, typed example: * ```ts * type ServiceID = 'auth' | 'paymentGateway' | 'cms' | 'crm'; * // This is a valid identifier * const healthCheckId: Identifier<ServiceID> = 'auth'; * // This is not a valid identifier * const healthCheckId: ServiceID = 'foo'; * ``` */exporttypeIdentifier<T>=Textendsstring ? T : never;
The text was updated successfully, but these errors were encountered:
Within 21Gram we only use "string" identifiers. Numbers are not ok internally as they open the doors for exploits such as intel guesswork (autoincrements). Instead, we always stick to GUID, UUID, etc. expressed as string ¯_(ツ)_/¯
If someone out there in the wilderness would like to have number support, just hit a thumbs up or smthn, we don't have issues with voluntarily shooting yourselves in the foot.
Reminder:
The text was updated successfully, but these errors were encountered: