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

3 lines
160 B
TypeScript

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