@decaf-ts/utils 0.9.6 → 0.10.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.
@@ -10,291 +10,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
15
  };
38
16
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.TestReporter = exports.JestReportersTempPathEnvKey = void 0;
40
- const path_1 = __importDefault(require("path"));
41
- const fs_1 = __importDefault(require("fs"));
42
- const fs_2 = require("./fs.cjs");
43
- /**
44
- * @description Environment variable key for Jest HTML reporters temporary directory path
45
- * @summary Constant defining the environment variable key for Jest HTML reporters
46
- * @const JestReportersTempPathEnvKey
47
- * @memberOf module:utils
48
- */
49
- exports.JestReportersTempPathEnvKey = "JEST_HTML_REPORTERS_TEMP_DIR_PATH";
50
- /**
51
- * @description Array of dependencies required by the test reporter
52
- * @summary List of npm packages needed for reporting functionality
53
- * @const dependencies
54
- * @memberOf module:utils
55
- */
56
- const dependencies = ["jest-html-reporters", "json2md", "chartjs-node-canvas"];
57
- /**
58
- * @description Normalizes imports to handle both CommonJS and ESModule formats
59
- * @summary Utility function to handle module import differences between formats
60
- * @template T - Type of the imported module
61
- * @param {Promise<T>} importPromise - Promise returned by dynamic import
62
- * @return {Promise<T>} Normalized module
63
- * @function normalizeImport
64
- * @memberOf module:utils
65
- */
66
- async function normalizeImport(importPromise) {
67
- // CommonJS's `module.exports` is wrapped as `default` in ESModule.
68
- return importPromise.then((m) => (m.default || m));
69
- }
70
- /**
71
- * @description Test reporting utility class for managing test results and evidence
72
- * @summary A comprehensive test reporter that handles various types of test artifacts including messages,
73
- * attachments, data, images, tables, and graphs. It provides methods to report and store test evidence
74
- * in different formats and manages dependencies for reporting functionality.
75
- *
76
- * @template T - Type of data being reported
77
- * @param {string} [testCase="tests"] - Name of the test case
78
- * @param {string} [basePath] - Base path for storing test reports
79
- * @class
80
- *
81
- * @example
82
- * ```typescript
83
- * const reporter = new TestReporter('login-test');
84
- *
85
- * // Report test messages
86
- * await reporter.reportMessage('Test Started', 'Login flow initiated');
87
- *
88
- * // Report test data
89
- * await reporter.reportData('user-credentials', { username: 'test' }, 'json');
90
- *
91
- * // Report test results table
92
- * await reporter.reportTable('test-results', {
93
- * headers: ['Step', 'Status'],
94
- * rows: [
95
- * { Step: 'Login', Status: 'Pass' },
96
- * { Step: 'Validation', Status: 'Pass' }
97
- * ]
98
- * });
99
- *
100
- * // Report test evidence
101
- * await reporter.reportAttachment('Screenshot', screenshotBuffer);
102
- * ```
103
- *
104
- * @mermaid
105
- * sequenceDiagram
106
- * participant Client
107
- * participant TestReporter
108
- * participant FileSystem
109
- * participant Dependencies
110
- *
111
- * Client->>TestReporter: new TestReporter(testCase, basePath)
112
- * TestReporter->>FileSystem: Create report directory
113
- *
114
- * alt Report Message
115
- * Client->>TestReporter: reportMessage(title, message)
116
- * TestReporter->>Dependencies: Import helpers
117
- * TestReporter->>FileSystem: Store message
118
- * else Report Data
119
- * Client->>TestReporter: reportData(reference, data, type)
120
- * TestReporter->>Dependencies: Process data
121
- * TestReporter->>FileSystem: Store formatted data
122
- * else Report Table
123
- * Client->>TestReporter: reportTable(reference, tableDef)
124
- * TestReporter->>Dependencies: Convert to MD format
125
- * TestReporter->>FileSystem: Store table
126
- * end
127
- */
128
- class TestReporter {
129
- constructor(testCase = "tests", basePath = path_1.default.join(process.cwd(), "workdocs", "reports", "evidences")) {
130
- this.testCase = testCase;
131
- this.basePath = basePath;
132
- this.basePath = path_1.default.join(basePath, this.testCase);
133
- if (!fs_1.default.existsSync(this.basePath)) {
134
- fs_1.default.mkdirSync(basePath, { recursive: true });
135
- }
136
- }
137
- /**
138
- * @description Imports required helper functions
139
- * @summary Ensures all necessary dependencies are available and imports helper functions
140
- * @return {Promise<void>} Promise that resolves when helpers are imported
141
- */
142
- async importHelpers() {
143
- this.deps = await (0, fs_2.installIfNotAvailable)([dependencies[0]], this.deps);
144
- // if (!process.env[JestReportersTempPathEnvKey])
145
- // process.env[JestReportersTempPathEnvKey] = './workdocs/reports';
146
- const { addMsg, addAttach } = await normalizeImport(Promise.resolve(`${`${dependencies[0]}/helper`}`).then(s => __importStar(require(s))));
147
- TestReporter.addMsgFunction = addMsg;
148
- TestReporter.addAttachFunction = addAttach;
149
- }
150
- /**
151
- * @description Reports a message to the test report
152
- * @summary Adds a formatted message to the test report with an optional title
153
- * @param {string} title - Title of the message
154
- * @param {string | object} message - Content of the message
155
- * @return {Promise<void>} Promise that resolves when the message is reported
156
- */
157
- async reportMessage(title, message) {
158
- if (!TestReporter.addMsgFunction)
159
- await this.importHelpers();
160
- const msg = `${title}${message ? `\n${message}` : ""}`;
161
- await TestReporter.addMsgFunction({ message: msg });
162
- }
163
- /**
164
- * @description Reports an attachment to the test report
165
- * @summary Adds a formatted message to the test report with an optional title
166
- * @param {string} title - Title of the message
167
- * @param {string | Buffer} attachment - Content of the message
168
- * @return {Promise<void>} Promise that resolves when the message is reported
169
- */
170
- async reportAttachment(title, attachment) {
171
- if (!TestReporter.addAttachFunction)
172
- await this.importHelpers();
173
- await TestReporter.addAttachFunction({
174
- attach: attachment,
175
- description: title,
176
- });
177
- }
178
- /**
179
- * @description Reports data with specified type
180
- * @summary Processes and stores data in the test report with formatting
181
- * @param {string} reference - Reference identifier for the data
182
- * @param {string | number | object} data - Data to be reported
183
- * @param {PayloadType} type - Type of the payload
184
- * @param {boolean} [trim=false] - Whether to trim the data
185
- * @return {Promise<void>} Promise that resolves when data is reported
186
- */
187
- async report(reference, data, type, trim = false) {
188
- try {
189
- let attachFunction = this.reportMessage.bind(this);
190
- let extension = ".txt";
191
- switch (type) {
192
- case "image":
193
- data = Buffer.from(data);
194
- extension = ".png";
195
- attachFunction = this.reportAttachment.bind(this);
196
- break;
197
- case "json":
198
- if (trim) {
199
- if (data.request)
200
- delete data["request"];
201
- if (data.config)
202
- delete data["config"];
203
- }
204
- data = JSON.stringify(data, null, 2);
205
- extension = ".json";
206
- break;
207
- case "md":
208
- extension = ".md";
209
- break;
210
- case "text":
211
- extension = ".txt";
212
- break;
213
- default:
214
- console.log(`Unsupported type ${type}. assuming text`);
215
- }
216
- reference = reference.includes("\n")
217
- ? reference
218
- : `${reference}${extension}`;
219
- await attachFunction(reference, data);
220
- }
221
- catch (e) {
222
- throw new Error(`Could not store attach artifact ${reference} under to test report ${this.testCase} - ${e}`);
223
- }
224
- }
225
- /**
226
- * @description Reports data with a specified type
227
- * @summary Wrapper method for reporting various types of data
228
- * @param {string} reference - Reference identifier for the data
229
- * @param {string | number | object} data - Data to be reported
230
- * @param {PayloadType} [type="json"] - Type of the payload
231
- * @param {boolean} [trim=false] - Whether to trim the data
232
- * @return {Promise<void>} Promise that resolves when data is reported
233
- */
234
- async reportData(reference, data, type = "json", trim = false) {
235
- return this.report(reference, data, type, trim);
236
- }
237
- /**
238
- * @description Reports a JSON object
239
- * @summary Convenience method for reporting JSON objects
240
- * @param {string} reference - Reference identifier for the object
241
- * @param {object} json - JSON object to be reported
242
- * @param {boolean} [trim=false] - Whether to trim the object
243
- * @return {Promise<void>} Promise that resolves when object is reported
244
- */
245
- async reportObject(reference, json, trim = false) {
246
- return this.report(reference, json, "json", trim);
247
- }
248
- /**
249
- * @description Reports a table in markdown format
250
- * @summary Converts and stores a table definition in markdown format
251
- * @param {string} reference - Reference identifier for the table
252
- * @param {MdTableDefinition} tableDef - Table definition object
253
- * @return {Promise<void>} Promise that resolves when table is reported
254
- */
255
- async reportTable(reference, tableDef) {
256
- this.deps = await (0, fs_2.installIfNotAvailable)([dependencies[1]], this.deps);
257
- let txt;
258
- try {
259
- const json2md = await normalizeImport(Promise.resolve(`${`${dependencies[1]}`}`).then(s => __importStar(require(s))));
260
- txt = json2md(tableDef);
261
- }
262
- catch (e) {
263
- throw new Error(`Could not convert JSON to Markdown - ${e}`);
264
- }
265
- return this.report(reference, txt, "md");
266
- }
267
- /**
268
- * @description Reports a graph using Chart.js
269
- * @summary Generates and stores a graph visualization
270
- * @param {string} reference - Reference identifier for the graph
271
- * @param {any} config - Chart.js configuration object
272
- * @return {Promise<void>} Promise that resolves when graph is reported
273
- */
274
- async reportGraph(reference, config) {
275
- this.deps = await (0, fs_2.installIfNotAvailable)([dependencies[2]], this.deps);
276
- const { ChartJSNodeCanvas } = await normalizeImport(Promise.resolve(`${dependencies[2]}`).then(s => __importStar(require(s))));
277
- const width = 600; //px
278
- const height = 800; //px
279
- const backgroundColour = "white"; // Uses https://www.w3schools.com/tags/canvas_fillstyle.asp
280
- const chartJSNodeCanvas = new ChartJSNodeCanvas({
281
- width,
282
- height,
283
- backgroundColour,
284
- });
285
- const image = await chartJSNodeCanvas.renderToBuffer(config);
286
- return await this.reportImage(reference, image);
287
- }
288
- /**
289
- * @description Reports an image to the test report
290
- * @summary Stores an image buffer in the test report
291
- * @param {string} reference - Reference identifier for the image
292
- * @param {Buffer} buffer - Image data buffer
293
- * @return {Promise<void>} Promise that resolves when image is reported
294
- */
295
- async reportImage(reference, buffer) {
296
- return this.report(reference, buffer, "image");
297
- }
298
- }
299
- exports.TestReporter = TestReporter;
17
+ __exportStar(require("./../tests/index.cjs"), exports);
300
18
  //# sourceMappingURL=tests.js.map
@@ -1,193 +1 @@
1
- import { MdTableDefinition } from "./md";
2
- /**
3
- * @interface AddAttachParams
4
- * @description Parameters for adding an attachment to a report
5
- * @summary Interface for attachment parameters
6
- * @memberOf module:utils
7
- */
8
- export interface AddAttachParams {
9
- attach: string | Buffer;
10
- description: string | object;
11
- context?: any;
12
- bufferFormat?: string;
13
- }
14
- /**
15
- * @interface AddMsgParams
16
- * @description Parameters for adding a message to a report
17
- * @summary Interface for message parameters
18
- * @memberOf module:utils
19
- */
20
- export interface AddMsgParams {
21
- message: string | object;
22
- context?: any;
23
- }
24
- /**
25
- * @typedef {("json"|"image"|"text"|"md")} PayloadType
26
- * @description Types of payloads that can be handled
27
- * @summary Union type for payload types
28
- * @memberOf module:utils
29
- */
30
- export type PayloadType = "json" | "image" | "text" | "md";
31
- /**
32
- * @description Environment variable key for Jest HTML reporters temporary directory path
33
- * @summary Constant defining the environment variable key for Jest HTML reporters
34
- * @const JestReportersTempPathEnvKey
35
- * @memberOf module:utils
36
- */
37
- export declare const JestReportersTempPathEnvKey = "JEST_HTML_REPORTERS_TEMP_DIR_PATH";
38
- /**
39
- * @description Test reporting utility class for managing test results and evidence
40
- * @summary A comprehensive test reporter that handles various types of test artifacts including messages,
41
- * attachments, data, images, tables, and graphs. It provides methods to report and store test evidence
42
- * in different formats and manages dependencies for reporting functionality.
43
- *
44
- * @template T - Type of data being reported
45
- * @param {string} [testCase="tests"] - Name of the test case
46
- * @param {string} [basePath] - Base path for storing test reports
47
- * @class
48
- *
49
- * @example
50
- * ```typescript
51
- * const reporter = new TestReporter('login-test');
52
- *
53
- * // Report test messages
54
- * await reporter.reportMessage('Test Started', 'Login flow initiated');
55
- *
56
- * // Report test data
57
- * await reporter.reportData('user-credentials', { username: 'test' }, 'json');
58
- *
59
- * // Report test results table
60
- * await reporter.reportTable('test-results', {
61
- * headers: ['Step', 'Status'],
62
- * rows: [
63
- * { Step: 'Login', Status: 'Pass' },
64
- * { Step: 'Validation', Status: 'Pass' }
65
- * ]
66
- * });
67
- *
68
- * // Report test evidence
69
- * await reporter.reportAttachment('Screenshot', screenshotBuffer);
70
- * ```
71
- *
72
- * @mermaid
73
- * sequenceDiagram
74
- * participant Client
75
- * participant TestReporter
76
- * participant FileSystem
77
- * participant Dependencies
78
- *
79
- * Client->>TestReporter: new TestReporter(testCase, basePath)
80
- * TestReporter->>FileSystem: Create report directory
81
- *
82
- * alt Report Message
83
- * Client->>TestReporter: reportMessage(title, message)
84
- * TestReporter->>Dependencies: Import helpers
85
- * TestReporter->>FileSystem: Store message
86
- * else Report Data
87
- * Client->>TestReporter: reportData(reference, data, type)
88
- * TestReporter->>Dependencies: Process data
89
- * TestReporter->>FileSystem: Store formatted data
90
- * else Report Table
91
- * Client->>TestReporter: reportTable(reference, tableDef)
92
- * TestReporter->>Dependencies: Convert to MD format
93
- * TestReporter->>FileSystem: Store table
94
- * end
95
- */
96
- export declare class TestReporter {
97
- protected testCase: string;
98
- protected basePath: string;
99
- /**
100
- * @description Function for adding messages to the test report
101
- * @summary Static handler for processing and storing test messages
102
- * @type {function(AddMsgParams): Promise<void>}
103
- */
104
- protected static addMsgFunction: (params: AddMsgParams) => Promise<void>;
105
- /**
106
- * @description Function for adding attachments to the test report
107
- * @summary Static handler for processing and storing test attachments
108
- * @type {function(AddAttachParams): Promise<void>}
109
- */
110
- protected static addAttachFunction: (params: AddAttachParams) => Promise<void>;
111
- /**
112
- * @description Map of dependencies required by the reporter
113
- * @summary Stores the current state of dependencies
114
- * @type {SimpleDependencyMap}
115
- */
116
- private deps?;
117
- constructor(testCase?: string, basePath?: string);
118
- /**
119
- * @description Imports required helper functions
120
- * @summary Ensures all necessary dependencies are available and imports helper functions
121
- * @return {Promise<void>} Promise that resolves when helpers are imported
122
- */
123
- private importHelpers;
124
- /**
125
- * @description Reports a message to the test report
126
- * @summary Adds a formatted message to the test report with an optional title
127
- * @param {string} title - Title of the message
128
- * @param {string | object} message - Content of the message
129
- * @return {Promise<void>} Promise that resolves when the message is reported
130
- */
131
- reportMessage(title: string, message: string | object): Promise<void>;
132
- /**
133
- * @description Reports an attachment to the test report
134
- * @summary Adds a formatted message to the test report with an optional title
135
- * @param {string} title - Title of the message
136
- * @param {string | Buffer} attachment - Content of the message
137
- * @return {Promise<void>} Promise that resolves when the message is reported
138
- */
139
- reportAttachment(title: string, attachment: string | Buffer): Promise<void>;
140
- /**
141
- * @description Reports data with specified type
142
- * @summary Processes and stores data in the test report with formatting
143
- * @param {string} reference - Reference identifier for the data
144
- * @param {string | number | object} data - Data to be reported
145
- * @param {PayloadType} type - Type of the payload
146
- * @param {boolean} [trim=false] - Whether to trim the data
147
- * @return {Promise<void>} Promise that resolves when data is reported
148
- */
149
- protected report(reference: string, data: string | number | object | Buffer, type: PayloadType, trim?: boolean): Promise<void>;
150
- /**
151
- * @description Reports data with a specified type
152
- * @summary Wrapper method for reporting various types of data
153
- * @param {string} reference - Reference identifier for the data
154
- * @param {string | number | object} data - Data to be reported
155
- * @param {PayloadType} [type="json"] - Type of the payload
156
- * @param {boolean} [trim=false] - Whether to trim the data
157
- * @return {Promise<void>} Promise that resolves when data is reported
158
- */
159
- reportData(reference: string, data: string | number | object, type?: PayloadType, trim?: boolean): Promise<void>;
160
- /**
161
- * @description Reports a JSON object
162
- * @summary Convenience method for reporting JSON objects
163
- * @param {string} reference - Reference identifier for the object
164
- * @param {object} json - JSON object to be reported
165
- * @param {boolean} [trim=false] - Whether to trim the object
166
- * @return {Promise<void>} Promise that resolves when object is reported
167
- */
168
- reportObject(reference: string, json: object, trim?: boolean): Promise<void>;
169
- /**
170
- * @description Reports a table in markdown format
171
- * @summary Converts and stores a table definition in markdown format
172
- * @param {string} reference - Reference identifier for the table
173
- * @param {MdTableDefinition} tableDef - Table definition object
174
- * @return {Promise<void>} Promise that resolves when table is reported
175
- */
176
- reportTable(reference: string, tableDef: MdTableDefinition): Promise<void>;
177
- /**
178
- * @description Reports a graph using Chart.js
179
- * @summary Generates and stores a graph visualization
180
- * @param {string} reference - Reference identifier for the graph
181
- * @param {any} config - Chart.js configuration object
182
- * @return {Promise<void>} Promise that resolves when graph is reported
183
- */
184
- reportGraph(reference: string, config: any): Promise<void>;
185
- /**
186
- * @description Reports an image to the test report
187
- * @summary Stores an image buffer in the test report
188
- * @param {string} reference - Reference identifier for the image
189
- * @param {Buffer} buffer - Image data buffer
190
- * @return {Promise<void>} Promise that resolves when image is reported
191
- */
192
- reportImage(reference: string, buffer: Buffer): Promise<void>;
193
- }
1
+ export * from "../tests";
@@ -1 +1 @@
1
- {"version":3,"file":"tests.js","sourceRoot":"","sources":["../../src/utils/tests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,4CAAoB;AAEpB,iCAA6C;AAmC7C;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG,mCAAmC,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,YAAY,GAAG,CAAC,qBAAqB,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC;AAE/E;;;;;;;;GAQG;AACH,KAAK,UAAU,eAAe,CAAI,aAAyB;IACzD,mEAAmE;IACnE,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAM,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAa,YAAY;IAwBvB,YACY,WAAmB,OAAO,EAC1B,WAAW,cAAI,CAAC,IAAI,CAC5B,OAAO,CAAC,GAAG,EAAE,EACb,UAAU,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AC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CAAC,SAAiB,EAAE,MAAW;QAC9C,IAAI,CAAC,IAAI,GAAG,MAAM,IAAA,0BAAqB,EAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACtE,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,eAAe,oBAC1C,YAAY,CAAC,CAAC,CAAC,wCACvB,CAAC;QAEF,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI;QACvB,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI;QACxB,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,2DAA2D;QAC7F,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC;YAC9C,KAAK;YACL,MAAM;YACN,gBAAgB;SACjB,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC7D,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IACD;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CAAC,SAAiB,EAAE,MAAc;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF;AApOD,oCAoOC"}
1
+ {"version":3,"file":"tests.js","sourceRoot":"","sources":["../../src/utils/tests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAyB"}
package/package.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
2
  "name": "@decaf-ts/utils",
3
- "version": "0.9.6",
3
+ "version": "0.10.1",
4
4
  "description": "module management utils for decaf-ts",
5
5
  "type": "module",
6
6
  "exports": {
7
- "require": "./lib/index.cjs",
8
- "import": "./lib/esm/index.js"
7
+ ".": {
8
+ "require": "./lib/index.cjs",
9
+ "import": "./lib/esm/index.js",
10
+ "types": "./lib/index.d.ts"
11
+ },
12
+ "./tests": {
13
+ "require": "./lib/tests/index.cjs",
14
+ "import": "./lib/esm/tests/index.js",
15
+ "types": "./lib/tests/index.d.ts"
16
+ }
9
17
  },
10
18
  "types": "lib/index.d.ts",
11
19
  "bin": {