import { fromJsonValue } from "https://deno.land/x/authlete_deno@v1.2.7/src/type/base_extended_enum.ts";
Convert JSON value(s) to the corresponding TExtendedEnum
class(es).
For example, if you pass 'CODE'
(a string
value) to this method,
the method returns ResponseType.CODE
(an instance of ResponseType
class).
NOTE: this method is supposed to be used by class-transformer (the object mapper we internally use). Manual use of this method is not recommended.
Type Parameters
Parameters
A string or string array to convert to the corresponding
TExtendedEnum
class or an array of the TExtendedEnum
class (e.g. 'CODE'
).
A target class to which the source
is converted to. Must
be a class that extends BaseExtendedEnum
class (e.g.
ResponseType
).
Returns
An instance of the TExtendedEnum
class or an array of the
TExtendedEnum
class. undefined
is returned if the the
source
can't be converted to the class.