type Narrowable = string | number | boolean | object | null | undefined | symbol; type Invalid = Error & { __errorMessage: T; }; type AsUniqueArray = { [I in keyof A]: unknown extends { [J in keyof B]: J extends I ? never : B[J] extends A[I] ? unknown : never; }[number] ? Invalid<[A[I], 'is repeated']> : A[I]; }; /** * This is a function to identify duplicates in arrays during compile time. * You may find it useful if you have a list of constants and you need them to be unique. * @see https://stackoverflow.com/a/57021889 */ export declare const asUniqueArray: )>(a: A) => A; export {};