@eolme/vma-router
Version:
Router for VK Mini Apps
30 lines (24 loc) • 480 B
text/typescript
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 };