@orbit/serializers
Classes​
- BaseSerializer
- BooleanSerializer
- DateSerializer
- DateTimeSerializer
- NoopSerializer
- NumberSerializer
- StringSerializer
Interfaces​
Type aliases​
Inflector​
Ƭ Inflector: (input
: string
) => string
Type declaration​
â–¸ (input
): string
Parameters​
Name | Type |
---|---|
input | string |
Returns​
string
Defined in​
InflectorOrName​
Ƭ InflectorOrName: Inflector
| StandardInflectorName
Defined in​
SerializerClass​
Ƭ SerializerClass<S
>: (settings?
: unknown
) => S
Type parameters​
Name | Type |
---|---|
S | Serializer |
Type declaration​
• (settings?
)
Parameters​
Name | Type |
---|---|
settings? | unknown |
Defined in​
SerializerClassForFn​
Ƭ SerializerClassForFn<S
>: (type
: string
) => SerializerClass
<S
>
Type parameters​
Name | Type |
---|---|
S | Serializer |
Type declaration​
â–¸ (type
): SerializerClass
<S
>
Parameters​
Name | Type |
---|---|
type | string |
Returns​
Defined in​
SerializerForFn​
Ƭ SerializerForFn<S
>: (type
: string
) => S
| undefined
Type parameters​
Name | Type |
---|---|
S | Serializer |
Type declaration​
â–¸ (type
): S
| undefined
Parameters​
Name | Type |
---|---|
type | string |
Returns​
S
| undefined
Defined in​
SerializerSettingsForFn​
Ƭ SerializerSettingsForFn: (type
: string
) => Dict
<unknown
> | undefined
Type declaration​
â–¸ (type
): Dict
<unknown
> | undefined
Parameters​
Name | Type |
---|---|
type | string |
Returns​
Dict
<unknown
> | undefined
Defined in​
StandardInflectorName​
Ƭ StandardInflectorName: "camelize"
| "dasherize"
| "underscore"
| "pluralize"
| "singularize"
Defined in​
Variables​
standardInflectors​
• standardInflectors: Object
Type declaration​
Name | Type |
---|---|
camelize | (str : string ) => string |
dasherize | (str : string ) => string |
pluralize | (word : string ) => string |
singularize | (word : string ) => string |
underscore | (str : string ) => string |
Defined in​
standardInverseInflectors​
• standardInverseInflectors: Object
Type declaration​
Name | Type |
---|---|
camelize | null |
dasherize | string |
pluralize | string |
singularize | string |
underscore | string |
Defined in​
Functions​
buildInflector​
â–¸ buildInflector(mappings?
, fallback?
): Inflector
Parameters​
Name | Type |
---|---|
mappings | Dict <string > |
fallback? | Inflector |
Returns​
Defined in​
buildSerializerClassFor​
â–¸ buildSerializerClassFor<S
>(serializerClasses?
): SerializerClassForFn
<S
>
Type parameters​
Name | Type |
---|---|
S | Serializer <unknown , unknown , unknown , unknown > |
Parameters​
Name | Type |
---|---|
serializerClasses | Dict <SerializerClass <S >> |
Returns​
Defined in​
buildSerializerFor​
â–¸ buildSerializerFor<S
>(settings
): SerializerForFn
<S
>
Type parameters​
Name | Type |
---|---|
S | Serializer <unknown , unknown , unknown , unknown > |
Parameters​
Name | Type |
---|---|
settings | Object |
settings.serializerClassFor? | SerializerClassForFn <S > |
settings.serializerSettingsFor? | SerializerSettingsForFn |
settings.serializers? | Dict <S > |
Returns​
Defined in​
buildSerializerSettingsFor​
â–¸ buildSerializerSettingsFor(settings
): SerializerSettingsForFn
Parameters​
Name | Type |
---|---|
settings | Object |
settings.settingsByType? | Dict <Dict <unknown >> |
settings.sharedSettings? | Dict <unknown > |
Returns​
Defined in​
camelize​
â–¸ camelize(str
): string
Convert underscored, dasherized, or space-delimited words into lowerCamelCase.
Parameters​
Name | Type |
---|---|
str | string |
Returns​
string
Defined in​
capitalize​
â–¸ capitalize(str
): string
Uppercase the first letter of a string, but don't change the remainder.
Parameters​
Name | Type |
---|---|
str | string |
Returns​
string
Defined in​
dasherize​
â–¸ dasherize(str
): string
Dasherize words that are underscored, space-delimited, or camelCased.
Parameters​
Name | Type |
---|---|
str | string |
Returns​
string
Defined in​
decamelize​
â–¸ decamelize(str
): string
Converts a camelized string into all lowercase separated by underscores.
Parameters​
Name | Type |
---|---|
str | string |
Returns​
string
Defined in​
pluralize​
â–¸ pluralize(word
): string
A naive pluralization method.
Parameters​
Name | Type |
---|---|
word | string |
Returns​
string
Defined in​
singularize​
â–¸ singularize(word
): string
A naive singularization method.
Parameters​
Name | Type |
---|---|
word | string |
Returns​
string
Defined in​
underscore​
â–¸ underscore(str
): string
Underscore words that are dasherized, space-delimited, or camelCased.
Parameters​
Name | Type |
---|---|
str | string |
Returns​
string