skuba 3.17.0 → 3.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,7 @@ const DEFAULT_PATHS = { src: ['src'], 'src/*': ['src/*'] };
20
20
  */
21
21
  const getConfigFromDisk = () => {
22
22
  const filename =
23
+ // TODO: drop Node.js 12 compatibility and switch to ?? in skuba v4.
23
24
  findConfigFile('.', sys.fileExists.bind(this)) || 'tsconfig.json';
24
25
 
25
26
  return readConfigFile(filename, sys.readFile.bind(this)).config;
@@ -32,7 +33,8 @@ module.exports.createModuleNameMapper = (getConfig = getConfigFromDisk) => {
32
33
  const parsedConfig = parseJsonConfigFileContent(json, sys, '.');
33
34
 
34
35
  const paths = Object.fromEntries(
35
- Object.entries(parsedConfig.options.paths ?? DEFAULT_PATHS).flatMap(
36
+ // TODO: drop Node.js 12 compatibility and switch to ?? in skuba v4.
37
+ Object.entries(parsedConfig.options.paths || DEFAULT_PATHS).flatMap(
36
38
  ([key, values]) => [
37
39
  // Pass through the input path entry almost verbatim.
38
40
  // We trim a trailing slash because TypeScript allows `import 'src'`
@@ -64,6 +66,7 @@ module.exports.createModuleNameMapper = (getConfig = getConfigFromDisk) => {
64
66
  ),
65
67
  );
66
68
 
69
+ // TODO: drop Node.js 12 compatibility and switch to ?? in skuba v4.
67
70
  const prefix = path.join('<rootDir>', parsedConfig.options.baseUrl || '.');
68
71
 
69
72
  const moduleNameMapper = pathsToModuleNameMapper(paths, { prefix });
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "engines": {
8
8
  "node": ">=12"
9
9
  },
10
- "version": "3.17.0",
10
+ "version": "3.17.1",
11
11
  "main": "lib/index.js",
12
12
  "typings": "lib/index.d.ts",
13
13
  "files": [
@@ -92,7 +92,7 @@
92
92
  "semantic-release": "^17.4.7",
93
93
  "serialize-error": "^8.0.1",
94
94
  "strip-ansi": "^6.0.1",
95
- "ts-jest": "^27.0.5",
95
+ "ts-jest": "^27.1.2",
96
96
  "ts-node": "^9.1.1",
97
97
  "ts-node-dev": "^1.1.8",
98
98
  "tsconfig-paths": "^3.11.0",