@storm-software/untyped 0.2.0 → 0.4.0
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.
- package/README.md +1 -1
- package/bin/untyped.js +6721 -1015
- package/bin/untyped.mjs +6723 -996
- package/dist/{chunk-I5HMFTDJ.js → chunk-6HKRKQSU.js} +7 -10
- package/dist/chunk-6OB6EGVE.js +6853 -0
- package/dist/{chunk-XAGWZ3JW.mjs → chunk-EBIRRCGB.mjs} +2 -5
- package/dist/chunk-GWEQOXW6.mjs +46 -0
- package/dist/{chunk-ZHHYXAVP.mjs → chunk-HSIBHFJE.mjs} +2 -5
- package/dist/{chunk-JRYWLT6J.js → chunk-LWMIR3BQ.js} +8 -11
- package/dist/chunk-MNW76QG7.mjs +6853 -0
- package/dist/chunk-NYKCIVTC.js +46 -0
- package/dist/{chunk-DV7PRVVQ.js → chunk-TJLW3KPU.js} +6 -9
- package/dist/{chunk-OLRKE2WB.mjs → chunk-XSW3ZXMK.mjs} +2 -5
- package/dist/generate.d.mts +2 -3
- package/dist/generate.d.ts +2 -3
- package/dist/generate.js +6 -7
- package/dist/generate.mjs +5 -6
- package/dist/index.js +6 -7
- package/dist/index.mjs +5 -6
- package/dist/utilities.js +2 -2
- package/dist/utilities.mjs +1 -1
- package/package.json +209 -1
- package/dist/chunk-7LOMEJRK.mjs +0 -73
- package/dist/chunk-7OPTVFZK.mjs +0 -388
- package/dist/chunk-DH2WY7QT.mjs +0 -38
- package/dist/chunk-HBHOVTK2.js +0 -73
- package/dist/chunk-YMCYTSDO.js +0 -388
- package/dist/chunk-ZP3OD7IO.js +0 -38
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkZP3OD7IOjs = require('./chunk-ZP3OD7IO.js');
|
|
4
|
+
var _chunkNYKCIVTCjs = require('./chunk-NYKCIVTC.js');
|
|
9
5
|
|
|
10
6
|
// src/generators/dts.ts
|
|
7
|
+
var _console = require('@storm-software/config-tools/logger/console');
|
|
11
8
|
var _promises = require('fs/promises');
|
|
12
9
|
var _untyped = require('untyped');
|
|
13
10
|
function generateDeclaration(schema) {
|
|
@@ -23,14 +20,14 @@ ${_untyped.generateTypes.call(void 0, schema, {
|
|
|
23
20
|
|
|
24
21
|
`;
|
|
25
22
|
}
|
|
26
|
-
|
|
23
|
+
_chunkNYKCIVTCjs.__name.call(void 0, generateDeclaration, "generateDeclaration");
|
|
27
24
|
function generateDeclarationFile(schema, file, config) {
|
|
28
25
|
try {
|
|
29
|
-
const declarations =
|
|
30
|
-
|
|
26
|
+
const declarations = _chunkNYKCIVTCjs.getOutputFile.call(void 0, file, "d.ts");
|
|
27
|
+
_console.writeTrace.call(void 0, `Writing type declaration file ${declarations}`, config);
|
|
31
28
|
return _promises.writeFile.call(void 0, declarations, generateDeclaration(schema));
|
|
32
29
|
} catch (error) {
|
|
33
|
-
|
|
30
|
+
_console.writeError.call(void 0, `Error writing declaration file for ${file.name}
|
|
34
31
|
|
|
35
32
|
Error:
|
|
36
33
|
${_optionalChain([error, 'optionalAccess', _4 => _4.message]) ? error.message : JSON.stringify(error)}${_optionalChain([error, 'optionalAccess', _5 => _5.stack]) ? `
|
|
@@ -42,7 +39,7 @@ ${JSON.stringify(schema)}
|
|
|
42
39
|
throw error;
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
|
-
|
|
42
|
+
_chunkNYKCIVTCjs.__name.call(void 0, generateDeclarationFile, "generateDeclarationFile");
|
|
46
43
|
|
|
47
44
|
|
|
48
45
|
|