0
0
switched/packages/backend/src/misc/is-duplicate-key-value-error.ts
2022-02-03 02:41:22 +09:00

4 lines
160 B
TypeScript

export function isDuplicateKeyValueError(e: unknown | Error): boolean {
return (e as any).message && (e as Error).message.startsWith('duplicate key value');
}