@bleedingdev/modern-js-utils 3.2.0-ultramodern.120 → 3.2.0-ultramodern.122

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.
@@ -1,29 +1,5 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.d = (exports1, getters, values)=>{
14
- var define = (defs, kind)=>{
15
- for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
16
- enumerable: true,
17
- [kind]: defs[key]
18
- });
19
- };
20
- define(getters, "get");
21
- define(values, "value");
22
- };
23
- })();
24
- (()=>{
25
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
26
- })();
27
3
  (()=>{
28
4
  __webpack_require__.r = (exports1)=>{
29
5
  if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
@@ -36,55 +12,7 @@ var __webpack_require__ = {};
36
12
  })();
37
13
  var __webpack_exports__ = {};
38
14
  __webpack_require__.r(__webpack_exports__);
39
- __webpack_require__.d(__webpack_exports__, {
40
- createRuntimeExportsUtils: ()=>createRuntimeExportsUtils
41
- });
42
- const external_path_namespaceObject = require("path");
43
- var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
44
- const external_compiled_js_namespaceObject = require("../compiled.js");
45
- const external_path_js_namespaceObject = require("./path.js");
46
- const memo = (fn)=>{
47
- const cache = new Map();
48
- return (...params)=>{
49
- const stringifiedParams = JSON.stringify(params);
50
- const cachedResult = cache.get(stringifiedParams);
51
- if (cachedResult) return cachedResult;
52
- const res = fn(...params);
53
- cache.set(stringifiedParams, res);
54
- return res;
55
- };
56
- };
57
- const ensureRuntimeExportsFile = (filepath)=>{
58
- external_compiled_js_namespaceObject.fs.ensureDirSync(external_path_default().dirname(filepath));
59
- if (!external_compiled_js_namespaceObject.fs.existsSync(filepath)) external_compiled_js_namespaceObject.fs.writeFileSync(filepath, 'export {};\n');
60
- };
61
- const formatRuntimeExports = (exportsList)=>{
62
- if (0 === exportsList.length) return 'export {};\n';
63
- return `${exportsList.join('\n')}\n`;
64
- };
65
- const flushRuntimeExports = (filepath, exportsSet)=>{
66
- external_compiled_js_namespaceObject.fs.writeFileSync(filepath, formatRuntimeExports(Array.from(exportsSet)));
67
- };
68
- const createRuntimeExportsUtils = memo((internalDirectory, filename)=>{
69
- const filepath = external_path_default().resolve(internalDirectory, `${filename}.ts`);
70
- const exportsSet = new Set();
71
- ensureRuntimeExportsFile(filepath);
72
- return {
73
- addExport (exportStatement) {
74
- const normalized = exportStatement?.trim();
75
- if (!normalized) return;
76
- exportsSet.add(normalized);
77
- flushRuntimeExports(filepath, exportsSet);
78
- },
79
- getPath () {
80
- return (0, external_path_js_namespaceObject.normalizeOutputPath)(filepath);
81
- }
82
- };
83
- });
84
- exports.createRuntimeExportsUtils = __webpack_exports__.createRuntimeExportsUtils;
85
- for(var __rspack_i in __webpack_exports__)if (-1 === [
86
- "createRuntimeExportsUtils"
87
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
88
16
  Object.defineProperty(exports, '__esModule', {
89
17
  value: true
90
18
  });
@@ -1,42 +0,0 @@
1
- import path from "path";
2
- import { fs } from "../compiled.mjs";
3
- import { normalizeOutputPath } from "./path.mjs";
4
- const memo = (fn)=>{
5
- const cache = new Map();
6
- return (...params)=>{
7
- const stringifiedParams = JSON.stringify(params);
8
- const cachedResult = cache.get(stringifiedParams);
9
- if (cachedResult) return cachedResult;
10
- const res = fn(...params);
11
- cache.set(stringifiedParams, res);
12
- return res;
13
- };
14
- };
15
- const ensureRuntimeExportsFile = (filepath)=>{
16
- fs.ensureDirSync(path.dirname(filepath));
17
- if (!fs.existsSync(filepath)) fs.writeFileSync(filepath, 'export {};\n');
18
- };
19
- const formatRuntimeExports = (exportsList)=>{
20
- if (0 === exportsList.length) return 'export {};\n';
21
- return `${exportsList.join('\n')}\n`;
22
- };
23
- const flushRuntimeExports = (filepath, exportsSet)=>{
24
- fs.writeFileSync(filepath, formatRuntimeExports(Array.from(exportsSet)));
25
- };
26
- const createRuntimeExportsUtils = memo((internalDirectory, filename)=>{
27
- const filepath = path.resolve(internalDirectory, `${filename}.ts`);
28
- const exportsSet = new Set();
29
- ensureRuntimeExportsFile(filepath);
30
- return {
31
- addExport (exportStatement) {
32
- const normalized = exportStatement?.trim();
33
- if (!normalized) return;
34
- exportsSet.add(normalized);
35
- flushRuntimeExports(filepath, exportsSet);
36
- },
37
- getPath () {
38
- return normalizeOutputPath(filepath);
39
- }
40
- };
41
- });
42
- export { createRuntimeExportsUtils };
@@ -1,43 +1 @@
1
1
  import "node:module";
2
- import path from "path";
3
- import { fs } from "../compiled.mjs";
4
- import { normalizeOutputPath } from "./path.mjs";
5
- const memo = (fn)=>{
6
- const cache = new Map();
7
- return (...params)=>{
8
- const stringifiedParams = JSON.stringify(params);
9
- const cachedResult = cache.get(stringifiedParams);
10
- if (cachedResult) return cachedResult;
11
- const res = fn(...params);
12
- cache.set(stringifiedParams, res);
13
- return res;
14
- };
15
- };
16
- const ensureRuntimeExportsFile = (filepath)=>{
17
- fs.ensureDirSync(path.dirname(filepath));
18
- if (!fs.existsSync(filepath)) fs.writeFileSync(filepath, 'export {};\n');
19
- };
20
- const formatRuntimeExports = (exportsList)=>{
21
- if (0 === exportsList.length) return 'export {};\n';
22
- return `${exportsList.join('\n')}\n`;
23
- };
24
- const flushRuntimeExports = (filepath, exportsSet)=>{
25
- fs.writeFileSync(filepath, formatRuntimeExports(Array.from(exportsSet)));
26
- };
27
- const createRuntimeExportsUtils = memo((internalDirectory, filename)=>{
28
- const filepath = path.resolve(internalDirectory, `${filename}.ts`);
29
- const exportsSet = new Set();
30
- ensureRuntimeExportsFile(filepath);
31
- return {
32
- addExport (exportStatement) {
33
- const normalized = exportStatement?.trim();
34
- if (!normalized) return;
35
- exportsSet.add(normalized);
36
- flushRuntimeExports(filepath, exportsSet);
37
- },
38
- getPath () {
39
- return normalizeOutputPath(filepath);
40
- }
41
- };
42
- });
43
- export { createRuntimeExportsUtils };
@@ -1,5 +1 @@
1
- export declare const createRuntimeExportsUtils: (internalDirectory: string, filename: string) => {
2
- addExport(exportStatement: string): void;
3
- getPath(): string;
4
- };
5
- export type RuntimeExportsUtils = ReturnType<typeof createRuntimeExportsUtils>;
1
+ export {};
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.2.0-ultramodern.120",
20
+ "version": "3.2.0-ultramodern.122",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "module": "./dist/esm/index.mjs",
@@ -193,7 +193,7 @@
193
193
  "@typescript/native-preview": "7.0.0-dev.20260610.1",
194
194
  "happy-dom": "^20.10.2",
195
195
  "@scripts/rstest-config": "2.66.0",
196
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.120"
196
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.122"
197
197
  },
198
198
  "peerDependencies": {
199
199
  "react": "^19.2.7",