tungsten 0.4.12 → 0.4.14

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.
Files changed (275) hide show
  1. package/dist/.build-complete +1 -1
  2. package/dist/AnyComponent.d.ts.map +1 -1
  3. package/dist/Components.d.ts +40 -0
  4. package/dist/Components.d.ts.map +1 -1
  5. package/dist/Components.js +66 -77
  6. package/dist/DomPointer.js +1 -1
  7. package/dist/DomRegion.js +2 -2
  8. package/dist/Framework.js +1 -1
  9. package/dist/FrameworkConfig.d.ts.map +1 -1
  10. package/dist/Instance/Instance.js +1 -1
  11. package/dist/RenderedContentNode.d.ts.map +1 -1
  12. package/dist/RenderedContentNode.js +2 -1
  13. package/dist/Sass.d.ts.map +1 -1
  14. package/dist/Sass.js +1 -0
  15. package/dist/Servers/DevServer.d.ts.map +1 -1
  16. package/dist/Servers/DevServer.js +4 -3
  17. package/dist/Servers/ProdServer.js +1 -1
  18. package/dist/Servers/StaticSiteServer.js +1 -1
  19. package/dist/Servers/loadEnvsDev.d.ts +1 -1
  20. package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
  21. package/dist/Servers/loadEnvsDev.js +4 -2
  22. package/dist/Servers/routing.d.ts.map +1 -1
  23. package/dist/Servers/routing.js +1 -1
  24. package/dist/Store/Store.js +1 -1
  25. package/dist/Store/TypeSafeStore.js +1 -1
  26. package/dist/Store/makeStore.js +1 -1
  27. package/dist/Store/registerStore.js +1 -1
  28. package/dist/TElement.js +1 -1
  29. package/dist/TungstenApp.js +6 -2
  30. package/dist/_client/cjsHelpers.d.ts.map +1 -1
  31. package/dist/_client/cjsHelpers.js +4 -2
  32. package/dist/_client/client.js +0 -14
  33. package/dist/_client/hmr.d.ts +2 -0
  34. package/dist/_client/hmr.d.ts.map +1 -0
  35. package/dist/_client/hmr.js +65 -0
  36. package/dist/_client/liveReload.d.ts +2 -0
  37. package/dist/_client/liveReload.d.ts.map +1 -0
  38. package/dist/_client/liveReload.js +6 -0
  39. package/dist/_client/liveReloadSource.d.ts +3 -0
  40. package/dist/_client/liveReloadSource.d.ts.map +1 -0
  41. package/dist/_client/liveReloadSource.js +25 -0
  42. package/dist/api/getExport.d.ts.map +1 -1
  43. package/dist/api/getExport.js +1 -0
  44. package/dist/babelPlugins/BabelTransformBindDirect.js +2 -0
  45. package/dist/babelPlugins/BabelTransformBindVar.d.ts.map +1 -1
  46. package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
  47. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
  48. package/dist/babelPlugins/BabelTransformComponentStyles.js +5 -4
  49. package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
  50. package/dist/babelPlugins/BabelTransformCssImports.js +2 -2
  51. package/dist/babelPlugins/BabelTransformDependencyImportsOld.js +1 -1
  52. package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
  53. package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
  54. package/dist/babelPlugins/BabelTransformPackageImports.js +10 -5
  55. package/dist/babelPlugins/BabelTransformRemoveBlocks.d.ts.map +1 -1
  56. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
  57. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +2 -1
  58. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
  59. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +2 -1
  60. package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +1 -1
  61. package/dist/bin/args.js +1 -1
  62. package/dist/bin/commands/build.js +1 -1
  63. package/dist/bin/commands/compileSimplePackage.js +1 -0
  64. package/dist/bin/index.d.ts.map +1 -1
  65. package/dist/bin/index.js +11 -3
  66. package/dist/bin/vendorHook.d.ts +3 -0
  67. package/dist/bin/vendorHook.d.ts.map +1 -0
  68. package/dist/bin/vendorHook.js +34 -0
  69. package/dist/browserStorage.js +4 -2
  70. package/dist/build/babel.user.common.config.d.ts +2 -0
  71. package/dist/build/babel.user.common.config.d.ts.map +1 -1
  72. package/dist/build/babel.user.common.config.js +10 -4
  73. package/dist/build/bundle.d.ts.map +1 -1
  74. package/dist/build/bundle.js +10 -1
  75. package/dist/build/compileJavascript.d.ts.map +1 -1
  76. package/dist/build/compileJavascript.js +40 -27
  77. package/dist/build/compileStyles.js +4 -4
  78. package/dist/build/copyAssets.js +3 -3
  79. package/dist/build/copyPublicFiles.js +3 -3
  80. package/dist/build/createClientFiles.d.ts.map +1 -1
  81. package/dist/build/createClientFiles.js +4 -8
  82. package/dist/build/frameworkStylesheets.js +1 -1
  83. package/dist/build/getAllSxyClientModules.d.ts.map +1 -1
  84. package/dist/build/getAllSxyClientModules.js +4 -28
  85. package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
  86. package/dist/build/getSxyClientPackageAliases.js +3 -1
  87. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  88. package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
  89. package/dist/build/rollupExtractComponentStylesheets.js +1 -1
  90. package/dist/build/sassImportParser.js +2 -2
  91. package/dist/build/tallyBabel.d.ts +3 -0
  92. package/dist/build/tallyBabel.d.ts.map +1 -0
  93. package/dist/build/tallyBabel.js +11 -0
  94. package/dist/clone.js +4 -4
  95. package/dist/compat/context.d.ts.map +1 -1
  96. package/dist/compat/types.d.ts.map +1 -1
  97. package/dist/componentProxyHandlers.d.ts +20 -13
  98. package/dist/componentProxyHandlers.d.ts.map +1 -1
  99. package/dist/componentProxyHandlers.js +134 -94
  100. package/dist/components/Stylesheet.d.ts +1 -2
  101. package/dist/components/Stylesheet.d.ts.map +1 -1
  102. package/dist/components/Stylesheet.js +1 -1
  103. package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
  104. package/dist/components/bindable/BindableInput.d.ts.map +1 -1
  105. package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
  106. package/dist/components/bindable/BindableRadio.d.ts.map +1 -1
  107. package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
  108. package/dist/components/library/RichTextEditor/RichTextEditor.js +2 -2
  109. package/dist/components/library/RichTextEditor/contentTree.js +1 -1
  110. package/dist/concat.d.ts.map +1 -1
  111. package/dist/concat.js +2 -2
  112. package/dist/copy.d.ts.map +1 -1
  113. package/dist/createRoutes.d.ts +1 -1
  114. package/dist/createRoutes.d.ts.map +1 -1
  115. package/dist/env/Env.js +2 -2
  116. package/dist/env/getEnvSchemas.d.ts +2 -2
  117. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  118. package/dist/env/getEnvSchemas.js +7 -5
  119. package/dist/env/windowGlobalEnvStatement.d.ts.map +1 -1
  120. package/dist/findProjectDir.d.ts.map +1 -1
  121. package/dist/findProjectDir.js +18 -4
  122. package/dist/findUserConfig.js +2 -2
  123. package/dist/foreach.js +1 -0
  124. package/dist/frameworkConfigSchema.js +2 -2
  125. package/dist/getComponent.d.ts.map +1 -1
  126. package/dist/getComponentDev.d.ts.map +1 -1
  127. package/dist/getRoutes.d.ts.map +1 -1
  128. package/dist/getRoutes.js +13 -22
  129. package/dist/getRoutesDevs.d.ts.map +1 -1
  130. package/dist/getStackTrace.js +1 -1
  131. package/dist/glob.d.ts +5 -0
  132. package/dist/glob.d.ts.map +1 -0
  133. package/dist/glob.js +103 -0
  134. package/dist/helpers/getFetchCompatibleHeaders.js +2 -2
  135. package/dist/hmr/applyHmrModule.js +5 -5
  136. package/dist/hmr/componentIdentity.js +1 -1
  137. package/dist/hmr/instanceRegistry.js +2 -2
  138. package/dist/hooks/useReducer.d.ts.map +1 -1
  139. package/dist/hooks/useState.d.ts.map +1 -1
  140. package/dist/hooks/useState.js +2 -8
  141. package/dist/hydrate/hydrate.d.ts +1 -1
  142. package/dist/hydrate/hydrate.d.ts.map +1 -1
  143. package/dist/hydrate/hydrate.js +29 -25
  144. package/dist/hydrate/reconcileHydratedAttributes.js +2 -2
  145. package/dist/indexInner.d.ts +1 -1
  146. package/dist/indexInner.d.ts.map +1 -1
  147. package/dist/indexInner.js +1 -0
  148. package/dist/makeFinalConfig.d.ts.map +1 -1
  149. package/dist/makeFinalConfig.js +2 -2
  150. package/dist/markOptionSelected.js +1 -1
  151. package/dist/mergeConfigs.d.ts.map +1 -1
  152. package/dist/mergeConfigs.js +11 -2
  153. package/dist/mutatingFunctions.d.ts +2 -1
  154. package/dist/mutatingFunctions.d.ts.map +1 -1
  155. package/dist/mutatingFunctions.js +10 -4
  156. package/dist/postcssPlugins/TransformCssNames.js +2 -2
  157. package/dist/rawHtml/parseHtml.js +1 -1
  158. package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
  159. package/dist/render/componentNodeToRenderingTree.js +6 -17
  160. package/dist/render/contentToHtml.d.ts.map +1 -1
  161. package/dist/render/contentToHtml.js +1 -1
  162. package/dist/render/getFunctionBodyAsString.d.ts.map +1 -1
  163. package/dist/render/getFunctionBodyAsString.js +2 -5
  164. package/dist/render/processHead.d.ts.map +1 -1
  165. package/dist/render/processHead.js +5 -34
  166. package/dist/render/processProps.js +2 -2
  167. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  168. package/dist/render/rootToHtml.d.ts.map +1 -1
  169. package/dist/routing/Route.js +1 -1
  170. package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
  171. package/dist/routing/RoutesWithSafeParams.js +1 -1
  172. package/dist/routing/WebRedirect.d.ts.map +1 -1
  173. package/dist/routing/compareRequestToRegex.js +2 -2
  174. package/dist/routing/getPathPriority.js +1 -1
  175. package/dist/serverRpc.d.ts.map +1 -1
  176. package/dist/signals/tracking.d.ts +33 -0
  177. package/dist/signals/tracking.d.ts.map +1 -0
  178. package/dist/signals/tracking.js +87 -0
  179. package/dist/slash.d.ts +2 -0
  180. package/dist/slash.d.ts.map +1 -0
  181. package/dist/slash.js +5 -0
  182. package/dist/spawnShellCommand.js +1 -1
  183. package/dist/staticGen/staticGen.d.ts.map +1 -1
  184. package/dist/staticGen/staticGen.js +9 -7
  185. package/dist/staticGen/staticGenFunctions.js +1 -1
  186. package/dist/style/jssToCss.d.ts.map +1 -1
  187. package/dist/style/jssToCss.js +11 -9
  188. package/dist/style/unusedStyles.d.ts.map +1 -1
  189. package/dist/testing/host.js +11 -11
  190. package/dist/testing/hydrateTestApp.d.ts.map +1 -1
  191. package/dist/testing/hydrateTestApp.js +9 -9
  192. package/dist/testing/index.d.ts.map +1 -1
  193. package/dist/testing/installTestStyleProcessors.js +1 -1
  194. package/dist/testing/loadEnv.d.ts +4 -1
  195. package/dist/testing/loadEnv.d.ts.map +1 -1
  196. package/dist/testing/loadEnv.js +2 -2
  197. package/dist/testing/temp/componentPackageMock.js +3 -3
  198. package/dist/timeProfiler.d.ts +4 -0
  199. package/dist/timeProfiler.d.ts.map +1 -1
  200. package/dist/timeProfiler.js +16 -0
  201. package/dist/todo.js +2 -1
  202. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  203. package/dist/update/integrateUpdateVdom.js +17 -14
  204. package/dist/update/integrateUpdateVdomPrebuild.js +5 -5
  205. package/dist/warnOnFrameworkChange.js +1 -1
  206. package/dist/watch.js +2 -2
  207. package/package.json +14 -33
  208. package/types/modules.d.ts +0 -1
  209. package/vendor/babel-core.js +26 -0
  210. package/vendor/babel-parser.js +9 -0
  211. package/vendor/babel-plugin-syntax-import-assertions.js +50 -0
  212. package/vendor/babel-preset-react.js +872 -0
  213. package/vendor/babel-preset-typescript.js +26 -0
  214. package/vendor/babel-types.js +9 -0
  215. package/vendor/chalk-extensions.js +1994 -0
  216. package/vendor/chalk.js +647 -0
  217. package/vendor/chokidar.js +6889 -0
  218. package/vendor/chunk-1TN2rK3j.js +1218 -0
  219. package/vendor/chunk-1UuLTU0U.js +34 -0
  220. package/vendor/chunk-B_NeooyV.js +86 -0
  221. package/vendor/chunk-C12hSZn7.js +88 -0
  222. package/vendor/chunk-C3YkUGz5.js +19 -0
  223. package/vendor/chunk-C3fcZDjl.js +41964 -0
  224. package/vendor/chunk-C9FSKeSx.js +14603 -0
  225. package/vendor/chunk-CPArXGxa.js +14623 -0
  226. package/vendor/cjs-module-lexer.js +6 -0
  227. package/vendor/dotenv.js +412 -0
  228. package/vendor/express.js +40577 -0
  229. package/vendor/import-meta-resolve.js +2201 -0
  230. package/vendor/manifest.json +29 -0
  231. package/vendor/postcss.js +8546 -0
  232. package/vendor/serialize-javascript.js +293 -0
  233. package/vendor/sxy-lib-arrays.js +113 -0
  234. package/vendor/sxy-lib-object-copy.js +1781 -0
  235. package/vendor/sxy-lib-objects.js +156 -0
  236. package/vendor/sxy-lib-promises.js +47 -0
  237. package/vendor/sxy-package-investigator.js +202 -0
  238. package/vendor/valibot.js +7664 -0
  239. package/dist/Servers/hono/DevServerHono.d.ts +0 -2
  240. package/dist/Servers/hono/DevServerHono.d.ts.map +0 -1
  241. package/dist/Servers/hono/DevServerHono.js +0 -423
  242. package/dist/Servers/hono/ProdServerHono.d.ts +0 -2
  243. package/dist/Servers/hono/ProdServerHono.d.ts.map +0 -1
  244. package/dist/Servers/hono/ProdServerHono.js +0 -220
  245. package/dist/Servers/hono/TungstenServerHono.d.ts +0 -6
  246. package/dist/Servers/hono/TungstenServerHono.d.ts.map +0 -1
  247. package/dist/Servers/hono/TungstenServerHono.js +0 -36
  248. package/dist/api/ApiEndpointHono.d.ts +0 -3
  249. package/dist/api/ApiEndpointHono.d.ts.map +0 -1
  250. package/dist/api/ApiEndpointHono.js +0 -1
  251. package/dist/api/ApiRouteHono.d.ts +0 -7
  252. package/dist/api/ApiRouteHono.d.ts.map +0 -1
  253. package/dist/api/ApiRouteHono.js +0 -1
  254. package/dist/api/ApiRoutesHono.d.ts +0 -5
  255. package/dist/api/ApiRoutesHono.d.ts.map +0 -1
  256. package/dist/api/ApiRoutesHono.js +0 -1
  257. package/dist/api/getApiRoutesHono.d.ts +0 -6
  258. package/dist/api/getApiRoutesHono.d.ts.map +0 -1
  259. package/dist/api/getApiRoutesHono.js +0 -14
  260. package/dist/build/compilePackages.d.ts +0 -2
  261. package/dist/build/compilePackages.d.ts.map +0 -1
  262. package/dist/build/compilePackages.js +0 -89
  263. package/dist/build/findRequiredUserModule.d.ts +0 -2
  264. package/dist/build/findRequiredUserModule.d.ts.map +0 -1
  265. package/dist/build/findRequiredUserModule.js +0 -36
  266. package/dist/build/processPackage.d.ts +0 -4
  267. package/dist/build/processPackage.d.ts.map +0 -1
  268. package/dist/build/processPackage.js +0 -91
  269. package/dist/build/tallyBabelPlugins.d.ts +0 -3
  270. package/dist/build/tallyBabelPlugins.d.ts.map +0 -1
  271. package/dist/build/tallyBabelPlugins.js +0 -63
  272. package/dist/testing/loadEnvSetup.d.ts +0 -2
  273. package/dist/testing/loadEnvSetup.d.ts.map +0 -1
  274. package/dist/testing/loadEnvSetup.js +0 -7
  275. package/sxy-loader.config.js +0 -7
@@ -0,0 +1,293 @@
1
+ import { createRequire as __tungstenCreateRequire } from 'node:module';
2
+ const require = __tungstenCreateRequire(import.meta.url);
3
+ import require$$0 from 'crypto';
4
+
5
+ var randombytes;
6
+ var hasRequiredRandombytes;
7
+
8
+ function requireRandombytes () {
9
+ if (hasRequiredRandombytes) return randombytes;
10
+ hasRequiredRandombytes = 1;
11
+ randombytes = require$$0.randomBytes;
12
+ return randombytes;
13
+ }
14
+
15
+ /*
16
+ Copyright (c) 2014, Yahoo! Inc. All rights reserved.
17
+ Copyrights licensed under the New BSD License.
18
+ See the accompanying LICENSE file for terms.
19
+ */
20
+
21
+ var serializeJavascript;
22
+ var hasRequiredSerializeJavascript;
23
+
24
+ function requireSerializeJavascript () {
25
+ if (hasRequiredSerializeJavascript) return serializeJavascript;
26
+ hasRequiredSerializeJavascript = 1;
27
+
28
+ var randomBytes = requireRandombytes();
29
+
30
+ // Generate an internal UID to make the regexp pattern harder to guess.
31
+ var UID_LENGTH = 16;
32
+ var UID = generateUID();
33
+ var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|A|U|I|B|L)-' + UID + '-(\\d+)__@"', 'g');
34
+
35
+ var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g;
36
+ var IS_PURE_FUNCTION = /function.*?\(/;
37
+ var IS_ARROW_FUNCTION = /.*?=>.*?/;
38
+ var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g;
39
+
40
+ var RESERVED_SYMBOLS = ['*', 'async'];
41
+
42
+ // Mapping of unsafe HTML and invalid JavaScript line terminator chars to their
43
+ // Unicode char counterparts which are safe to use in JavaScript strings.
44
+ var ESCAPED_CHARS = {
45
+ '<' : '\\u003C',
46
+ '>' : '\\u003E',
47
+ '/' : '\\u002F',
48
+ '\u2028': '\\u2028',
49
+ '\u2029': '\\u2029'
50
+ };
51
+
52
+ function escapeUnsafeChars(unsafeChar) {
53
+ return ESCAPED_CHARS[unsafeChar];
54
+ }
55
+
56
+ function generateUID() {
57
+ var bytes = randomBytes(UID_LENGTH);
58
+ var result = '';
59
+ for(var i=0; i<UID_LENGTH; ++i) {
60
+ result += bytes[i].toString(16);
61
+ }
62
+ return result;
63
+ }
64
+
65
+ function deleteFunctions(obj){
66
+ var functionKeys = [];
67
+ for (var key in obj) {
68
+ if (typeof obj[key] === "function") {
69
+ functionKeys.push(key);
70
+ }
71
+ }
72
+ for (var i = 0; i < functionKeys.length; i++) {
73
+ delete obj[functionKeys[i]];
74
+ }
75
+ }
76
+
77
+ serializeJavascript = function serialize(obj, options) {
78
+ options || (options = {});
79
+
80
+ // Backwards-compatibility for `space` as the second argument.
81
+ if (typeof options === 'number' || typeof options === 'string') {
82
+ options = {space: options};
83
+ }
84
+
85
+ var functions = [];
86
+ var regexps = [];
87
+ var dates = [];
88
+ var maps = [];
89
+ var sets = [];
90
+ var arrays = [];
91
+ var undefs = [];
92
+ var infinities= [];
93
+ var bigInts = [];
94
+ var urls = [];
95
+
96
+ // Returns placeholders for functions and regexps (identified by index)
97
+ // which are later replaced by their string representation.
98
+ function replacer(key, value) {
99
+
100
+ // For nested function
101
+ if(options.ignoreFunction){
102
+ deleteFunctions(value);
103
+ }
104
+
105
+ if (!value && value !== undefined && value !== BigInt(0)) {
106
+ return value;
107
+ }
108
+
109
+ // If the value is an object w/ a toJSON method, toJSON is called before
110
+ // the replacer runs, so we use this[key] to get the non-toJSONed value.
111
+ var origValue = this[key];
112
+ var type = typeof origValue;
113
+
114
+ if (type === 'object') {
115
+ if(origValue instanceof RegExp) {
116
+ return '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@';
117
+ }
118
+
119
+ if(origValue instanceof Date) {
120
+ return '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@';
121
+ }
122
+
123
+ if(origValue instanceof Map) {
124
+ return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@';
125
+ }
126
+
127
+ if(origValue instanceof Set) {
128
+ return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@';
129
+ }
130
+
131
+ if(origValue instanceof Array) {
132
+ var isSparse = origValue.filter(function(){return true}).length !== origValue.length;
133
+ if (isSparse) {
134
+ return '@__A-' + UID + '-' + (arrays.push(origValue) - 1) + '__@';
135
+ }
136
+ }
137
+
138
+ if(origValue instanceof URL) {
139
+ return '@__L-' + UID + '-' + (urls.push(origValue) - 1) + '__@';
140
+ }
141
+ }
142
+
143
+ if (type === 'function') {
144
+ return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@';
145
+ }
146
+
147
+ if (type === 'undefined') {
148
+ return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@';
149
+ }
150
+
151
+ if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) {
152
+ return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@';
153
+ }
154
+
155
+ if (type === 'bigint') {
156
+ return '@__B-' + UID + '-' + (bigInts.push(origValue) - 1) + '__@';
157
+ }
158
+
159
+ return value;
160
+ }
161
+
162
+ function serializeFunc(fn) {
163
+ var serializedFn = fn.toString();
164
+ if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) {
165
+ throw new TypeError('Serializing native function: ' + fn.name);
166
+ }
167
+
168
+ // pure functions, example: {key: function() {}}
169
+ if(IS_PURE_FUNCTION.test(serializedFn)) {
170
+ return serializedFn;
171
+ }
172
+
173
+ // arrow functions, example: arg1 => arg1+5
174
+ if(IS_ARROW_FUNCTION.test(serializedFn)) {
175
+ return serializedFn;
176
+ }
177
+
178
+ var argsStartsAt = serializedFn.indexOf('(');
179
+ var def = serializedFn.substr(0, argsStartsAt)
180
+ .trim()
181
+ .split(' ')
182
+ .filter(function(val) { return val.length > 0 });
183
+
184
+ var nonReservedSymbols = def.filter(function(val) {
185
+ return RESERVED_SYMBOLS.indexOf(val) === -1
186
+ });
187
+
188
+ // enhanced literal objects, example: {key() {}}
189
+ if(nonReservedSymbols.length > 0) {
190
+ return (def.indexOf('async') > -1 ? 'async ' : '') + 'function'
191
+ + (def.join('').indexOf('*') > -1 ? '*' : '')
192
+ + serializedFn.substr(argsStartsAt);
193
+ }
194
+
195
+ // arrow functions
196
+ return serializedFn;
197
+ }
198
+
199
+ // Check if the parameter is function
200
+ if (options.ignoreFunction && typeof obj === "function") {
201
+ obj = undefined;
202
+ }
203
+ // Protects against `JSON.stringify()` returning `undefined`, by serializing
204
+ // to the literal string: "undefined".
205
+ if (obj === undefined) {
206
+ return String(obj);
207
+ }
208
+
209
+ var str;
210
+
211
+ // Creates a JSON string representation of the value.
212
+ // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args.
213
+ if (options.isJSON && !options.space) {
214
+ str = JSON.stringify(obj);
215
+ } else {
216
+ str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);
217
+ }
218
+
219
+ // Protects against `JSON.stringify()` returning `undefined`, by serializing
220
+ // to the literal string: "undefined".
221
+ if (typeof str !== 'string') {
222
+ return String(str);
223
+ }
224
+
225
+ // Replace unsafe HTML and invalid JavaScript line terminator chars with
226
+ // their safe Unicode char counterpart. This _must_ happen before the
227
+ // regexps and functions are serialized and added back to the string.
228
+ if (options.unsafe !== true) {
229
+ str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars);
230
+ }
231
+
232
+ if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && arrays.length === 0 && undefs.length === 0 && infinities.length === 0 && bigInts.length === 0 && urls.length === 0) {
233
+ return str;
234
+ }
235
+
236
+ // Replaces all occurrences of function, regexp, date, map and set placeholders in the
237
+ // JSON string with their string representations. If the original value can
238
+ // not be found, then `undefined` is used.
239
+ return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) {
240
+ // The placeholder may not be preceded by a backslash. This is to prevent
241
+ // replacing things like `"a\"@__R-<UID>-0__@"` and thus outputting
242
+ // invalid JS.
243
+ if (backSlash) {
244
+ return match;
245
+ }
246
+
247
+ if (type === 'D') {
248
+ return "new Date(\"" + dates[valueIndex].toISOString() + "\")";
249
+ }
250
+
251
+ if (type === 'R') {
252
+ return "new RegExp(" + serialize(regexps[valueIndex].source) + ", \"" + regexps[valueIndex].flags + "\")";
253
+ }
254
+
255
+ if (type === 'M') {
256
+ return "new Map(" + serialize(Array.from(maps[valueIndex].entries()), options) + ")";
257
+ }
258
+
259
+ if (type === 'S') {
260
+ return "new Set(" + serialize(Array.from(sets[valueIndex].values()), options) + ")";
261
+ }
262
+
263
+ if (type === 'A') {
264
+ return "Array.prototype.slice.call(" + serialize(Object.assign({ length: arrays[valueIndex].length }, arrays[valueIndex]), options) + ")";
265
+ }
266
+
267
+ if (type === 'U') {
268
+ return 'undefined'
269
+ }
270
+
271
+ if (type === 'I') {
272
+ return infinities[valueIndex];
273
+ }
274
+
275
+ if (type === 'B') {
276
+ return "BigInt(\"" + bigInts[valueIndex] + "\")";
277
+ }
278
+
279
+ if (type === 'L') {
280
+ return "new URL(" + serialize(urls[valueIndex].toString(), options) + ")";
281
+ }
282
+
283
+ var fn = functions[valueIndex];
284
+
285
+ return serializeFunc(fn);
286
+ });
287
+ };
288
+ return serializeJavascript;
289
+ }
290
+
291
+ var serializeJavascriptExports = requireSerializeJavascript();
292
+
293
+ export { serializeJavascriptExports as default };
@@ -0,0 +1,113 @@
1
+ import { createRequire as __tungstenCreateRequire } from 'node:module';
2
+ const require = __tungstenCreateRequire(import.meta.url);
3
+ var arrays = {};
4
+
5
+ var hasRequiredArrays;
6
+
7
+ function requireArrays () {
8
+ if (hasRequiredArrays) return arrays;
9
+ hasRequiredArrays = 1;
10
+ //const { packageName } = require('./config.js')
11
+ Object.defineProperty(arrays, "__esModule", { value: true });
12
+ arrays.mapSomeToObject = arrays.mapToObject = arrays.dedupeSlow = arrays.uniqueSlow = arrays.process = arrays.add = arrays.removeAndReturn = arrays.remove = void 0;
13
+ ////////////////////////////////////////
14
+ // .remove
15
+ ////////////////////////////////////////
16
+ function remove(array, ...removeValues) {
17
+ for (const removeValue of removeValues) {
18
+ let i = 0;
19
+ let length = array.length;
20
+ for (; i < length; i++) {
21
+ if (array[i] === removeValue) {
22
+ array.splice(i, 1);
23
+ length--;
24
+ }
25
+ }
26
+ }
27
+ }
28
+ arrays.remove = remove;
29
+ //////////////////////////////////////
30
+ // .removeAndReturn
31
+ //////////////////////////////////////
32
+ function removeAndReturn(array, removeValue) {
33
+ return array.filter(value => value !== removeValue);
34
+ }
35
+ arrays.removeAndReturn = removeAndReturn;
36
+ ////////////////////////////////////////
37
+ // .add
38
+ ////////////////////////////////////////
39
+ function add(array, ...values) {
40
+ array.push(...values);
41
+ }
42
+ arrays.add = add;
43
+ function process(array, func) {
44
+ for (const k in array) {
45
+ array[k] = func(array[k], k, array);
46
+ }
47
+ }
48
+ arrays.process = process;
49
+ ////////////////////////////////////////
50
+ // .uniqueSlow
51
+ ////////////////////////////////////////
52
+ function uniqueSlow(array) {
53
+ for (let i = 0; i < array.length; i++) {
54
+ for (let j = i + 1; j < array.length; j++) {
55
+ if (array[i] === array[j])
56
+ array.splice(j--, 1);
57
+ }
58
+ }
59
+ return array;
60
+ }
61
+ arrays.uniqueSlow = uniqueSlow;
62
+ ////////////////////////////////////////
63
+ // .dedupeSlow
64
+ ////////////////////////////////////////
65
+ function dedupeSlow(array) { return uniqueSlow(array); }
66
+ arrays.dedupeSlow = dedupeSlow;
67
+ ////////////////////////////////////////
68
+ // .mapToObject
69
+ ////////////////////////////////////////
70
+ // export type MapToObjectFunction<A extends readonly unknown[], K extends string | number | symbol, V>
71
+ // = (value: A[number], index: number, array: A) => [key: K, value: V]
72
+ function mapToObject(array, func) {
73
+ const returnObj = {};
74
+ for (let i = 0; i < array.length; i++) {
75
+ const objData = func(array[i], i, array);
76
+ const [key, value] = objData;
77
+ returnObj[key] = value;
78
+ }
79
+ return returnObj;
80
+ }
81
+ arrays.mapToObject = mapToObject;
82
+ ////////////////////////////////////////
83
+ // .mapSomeToObject
84
+ ////////////////////////////////////////
85
+ // export type MapSomeToObjectFunction<A extends readonly unknown[], K extends string | symbol, V>
86
+ // = (value: A[number], index: number, array: A) => [key: K, value: V] | null | undefined | false
87
+ function mapSomeToObject(array, func) {
88
+ const returnObj = {};
89
+ for (let i = 0; i < array.length; i++) {
90
+ const objData = func(array[i], i, array);
91
+ if (objData) {
92
+ const [key, value] = objData;
93
+ returnObj[key] = value;
94
+ }
95
+ }
96
+ return returnObj;
97
+ }
98
+ arrays.mapSomeToObject = mapSomeToObject;
99
+ // const a = mapToObject(['a', 'b', 'c'], (v) => [v, v])
100
+ // function f<K extends string>() {
101
+ // const o: Record<K, boolean> = {}
102
+ // }
103
+ // const o1: Record<string, boolean> = {}
104
+ // const o2: Record<'foo', boolean | undefined> = {}
105
+ // const o3: { [Key in 'foo']?: boolean } = {}
106
+ return arrays;
107
+ }
108
+
109
+ var arraysExports = requireArrays();
110
+
111
+ const __v0 = arraysExports["__esModule"];const __v1 = arraysExports["add"];const __v2 = arraysExports["dedupeSlow"];const __v3 = arraysExports["mapSomeToObject"];const __v4 = arraysExports["mapToObject"];const __v5 = arraysExports["process"];const __v6 = arraysExports["remove"];const __v7 = arraysExports["removeAndReturn"];const __v8 = arraysExports["uniqueSlow"];
112
+
113
+ export { __v0 as __esModule, __v1 as add, __v2 as dedupeSlow, arraysExports as default, __v3 as mapSomeToObject, __v4 as mapToObject, __v5 as process, __v6 as remove, __v7 as removeAndReturn, __v8 as uniqueSlow };