Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F9582567
field-type.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
field-type.js
View Options
var
Promise
=
require
(
"bluebird"
);
var
merge
=
require
(
"merge"
);
var
Chip
=
require
(
"./chip.js"
);
/**
* Stores field type metadata, as well as validation methods
* @class
*/
function
FieldType
(
parent_module_path
,
name
){
var
instance
=
function
(){};
Chip
.
call
(
instance
,
parent_module_path
,
true
,
"field_type"
,
name
);
instance
.
prototype
=
Object
.
create
(
FieldType
.
prototype
);
return
instance
;
}
FieldType
.
prototype
=
new
function
(){
/**
* Whether a given value can be stored in this field type instance
* @memberOf FieldType
* @abstract
* @param {any} value value of this variable will be tested for compatibility with this field
* @return {Promise}
*/
this
.
isProperValue
=
function
(
value
){
return
Promise
.
resolve
();
}
this
.
validate_declaration
=
function
(
declaration
){
return
Promise
.
resolve
();
}
this
.
encode
=
function
(
value_in_code
){
return
Promise
.
resolve
();
}
this
.
decode
=
function
(
value_in_database
,
formatting_options
){
return
Promise
.
resolve
();
}
this
.
set_params
=
function
(
param_map
){
if
(
this
.
params
==
undefined
){
this
.
params
=
param_map
;
}
this
.
params
=
merge
(
this
.
params
,
param_map
);
}
this
.
set_fieldname
=
function
(
fieldname
){
this
.
fieldname
=
fieldname
;
}
}
FieldType
.
is_a_constructor
=
true
;
FieldType
.
type_name
=
"field_type"
;
module
.
exports
=
FieldType
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 07:09 (19 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
983944
Default Alt Text
field-type.js (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment