Class StringTransform
Defined in: warp-drive-packages/legacy/src/serializer/-private/transforms/string.ts:6
The StringTransform class is used to serialize and deserialize string attributes on Ember Data record objects. This transform is used when string is passed as the type parameter to the attr function.
Usage
import Model, { attr, belongsTo } from '@warp-drive/legacy/model';
export default class UserModel extends Model {
@attr('boolean') isAdmin;
@attr('string') name;
@attr('string') email;
}Constructors
Constructor
new StringTransform(): StringTransform;Returns
StringTransform
Methods
deserialize()
deserialize(serialized, _options?): string | null;Defined in: warp-drive-packages/legacy/src/serializer/-private/transforms/string.ts:37
Converts a serialized (raw payload) value into a string, or null if the value is falsy (and not an empty string).
Parameters
serialized
unknown
_options?
Record<string, unknown>
Returns
string | null
serialize()
serialize(deserialized, _options?): string | null;Defined in: warp-drive-packages/legacy/src/serializer/-private/transforms/string.ts:43
Converts a string attribute value into its serialized (raw payload) form.
Parameters
deserialized
unknown
_options?
Record<string, unknown>
Returns
string | null
create()
static create(): StringTransform;Defined in: warp-drive-packages/legacy/src/serializer/-private/transforms/string.ts:50
Creates a new instance of this transform.
Returns
StringTransform
Properties
___(unique) Symbol($type)
___(unique) Symbol($type): "string";Defined in: warp-drive-packages/legacy/src/serializer/-private/transforms/string.ts:10
see TransformName