mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 11:16:10 +02:00
* 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:
parent
052cf5c490
commit
ca4b99a83e
10 changed files with 163 additions and 108 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue