Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
446 B
1
Indexable
Never
const generatePKCEErrorTag: unique symbol = Symbol("GeneratePKCEError");
export type GeneratePKCEError = Readonly<{
  _tag: typeof generatePKCEErrorTag;
  error: Error;
}>;

export const generatePKCEError = (error: Error): GeneratePKCEError => ({
  _tag: generatePKCEErrorTag,
  error,
});

export const isGeneratePKCEError = (error: {
  _tag: symbol | string;
}): error is GeneratePKCEError => error._tag === generatePKCEErrorTag;
Leave a Comment