Skip to content

Commit d1fb92e

Browse files
committed
Use inspect symbol over import
1 parent b699202 commit d1fb92e

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/index.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
import { inspect } from "util";
2-
3-
export type Value = string | number | boolean | object | null | undefined;
1+
const customInspect = Symbol.for("nodejs.util.inspect.custom");
2+
3+
export type Value =
4+
| string
5+
| number
6+
| boolean
7+
| Record<string, unknown>
8+
| null
9+
| undefined;
410
export type RawValue = Value | Sql;
511

612
/**
@@ -77,7 +83,7 @@ export class Sql {
7783
return this.strings.join("?");
7884
}
7985

80-
[inspect.custom]() {
86+
[customInspect]() {
8187
return {
8288
text: this.text,
8389
sql: this.sql,

tsconfig.build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"types": ["node"]
4+
"types": []
55
},
66
"exclude": ["src/**/*.spec.ts"]
77
}

0 commit comments

Comments
 (0)