Skip to content

Commit

Permalink
fix(@formatjs/intl): rm dep on @types/node
Browse files Browse the repository at this point in the history
  • Loading branch information
longlho committed Sep 27, 2021
1 parent 59037ef commit 245301f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/intl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ alias(
SRCS = glob(["src/**/*.ts*"]) + ["index.ts"]

SRC_DEPS = [
"@npm//@types/node",
"//packages/ecma402-abstract:dist",
"//packages/fast-memoize:dist",
"//packages/icu-messageformat-parser:dist",
Expand Down Expand Up @@ -73,6 +72,7 @@ jest_test(
"//packages/intl-messageformat:types",
"//packages/intl-numberformat:dist",
"//packages/intl-numberformat:types",
"@npm//@types/node",
],
)

Expand Down
1 change: 0 additions & 1 deletion packages/intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"tslib": "^2.1.0"
},
"peerDependencies": {
"@types/node": "14 || 16",
"typescript": "^4.3"
},
"peerDependenciesMeta": {
Expand Down
2 changes: 2 additions & 0 deletions packages/intl/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export class IntlError<
${exception ? `\n${exception.message}\n${exception.stack}` : ''}`
)
this.code = code
// @ts-ignore just so we don't need to declare dep on @types/node
if (typeof Error.captureStackTrace === 'function') {
// @ts-ignore just so we don't need to declare dep on @types/node
Error.captureStackTrace(this, IntlError)
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/intl/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function filterProps<T extends Record<string, any>, K extends string>(
}

const defaultErrorHandler: OnErrorFn = error => {
// @ts-ignore just so we don't need to declare dep on @types/node
if (process.env.NODE_ENV !== 'production') {
console.error(error)
}
Expand Down

0 comments on commit 245301f

Please sign in to comment.