Skip to content

Instantly share code, notes, and snippets.

@mcavaliere
Last active September 28, 2018 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcavaliere/9d097d5148ee6fa45e60917870fbdc53 to your computer and use it in GitHub Desktop.
Save mcavaliere/9d097d5148ee6fa45e60917870fbdc53 to your computer and use it in GitHub Desktop.
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