update deep import of @packages/errors

This commit is contained in:
Tim Griesser
2022-02-21 10:11:55 -05:00
parent 8877654126
commit 1c84831317
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -7,9 +7,9 @@ import { codeFrameColumns } from '@babel/code-frame'
import $utils from './utils'
import $sourceMapUtils from './source_map_utils'
import { stackUtils } from '@packages/errors'
const { getStackLines, replacedStack, stackWithoutMessage, splitStack, unsplitStack } = stackUtils
// Intentionally deep-importing from @packages/errors so as to not bundle the entire @packages/errors in the client unnecessarily
import { getStackLines, replacedStack, stackWithoutMessage, splitStack, unsplitStack } from '@packages/errors/src/stackUtils'
const whitespaceRegex = /^(\s*)*/
const stackLineRegex = /^\s*(at )?.*@?\(?.*\:\d+\:\d+\)?$/
+1 -1
View File
@@ -21,7 +21,7 @@ export const splitStack = (stack: string) => {
}, [[], []] as MessageLines)
}
export const unsplitStack = (messageLines: string, stackLines: string[]) => {
export const unsplitStack = (messageLines: string | string[], stackLines: string[]) => {
return _.castArray(messageLines).concat(stackLines).join('\n')
}