Protected
dataStatic
Readonly
TemplateTemplate enabling settings
data path
Optional
def: Tdefault value
Optional
Get config property by path
import { Config } from '@biorate/config';
const config = new Config();
config.set('a', 1);
console.log(config.get('a')); // 1
console.log(config.get('b', 2)); // 2
console.log(config.get('b')); // UndefinedConfigPathError: Undefined config path [b]
// at Config.get (src/index.ts:2:1608)
// at Context.<anonymous> (tests/index.spec.ts:19:24)
// at processImmediate (node:internal/timers:464:21)
data object
Merge config data
import { Config } from '@biorate/config';
const config = new Config();
config.merge({
a: { b: { c: 1 } },
});
config.merge({
a: { b: { d: 2 } },
});
console.log(config.has('a')); // true
console.log(config.has('a.b')); // true
console.log(config.get('a.b.c')); // 1
console.log(config.get('a.b.d')); // 2
Protected
templateProtected
templatizeGenerated using TypeDoc
Description
Data storage