Skip to content

Commit 4e9bcc0

Browse files
committed
Merge remote-tracking branch 'origin/master' into chore/use_swc_jest
2 parents 7b4c777 + 3cec7e4 commit 4e9bcc0

File tree

6 files changed

+230
-74
lines changed

6 files changed

+230
-74
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
"@swc/core": "^1.10.0",
9494
"@swc/jest": "^0.2.37",
9595
"@types/jest": "^30.0.0",
96-
"@typescript-eslint/eslint-plugin": "^8.51.0",
97-
"@typescript-eslint/parser": "^8.51.0",
96+
"@typescript-eslint/eslint-plugin": "^8.52.0",
97+
"@typescript-eslint/parser": "^8.52.0",
9898
"eslint-config-4catalyzer": "^1.5.0",
9999
"eslint-config-4catalyzer-jest": "^2.3.0",
100100
"eslint-config-4catalyzer-typescript": "^3.3.0",
@@ -106,7 +106,7 @@
106106
"hookem": "^3.0.4",
107107
"jest": "^30.2.0",
108108
"lint-staged": "^16.2.7",
109-
"prettier": "^3.7.4",
109+
"ts-jest": "^29.2.5",
110110
"typescript": "^5.9.3"
111111
},
112112
"engines": {

src/utils/asType.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ export default function asType<T, SubT extends T>(
66
klass: Class<SubT>,
77
): SubT {
88
if (!(obj instanceof klass)) {
9-
const ctor =
10-
_.isObject(obj) &&
11-
(obj as object).constructor &&
12-
(obj as object).constructor.name;
9+
const ctor = _.isObject(obj) && obj.constructor && obj.constructor.name;
1310
throw new Error(
1411
`"${String(ctor || obj)}" is not an instance of ${String(klass)}`,
1512
);

test/asType.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ describe('asType', () => {
2121
const value = new Bar();
2222

2323
expect(() => asType(value, Foo)).toThrow(
24-
/"Bar" is not an instance of class Foo/,
24+
'"Bar" is not an instance of class Foo',
2525
);
2626

2727
expect(() => asType('foo', Foo as any)).toThrow(
28-
/"foo" is not an instance of class Foo/,
28+
'"foo" is not an instance of class Foo',
2929
);
3030
});
3131
});

test/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"module": "NodeNext",
55
"moduleResolution": "NodeNext",
6-
"verbatimModuleSyntax": true,
76
"noImplicitAny": false,
87
"types": ["jest", "node"]
98
},

tsconfig.json

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
{
2+
"extends": "@4c/tsconfig/node",
23
"compilerOptions": {
34
"target": "ES2022",
5+
"lib": ["ES2022"],
46
"module": "NodeNext",
57
"moduleResolution": "NodeNext",
6-
"declaration": true,
7-
"declarationMap": true,
8-
"sourceMap": true,
98
"outDir": "lib",
10-
"rootDir": "src",
11-
"strict": true,
12-
"esModuleInterop": true,
13-
"skipLibCheck": true,
14-
"forceConsistentCasingInFileNames": true,
15-
"resolveJsonModule": true,
16-
"isolatedModules": true,
17-
"verbatimModuleSyntax": true,
18-
"noImplicitAny": true,
19-
"noUnusedParameters": true,
20-
"types": ["node"]
9+
"rootDir": "src"
2110
},
2211
"include": ["src/**/*.ts"]
2312
}

0 commit comments

Comments
 (0)