UNPKG

atriusmaps-node-sdk

Version:

This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information

38 lines (35 loc) 840 B
'use strict'; function getLocalized(config, name, lang, def) { let key = name; if (lang) { key += "-" + lang; } const value = config[key]; if (value) { return value; } if (lang) { if (lang.indexOf("-") > 0) { return getLocalized(config, name, lang.substring(0, lang.indexOf("-")), def); } else { return getLocalized(config, name, null, def); } } return def; } function debugIsTrue(app, key) { if (!app.config.debug) { return false; } let value = app.config.debug[key]; if (value === void 0 || value === null || value === false) { return false; } if (value === true) { return true; } value = value.toLowerCase ? value.toLowerCase() : value; return value !== "no" && value !== "false"; } exports.debugIsTrue = debugIsTrue; exports.getLocalized = getLocalized;