Instantly share code, notes, and snippets.

Embed
What would you like to do?
export default {
configSettingExists( config, key ) {
// Search the config object for the key value
let found = Object.keys( config ).indexOf( key )
return found;
},
indexArrayBy(arr, attrName, group=false) {
// ...
},
initConfig() {
// ... load a json file via AJAX, filesystem, etc. ...
return config
},
printConfigFormatInstructions() {
console.log('Your config file must be in json format, and contain the following keys: foo, bar, baz.');
},
toRGBA(hex, opacity) {
// ...
},
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment