* Convert all JSON configurations (*.json) to HJSON (*.hjson) which is much more flexible for a human readable and editable configuration format

* WIP "next" vs "action" changes
* options.cls is now defaulted in config.js/config.hjson (default = true)
* Notes/etc.
This commit is contained in:
Bryan Ashby 2015-09-08 22:08:45 -06:00
parent 052cf5c490
commit ca4b99a83e
10 changed files with 163 additions and 108 deletions

View file

@ -8,6 +8,7 @@ var _ = require('lodash');
var assert = require('assert');
exports.parseAsset = parseAsset;
exports.getAssetWithShorthand = getAssetWithShorthand;
exports.getArtAsset = getArtAsset;
exports.getModuleAsset = getModuleAsset;
exports.resolveConfigAsset = resolveConfigAsset;
@ -42,6 +43,25 @@ function parseAsset(s) {
}
}
function getAssetWithShorthand(spec, defaultType) {
if(!_.isString(spec)) {
return null;
}
if('@' === spec[0]) {
var asset = parseAsset(spec);
assert(_.isString(asset.type));
return asset;
} else {
return {
type : defaultType,
asset : spec,
}
}
}
// :TODO: Convert these to getAssetWithShorthand()
function getArtAsset(art) {
if(!_.isString(art)) {
return null;