UNPKG

@eolme/vma-router

Version:
30 lines (24 loc) 480 B
import { SharedConfig } from '../types'; let _config: SharedConfig = { debug: false, positive: false }; const log = (...args) => { if (_config.debug) { console.log(...args); } }; const error = (...args) => { if (_config.positive) { console.error(...args); } else { throw new Error(args.join(' ')); } }; const configure = (config: Partial<SharedConfig> = {}) => { _config = { ..._config, ...config }; }; export { log, error, configure };