Created
June 2, 2019 14:51
-
-
Save aaronoah/cd2eb497b64c9843c116ae77844cf3f0 to your computer and use it in GitHub Desktop.
GSoC 2018 - code snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createStringFormat(FieldFormat) { | |
return class StringFormat extends FieldFormat { | |
_convert(val) { | |
return String(val); | |
} | |
static id = 'string'; | |
static title = 'String'; | |
static fieldType = [ | |
'number', | |
'boolean', | |
... | |
] | |
} | |
} | |
fieldFormats.register(createStringFormat); | |
fieldFormats._defaultMap = { | |
_default_: { id: 'string', params: {} } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment