@dbux/common
Advanced tools
Comparing version 0.1.27 to 0.1.28
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ var path = require('path'); |
@@ -0,0 +0,0 @@ { |
{ | ||
"name": "@dbux/common", | ||
"version": "0.1.27", | ||
"version": "0.1.28", | ||
"description": "", | ||
@@ -17,3 +17,3 @@ "module": "src/index.js", | ||
"_moduleAliases": {}, | ||
"gitHead": "fa98e034cfb16947776eb66b74ba945b0ea12ee8" | ||
"gitHead": "c413121cbf4371570b8dd219f46fc06e8b761824" | ||
} |
@@ -0,0 +0,0 @@ import Enum from '../../util/Enum'; |
@@ -0,0 +0,0 @@ import Enum from "../../util/Enum"; |
@@ -0,0 +0,0 @@ import Enum from "../../util/Enum"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import Enum from '../../util/Enum'; |
@@ -63,2 +63,3 @@ import isString from 'lodash/isString'; | ||
// eslint-disable-next-line import/no-mutable-exports | ||
let ValuePruneState = { | ||
@@ -65,0 +66,0 @@ Normal: 0, |
@@ -0,0 +0,0 @@ import Enum from "../../util/Enum"; |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ import ExecutionContextType from '../constants/ExecutionContextType'; |
@@ -0,0 +0,0 @@ export default class HasValue { |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** @typedef {import('../Var').default} Var */ |
@@ -0,0 +0,0 @@ export default class LoopIteration { |
@@ -0,0 +0,0 @@ /** @typedef {import('../Loc').default} Loc */ |
@@ -0,0 +0,0 @@ /** @typedef {import('../Loc').default} Loc */ |
@@ -0,0 +0,0 @@ /** @typedef {import('../Loc').default} Loc */ |
@@ -0,0 +0,0 @@ /** @typedef {import('../Loc').default} Loc */ |
@@ -0,0 +0,0 @@ import VarOwnerType from '../constants/VarOwnerType'; |
@@ -0,0 +0,0 @@ import TraceType from '../constants/TraceType'; |
@@ -0,0 +0,0 @@ export default class ValueRef { |
@@ -0,0 +0,0 @@ import HasValue from './HasValue'; |
@@ -0,0 +0,0 @@ import HasValue from './HasValue'; |
/** | ||
* NOTE: In dev mode, we want to always link back to our original source files. | ||
*/ | ||
export function getDbuxTargetPath(dbuxPackageName, relativePath) { | ||
export function getDbuxModulePath(dbuxPackageName, relativePath) { | ||
let path; | ||
if (dbuxPackageName === 'code') { | ||
throw new Error('Don\'t use this function to lookup dbux-code paths. It is not a public module.'); | ||
} | ||
if (process.env.NODE_ENV === 'production') { | ||
@@ -7,0 +10,0 @@ path = `@dbux/${dbuxPackageName}/${relativePath}`; |
@@ -0,0 +0,0 @@ |
@@ -128,3 +128,12 @@ /* eslint no-console: 0 */ | ||
export function setOutputStreams(newOutputStreams) { | ||
export function setOutputStreams(newOutputStreams, fullErrorStack = true) { | ||
if (fullErrorStack) { | ||
// fix up error logging to log Error.stack | ||
// NOTE: by default, Error.toString returns only the message for some reason? | ||
const cb = newOutputStreams.error; | ||
newOutputStreams.error = (...args) => { | ||
args = args.map(arg => arg instanceof Error ? arg.stack : arg); | ||
cb(...args); | ||
}; | ||
} | ||
outputStreams = mergeOutputStreams(newOutputStreams); | ||
@@ -131,0 +140,0 @@ } |
@@ -0,0 +0,0 @@ import SerializationMethod from './SerializationMethod'; |
@@ -0,0 +0,0 @@ import Enum from '../util/Enum'; |
@@ -0,0 +0,0 @@ import { newLogger } from '../log/logger'; |
@@ -0,0 +0,0 @@ import countBy from 'lodash/countBy'; |
@@ -0,0 +0,0 @@ // import FastBitSet from 'fastbitset'; |
@@ -0,0 +0,0 @@ |
export default Object.freeze({}); |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ import path from 'path'; |
@@ -0,0 +0,0 @@ import isFunction from 'lodash/isFunction'; |
@@ -0,0 +0,0 @@ // /** |
@@ -0,0 +0,0 @@ import process from 'process'; |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /* eslint no-console: 0 */ |
@@ -0,0 +0,0 @@ import isFunction from 'lodash/isFunction'; |
@@ -0,0 +0,0 @@ // let TaskQueueState = { |
@@ -0,4 +1,10 @@ | ||
import { newLogger } from '@dbux/common/src/log/logger'; | ||
// eslint-disable-next-line no-unused-vars | ||
const { log, debug, warn, error: logError } = newLogger('makeDebounce'); | ||
/** | ||
* Make sure, function is not called more than once every `ms` milliseconds. | ||
*/ | ||
// eslint-disable-next-line camelcase | ||
export function makeDebounce(cb, ms = 300) { | ||
@@ -8,3 +14,9 @@ let timer; | ||
timer = null; | ||
cb(); | ||
try { | ||
cb(); | ||
} | ||
catch (err) { | ||
logError('Error when executing callback', | ||
cb.name?.trim() || '(anonymous callback)', '-', err); | ||
} | ||
} | ||
@@ -11,0 +23,0 @@ return () => { |
@@ -0,0 +0,0 @@ import { logInternalError } from '../log/logger'; |
Sorry, the diff of this file is not supported yet
1818
63334