@baseplate-dev/plugin-auth 0.6.15 → 0.6.16
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/CHANGELOG.md +20 -0
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +14 -28
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +14 -28
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +7 -14
- package/dist/better-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +7 -14
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +14 -28
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +14 -28
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +7 -14
- package/dist/better-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +14 -28
- package/dist/better-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +7 -14
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts +9 -2
- package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js +6 -2
- package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts +16 -2
- package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts +8 -1
- package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts +8 -1
- package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/auth.ts +5 -1
- package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts +7 -14
- package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts +42 -84
- package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts +7 -14
- package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts +70 -140
- package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts +14 -28
- package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts +7 -14
- package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts +7 -14
- package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts +7 -14
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +14 -28
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +14 -28
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +7 -14
- package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +7 -14
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +14 -28
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +14 -28
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +7 -14
- package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +14 -28
- package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +7 -14
- package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +2 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +6 -3
- package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +2 -1
- package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +6 -3
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +2 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +2 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +2 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +2 -2
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +6 -3
- package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +6 -3
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +3 -2
- package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +3 -1
- package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +6 -3
- package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +2 -1
- package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +6 -3
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js +18 -16
- package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.ts +18 -16
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js +6 -6
- package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.ts +6 -6
- package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +7 -14
- package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +42 -84
- package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +7 -14
- package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +63 -126
- package/dist/local-auth/core/generators/react-session/generated/index.d.ts +14 -28
- package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +7 -14
- package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +14 -28
- package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +7 -14
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/placeholder-auth-module.generator.d.ts +1 -1
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/placeholder-auth-module.generator.js +3 -1
- package/dist/web/assets/{_virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-D2O_GHnM.js → _virtual_mf-localSharedImportMap___mfe_internal__plugin_mf_2_auth-04_7KkB1.js} +15 -15
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib__loadShare__.js-DPxqayXr.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib__loadShare__.js-BfSk5vRC.js} +5 -4
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib_mf_1_web__loadShare__.js-DGL7vJhO.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_project_mf_2_builder_mf_2_lib_mf_1_web__loadShare__.js-DZIcwf2B.js} +1 -1
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.js-IL2CfUDN.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.js-CXGct_48.js} +10031 -3732
- package/dist/web/assets/{_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.js-olZgW088.js → _virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_tanstack_mf_1_react_mf_2_router__loadShare__.js-Ci5_qYaj.js} +3823 -2545
- package/dist/web/assets/arduino-BP2nYunF.js +21 -0
- package/dist/web/assets/auth-8qJtXAgU.js +1 -0
- package/dist/web/assets/bash-Zh_IyzBN.js +192 -0
- package/dist/web/assets/basic-3mvohyEL.js +28 -0
- package/dist/web/assets/c-C7Ey31hW.js +74 -0
- package/dist/web/assets/clike-D9YNFwtw.js +41 -0
- package/dist/web/assets/{common-2sTWj7X2.js → common-23-wvKrM.js} +5 -5
- package/dist/web/assets/{common-D-CUPN3f.js → common-B-NI9TR-.js} +2 -2
- package/dist/web/assets/{common-BJslFOaI.js → common-BBriDRRy.js} +3 -3
- package/dist/web/assets/{common-2qsch56z.js → common-BvU-7KsV.js} +5 -5
- package/dist/web/assets/{common-DtVPzGI9.js → common-DBBUvtGu.js} +2 -2
- package/dist/web/assets/{common-BY8yEk1M.js → common-eFh2vwGb.js} +3 -3
- package/dist/web/assets/cpp-_RjA_yNA.js +82 -0
- package/dist/web/assets/csharp-0LZzOc6Q.js +301 -0
- package/dist/web/assets/css-D7TbgetL.js +70 -0
- package/dist/web/assets/diff-CtSa_15w.js +54 -0
- package/dist/web/assets/{dist-DiQ4J8N0.js → dist-BjxypexQ.js} +1397 -897
- package/dist/web/assets/{get-auth-plugin-definition-gCzcUybB.js → get-auth-plugin-definition-x8oAsN1R.js} +2 -2
- package/dist/web/assets/go-CzER04EZ.js +36 -0
- package/dist/web/assets/{hostInit-BPDI3Q4j.js → hostInit-Bay0Y9UX.js} +1 -1
- package/dist/web/assets/{index-BocHdii2.js → index-qso1IsKy.js} +2 -2
- package/dist/web/assets/ini-CU-wHLTy.js +51 -0
- package/dist/web/assets/java-HAvRESj1.js +116 -0
- package/dist/web/assets/javascript-BVAr0eZH.js +124 -0
- package/dist/web/assets/json-DN8T4yFI.js +38 -0
- package/dist/web/assets/kotlin-DkCMjTKK.js +83 -0
- package/dist/web/assets/less-ZXX1tgaG.js +42 -0
- package/dist/web/assets/lua-D9bD4wrb.js +28 -0
- package/dist/web/assets/makefile-CKoRpler.js +40 -0
- package/dist/web/assets/markdown-_2_uVr2L.js +278 -0
- package/dist/web/assets/markup-BVZ8HhdW.js +176 -0
- package/dist/web/assets/markup-templating-BDIRuVJH.js +94 -0
- package/dist/web/assets/{mf-entry-bootstrap-0-b337c957.js → mf-entry-bootstrap-0-659c976f.js} +2 -2
- package/dist/web/assets/{model-utils-BoeoBppL.js → model-utils-dNFTOjqi.js} +268 -25
- package/dist/web/assets/{models-CExR9mVk.js → models-BpslIbU7.js} +2 -2
- package/dist/web/assets/{models-Bb8Sa9xa.js → models-CKab4MTC.js} +2 -2
- package/dist/web/assets/objectivec-DPgB68It.js +25 -0
- package/dist/web/assets/perl-Cul_ma_h.js +92 -0
- package/dist/web/assets/php-JTON0zp9.js +298 -0
- package/dist/web/assets/{plugin-definition-BSgRuyCf.js → plugin-definition-8Exesd6T.js} +2 -2
- package/dist/web/assets/{plugin-definition-DoLu-enC.js → plugin-definition-ChBrbazJ.js} +2 -2
- package/dist/web/assets/python-CURlmZ7M.js +73 -0
- package/dist/web/assets/r-8lr7pbGm.js +30 -0
- package/dist/web/assets/regex-CxQ7DXCx.js +96 -0
- package/dist/web/assets/ruby-BoFHz67P.js +175 -0
- package/dist/web/assets/rust-CpZXpaj0.js +107 -0
- package/dist/web/assets/sass-DG0YAnL7.js +65 -0
- package/dist/web/assets/scss-BDRIqhak.js +70 -0
- package/dist/web/assets/sql-C-bL8_gT.js +40 -0
- package/dist/web/assets/{styles-DWNihayS.js → styles-Cuq4wgvD.js} +7 -7
- package/dist/web/assets/swift-rQ52kfab.js +107 -0
- package/dist/web/assets/typescript-CDkIWcT8.js +57 -0
- package/dist/web/assets/vbnet-_PL7-T9d.js +32 -0
- package/dist/web/assets/{virtualExposes-ZQ3-2Iup.js → virtualExposes-BwIds34r.js} +1 -1
- package/dist/web/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-joyeTHHj.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__plugin-auth__remoteEntry_js-BBt5f0I7.js} +3 -3
- package/dist/web/assets/{virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-Cxtxsg7w.js → virtual_mf-exposes-ssr___mfe_internal__plugin-auth__remoteEntry_js-RzPgl37a.js} +13 -13
- package/dist/web/assets/{virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-BzJkYZS3.js → virtual_mf-exposes___mfe_internal__plugin-auth__remoteEntry_js-DM6Ir1_S.js} +13 -13
- package/dist/web/assets/{web-CbftiK5A.js → web-BZd3bM0n.js} +6 -6
- package/dist/web/assets/{web-sVeHdqQo.js → web-BgWG7dYl.js} +10 -10
- package/dist/web/assets/{web-BbZNg5Ko.js → web-CXHw8SK7.js} +13 -13
- package/dist/web/assets/{web-DUQ-iyMI.js → web-CnB-sqCR.js} +18 -18
- package/dist/web/assets/{web-QvGnMr85.js → web-DHv2aVpi.js} +10 -10
- package/dist/web/assets/{web-pdVFZ-id.js → web-DNrWXjpS.js} +3 -3
- package/dist/web/assets/{web-BWF6Fc7g.js → web-D_H-MoGI.js} +3 -3
- package/dist/web/assets/workerBundle-GFUata9j.js +10 -0
- package/dist/web/assets/yaml-C9m3vuV5.js +90 -0
- package/dist/web/index.html +2 -2
- package/dist/web/remoteEntry.js +1 -1
- package/dist/web/remoteEntry.ssr.js +1 -1
- package/package.json +16 -16
- package/dist/web/assets/auth-BA-e6ORB.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __commonJSMin } from "./rolldown-runtime-FZ4Itg2g.js";
|
|
2
|
-
import { q as stringifyPrettyStable } from "./_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.js-
|
|
2
|
+
import { q as stringifyPrettyStable } from "./_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare___mf_0_baseplate_mf_2_dev_mf_1_ui_mf_2_components__loadShare__.js-CXGct_48.js";
|
|
3
3
|
import { n as __mf_0, t as __mfDefaultExport } from "./_virtual_mf___mfe_internal__plugin_mf_2_auth__loadShare__zod__loadShare__.js-Do-7VDVw.js";
|
|
4
|
-
import { $ as getTag, A as isPlainObject$1, B as int32ArrayTag, C as createPluginFieldMap, D as validationHintRegistry, E as CASE_VALIDATORS, F as dataViewTag, G as regexpTag, H as mapTag, I as dateTag, J as symbolTag, K as setTag, L as float32ArrayTag, M as arrayBufferTag, N as arrayTag, O as isEqual, P as booleanTag, Q as uint8ClampedArrayTag, R as float64ArrayTag, S as createFieldMapSpec, T as runInPluginContext, U as numberTag, V as int8ArrayTag, W as objectTag, X as uint32ArrayTag, Y as uint16ArrayTag, Z as uint8ArrayTag, _ as createRefContextSlot, a as featureEntityType, b as expressionParserSpec, c as createEntityType, d as definitionSchemaWithSlots, et as getSymbols, f as withPlaceholderSlots, g as withRef, h as withEnt, i as createFeaturesSchema, j as argumentsTag, k as
|
|
4
|
+
import { $ as getTag, A as isPlainObject$1, B as int32ArrayTag, C as createPluginFieldMap, D as validationHintRegistry, E as CASE_VALIDATORS, F as dataViewTag, G as regexpTag, H as mapTag, I as dateTag, J as symbolTag, K as setTag, L as float32ArrayTag, M as arrayBufferTag, N as arrayTag, O as isEqual, P as booleanTag, Q as uint8ClampedArrayTag, R as float64ArrayTag, S as createFieldMapSpec, T as runInPluginContext, U as numberTag, V as int8ArrayTag, W as objectTag, X as uint32ArrayTag, Y as uint16ArrayTag, Z as uint8ArrayTag, _ as createRefContextSlot, a as featureEntityType, b as expressionParserSpec, c as createEntityType, d as definitionSchemaWithSlots, et as getSymbols, f as withPlaceholderSlots, g as withRef, h as withEnt, i as createFeaturesSchema, j as argumentsTag, k as eq, l as createDefinitionSchemaParserContext, m as definitionDefaultRegistry, n as FeatureUtils, nt as sortBy, o as featureNameSchema, p as withDefault, q as stringTag, r as createFeatureSchema, rt as createPluginSpec, s as DefinitionEntityType, t as ModelUtils, tt as isBuffer, u as definitionSchema, v as createRefContextSlotMap, w as getPluginContext, x as definitionRefRegistry, y as RefExpressionParser, z as int16ArrayTag } from "./model-utils-dNFTOjqi.js";
|
|
5
5
|
//#region ../../packages/utils/dist/arrays/assert-no-duplicates.js
|
|
6
6
|
/**
|
|
7
7
|
* Asserts that an array has no duplicate values based on an optional key function.
|
|
@@ -43,7 +43,45 @@ function enhanceErrorWithContext(originalError, contextMessage) {
|
|
|
43
43
|
return enhancedError;
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
46
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/array/groupBy.mjs
|
|
47
|
+
/**
|
|
48
|
+
* Groups the elements of an array based on a provided key-generating function.
|
|
49
|
+
*
|
|
50
|
+
* This function takes an array and a function that generates a key from each element. It returns
|
|
51
|
+
* an object where the keys are the generated keys and the values are arrays of elements that share
|
|
52
|
+
* the same key.
|
|
53
|
+
*
|
|
54
|
+
* @template T - The type of elements in the array.
|
|
55
|
+
* @template K - The type of keys.
|
|
56
|
+
* @param arr - The array to group.
|
|
57
|
+
* @param getKeyFromItem - A function that generates a key from an element, its index, and the array.
|
|
58
|
+
* @returns An object where each key is associated with an array of elements that
|
|
59
|
+
* share that key.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* const array = [
|
|
63
|
+
* { category: 'fruit', name: 'apple' },
|
|
64
|
+
* { category: 'fruit', name: 'banana' },
|
|
65
|
+
* { category: 'vegetable', name: 'carrot' }
|
|
66
|
+
* ];
|
|
67
|
+
* const result = groupBy(array, item => item.category);
|
|
68
|
+
* // result will be:
|
|
69
|
+
* // {
|
|
70
|
+
* // fruit: [
|
|
71
|
+
* // { category: 'fruit', name: 'apple' },
|
|
72
|
+
* // { category: 'fruit', name: 'banana' }
|
|
73
|
+
* // ],
|
|
74
|
+
* // vegetable: [
|
|
75
|
+
* // { category: 'vegetable', name: 'carrot' }
|
|
76
|
+
* // ]
|
|
77
|
+
* // }
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* // Using index parameter
|
|
81
|
+
* const items = ['a', 'b', 'c', 'd'];
|
|
82
|
+
* const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd');
|
|
83
|
+
* // result will be: { even: ['a', 'c'], odd: ['b', 'd'] }
|
|
84
|
+
*/
|
|
47
85
|
function groupBy$1(arr, getKeyFromItem) {
|
|
48
86
|
const result = {};
|
|
49
87
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -55,7 +93,40 @@ function groupBy$1(arr, getKeyFromItem) {
|
|
|
55
93
|
return result;
|
|
56
94
|
}
|
|
57
95
|
//#endregion
|
|
58
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
96
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/array/keyBy.mjs
|
|
97
|
+
/**
|
|
98
|
+
* Maps each element of an array based on a provided key-generating function.
|
|
99
|
+
*
|
|
100
|
+
* This function takes an array and a function that generates a key from each element. It returns
|
|
101
|
+
* an object where the keys are the generated keys and the values are the corresponding elements.
|
|
102
|
+
* If there are multiple elements generating the same key, the last element among them is used
|
|
103
|
+
* as the value.
|
|
104
|
+
*
|
|
105
|
+
* @template T - The type of elements in the array.
|
|
106
|
+
* @template K - The type of keys.
|
|
107
|
+
* @param arr - The array of elements to be mapped.
|
|
108
|
+
* @param getKeyFromItem - A function that generates a key from an element, its index, and the array.
|
|
109
|
+
* @returns An object where keys are mapped to each element of an array.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* const array = [
|
|
113
|
+
* { category: 'fruit', name: 'apple' },
|
|
114
|
+
* { category: 'fruit', name: 'banana' },
|
|
115
|
+
* { category: 'vegetable', name: 'carrot' }
|
|
116
|
+
* ];
|
|
117
|
+
* const result = keyBy(array, item => item.category);
|
|
118
|
+
* // result will be:
|
|
119
|
+
* // {
|
|
120
|
+
* // fruit: { category: 'fruit', name: 'banana' },
|
|
121
|
+
* // vegetable: { category: 'vegetable', name: 'carrot' }
|
|
122
|
+
* // }
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* // Using index parameter
|
|
126
|
+
* const items = ['a', 'b', 'c'];
|
|
127
|
+
* const result = keyBy(items, (item, index) => index);
|
|
128
|
+
* // result will be: { 0: 'a', 1: 'b', 2: 'c' }
|
|
129
|
+
*/
|
|
59
130
|
function keyBy(arr, getKeyFromItem) {
|
|
60
131
|
const result = {};
|
|
61
132
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -66,17 +137,42 @@ function keyBy(arr, getKeyFromItem) {
|
|
|
66
137
|
return result;
|
|
67
138
|
}
|
|
68
139
|
//#endregion
|
|
69
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
140
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/array/uniq.mjs
|
|
141
|
+
/**
|
|
142
|
+
* Creates a duplicate-free version of an array.
|
|
143
|
+
*
|
|
144
|
+
* This function takes an array and returns a new array containing only the unique values
|
|
145
|
+
* from the original array, preserving the order of first occurrence.
|
|
146
|
+
*
|
|
147
|
+
* @template T - The type of elements in the array.
|
|
148
|
+
* @param arr - The array to process.
|
|
149
|
+
* @returns A new array with only unique values from the original array.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* const array = [1, 2, 2, 3, 4, 4, 5];
|
|
153
|
+
* const result = uniq(array);
|
|
154
|
+
* // result will be [1, 2, 3, 4, 5]
|
|
155
|
+
*/
|
|
75
156
|
function uniq(arr) {
|
|
76
157
|
return [...new Set(arr)];
|
|
77
158
|
}
|
|
78
159
|
//#endregion
|
|
79
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
160
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/function/flow.mjs
|
|
161
|
+
/**
|
|
162
|
+
* Creates a new function that executes the given functions in sequence. The return value of the previous function is passed as an argument to the next function.
|
|
163
|
+
*
|
|
164
|
+
* The `this` context of the returned function is also passed to the functions provided as parameters.
|
|
165
|
+
*
|
|
166
|
+
* @param funcs The functions to invoke.
|
|
167
|
+
* @returns Returns the new composite function.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* const add = (x: number, y: number) => x + y;
|
|
171
|
+
* const square = (n: number) => n * n;
|
|
172
|
+
*
|
|
173
|
+
* const combined = flow(add, square);
|
|
174
|
+
* console.log(combined(1, 2)); // 9
|
|
175
|
+
*/
|
|
80
176
|
function flow(...funcs) {
|
|
81
177
|
return function(...args) {
|
|
82
178
|
let result = funcs.length ? funcs[0].apply(this, args) : args[0];
|
|
@@ -85,22 +181,105 @@ function flow(...funcs) {
|
|
|
85
181
|
};
|
|
86
182
|
}
|
|
87
183
|
//#endregion
|
|
88
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
184
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/function/identity.mjs
|
|
185
|
+
/**
|
|
186
|
+
* Returns the input value unchanged.
|
|
187
|
+
*
|
|
188
|
+
* @template T - The type of the input value.
|
|
189
|
+
* @param x - The value to be returned.
|
|
190
|
+
* @returns The input value.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* // Returns 5
|
|
194
|
+
* identity(5);
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* // Returns 'hello'
|
|
198
|
+
* identity('hello');
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* // Returns { key: 'value' }
|
|
202
|
+
* identity({ key: 'value' });
|
|
203
|
+
*/
|
|
89
204
|
function identity$1(x) {
|
|
90
205
|
return x;
|
|
91
206
|
}
|
|
92
207
|
//#endregion
|
|
93
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
208
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
|
|
209
|
+
/**
|
|
210
|
+
* Checks whether a value is a JavaScript primitive.
|
|
211
|
+
* JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints.
|
|
212
|
+
*
|
|
213
|
+
* @param value The value to check.
|
|
214
|
+
* @returns Returns true if `value` is a primitive, false otherwise.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* isPrimitive(null); // true
|
|
218
|
+
* isPrimitive(undefined); // true
|
|
219
|
+
* isPrimitive('123'); // true
|
|
220
|
+
* isPrimitive(false); // true
|
|
221
|
+
* isPrimitive(true); // true
|
|
222
|
+
* isPrimitive(Symbol('a')); // true
|
|
223
|
+
* isPrimitive(123n); // true
|
|
224
|
+
* isPrimitive({}); // false
|
|
225
|
+
* isPrimitive(new Date()); // false
|
|
226
|
+
* isPrimitive(new Map()); // false
|
|
227
|
+
* isPrimitive(new Set()); // false
|
|
228
|
+
* isPrimitive([1, 2, 3]); // false
|
|
229
|
+
*/
|
|
94
230
|
function isPrimitive(value) {
|
|
95
231
|
return value == null || typeof value !== "object" && typeof value !== "function";
|
|
96
232
|
}
|
|
97
233
|
//#endregion
|
|
98
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
234
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
235
|
+
/**
|
|
236
|
+
* Checks if a value is a TypedArray.
|
|
237
|
+
* @param x The value to check.
|
|
238
|
+
* @returns Returns true if `x` is a TypedArray, false otherwise.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* const arr = new Uint8Array([1, 2, 3]);
|
|
242
|
+
* isTypedArray(arr); // true
|
|
243
|
+
*
|
|
244
|
+
* const regularArray = [1, 2, 3];
|
|
245
|
+
* isTypedArray(regularArray); // false
|
|
246
|
+
*
|
|
247
|
+
* const buffer = new ArrayBuffer(16);
|
|
248
|
+
* isTypedArray(buffer); // false
|
|
249
|
+
*/
|
|
99
250
|
function isTypedArray(x) {
|
|
100
251
|
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
101
252
|
}
|
|
102
253
|
//#endregion
|
|
103
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
254
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/clone.mjs
|
|
255
|
+
/**
|
|
256
|
+
* Creates a shallow clone of the given object.
|
|
257
|
+
*
|
|
258
|
+
* @template T - The type of the object.
|
|
259
|
+
* @param obj - The object to clone.
|
|
260
|
+
* @returns A shallow clone of the given object.
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* // Clone a primitive value
|
|
264
|
+
* const num = 29;
|
|
265
|
+
* const clonedNum = clone(num);
|
|
266
|
+
* console.log(clonedNum); // 29
|
|
267
|
+
* console.log(clonedNum === num); // true
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* // Clone an array
|
|
271
|
+
* const arr = [1, 2, 3];
|
|
272
|
+
* const clonedArr = clone(arr);
|
|
273
|
+
* console.log(clonedArr); // [1, 2, 3]
|
|
274
|
+
* console.log(clonedArr === arr); // false
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* // Clone an object
|
|
278
|
+
* const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };
|
|
279
|
+
* const clonedObj = clone(obj);
|
|
280
|
+
* console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }
|
|
281
|
+
* console.log(clonedObj === obj); // false
|
|
282
|
+
*/
|
|
104
283
|
function clone(obj) {
|
|
105
284
|
if (isPrimitive(obj)) return obj;
|
|
106
285
|
if (Array.isArray(obj) || isTypedArray(obj) || obj instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && obj instanceof SharedArrayBuffer) return obj.slice(0);
|
|
@@ -126,14 +305,51 @@ function clone(obj) {
|
|
|
126
305
|
type: obj.type,
|
|
127
306
|
lastModified: obj.lastModified
|
|
128
307
|
});
|
|
129
|
-
if (typeof obj === "object")
|
|
130
|
-
const newObject = Object.create(prototype);
|
|
131
|
-
return Object.assign(newObject, obj);
|
|
132
|
-
}
|
|
308
|
+
if (typeof obj === "object") return Object.assign(Object.create(prototype), obj);
|
|
133
309
|
return obj;
|
|
134
310
|
}
|
|
135
311
|
//#endregion
|
|
136
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
312
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
|
|
313
|
+
/**
|
|
314
|
+
* Deeply clones the given object.
|
|
315
|
+
*
|
|
316
|
+
* You can customize the deep cloning process using the `cloneValue` function.
|
|
317
|
+
* The function takes the current value `value`, the property name `key`, and the entire object `obj` as arguments.
|
|
318
|
+
* If the function returns a value, that value is used;
|
|
319
|
+
* if it returns `undefined`, the default cloning method is used.
|
|
320
|
+
*
|
|
321
|
+
* @template T - The type of the object.
|
|
322
|
+
* @param obj - The object to clone.
|
|
323
|
+
* @param [cloneValue] - A function to customize the cloning process.
|
|
324
|
+
* @returns A deep clone of the given object.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* // Clone a primitive value
|
|
328
|
+
* const num = 29;
|
|
329
|
+
* const clonedNum = cloneDeepWith(num);
|
|
330
|
+
* console.log(clonedNum); // 29
|
|
331
|
+
* console.log(clonedNum === num); // true
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* // Clone an object with a customizer
|
|
335
|
+
* const obj = { a: 1, b: 2 };
|
|
336
|
+
* const clonedObj = cloneDeepWith(obj, (value) => {
|
|
337
|
+
* if (typeof value === 'number') {
|
|
338
|
+
* return value * 2; // Double the number
|
|
339
|
+
* }
|
|
340
|
+
* });
|
|
341
|
+
* console.log(clonedObj); // { a: 2, b: 4 }
|
|
342
|
+
* console.log(clonedObj === obj); // false
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* // Clone an array with a customizer
|
|
346
|
+
* const arr = [1, 2, 3];
|
|
347
|
+
* const clonedArr = cloneDeepWith(arr, (value) => {
|
|
348
|
+
* return value + 1; // Increment each value
|
|
349
|
+
* });
|
|
350
|
+
* console.log(clonedArr); // [2, 3, 4]
|
|
351
|
+
* console.log(clonedArr === arr); // false
|
|
352
|
+
*/
|
|
137
353
|
function cloneDeepWith$1(obj, cloneValue) {
|
|
138
354
|
return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), cloneValue);
|
|
139
355
|
}
|
|
@@ -168,7 +384,7 @@ function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @
|
|
|
168
384
|
for (const value of valueToClone) result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));
|
|
169
385
|
return result;
|
|
170
386
|
}
|
|
171
|
-
if (
|
|
387
|
+
if (isBuffer(valueToClone)) return valueToClone.subarray();
|
|
172
388
|
if (isTypedArray(valueToClone)) {
|
|
173
389
|
const result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);
|
|
174
390
|
stack.set(valueToClone, result);
|
|
@@ -195,12 +411,13 @@ function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @
|
|
|
195
411
|
return result;
|
|
196
412
|
}
|
|
197
413
|
if (valueToClone instanceof Error) {
|
|
198
|
-
const result =
|
|
414
|
+
const result = structuredClone(valueToClone);
|
|
199
415
|
stack.set(valueToClone, result);
|
|
200
416
|
result.message = valueToClone.message;
|
|
201
417
|
result.name = valueToClone.name;
|
|
202
418
|
result.stack = valueToClone.stack;
|
|
203
419
|
result.cause = valueToClone.cause;
|
|
420
|
+
result.constructor = valueToClone.constructor;
|
|
204
421
|
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
205
422
|
return result;
|
|
206
423
|
}
|
|
@@ -266,12 +483,76 @@ function isCloneableObject(object) {
|
|
|
266
483
|
}
|
|
267
484
|
}
|
|
268
485
|
//#endregion
|
|
269
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
486
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/cloneDeep.mjs
|
|
487
|
+
/**
|
|
488
|
+
* Creates a deep clone of the given object.
|
|
489
|
+
*
|
|
490
|
+
* @template T - The type of the object.
|
|
491
|
+
* @param obj - The object to clone.
|
|
492
|
+
* @returns A deep clone of the given object.
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* // Clone a primitive value
|
|
496
|
+
* const num = 29;
|
|
497
|
+
* const clonedNum = cloneDeep(num);
|
|
498
|
+
* console.log(clonedNum); // 29
|
|
499
|
+
* console.log(clonedNum === num); // true
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* // Clone an array
|
|
503
|
+
* const arr = [1, 2, 3];
|
|
504
|
+
* const clonedArr = cloneDeep(arr);
|
|
505
|
+
* console.log(clonedArr); // [1, 2, 3]
|
|
506
|
+
* console.log(clonedArr === arr); // false
|
|
507
|
+
*
|
|
508
|
+
* @example
|
|
509
|
+
* // Clone an array with nested objects
|
|
510
|
+
* const arr = [1, { a: 1 }, [1, 2, 3]];
|
|
511
|
+
* const clonedArr = cloneDeep(arr);
|
|
512
|
+
* arr[1].a = 2;
|
|
513
|
+
* console.log(arr); // [1, { a: 2 }, [1, 2, 3]]
|
|
514
|
+
* console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]
|
|
515
|
+
* console.log(clonedArr === arr); // false
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* // Clone an object
|
|
519
|
+
* const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };
|
|
520
|
+
* const clonedObj = cloneDeep(obj);
|
|
521
|
+
* console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }
|
|
522
|
+
* console.log(clonedObj === obj); // false
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
* // Clone an object with nested objects
|
|
526
|
+
* const obj = { a: 1, b: { c: 1 } };
|
|
527
|
+
* const clonedObj = cloneDeep(obj);
|
|
528
|
+
* obj.b.c = 2;
|
|
529
|
+
* console.log(obj); // { a: 1, b: { c: 2 } }
|
|
530
|
+
* console.log(clonedObj); // { a: 1, b: { c: 1 } }
|
|
531
|
+
* console.log(clonedObj === obj); // false
|
|
532
|
+
*/
|
|
270
533
|
function cloneDeep$1(obj) {
|
|
271
534
|
return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
|
|
272
535
|
}
|
|
273
536
|
//#endregion
|
|
274
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
537
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/mapValues.mjs
|
|
538
|
+
/**
|
|
539
|
+
* Creates a new object with the same keys as the given object, but with values generated
|
|
540
|
+
* by running each own enumerable property of the object through the iteratee function.
|
|
541
|
+
*
|
|
542
|
+
* @template T - The type of the object.
|
|
543
|
+
* @template K - The type of the keys in the object.
|
|
544
|
+
* @template V - The type of the new values generated by the iteratee function.
|
|
545
|
+
*
|
|
546
|
+
* @param object - The object to iterate over.
|
|
547
|
+
* @param getNewValue - The function invoked per own enumerable property.
|
|
548
|
+
* @returns Returns the new mapped object.
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* // Example usage:
|
|
552
|
+
* const obj = { a: 1, b: 2 };
|
|
553
|
+
* const result = mapValues(obj, (value) => value * 2);
|
|
554
|
+
* console.log(result); // { a: 2, b: 4 }
|
|
555
|
+
*/
|
|
275
556
|
function mapValues(object, getNewValue) {
|
|
276
557
|
const result = {};
|
|
277
558
|
const keys = Object.keys(object);
|
|
@@ -283,12 +564,70 @@ function mapValues(object, getNewValue) {
|
|
|
283
564
|
return result;
|
|
284
565
|
}
|
|
285
566
|
//#endregion
|
|
286
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
567
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
568
|
+
/**
|
|
569
|
+
* Checks if a property key is unsafe to modify directly.
|
|
570
|
+
*
|
|
571
|
+
* This function is used in functions like `merge` to prevent prototype pollution attacks
|
|
572
|
+
* by identifying property keys that could modify the object's prototype chain or constructor.
|
|
573
|
+
*
|
|
574
|
+
* @param key - The property key to check
|
|
575
|
+
* @returns `true` if the property is unsafe to modify directly, `false` otherwise
|
|
576
|
+
* @internal
|
|
577
|
+
*/
|
|
287
578
|
function isUnsafeProperty(key) {
|
|
288
579
|
return key === "__proto__";
|
|
289
580
|
}
|
|
290
581
|
//#endregion
|
|
291
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
582
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/mergeWith.mjs
|
|
583
|
+
/**
|
|
584
|
+
* Merges the properties of the source object into the target object.
|
|
585
|
+
*
|
|
586
|
+
* You can provide a custom `merge` function to control how properties are merged. It should return the value to be set in the target object.
|
|
587
|
+
*
|
|
588
|
+
* If it returns `undefined`, a default deep merge will be applied for arrays and objects:
|
|
589
|
+
*
|
|
590
|
+
* - If a property in the source object is an array or an object and the corresponding property in the target object is also an array or object, they will be merged.
|
|
591
|
+
* - If a property in the source object is undefined, it will not overwrite a defined property in the target object.
|
|
592
|
+
*
|
|
593
|
+
* Note that this function mutates the target object.
|
|
594
|
+
*
|
|
595
|
+
* @param target - The target object into which the source object properties will be merged. This object is modified in place.
|
|
596
|
+
* @param source - The source object whose properties will be merged into the target object.
|
|
597
|
+
* @param merge - A custom merge function that defines how properties should be combined. It receives the following arguments:
|
|
598
|
+
* - `targetValue`: The current value of the property in the target object.
|
|
599
|
+
* - `sourceValue`: The value of the property in the source object.
|
|
600
|
+
* - `key`: The key of the property being merged.
|
|
601
|
+
* - `target`: The target object.
|
|
602
|
+
* - `source`: The source object.
|
|
603
|
+
*
|
|
604
|
+
* @returns The updated target object with properties from the source object merged in.
|
|
605
|
+
*
|
|
606
|
+
* @template T - Type of the target object.
|
|
607
|
+
* @template S - Type of the source object.
|
|
608
|
+
*
|
|
609
|
+
* @example
|
|
610
|
+
* const target = { a: 1, b: 2 };
|
|
611
|
+
* const source = { b: 3, c: 4 };
|
|
612
|
+
*
|
|
613
|
+
* mergeWith(target, source, (targetValue, sourceValue) => {
|
|
614
|
+
* if (typeof targetValue === 'number' && typeof sourceValue === 'number') {
|
|
615
|
+
* return targetValue + sourceValue;
|
|
616
|
+
* }
|
|
617
|
+
* });
|
|
618
|
+
* // Returns { a: 1, b: 5, c: 4 }
|
|
619
|
+
* @example
|
|
620
|
+
* const target = { a: [1], b: [2] };
|
|
621
|
+
* const source = { a: [3], b: [4] };
|
|
622
|
+
*
|
|
623
|
+
* const result = mergeWith(target, source, (objValue, srcValue) => {
|
|
624
|
+
* if (Array.isArray(objValue)) {
|
|
625
|
+
* return objValue.concat(srcValue);
|
|
626
|
+
* }
|
|
627
|
+
* });
|
|
628
|
+
*
|
|
629
|
+
* expect(result).toEqual({ a: [1, 3], b: [2, 4] });
|
|
630
|
+
*/
|
|
292
631
|
function mergeWith(target, source, merge) {
|
|
293
632
|
const sourceKeys = Object.keys(source);
|
|
294
633
|
for (let i = 0; i < sourceKeys.length; i++) {
|
|
@@ -307,7 +646,24 @@ function mergeWith(target, source, merge) {
|
|
|
307
646
|
return target;
|
|
308
647
|
}
|
|
309
648
|
//#endregion
|
|
310
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
649
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/omit.mjs
|
|
650
|
+
/**
|
|
651
|
+
* Creates a new object with specified keys omitted.
|
|
652
|
+
*
|
|
653
|
+
* This function takes an object and an array of keys, and returns a new object that
|
|
654
|
+
* excludes the properties corresponding to the specified keys.
|
|
655
|
+
*
|
|
656
|
+
* @template T - The type of object.
|
|
657
|
+
* @template K - The type of keys in object.
|
|
658
|
+
* @param obj - The object to omit keys from.
|
|
659
|
+
* @param keys - An array of keys to be omitted from the object.
|
|
660
|
+
* @returns A new object with the specified keys omitted.
|
|
661
|
+
*
|
|
662
|
+
* @example
|
|
663
|
+
* const obj = { a: 1, b: 2, c: 3 };
|
|
664
|
+
* const result = omit(obj, ['b', 'c']);
|
|
665
|
+
* // result will be { a: 1 }
|
|
666
|
+
*/
|
|
311
667
|
function omit(obj, keys) {
|
|
312
668
|
const result = { ...obj };
|
|
313
669
|
for (let i = 0; i < keys.length; i++) {
|
|
@@ -317,7 +673,26 @@ function omit(obj, keys) {
|
|
|
317
673
|
return result;
|
|
318
674
|
}
|
|
319
675
|
//#endregion
|
|
320
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
676
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/pickBy.mjs
|
|
677
|
+
/**
|
|
678
|
+
* Creates a new object composed of the properties that satisfy the predicate function.
|
|
679
|
+
*
|
|
680
|
+
* This function takes an object and a predicate function, and returns a new object that
|
|
681
|
+
* includes only the properties for which the predicate function returns true.
|
|
682
|
+
*
|
|
683
|
+
* @template T - The type of object.
|
|
684
|
+
* @param obj - The object to pick properties from.
|
|
685
|
+
* @param shouldPick - A predicate function that determines
|
|
686
|
+
* whether a property should be picked. It takes the property's key and value as arguments and returns `true`
|
|
687
|
+
* if the property should be picked, and `false` otherwise.
|
|
688
|
+
* @returns A new object with the properties that satisfy the predicate function.
|
|
689
|
+
*
|
|
690
|
+
* @example
|
|
691
|
+
* const obj = { a: 1, b: 'pick', c: 3 };
|
|
692
|
+
* const shouldPick = (value) => typeof value === 'string';
|
|
693
|
+
* const result = pickBy(obj, shouldPick);
|
|
694
|
+
* // result will be { b: 'pick' }
|
|
695
|
+
*/
|
|
321
696
|
function pickBy(obj, shouldPick) {
|
|
322
697
|
const result = {};
|
|
323
698
|
const keys = Object.keys(obj);
|
|
@@ -329,14 +704,67 @@ function pickBy(obj, shouldPick) {
|
|
|
329
704
|
return result;
|
|
330
705
|
}
|
|
331
706
|
//#endregion
|
|
332
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
707
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/string/capitalize.mjs
|
|
708
|
+
/**
|
|
709
|
+
* Converts the first character of string to upper case and the remaining to lower case.
|
|
710
|
+
*
|
|
711
|
+
* @template T - Literal type of the string.
|
|
712
|
+
* @param str - The string to be converted to uppercase.
|
|
713
|
+
* @returns The capitalized string.
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
* const result = capitalize('fred') // returns 'Fred'
|
|
717
|
+
* const result2 = capitalize('FRED') // returns 'Fred'
|
|
718
|
+
*/
|
|
333
719
|
function capitalize$1(str) {
|
|
334
720
|
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
335
721
|
}
|
|
336
722
|
//#endregion
|
|
337
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
723
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/object/toMerged.mjs
|
|
724
|
+
/**
|
|
725
|
+
* Merges the properties of the source object into a deep clone of the target object.
|
|
726
|
+
* Unlike `merge`, This function does not modify the original target object.
|
|
727
|
+
*
|
|
728
|
+
* This function performs a deep merge, meaning nested objects and arrays are merged recursively.
|
|
729
|
+
*
|
|
730
|
+
* - If a property in the source object is an array or object and the corresponding property in the target object is also an array or object, they will be merged.
|
|
731
|
+
* - If a property in the source object is undefined, it will not overwrite a defined property in the target object.
|
|
732
|
+
*
|
|
733
|
+
* Note that this function does not mutate the target object.
|
|
734
|
+
*
|
|
735
|
+
* @param target - The target object to be cloned and merged into. This object is not modified directly.
|
|
736
|
+
* @param source - The source object whose properties will be merged into the cloned target object.
|
|
737
|
+
* @returns A new object with properties from the source object merged into a deep clone of the target object.
|
|
738
|
+
*
|
|
739
|
+
* @template T - Type of the target object.
|
|
740
|
+
* @template S - Type of the source object.
|
|
741
|
+
*
|
|
742
|
+
* @example
|
|
743
|
+
* const target = { a: 1, b: { x: 1, y: 2 } };
|
|
744
|
+
* const source = { b: { y: 3, z: 4 }, c: 5 };
|
|
745
|
+
*
|
|
746
|
+
* const result = toMerged(target, source);
|
|
747
|
+
* console.log(result);
|
|
748
|
+
* // Output: { a: 1, b: { x: 1, y: 3, z: 4 }, c: 5 }
|
|
749
|
+
*
|
|
750
|
+
* @example
|
|
751
|
+
* const target = { a: [1, 2], b: { x: 1 } };
|
|
752
|
+
* const source = { a: [3], b: { y: 2 } };
|
|
753
|
+
*
|
|
754
|
+
* const result = toMerged(target, source);
|
|
755
|
+
* console.log(result);
|
|
756
|
+
* // Output: { a: [3, 2], b: { x: 1, y: 2 } }
|
|
757
|
+
*
|
|
758
|
+
* @example
|
|
759
|
+
* const target = { a: null };
|
|
760
|
+
* const source = { a: [1, 2, 3] };
|
|
761
|
+
*
|
|
762
|
+
* const result = toMerged(target, source);
|
|
763
|
+
* console.log(result);
|
|
764
|
+
* // Output: { a: [1, 2, 3] }
|
|
765
|
+
*/
|
|
338
766
|
function toMerged(target, source) {
|
|
339
|
-
return mergeWith(
|
|
767
|
+
return mergeWith(cloneDeep$1(target), source, function mergeRecursively(targetValue, sourceValue) {
|
|
340
768
|
if (Array.isArray(sourceValue)) if (Array.isArray(targetValue)) return mergeWith(clone(targetValue), sourceValue, mergeRecursively);
|
|
341
769
|
else return mergeWith([], sourceValue, mergeRecursively);
|
|
342
770
|
else if (isPlainObject$1(sourceValue)) if (isPlainObject$1(targetValue)) return mergeWith(clone(targetValue), sourceValue, mergeRecursively);
|
|
@@ -344,7 +772,28 @@ function toMerged(target, source) {
|
|
|
344
772
|
});
|
|
345
773
|
}
|
|
346
774
|
//#endregion
|
|
347
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
775
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/predicate/isLength.mjs
|
|
776
|
+
/**
|
|
777
|
+
* Checks if a given value is a valid length.
|
|
778
|
+
*
|
|
779
|
+
* A valid length is of type `number`, is a non-negative integer, and is less than or equal to
|
|
780
|
+
* JavaScript's maximum safe integer (`Number.MAX_SAFE_INTEGER`).
|
|
781
|
+
* It returns `true` if the value is a valid length, and `false` otherwise.
|
|
782
|
+
*
|
|
783
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the
|
|
784
|
+
* argument to a valid length (`number`).
|
|
785
|
+
*
|
|
786
|
+
* @param value The value to check.
|
|
787
|
+
* @returns Returns `true` if `value` is a valid length, else `false`.
|
|
788
|
+
*
|
|
789
|
+
* @example
|
|
790
|
+
* isLength(0); // true
|
|
791
|
+
* isLength(42); // true
|
|
792
|
+
* isLength(-1); // false
|
|
793
|
+
* isLength(1.5); // false
|
|
794
|
+
* isLength(Number.MAX_SAFE_INTEGER); // true
|
|
795
|
+
* isLength(Number.MAX_SAFE_INTEGER + 1); // false
|
|
796
|
+
*/
|
|
348
797
|
function isLength(value) {
|
|
349
798
|
return Number.isSafeInteger(value) && value >= 0;
|
|
350
799
|
}
|
|
@@ -1319,28 +1768,47 @@ function createDefinitionEntityNameResolver(entityNameResolver) {
|
|
|
1319
1768
|
return entityNameResolver;
|
|
1320
1769
|
}
|
|
1321
1770
|
//#endregion
|
|
1322
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1771
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs
|
|
1772
|
+
/**
|
|
1773
|
+
* Checks if `value` is array-like.
|
|
1774
|
+
*
|
|
1775
|
+
* @param value The value to check.
|
|
1776
|
+
* @returns Returns `true` if `value` is array-like, else `false`.
|
|
1777
|
+
*
|
|
1778
|
+
* @example
|
|
1779
|
+
* isArrayLike([1, 2, 3]); // true
|
|
1780
|
+
* isArrayLike('abc'); // true
|
|
1781
|
+
* isArrayLike({ 0: 'a', length: 1 }); // true
|
|
1782
|
+
* isArrayLike({}); // false
|
|
1783
|
+
* isArrayLike(null); // false
|
|
1784
|
+
* isArrayLike(undefined); // false
|
|
1785
|
+
*/
|
|
1323
1786
|
function isArrayLike(value) {
|
|
1324
1787
|
return value != null && typeof value !== "function" && isLength(value.length);
|
|
1325
1788
|
}
|
|
1326
1789
|
//#endregion
|
|
1327
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1328
|
-
function
|
|
1329
|
-
|
|
1330
|
-
case "number":
|
|
1331
|
-
case "symbol": return false;
|
|
1332
|
-
case "string": return key.includes(".") || key.includes("[") || key.includes("]");
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
//#endregion
|
|
1336
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs
|
|
1337
|
-
function toKey(value) {
|
|
1338
|
-
if (typeof value === "string" || typeof value === "symbol") return value;
|
|
1339
|
-
if (Object.is(value?.valueOf?.(), -0)) return "-0";
|
|
1340
|
-
return String(value);
|
|
1790
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/_internal/toArray.mjs
|
|
1791
|
+
function toArray(value) {
|
|
1792
|
+
return Array.isArray(value) ? value : Array.from(value);
|
|
1341
1793
|
}
|
|
1342
1794
|
//#endregion
|
|
1343
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1795
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/util/toString.mjs
|
|
1796
|
+
/**
|
|
1797
|
+
* Converts `value` to a string.
|
|
1798
|
+
*
|
|
1799
|
+
* An empty string is returned for `null` and `undefined` values.
|
|
1800
|
+
* The sign of `-0` is preserved.
|
|
1801
|
+
*
|
|
1802
|
+
* @param value - The value to convert.
|
|
1803
|
+
* @returns Returns the converted string.
|
|
1804
|
+
*
|
|
1805
|
+
* @example
|
|
1806
|
+
* toString(null) // returns ''
|
|
1807
|
+
* toString(undefined) // returns ''
|
|
1808
|
+
* toString(-0) // returns '-0'
|
|
1809
|
+
* toString([1, 2, -0]) // returns '1,2,-0'
|
|
1810
|
+
* toString([Symbol('a'), Symbol('b')]) // returns 'Symbol(a),Symbol(b)'
|
|
1811
|
+
*/
|
|
1344
1812
|
function toString$1(value) {
|
|
1345
1813
|
if (value == null) return "";
|
|
1346
1814
|
if (typeof value === "string") return value;
|
|
@@ -1350,7 +1818,38 @@ function toString$1(value) {
|
|
|
1350
1818
|
return result;
|
|
1351
1819
|
}
|
|
1352
1820
|
//#endregion
|
|
1353
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1821
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs
|
|
1822
|
+
/**
|
|
1823
|
+
* Converts `value` to a string key if it's not a string or symbol.
|
|
1824
|
+
*
|
|
1825
|
+
* @private
|
|
1826
|
+
* @param {*} value The value to inspect.
|
|
1827
|
+
* @returns {string|symbol} Returns the key.
|
|
1828
|
+
*/
|
|
1829
|
+
function toKey(value) {
|
|
1830
|
+
if (typeof value === "string" || typeof value === "symbol") return value;
|
|
1831
|
+
if (Object.is(value?.valueOf?.(), -0)) return "-0";
|
|
1832
|
+
return String(value);
|
|
1833
|
+
}
|
|
1834
|
+
//#endregion
|
|
1835
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/util/toPath.mjs
|
|
1836
|
+
/**
|
|
1837
|
+
* Converts a deep key string into an array of path segments.
|
|
1838
|
+
*
|
|
1839
|
+
* This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.
|
|
1840
|
+
*
|
|
1841
|
+
* @param deepKey - The deep key string to convert.
|
|
1842
|
+
* @returns An array of strings, each representing a segment of the path.
|
|
1843
|
+
*
|
|
1844
|
+
* Examples:
|
|
1845
|
+
*
|
|
1846
|
+
* toPath('a.b.c') // Returns ['a', 'b', 'c']
|
|
1847
|
+
* toPath('a[b][c]') // Returns ['a', 'b', 'c']
|
|
1848
|
+
* toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']
|
|
1849
|
+
* toPath('a["b.c"].d') // Returns ['a', 'b.c', 'd']
|
|
1850
|
+
* toPath('') // Returns []
|
|
1851
|
+
* toPath('.a[b].c.d[e]["f.g"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']
|
|
1852
|
+
*/
|
|
1354
1853
|
function toPath(deepKey) {
|
|
1355
1854
|
if (Array.isArray(deepKey)) return deepKey.map(toKey);
|
|
1356
1855
|
if (typeof deepKey === "symbol") return [deepKey];
|
|
@@ -1362,10 +1861,7 @@ function toPath(deepKey) {
|
|
|
1362
1861
|
let key = "";
|
|
1363
1862
|
let quoteChar = "";
|
|
1364
1863
|
let bracket = false;
|
|
1365
|
-
if (deepKey.charCodeAt(0) === 46)
|
|
1366
|
-
result.push("");
|
|
1367
|
-
index++;
|
|
1368
|
-
}
|
|
1864
|
+
if (deepKey.charCodeAt(0) === 46) result.push("");
|
|
1369
1865
|
while (index < length) {
|
|
1370
1866
|
const char = deepKey[index];
|
|
1371
1867
|
if (quoteChar) if (char === "\\" && index + 1 < length) {
|
|
@@ -1390,6 +1886,8 @@ function toPath(deepKey) {
|
|
|
1390
1886
|
result.push(key);
|
|
1391
1887
|
key = "";
|
|
1392
1888
|
}
|
|
1889
|
+
const next = deepKey[index + 1];
|
|
1890
|
+
if (next === void 0 || next === ".") result.push("");
|
|
1393
1891
|
} else key += char;
|
|
1394
1892
|
index++;
|
|
1395
1893
|
}
|
|
@@ -1397,14 +1895,72 @@ function toPath(deepKey) {
|
|
|
1397
1895
|
return result;
|
|
1398
1896
|
}
|
|
1399
1897
|
//#endregion
|
|
1400
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1898
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs
|
|
1899
|
+
/** Matches any deep property path. Examples: `a.b`, `a[0]`, `a["b"]` */
|
|
1900
|
+
var regexIsDeepProp$1 = /\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;
|
|
1901
|
+
/**
|
|
1902
|
+
* Checks if a given key is a deep key.
|
|
1903
|
+
*
|
|
1904
|
+
* A deep key is a string that contains a dot (.) or square brackets with a property accessor.
|
|
1905
|
+
*
|
|
1906
|
+
* @param {PropertyKey} key - The key to check.
|
|
1907
|
+
* @returns {boolean} - Returns true if the key is a deep key, otherwise false.
|
|
1908
|
+
*
|
|
1909
|
+
* Examples:
|
|
1910
|
+
*
|
|
1911
|
+
* isDeepKey('a.b') // true
|
|
1912
|
+
* isDeepKey('a[b]') // true
|
|
1913
|
+
* isDeepKey('a') // false
|
|
1914
|
+
* isDeepKey(123) // false
|
|
1915
|
+
* isDeepKey('a.b.c') // true
|
|
1916
|
+
* isDeepKey('a[b][c]') // true
|
|
1917
|
+
* isDeepKey('a.') // false
|
|
1918
|
+
* isDeepKey('.a') // false
|
|
1919
|
+
* isDeepKey('a[b') // false
|
|
1920
|
+
* isDeepKey('a]b]') // false
|
|
1921
|
+
* isDeepKey('a][b') // false
|
|
1922
|
+
* isDeepKey('') // false
|
|
1923
|
+
* isDeepKey('a[0]') // true
|
|
1924
|
+
*
|
|
1925
|
+
*/
|
|
1926
|
+
function isDeepKey(key) {
|
|
1927
|
+
switch (typeof key) {
|
|
1928
|
+
case "number":
|
|
1929
|
+
case "symbol": return false;
|
|
1930
|
+
case "string":
|
|
1931
|
+
if (key === "" || key.startsWith(".") || key.endsWith(".")) return false;
|
|
1932
|
+
return regexIsDeepProp$1.test(key);
|
|
1933
|
+
default: return false;
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
//#endregion
|
|
1937
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/get.mjs
|
|
1938
|
+
/**
|
|
1939
|
+
* Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.
|
|
1940
|
+
*
|
|
1941
|
+
* @param object - The object to query.
|
|
1942
|
+
* @param path - The path of the property to get.
|
|
1943
|
+
* @param [defaultValue] - The value returned if the resolved value is undefined.
|
|
1944
|
+
* @returns Returns the resolved value.
|
|
1945
|
+
*
|
|
1946
|
+
* @example
|
|
1947
|
+
* const object = { a: { b: { c: 1 } } };
|
|
1948
|
+
* get(object, 'a.b.c');
|
|
1949
|
+
* // => 1
|
|
1950
|
+
*
|
|
1951
|
+
* get(object, ['a', 'b', 'c']);
|
|
1952
|
+
* // => 1
|
|
1953
|
+
*
|
|
1954
|
+
* get(object, 'a.b.d', 'default');
|
|
1955
|
+
* // => 'default'
|
|
1956
|
+
*/
|
|
1401
1957
|
function get$1(object, path, defaultValue) {
|
|
1402
1958
|
if (object == null) return defaultValue;
|
|
1403
1959
|
switch (typeof path) {
|
|
1404
1960
|
case "string": {
|
|
1405
1961
|
if (isUnsafeProperty(path)) return defaultValue;
|
|
1406
1962
|
const result = object[path];
|
|
1407
|
-
if (result === void 0) if (isDeepKey(path)) return get$1(object, toPath(path), defaultValue);
|
|
1963
|
+
if (result === void 0) if (isDeepKey(path) && !Object.hasOwn(object, path)) return get$1(object, toPath(path), defaultValue);
|
|
1408
1964
|
else return defaultValue;
|
|
1409
1965
|
return result;
|
|
1410
1966
|
}
|
|
@@ -1438,38 +1994,151 @@ function getWithPath(object, path, defaultValue) {
|
|
|
1438
1994
|
return current;
|
|
1439
1995
|
}
|
|
1440
1996
|
//#endregion
|
|
1441
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1997
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/property.mjs
|
|
1998
|
+
/**
|
|
1999
|
+
* Creates a function that returns the value at a given path of an object.
|
|
2000
|
+
*
|
|
2001
|
+
* @template T - The type of object.
|
|
2002
|
+
* @template R - The type of the value to return.
|
|
2003
|
+
* @param path - The path of the property to get.
|
|
2004
|
+
* @returns Returns a new function that takes an object and returns the value at the specified path.
|
|
2005
|
+
*
|
|
2006
|
+
* @example
|
|
2007
|
+
* const getObjectValue = property('a.b.c');
|
|
2008
|
+
* const result = getObjectValue({ a: { b: { c: 3 } } });
|
|
2009
|
+
* console.log(result); // => 3
|
|
2010
|
+
*
|
|
2011
|
+
* @example
|
|
2012
|
+
* const getObjectValue = property(['a', 'b', 'c']);
|
|
2013
|
+
* const result = getObjectValue({ a: { b: { c: 3 } } });
|
|
2014
|
+
* console.log(result); // => 3
|
|
2015
|
+
*/
|
|
1442
2016
|
function property(path) {
|
|
1443
2017
|
return function(object) {
|
|
1444
2018
|
return get$1(object, path);
|
|
1445
2019
|
};
|
|
1446
2020
|
}
|
|
1447
2021
|
//#endregion
|
|
1448
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2022
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isObject.mjs
|
|
2023
|
+
/**
|
|
2024
|
+
* Checks if the given value is an object. An object is a value that is
|
|
2025
|
+
* not a primitive type (string, number, boolean, symbol, null, or undefined).
|
|
2026
|
+
*
|
|
2027
|
+
* This function tests whether the provided value is an object or not.
|
|
2028
|
+
* It returns `true` if the value is an object, and `false` otherwise.
|
|
2029
|
+
*
|
|
2030
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object value.
|
|
2031
|
+
*
|
|
2032
|
+
* @param value - The value to check if it is an object.
|
|
2033
|
+
* @returns `true` if the value is an object, `false` otherwise.
|
|
2034
|
+
*
|
|
2035
|
+
* @example
|
|
2036
|
+
* const value1 = {};
|
|
2037
|
+
* const value2 = [1, 2, 3];
|
|
2038
|
+
* const value3 = () => {};
|
|
2039
|
+
* const value4 = null;
|
|
2040
|
+
*
|
|
2041
|
+
* console.log(isObject(value1)); // true
|
|
2042
|
+
* console.log(isObject(value2)); // true
|
|
2043
|
+
* console.log(isObject(value3)); // true
|
|
2044
|
+
* console.log(isObject(value4)); // false
|
|
2045
|
+
*/
|
|
1449
2046
|
function isObject(value) {
|
|
1450
2047
|
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
1451
2048
|
}
|
|
1452
2049
|
//#endregion
|
|
1453
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2050
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.mjs
|
|
2051
|
+
/**
|
|
2052
|
+
* Performs a deep comparison between a target value and a source pattern to determine if they match,
|
|
2053
|
+
* using a custom comparison function for fine-grained control over the matching logic.
|
|
2054
|
+
*
|
|
2055
|
+
* This function recursively traverses both values, calling the custom compare function for each
|
|
2056
|
+
* property/element pair. If the compare function returns a boolean, that result is used directly.
|
|
2057
|
+
* If it returns undefined, the default matching behavior continues recursively.
|
|
2058
|
+
*
|
|
2059
|
+
* The matching behavior varies by data type:
|
|
2060
|
+
* - **Objects**: Matches if all properties in the source exist in the target and match
|
|
2061
|
+
* - **Arrays**: Matches if all elements in the source array can be found in the target array (order-independent)
|
|
2062
|
+
* - **Maps**: Matches if all key-value pairs in the source Map exist and match in the target Map
|
|
2063
|
+
* - **Sets**: Matches if all elements in the source Set can be found in the target Set
|
|
2064
|
+
* - **Functions**: Matches using strict equality, or object comparison if the function has properties
|
|
2065
|
+
* - **Primitives**: Matches using strict equality
|
|
2066
|
+
*
|
|
2067
|
+
* Special cases:
|
|
2068
|
+
* - Empty objects, arrays, Maps, and Sets always match any target
|
|
2069
|
+
* - `null` and `undefined` source values have specific matching rules
|
|
2070
|
+
* - Circular references are handled using an internal stack to prevent infinite recursion
|
|
2071
|
+
*
|
|
2072
|
+
* @param target - The value to be tested for matching
|
|
2073
|
+
* @param source - The pattern/template to match against
|
|
2074
|
+
* @param [compare] - Optional custom comparison function that receives:
|
|
2075
|
+
* - `objValue` - The value from the target at the current path
|
|
2076
|
+
* - `srcValue` - The value from the source at the current path
|
|
2077
|
+
* - `key` - The property key or array index being compared
|
|
2078
|
+
* - `object` - The parent object/array from the target
|
|
2079
|
+
* - `source` - The parent object/array from the source
|
|
2080
|
+
* - `stack` - Internal Map used for circular reference detection
|
|
2081
|
+
* Should return `true` for a match, `false` for no match, or `undefined` to continue with default behavior
|
|
2082
|
+
*
|
|
2083
|
+
* @returns `true` if the target matches the source pattern, `false` otherwise
|
|
2084
|
+
*
|
|
2085
|
+
* @example
|
|
2086
|
+
* // Basic matching without custom comparator
|
|
2087
|
+
* isMatchWith({ a: 1, b: 2 }, { a: 1 }); // true
|
|
2088
|
+
* isMatchWith([1, 2, 3], [1, 3]); // true
|
|
2089
|
+
*
|
|
2090
|
+
* @example
|
|
2091
|
+
* // Custom comparison for case-insensitive string matching
|
|
2092
|
+
* const caseInsensitiveCompare = (objVal, srcVal) => {
|
|
2093
|
+
* if (typeof objVal === 'string' && typeof srcVal === 'string') {
|
|
2094
|
+
* return objVal.toLowerCase() === srcVal.toLowerCase();
|
|
2095
|
+
* }
|
|
2096
|
+
* return undefined; // Use default behavior for non-strings
|
|
2097
|
+
* };
|
|
2098
|
+
*
|
|
2099
|
+
* isMatchWith(
|
|
2100
|
+
* { name: 'JOHN', age: 30 },
|
|
2101
|
+
* { name: 'john' },
|
|
2102
|
+
* caseInsensitiveCompare
|
|
2103
|
+
* ); // true
|
|
2104
|
+
*
|
|
2105
|
+
* @example
|
|
2106
|
+
* // Custom comparison for range matching
|
|
2107
|
+
* const rangeCompare = (objVal, srcVal, key) => {
|
|
2108
|
+
* if (key === 'age' && typeof srcVal === 'object' && srcVal.min !== undefined) {
|
|
2109
|
+
* return objVal >= srcVal.min && objVal <= srcVal.max;
|
|
2110
|
+
* }
|
|
2111
|
+
* return undefined;
|
|
2112
|
+
* };
|
|
2113
|
+
*
|
|
2114
|
+
* isMatchWith(
|
|
2115
|
+
* { name: 'John', age: 25 },
|
|
2116
|
+
* { age: { min: 18, max: 30 } },
|
|
2117
|
+
* rangeCompare
|
|
2118
|
+
* ); // true
|
|
2119
|
+
*/
|
|
1454
2120
|
function isMatchWith(target, source, compare) {
|
|
1455
2121
|
if (typeof compare !== "function") return isMatchWith(target, source, () => void 0);
|
|
1456
2122
|
return isMatchWithInternal(target, source, function doesMatch(objValue, srcValue, key, object, source, stack) {
|
|
1457
2123
|
const isEqual = compare(objValue, srcValue, key, object, source, stack);
|
|
1458
2124
|
if (isEqual !== void 0) return Boolean(isEqual);
|
|
1459
|
-
return isMatchWithInternal(objValue, srcValue, doesMatch, stack);
|
|
1460
|
-
}, /* @__PURE__ */ new Map());
|
|
2125
|
+
return isMatchWithInternal(objValue, srcValue, doesMatch, stack, false);
|
|
2126
|
+
}, /* @__PURE__ */ new Map(), true);
|
|
1461
2127
|
}
|
|
1462
|
-
function isMatchWithInternal(target, source, compare, stack) {
|
|
2128
|
+
function isMatchWithInternal(target, source, compare, stack, isRoot = false) {
|
|
1463
2129
|
if (source === target) return true;
|
|
1464
2130
|
switch (typeof source) {
|
|
1465
2131
|
case "object": return isObjectMatch(target, source, compare, stack);
|
|
1466
2132
|
case "function":
|
|
1467
|
-
if (Object.keys(source).length > 0) return isMatchWithInternal(target, { ...source }, compare, stack);
|
|
1468
|
-
return
|
|
2133
|
+
if (Object.keys(source).length > 0) return isMatchWithInternal(target, { ...source }, compare, stack, isRoot);
|
|
2134
|
+
return eq(target, source);
|
|
1469
2135
|
default:
|
|
1470
|
-
if (!isObject(target)) return
|
|
1471
|
-
if (
|
|
1472
|
-
|
|
2136
|
+
if (!isObject(target)) return eq(target, source);
|
|
2137
|
+
if (isRoot) {
|
|
2138
|
+
if (typeof source === "string") return source === "";
|
|
2139
|
+
return true;
|
|
2140
|
+
}
|
|
2141
|
+
return eq(target, source);
|
|
1473
2142
|
}
|
|
1474
2143
|
}
|
|
1475
2144
|
function isObjectMatch(target, source, compare, stack) {
|
|
@@ -1529,12 +2198,66 @@ function isSetMatch(target, source, compare, stack) {
|
|
|
1529
2198
|
return isArrayMatch([...target], [...source], compare, stack);
|
|
1530
2199
|
}
|
|
1531
2200
|
//#endregion
|
|
1532
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2201
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isMatch.mjs
|
|
2202
|
+
/**
|
|
2203
|
+
* Checks if the target matches the source by comparing their structures and values.
|
|
2204
|
+
* This function supports deep comparison for objects, arrays, maps, and sets.
|
|
2205
|
+
*
|
|
2206
|
+
* @param target - The target value to match against.
|
|
2207
|
+
* @param source - The source value to match with.
|
|
2208
|
+
* @returns Returns `true` if the target matches the source, otherwise `false`.
|
|
2209
|
+
*
|
|
2210
|
+
* @example
|
|
2211
|
+
* // Basic usage
|
|
2212
|
+
* isMatch({ a: 1, b: 2 }, { a: 1 }); // true
|
|
2213
|
+
*
|
|
2214
|
+
* @example
|
|
2215
|
+
* // Matching arrays
|
|
2216
|
+
* isMatch([1, 2, 3], [1, 2, 3]); // true
|
|
2217
|
+
*
|
|
2218
|
+
* @example
|
|
2219
|
+
* // Matching maps
|
|
2220
|
+
* const targetMap = new Map([['key1', 'value1'], ['key2', 'value2']]);
|
|
2221
|
+
* const sourceMap = new Map([['key1', 'value1']]);
|
|
2222
|
+
* isMatch(targetMap, sourceMap); // true
|
|
2223
|
+
*
|
|
2224
|
+
* @example
|
|
2225
|
+
* // Matching sets
|
|
2226
|
+
* const targetSet = new Set([1, 2, 3]);
|
|
2227
|
+
* const sourceSet = new Set([1, 2]);
|
|
2228
|
+
* isMatch(targetSet, sourceSet); // true
|
|
2229
|
+
*/
|
|
1533
2230
|
function isMatch(target, source) {
|
|
1534
2231
|
return isMatchWith(target, source, () => void 0);
|
|
1535
2232
|
}
|
|
1536
2233
|
//#endregion
|
|
1537
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2234
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/matches.mjs
|
|
2235
|
+
/**
|
|
2236
|
+
* Creates a function that performs a deep comparison between a given target and the source object.
|
|
2237
|
+
*
|
|
2238
|
+
* @template T
|
|
2239
|
+
* @template V
|
|
2240
|
+
* @param source - The source object to create the matcher from.
|
|
2241
|
+
* @returns Returns a function that takes a target object and returns `true` if the target matches the source, otherwise `false`.
|
|
2242
|
+
*
|
|
2243
|
+
* @example
|
|
2244
|
+
* // Basic usage
|
|
2245
|
+
* const matcher = matches({ a: 1, b: 2 });
|
|
2246
|
+
* matcher({ a: 1, b: 2, c: 3 }); // true
|
|
2247
|
+
* matcher({ a: 1, c: 3 }); // false
|
|
2248
|
+
*
|
|
2249
|
+
* @example
|
|
2250
|
+
* // Matching arrays
|
|
2251
|
+
* const arrayMatcher = matches([1, 2, 3]);
|
|
2252
|
+
* arrayMatcher([1, 2, 3, 4]); // true
|
|
2253
|
+
* arrayMatcher([4, 5, 6]); // false
|
|
2254
|
+
*
|
|
2255
|
+
* @example
|
|
2256
|
+
* // Matching objects with nested structures
|
|
2257
|
+
* const nestedMatcher = matches({ a: { b: 2 } });
|
|
2258
|
+
* nestedMatcher({ a: { b: 2, c: 3 } }); // true
|
|
2259
|
+
* nestedMatcher({ a: { c: 3 } }); // false
|
|
2260
|
+
*/
|
|
1538
2261
|
function matches(source) {
|
|
1539
2262
|
source = cloneDeep$1(source);
|
|
1540
2263
|
return (target) => {
|
|
@@ -1542,7 +2265,42 @@ function matches(source) {
|
|
|
1542
2265
|
};
|
|
1543
2266
|
}
|
|
1544
2267
|
//#endregion
|
|
1545
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2268
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs
|
|
2269
|
+
/**
|
|
2270
|
+
* Creates a deep clone of the given object using a customizer function.
|
|
2271
|
+
*
|
|
2272
|
+
* @template T - The type of the object.
|
|
2273
|
+
* @param obj - The object to clone.
|
|
2274
|
+
* @param [cloneValue] - A function to customize the cloning process.
|
|
2275
|
+
* @returns A deep clone of the given object.
|
|
2276
|
+
*
|
|
2277
|
+
* @example
|
|
2278
|
+
* // Clone a primitive value
|
|
2279
|
+
* const num = 29;
|
|
2280
|
+
* const clonedNum = cloneDeepWith(num);
|
|
2281
|
+
* console.log(clonedNum); // 29
|
|
2282
|
+
* console.log(clonedNum === num); // true
|
|
2283
|
+
*
|
|
2284
|
+
* @example
|
|
2285
|
+
* // Clone an object with a customizer
|
|
2286
|
+
* const obj = { a: 1, b: 2 };
|
|
2287
|
+
* const clonedObj = cloneDeepWith(obj, (value) => {
|
|
2288
|
+
* if (typeof value === 'number') {
|
|
2289
|
+
* return value * 2; // Double the number
|
|
2290
|
+
* }
|
|
2291
|
+
* });
|
|
2292
|
+
* console.log(clonedObj); // { a: 2, b: 4 }
|
|
2293
|
+
* console.log(clonedObj === obj); // false
|
|
2294
|
+
*
|
|
2295
|
+
* @example
|
|
2296
|
+
* // Clone an array with a customizer
|
|
2297
|
+
* const arr = [1, 2, 3];
|
|
2298
|
+
* const clonedArr = cloneDeepWith(arr, (value) => {
|
|
2299
|
+
* return value + 1; // Increment each value
|
|
2300
|
+
* });
|
|
2301
|
+
* console.log(clonedArr); // [2, 3, 4]
|
|
2302
|
+
* console.log(clonedArr === arr); // false
|
|
2303
|
+
*/
|
|
1546
2304
|
function cloneDeepWith(obj, customizer) {
|
|
1547
2305
|
return cloneDeepWith$1(obj, (value, key, object, stack) => {
|
|
1548
2306
|
const cloned = customizer?.(value, key, object, stack);
|
|
@@ -1574,12 +2332,83 @@ function cloneDeepWith(obj, customizer) {
|
|
|
1574
2332
|
});
|
|
1575
2333
|
}
|
|
1576
2334
|
//#endregion
|
|
1577
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2335
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs
|
|
2336
|
+
/**
|
|
2337
|
+
* Creates a deep clone of the given object.
|
|
2338
|
+
*
|
|
2339
|
+
* @template T - The type of the object.
|
|
2340
|
+
* @param obj - The object to clone.
|
|
2341
|
+
* @returns A deep clone of the given object.
|
|
2342
|
+
*
|
|
2343
|
+
* @example
|
|
2344
|
+
* // Clone a primitive value
|
|
2345
|
+
* const num = 29;
|
|
2346
|
+
* const clonedNum = clone(num);
|
|
2347
|
+
* console.log(clonedNum); // 29
|
|
2348
|
+
* console.log(clonedNum === num); // true
|
|
2349
|
+
*
|
|
2350
|
+
* @example
|
|
2351
|
+
* // Clone an array
|
|
2352
|
+
* const arr = [1, 2, 3];
|
|
2353
|
+
* const clonedArr = clone(arr);
|
|
2354
|
+
* console.log(clonedArr); // [1, 2, 3]
|
|
2355
|
+
* console.log(clonedArr === arr); // false
|
|
2356
|
+
*
|
|
2357
|
+
* @example
|
|
2358
|
+
* // Clone an array with nested objects
|
|
2359
|
+
* const arr = [1, { a: 1 }, [1, 2, 3]];
|
|
2360
|
+
* const clonedArr = clone(arr);
|
|
2361
|
+
* arr[1].a = 2;
|
|
2362
|
+
* console.log(arr); // [2, { a: 2 }, [1, 2, 3]]
|
|
2363
|
+
* console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]
|
|
2364
|
+
* console.log(clonedArr === arr); // false
|
|
2365
|
+
*
|
|
2366
|
+
* @example
|
|
2367
|
+
* // Clone an object
|
|
2368
|
+
* const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };
|
|
2369
|
+
* const clonedObj = clone(obj);
|
|
2370
|
+
* console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }
|
|
2371
|
+
* console.log(clonedObj === obj); // false
|
|
2372
|
+
*
|
|
2373
|
+
* @example
|
|
2374
|
+
* // Clone an object with nested objects
|
|
2375
|
+
* const obj = { a: 1, b: { c: 1 } };
|
|
2376
|
+
* const clonedObj = clone(obj);
|
|
2377
|
+
* obj.b.c = 2;
|
|
2378
|
+
* console.log(obj); // { a: 1, b: { c: 2 } }
|
|
2379
|
+
* console.log(clonedObj); // { a: 1, b: { c: 1 } }
|
|
2380
|
+
* console.log(clonedObj === obj); // false
|
|
2381
|
+
*/
|
|
1578
2382
|
function cloneDeep(obj) {
|
|
1579
2383
|
return cloneDeepWith(obj);
|
|
1580
2384
|
}
|
|
1581
2385
|
//#endregion
|
|
1582
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2386
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs
|
|
2387
|
+
/**
|
|
2388
|
+
* Checks if the given value is an arguments object.
|
|
2389
|
+
*
|
|
2390
|
+
* This function tests whether the provided value is an arguments object or not.
|
|
2391
|
+
* It returns `true` if the value is an arguments object, and `false` otherwise.
|
|
2392
|
+
*
|
|
2393
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an arguments object.
|
|
2394
|
+
*
|
|
2395
|
+
* @param value - The value to test if it is an arguments object.
|
|
2396
|
+
* @returns `true` if the value is an arguments, `false` otherwise.
|
|
2397
|
+
*
|
|
2398
|
+
* @example
|
|
2399
|
+
* const args = (function() { return arguments; })();
|
|
2400
|
+
* const strictArgs = (function() { 'use strict'; return arguments; })();
|
|
2401
|
+
* const value = [1, 2, 3];
|
|
2402
|
+
*
|
|
2403
|
+
* console.log(isArguments(args)); // true
|
|
2404
|
+
* console.log(isArguments(strictArgs)); // true
|
|
2405
|
+
* console.log(isArguments(value)); // false
|
|
2406
|
+
*/
|
|
2407
|
+
function isArguments(value) {
|
|
2408
|
+
return value !== null && typeof value === "object" && getTag(value) === "[object Arguments]";
|
|
2409
|
+
}
|
|
2410
|
+
//#endregion
|
|
2411
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs
|
|
1583
2412
|
var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
|
|
1584
2413
|
function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
|
|
1585
2414
|
switch (typeof value) {
|
|
@@ -1589,16 +2418,40 @@ function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
|
|
|
1589
2418
|
}
|
|
1590
2419
|
}
|
|
1591
2420
|
//#endregion
|
|
1592
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
2421
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/has.mjs
|
|
2422
|
+
/**
|
|
2423
|
+
* Checks if a given path exists within an object.
|
|
2424
|
+
*
|
|
2425
|
+
* You can provide the path as a single property key, an array of property keys,
|
|
2426
|
+
* or a string representing a deep path.
|
|
2427
|
+
*
|
|
2428
|
+
* If the path is an index and the object is an array or an arguments object, the function will verify
|
|
2429
|
+
* if the index is valid and within the bounds of the array or arguments object, even if the array or
|
|
2430
|
+
* arguments object is sparse (i.e., not all indexes are defined).
|
|
2431
|
+
*
|
|
2432
|
+
* @param object - The object to query.
|
|
2433
|
+
* @param path - The path to check. This can be a single property key,
|
|
2434
|
+
* an array of property keys, or a string representing a deep path.
|
|
2435
|
+
* @returns Returns `true` if the path exists in the object, `false` otherwise.
|
|
2436
|
+
*
|
|
2437
|
+
* @example
|
|
2438
|
+
*
|
|
2439
|
+
* const obj = { a: { b: { c: 3 } } };
|
|
2440
|
+
*
|
|
2441
|
+
* has(obj, 'a'); // true
|
|
2442
|
+
* has(obj, ['a', 'b']); // true
|
|
2443
|
+
* has(obj, ['a', 'b', 'c']); // true
|
|
2444
|
+
* has(obj, 'a.b.c'); // true
|
|
2445
|
+
* has(obj, 'a.b.d'); // false
|
|
2446
|
+
* has(obj, ['a', 'b', 'c', 'd']); // false
|
|
2447
|
+
* has([], 0); // false
|
|
2448
|
+
* has([1, 2, 3], 2); // true
|
|
2449
|
+
* has([1, 2, 3], 5); // false
|
|
2450
|
+
*/
|
|
1598
2451
|
function has$1(object, path) {
|
|
1599
2452
|
let resolvedPath;
|
|
1600
2453
|
if (Array.isArray(path)) resolvedPath = path;
|
|
1601
|
-
else if (typeof path === "string" && isDeepKey(path) &&
|
|
2454
|
+
else if (typeof path === "string" && isDeepKey(path) && !(path in Object(object))) resolvedPath = toPath(path);
|
|
1602
2455
|
else resolvedPath = [path];
|
|
1603
2456
|
if (resolvedPath.length === 0) return false;
|
|
1604
2457
|
let current = object;
|
|
@@ -1612,7 +2465,32 @@ function has$1(object, path) {
|
|
|
1612
2465
|
return true;
|
|
1613
2466
|
}
|
|
1614
2467
|
//#endregion
|
|
1615
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2468
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.mjs
|
|
2469
|
+
/**
|
|
2470
|
+
* Creates a function that checks if a given target object matches a specific property value.
|
|
2471
|
+
*
|
|
2472
|
+
* The returned function takes a target object and determines if the property at the
|
|
2473
|
+
* specified path within the target object is equal to the given value.
|
|
2474
|
+
*
|
|
2475
|
+
* @param property - The property path to check within the target object.
|
|
2476
|
+
* This can be a single property key or an array of property keys.
|
|
2477
|
+
* @param source - The value to compare against the property value in the target object.
|
|
2478
|
+
*
|
|
2479
|
+
* @returns A function that takes a target object and returns
|
|
2480
|
+
* `true` if the property value at the given path in the target object matches the provided value,
|
|
2481
|
+
* otherwise returns `false`.
|
|
2482
|
+
*
|
|
2483
|
+
* @example
|
|
2484
|
+
* // Using a single property key
|
|
2485
|
+
* const checkName = matchesProperty('name', 'Alice');
|
|
2486
|
+
* console.log(checkName({ name: 'Alice' })); // true
|
|
2487
|
+
* console.log(checkName({ name: 'Bob' })); // false
|
|
2488
|
+
*
|
|
2489
|
+
* // Using an array of property keys
|
|
2490
|
+
* const checkNested = matchesProperty(['address', 'city'], 'New York');
|
|
2491
|
+
* console.log(checkNested({ address: { city: 'New York' } })); // true
|
|
2492
|
+
* console.log(checkNested({ address: { city: 'Los Angeles' } })); // false
|
|
2493
|
+
*/
|
|
1616
2494
|
function matchesProperty(property, source) {
|
|
1617
2495
|
switch (typeof property) {
|
|
1618
2496
|
case "object":
|
|
@@ -1631,7 +2509,37 @@ function matchesProperty(property, source) {
|
|
|
1631
2509
|
};
|
|
1632
2510
|
}
|
|
1633
2511
|
//#endregion
|
|
1634
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2512
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/util/iteratee.mjs
|
|
2513
|
+
/**
|
|
2514
|
+
* Creates a function that returns a value from an element in a collection.
|
|
2515
|
+
*
|
|
2516
|
+
* You can call `iteratee` with the following types of arguments:
|
|
2517
|
+
*
|
|
2518
|
+
* - **Function**: Returns the function as-is, which will be called with the element from the collection.
|
|
2519
|
+
* - **Property name**: Returns the value of the specified property from the element.
|
|
2520
|
+
* - **Property-value pair**: Returns a boolean indicating whether the element's property matches the given value.
|
|
2521
|
+
* - **Partial object**: Returns a boolean indicating whether the element matches the properties of the partial object.
|
|
2522
|
+
*
|
|
2523
|
+
* If you don't provide any arguments or pass `null`, this function will return a function that simply returns its input unchanged.
|
|
2524
|
+
*
|
|
2525
|
+
* @param value - The value to convert to an iteratee.
|
|
2526
|
+
* @returns Returns the new iteratee function.
|
|
2527
|
+
* @example
|
|
2528
|
+
* const func = iteratee();
|
|
2529
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [{ a: 1 }, { a: 2 }, { a: 3 }]
|
|
2530
|
+
*
|
|
2531
|
+
* const func = iteratee((object) => object.a);
|
|
2532
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [1, 2, 3]
|
|
2533
|
+
*
|
|
2534
|
+
* const func = iteratee('a');
|
|
2535
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [1, 2, 3]
|
|
2536
|
+
*
|
|
2537
|
+
* const func = iteratee({ a: 1 });
|
|
2538
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].find(func) // => { a: 1 }
|
|
2539
|
+
*
|
|
2540
|
+
* const func = iteratee(['a', 1]);
|
|
2541
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].find(func) // => { a: 1 }
|
|
2542
|
+
*/
|
|
1635
2543
|
function iteratee(value) {
|
|
1636
2544
|
if (value == null) return identity$1;
|
|
1637
2545
|
switch (typeof value) {
|
|
@@ -1645,28 +2553,109 @@ function iteratee(value) {
|
|
|
1645
2553
|
}
|
|
1646
2554
|
}
|
|
1647
2555
|
//#endregion
|
|
1648
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
1649
|
-
|
|
2556
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs
|
|
2557
|
+
/**
|
|
2558
|
+
* Check whether a value is a symbol.
|
|
2559
|
+
*
|
|
2560
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `symbol`.
|
|
2561
|
+
*
|
|
2562
|
+
* @param value The value to check.
|
|
2563
|
+
* @returns Returns `true` if `value` is a symbol, else `false`.
|
|
2564
|
+
* @example
|
|
2565
|
+
* isSymbol(Symbol.iterator);
|
|
2566
|
+
* // => true
|
|
2567
|
+
*
|
|
2568
|
+
* isSymbol('abc');
|
|
2569
|
+
* // => false
|
|
2570
|
+
*/
|
|
2571
|
+
function isSymbol(value) {
|
|
2572
|
+
return typeof value === "symbol" || value instanceof Symbol;
|
|
2573
|
+
}
|
|
2574
|
+
//#endregion
|
|
2575
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/array/groupBy.mjs
|
|
2576
|
+
/**
|
|
2577
|
+
* Groups the elements of an array or object based on a provided key-generating function.
|
|
2578
|
+
*
|
|
2579
|
+
* This function takes an array or object and a function that generates a key from each element or value.
|
|
2580
|
+
* It returns an object where the keys are the generated keys and the values are arrays of elements that
|
|
2581
|
+
* share the same key.
|
|
2582
|
+
*
|
|
2583
|
+
* @template T - The type of elements in the array or values in the object.
|
|
2584
|
+
* @template K - The type of keys.
|
|
2585
|
+
* @param source - The collection to group.
|
|
2586
|
+
* @param [_getKeyFromItem=identity] - The iteratee to transform keys.
|
|
2587
|
+
* - If a function is provided, it's invoked for each element in the collection.
|
|
2588
|
+
* - If a property name (string) is provided, that property of each element is used as the key.
|
|
2589
|
+
* - If a property-value pair (array) is provided, elements with matching property values are used.
|
|
2590
|
+
* - If a partial object is provided, elements with matching properties are used.
|
|
2591
|
+
* @returns An object where each key is associated with an array of elements that
|
|
2592
|
+
* share that key.
|
|
2593
|
+
*
|
|
2594
|
+
* @example
|
|
2595
|
+
* // Using an array
|
|
2596
|
+
* const array = [6.1, 4.2, 6.3];
|
|
2597
|
+
* const result = groupBy(array, Math.floor);
|
|
2598
|
+
* // => { 4: [4.2], 6: [6.1, 6.3] }
|
|
2599
|
+
*
|
|
2600
|
+
* @example
|
|
2601
|
+
* // Using a property name
|
|
2602
|
+
* const array = ['one', 'two', 'three'];
|
|
2603
|
+
* const result = groupBy(array, 'length');
|
|
2604
|
+
* // => { 3: ['one', 'two'], 5: ['three'] }
|
|
2605
|
+
*/
|
|
2606
|
+
function groupBy(source, _getKeyFromItem = identity$1) {
|
|
1650
2607
|
if (source == null) return {};
|
|
1651
|
-
return groupBy$1(isArrayLike(source) ?
|
|
2608
|
+
return groupBy$1(isArrayLike(source) ? toArray(source) : Object.values(source), iteratee(_getKeyFromItem));
|
|
1652
2609
|
}
|
|
1653
2610
|
//#endregion
|
|
1654
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2611
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs
|
|
2612
|
+
/** Matches any deep property path. (e.g. `a.b[0].c`)*/
|
|
1655
2613
|
var regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
2614
|
+
/** Matches any word character (alphanumeric & underscore).*/
|
|
1656
2615
|
var regexIsPlainProp = /^\w*$/;
|
|
2616
|
+
/**
|
|
2617
|
+
* Checks if `value` is a property name and not a property path. (It's ok that the `value` is not in the keys of the `object`)
|
|
2618
|
+
* @param {unknown} value The value to check.
|
|
2619
|
+
* @param {unknown} object The object to query.
|
|
2620
|
+
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
2621
|
+
*
|
|
2622
|
+
* @example
|
|
2623
|
+
* isKey('a', { a: 1 });
|
|
2624
|
+
* // => true
|
|
2625
|
+
*
|
|
2626
|
+
* isKey('a.b', { a: { b: 2 } });
|
|
2627
|
+
* // => false
|
|
2628
|
+
*/
|
|
1657
2629
|
function isKey(value, object) {
|
|
1658
2630
|
if (Array.isArray(value)) return false;
|
|
1659
2631
|
if (typeof value === "number" || typeof value === "boolean" || value == null || isSymbol(value)) return true;
|
|
1660
2632
|
return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value);
|
|
1661
2633
|
}
|
|
1662
2634
|
//#endregion
|
|
1663
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2635
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs
|
|
1664
2636
|
var assignValue = (object, key, value) => {
|
|
1665
2637
|
const objValue = object[key];
|
|
1666
|
-
if (!(Object.hasOwn(object, key) &&
|
|
2638
|
+
if (!(Object.hasOwn(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) object[key] = value;
|
|
1667
2639
|
};
|
|
1668
2640
|
//#endregion
|
|
1669
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2641
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/updateWith.mjs
|
|
2642
|
+
/**
|
|
2643
|
+
* Updates the value at the specified path of the given object using an updater function and a customizer.
|
|
2644
|
+
* If any part of the path does not exist, it will be created.
|
|
2645
|
+
*
|
|
2646
|
+
* @template T - The type of the object.
|
|
2647
|
+
* @template R - The type of the return value.
|
|
2648
|
+
* @param obj - The object to modify.
|
|
2649
|
+
* @param path - The path of the property to update.
|
|
2650
|
+
* @param updater - The function to produce the updated value.
|
|
2651
|
+
* @param customizer - The function to customize the update process.
|
|
2652
|
+
* @returns The modified object.
|
|
2653
|
+
*
|
|
2654
|
+
* @example
|
|
2655
|
+
* const object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2656
|
+
* updateWith(object, 'a[0].b.c', (n) => n * n);
|
|
2657
|
+
* // => { 'a': [{ 'b': { 'c': 9 } }] }
|
|
2658
|
+
*/
|
|
1670
2659
|
function updateWith(obj, path, updater, customizer) {
|
|
1671
2660
|
if (obj == null && !isObject(obj)) return obj;
|
|
1672
2661
|
let resolvedPath;
|
|
@@ -1691,12 +2680,50 @@ function updateWith(obj, path, updater, customizer) {
|
|
|
1691
2680
|
return obj;
|
|
1692
2681
|
}
|
|
1693
2682
|
//#endregion
|
|
1694
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2683
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/set.mjs
|
|
2684
|
+
/**
|
|
2685
|
+
* Sets the value at the specified path of the given object. If any part of the path does not exist, it will be created.
|
|
2686
|
+
*
|
|
2687
|
+
* @template T - The type of the object.
|
|
2688
|
+
* @param obj - The object to modify.
|
|
2689
|
+
* @param path - The path of the property to set.
|
|
2690
|
+
* @param value - The value to set.
|
|
2691
|
+
* @returns The modified object.
|
|
2692
|
+
*
|
|
2693
|
+
* @example
|
|
2694
|
+
* // Set a value in a nested object
|
|
2695
|
+
* const obj = { a: { b: { c: 3 } } };
|
|
2696
|
+
* set(obj, 'a.b.c', 4);
|
|
2697
|
+
* console.log(obj.a.b.c); // 4
|
|
2698
|
+
*
|
|
2699
|
+
* @example
|
|
2700
|
+
* // Set a value in an array
|
|
2701
|
+
* const arr = [1, 2, 3];
|
|
2702
|
+
* set(arr, 1, 4);
|
|
2703
|
+
* console.log(arr[1]); // 4
|
|
2704
|
+
*
|
|
2705
|
+
* @example
|
|
2706
|
+
* // Create non-existent path and set value
|
|
2707
|
+
* const obj = {};
|
|
2708
|
+
* set(obj, 'a.b.c', 4);
|
|
2709
|
+
* console.log(obj); // { a: { b: { c: 4 } } }
|
|
2710
|
+
*/
|
|
1695
2711
|
function set$1(obj, path, value) {
|
|
1696
2712
|
return updateWith(obj, path, () => value, () => void 0);
|
|
1697
2713
|
}
|
|
1698
2714
|
//#endregion
|
|
1699
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.
|
|
2715
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/string/capitalize.mjs
|
|
2716
|
+
/**
|
|
2717
|
+
* Converts the first character of string to upper case and the remaining to lower case.
|
|
2718
|
+
*
|
|
2719
|
+
* @param string - The string to capitalize.
|
|
2720
|
+
* @returns The capitalized string.
|
|
2721
|
+
*
|
|
2722
|
+
* @example
|
|
2723
|
+
* const convertedStr1 = capitalize('fred') // returns 'Fred'
|
|
2724
|
+
* const convertedStr2 = capitalize('FRED') // returns 'Fred'
|
|
2725
|
+
* const convertedStr3 = capitalize('') // returns ''
|
|
2726
|
+
*/
|
|
1700
2727
|
function capitalize(str) {
|
|
1701
2728
|
return capitalize$1(toString$1(str));
|
|
1702
2729
|
}
|
|
@@ -2482,7 +3509,7 @@ function fixDefinitionRefs(schema, value, options) {
|
|
|
2482
3509
|
return fixRefDeletions(schema, modified ? renamedValue : newRefPayload.data);
|
|
2483
3510
|
}
|
|
2484
3511
|
//#endregion
|
|
2485
|
-
//#region ../../node_modules/.pnpm/immer@11.1.
|
|
3512
|
+
//#region ../../node_modules/.pnpm/immer@11.1.15/node_modules/immer/dist/immer.mjs
|
|
2486
3513
|
var NOTHING = Symbol.for("immer-nothing");
|
|
2487
3514
|
var DRAFTABLE = Symbol.for("immer-draftable");
|
|
2488
3515
|
var DRAFT_STATE = Symbol.for("immer-state");
|
|
@@ -2802,7 +3829,7 @@ var objectTraps = {
|
|
|
2802
3829
|
const value = source[prop];
|
|
2803
3830
|
if (state.finalized_ || !isDraftable(value)) return value;
|
|
2804
3831
|
if (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod(state.operationMethod) && isArrayIndex(prop)) return value;
|
|
2805
|
-
if (value === peek(state.base_, prop)) {
|
|
3832
|
+
if (value === peek(state.base_, prop) || isRelocatedBaseRef(state, prop, value)) {
|
|
2806
3833
|
prepareCopy(state);
|
|
2807
3834
|
const childKey = state.type_ === 1 ? +prop : prop;
|
|
2808
3835
|
const childDraft = createProxy(state.scope_, value, state, childKey);
|
|
@@ -2834,7 +3861,7 @@ var objectTraps = {
|
|
|
2834
3861
|
prepareCopy(state);
|
|
2835
3862
|
markChanged(state);
|
|
2836
3863
|
}
|
|
2837
|
-
if (state.copy_[prop] === value && (value !== void 0 || prop
|
|
3864
|
+
if (state.copy_[prop] === value && (value !== void 0 || has(state.copy_, prop, state.type_)) || Number.isNaN(value) && Number.isNaN(state.copy_[prop])) return true;
|
|
2838
3865
|
state.copy_[prop] = value;
|
|
2839
3866
|
state.assigned_.set(prop, true);
|
|
2840
3867
|
handleCrossReference(state, prop, value);
|
|
@@ -2889,6 +3916,10 @@ function peek(draft, prop) {
|
|
|
2889
3916
|
const state = draft[DRAFT_STATE];
|
|
2890
3917
|
return (state ? latest(state) : draft)[prop];
|
|
2891
3918
|
}
|
|
3919
|
+
function isRelocatedBaseRef(state, prop, value) {
|
|
3920
|
+
if (state.type_ !== 1 || !state.allIndicesReassigned_ || state.assigned_?.get(prop) || !isDraftable(value) || value[DRAFT_STATE]) return false;
|
|
3921
|
+
return state.baseRefs_.has(value);
|
|
3922
|
+
}
|
|
2892
3923
|
function readPropFromProto(state, source, prop) {
|
|
2893
3924
|
const desc = getDescriptorFromProto(source, prop);
|
|
2894
3925
|
return desc ? VALUE in desc ? desc[VALUE] : desc.get?.call(state.draft_) : void 0;
|
|
@@ -3315,7 +4346,7 @@ var createModelAuthorizerSchema = definitionSchemaWithSlots({ modelSlot: modelEn
|
|
|
3315
4346
|
*/
|
|
3316
4347
|
roles: __mf_0.array(createAuthorizerRoleSchema(ctx, { modelSlot })).default([]) }));
|
|
3317
4348
|
//#endregion
|
|
3318
|
-
//#region ../../node_modules/.pnpm/acorn@8.
|
|
4349
|
+
//#region ../../node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.mjs
|
|
3319
4350
|
var astralIdentifierCodes = [
|
|
3320
4351
|
509,
|
|
3321
4352
|
0,
|
|
@@ -3347,8 +4378,8 @@ var astralIdentifierCodes = [
|
|
|
3347
4378
|
4,
|
|
3348
4379
|
318,
|
|
3349
4380
|
1,
|
|
3350
|
-
|
|
3351
|
-
|
|
4381
|
+
78,
|
|
4382
|
+
5,
|
|
3352
4383
|
71,
|
|
3353
4384
|
10,
|
|
3354
4385
|
50,
|
|
@@ -3493,7 +4524,9 @@ var astralIdentifierCodes = [
|
|
|
3493
4524
|
10,
|
|
3494
4525
|
47,
|
|
3495
4526
|
15,
|
|
3496
|
-
|
|
4527
|
+
199,
|
|
4528
|
+
7,
|
|
4529
|
+
137,
|
|
3497
4530
|
9,
|
|
3498
4531
|
54,
|
|
3499
4532
|
7,
|
|
@@ -3525,7 +4558,9 @@ var astralIdentifierCodes = [
|
|
|
3525
4558
|
4,
|
|
3526
4559
|
9,
|
|
3527
4560
|
9,
|
|
3528
|
-
|
|
4561
|
+
55,
|
|
4562
|
+
9,
|
|
4563
|
+
266,
|
|
3529
4564
|
3,
|
|
3530
4565
|
10,
|
|
3531
4566
|
1,
|
|
@@ -3625,7 +4660,15 @@ var astralIdentifierCodes = [
|
|
|
3625
4660
|
1,
|
|
3626
4661
|
2,
|
|
3627
4662
|
9,
|
|
3628
|
-
|
|
4663
|
+
233,
|
|
4664
|
+
0,
|
|
4665
|
+
3,
|
|
4666
|
+
0,
|
|
4667
|
+
8,
|
|
4668
|
+
1,
|
|
4669
|
+
6,
|
|
4670
|
+
0,
|
|
4671
|
+
475,
|
|
3629
4672
|
6,
|
|
3630
4673
|
110,
|
|
3631
4674
|
6,
|
|
@@ -3735,7 +4778,9 @@ var astralIdentifierStartCodes = [
|
|
|
3735
4778
|
21,
|
|
3736
4779
|
11,
|
|
3737
4780
|
25,
|
|
3738
|
-
|
|
4781
|
+
7,
|
|
4782
|
+
25,
|
|
4783
|
+
39,
|
|
3739
4784
|
55,
|
|
3740
4785
|
7,
|
|
3741
4786
|
1,
|
|
@@ -3780,8 +4825,8 @@ var astralIdentifierStartCodes = [
|
|
|
3780
4825
|
7,
|
|
3781
4826
|
1,
|
|
3782
4827
|
17,
|
|
3783
|
-
|
|
3784
|
-
|
|
4828
|
+
5,
|
|
4829
|
+
57,
|
|
3785
4830
|
28,
|
|
3786
4831
|
11,
|
|
3787
4832
|
0,
|
|
@@ -3965,7 +5010,9 @@ var astralIdentifierStartCodes = [
|
|
|
3965
5010
|
31,
|
|
3966
5011
|
15,
|
|
3967
5012
|
0,
|
|
3968
|
-
|
|
5013
|
+
24,
|
|
5014
|
+
43,
|
|
5015
|
+
261,
|
|
3969
5016
|
18,
|
|
3970
5017
|
16,
|
|
3971
5018
|
0,
|
|
@@ -4013,7 +5060,11 @@ var astralIdentifierStartCodes = [
|
|
|
4013
5060
|
44,
|
|
4014
5061
|
212,
|
|
4015
5062
|
63,
|
|
4016
|
-
|
|
5063
|
+
33,
|
|
5064
|
+
24,
|
|
5065
|
+
3,
|
|
5066
|
+
24,
|
|
5067
|
+
45,
|
|
4017
5068
|
74,
|
|
4018
5069
|
6,
|
|
4019
5070
|
0,
|
|
@@ -4023,13 +5074,15 @@ var astralIdentifierStartCodes = [
|
|
|
4023
5074
|
1,
|
|
4024
5075
|
2,
|
|
4025
5076
|
0,
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
5077
|
+
15,
|
|
5078
|
+
4,
|
|
5079
|
+
10,
|
|
5080
|
+
7381,
|
|
4030
5081
|
42,
|
|
4031
|
-
|
|
4032
|
-
|
|
5082
|
+
31,
|
|
5083
|
+
98,
|
|
5084
|
+
114,
|
|
5085
|
+
8702,
|
|
4033
5086
|
3,
|
|
4034
5087
|
2,
|
|
4035
5088
|
6,
|
|
@@ -4137,7 +5190,19 @@ var astralIdentifierStartCodes = [
|
|
|
4137
5190
|
29,
|
|
4138
5191
|
3,
|
|
4139
5192
|
0,
|
|
4140
|
-
|
|
5193
|
+
208,
|
|
5194
|
+
30,
|
|
5195
|
+
2,
|
|
5196
|
+
2,
|
|
5197
|
+
2,
|
|
5198
|
+
1,
|
|
5199
|
+
2,
|
|
5200
|
+
6,
|
|
5201
|
+
3,
|
|
5202
|
+
4,
|
|
5203
|
+
10,
|
|
5204
|
+
1,
|
|
5205
|
+
225,
|
|
4141
5206
|
6,
|
|
4142
5207
|
2,
|
|
4143
5208
|
3,
|
|
@@ -4220,12 +5285,10 @@ var astralIdentifierStartCodes = [
|
|
|
4220
5285
|
4421,
|
|
4221
5286
|
42719,
|
|
4222
5287
|
33,
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
5288
|
+
4381,
|
|
5289
|
+
3,
|
|
5290
|
+
5773,
|
|
4226
5291
|
3,
|
|
4227
|
-
5761,
|
|
4228
|
-
15,
|
|
4229
5292
|
7472,
|
|
4230
5293
|
16,
|
|
4231
5294
|
621,
|
|
@@ -4234,10 +5297,10 @@ var astralIdentifierStartCodes = [
|
|
|
4234
5297
|
1507,
|
|
4235
5298
|
4938,
|
|
4236
5299
|
6,
|
|
4237
|
-
|
|
5300
|
+
8489
|
|
4238
5301
|
];
|
|
4239
|
-
var nonASCIIidentifierChars = "
|
|
4240
|
-
var nonASCIIidentifierStartChars = "
|
|
5302
|
+
var nonASCIIidentifierChars = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
|
|
5303
|
+
var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
|
|
4241
5304
|
var reservedWords = {
|
|
4242
5305
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
4243
5306
|
5: "class enum extends super const export import",
|
|
@@ -4502,6 +5565,7 @@ function getLineInfo(input, offset) {
|
|
|
4502
5565
|
var defaultOptions = {
|
|
4503
5566
|
ecmaVersion: null,
|
|
4504
5567
|
sourceType: "script",
|
|
5568
|
+
strict: false,
|
|
4505
5569
|
onInsertedSemicolon: null,
|
|
4506
5570
|
onTrailingComma: null,
|
|
4507
5571
|
allowReserved: null,
|
|
@@ -4512,6 +5576,7 @@ var defaultOptions = {
|
|
|
4512
5576
|
allowHashBang: false,
|
|
4513
5577
|
checkPrivateFields: true,
|
|
4514
5578
|
locations: false,
|
|
5579
|
+
startLocation: null,
|
|
4515
5580
|
onToken: null,
|
|
4516
5581
|
onComment: null,
|
|
4517
5582
|
ranges: false,
|
|
@@ -4541,6 +5606,7 @@ function getOptions(opts) {
|
|
|
4541
5606
|
};
|
|
4542
5607
|
}
|
|
4543
5608
|
if (isArray(options.onComment)) options.onComment = pushComment(options, options.onComment);
|
|
5609
|
+
if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction) throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
4544
5610
|
return options;
|
|
4545
5611
|
}
|
|
4546
5612
|
function pushComment(options, array) {
|
|
@@ -4566,6 +5632,7 @@ var SCOPE_SUPER = 64;
|
|
|
4566
5632
|
var SCOPE_DIRECT_SUPER = 128;
|
|
4567
5633
|
var SCOPE_CLASS_STATIC_BLOCK = 256;
|
|
4568
5634
|
var SCOPE_CLASS_FIELD_INIT = 512;
|
|
5635
|
+
var SCOPE_SWITCH = 1024;
|
|
4569
5636
|
var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
4570
5637
|
function functionFlags(async, generator) {
|
|
4571
5638
|
return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
|
|
@@ -4591,14 +5658,15 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
4591
5658
|
this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
|
|
4592
5659
|
this.input = String(input);
|
|
4593
5660
|
this.containsEsc = false;
|
|
4594
|
-
|
|
4595
|
-
|
|
5661
|
+
this.pos = startPos || 0;
|
|
5662
|
+
this.curLine = 1;
|
|
5663
|
+
if (options.startLocation) {
|
|
5664
|
+
this.lineStart = this.pos - options.startLocation.column;
|
|
5665
|
+
this.curLine = options.startLocation.line;
|
|
5666
|
+
} else if (startPos) {
|
|
4596
5667
|
this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
|
|
4597
|
-
this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
|
|
4598
|
-
} else
|
|
4599
|
-
this.pos = this.lineStart = 0;
|
|
4600
|
-
this.curLine = 1;
|
|
4601
|
-
}
|
|
5668
|
+
if (this.options.locations) this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
|
|
5669
|
+
} else this.lineStart = 0;
|
|
4602
5670
|
this.type = types$1.eof;
|
|
4603
5671
|
this.value = null;
|
|
4604
5672
|
this.start = this.end = this.pos;
|
|
@@ -4608,7 +5676,7 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
4608
5676
|
this.context = this.initialContext();
|
|
4609
5677
|
this.exprAllowed = true;
|
|
4610
5678
|
this.inModule = options.sourceType === "module";
|
|
4611
|
-
this.strict = this.inModule || this.strictDirective(this.pos);
|
|
5679
|
+
this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);
|
|
4612
5680
|
this.potentialArrowAt = -1;
|
|
4613
5681
|
this.potentialArrowInForAwait = false;
|
|
4614
5682
|
this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
|
|
@@ -4616,7 +5684,7 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
4616
5684
|
this.undefinedExports = Object.create(null);
|
|
4617
5685
|
if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") this.skipLineComment(2);
|
|
4618
5686
|
this.scopeStack = [];
|
|
4619
|
-
this.enterScope(SCOPE_TOP);
|
|
5687
|
+
this.enterScope(this.options.sourceType === "commonjs" ? SCOPE_FUNCTION : SCOPE_TOP);
|
|
4620
5688
|
this.regexpState = null;
|
|
4621
5689
|
this.privateNameStack = [];
|
|
4622
5690
|
};
|
|
@@ -4625,16 +5693,21 @@ var prototypeAccessors = {
|
|
|
4625
5693
|
inGenerator: { configurable: true },
|
|
4626
5694
|
inAsync: { configurable: true },
|
|
4627
5695
|
canAwait: { configurable: true },
|
|
5696
|
+
allowReturn: { configurable: true },
|
|
4628
5697
|
allowSuper: { configurable: true },
|
|
4629
5698
|
allowDirectSuper: { configurable: true },
|
|
4630
5699
|
treatFunctionsAsVar: { configurable: true },
|
|
4631
5700
|
allowNewDotTarget: { configurable: true },
|
|
5701
|
+
allowUsing: { configurable: true },
|
|
4632
5702
|
inClassStaticBlock: { configurable: true }
|
|
4633
5703
|
};
|
|
4634
5704
|
Parser.prototype.parse = function parse() {
|
|
5705
|
+
var this$1$1 = this;
|
|
4635
5706
|
var node = this.options.program || this.startNode();
|
|
4636
5707
|
this.nextToken();
|
|
4637
|
-
return this.
|
|
5708
|
+
return this.catchStackOverflow(function() {
|
|
5709
|
+
return this$1$1.parseTopLevel(node);
|
|
5710
|
+
});
|
|
4638
5711
|
};
|
|
4639
5712
|
prototypeAccessors.inFunction.get = function() {
|
|
4640
5713
|
return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
|
|
@@ -4653,6 +5726,11 @@ prototypeAccessors.canAwait.get = function() {
|
|
|
4653
5726
|
}
|
|
4654
5727
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
4655
5728
|
};
|
|
5729
|
+
prototypeAccessors.allowReturn.get = function() {
|
|
5730
|
+
if (this.inFunction) return true;
|
|
5731
|
+
if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) return true;
|
|
5732
|
+
return false;
|
|
5733
|
+
};
|
|
4656
5734
|
prototypeAccessors.allowSuper.get = function() {
|
|
4657
5735
|
return (this.currentThisScope().flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod;
|
|
4658
5736
|
};
|
|
@@ -4669,6 +5747,12 @@ prototypeAccessors.allowNewDotTarget.get = function() {
|
|
|
4669
5747
|
}
|
|
4670
5748
|
return false;
|
|
4671
5749
|
};
|
|
5750
|
+
prototypeAccessors.allowUsing.get = function() {
|
|
5751
|
+
var flags = this.currentScope().flags;
|
|
5752
|
+
if (flags & SCOPE_SWITCH) return false;
|
|
5753
|
+
if (!this.inModule && flags & SCOPE_TOP) return false;
|
|
5754
|
+
return true;
|
|
5755
|
+
};
|
|
4672
5756
|
prototypeAccessors.inClassStaticBlock.get = function() {
|
|
4673
5757
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
|
|
4674
5758
|
};
|
|
@@ -4726,6 +5810,14 @@ pp$9.eatContextual = function(name) {
|
|
|
4726
5810
|
this.next();
|
|
4727
5811
|
return true;
|
|
4728
5812
|
};
|
|
5813
|
+
pp$9.catchStackOverflow = function(f) {
|
|
5814
|
+
try {
|
|
5815
|
+
return f();
|
|
5816
|
+
} catch (e) {
|
|
5817
|
+
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
|
|
5818
|
+
else throw e;
|
|
5819
|
+
}
|
|
5820
|
+
};
|
|
4729
5821
|
pp$9.expectContextual = function(name) {
|
|
4730
5822
|
if (!this.eatContextual(name)) this.unexpected();
|
|
4731
5823
|
};
|
|
@@ -4781,10 +5873,10 @@ pp$9.isSimpleAssignTarget = function(expr) {
|
|
|
4781
5873
|
};
|
|
4782
5874
|
var pp$8 = Parser.prototype;
|
|
4783
5875
|
pp$8.parseTopLevel = function(node) {
|
|
4784
|
-
var exports = Object.create(null);
|
|
5876
|
+
var exports$1 = Object.create(null);
|
|
4785
5877
|
if (!node.body) node.body = [];
|
|
4786
5878
|
while (this.type !== types$1.eof) {
|
|
4787
|
-
var stmt = this.parseStatement(null, true, exports);
|
|
5879
|
+
var stmt = this.parseStatement(null, true, exports$1);
|
|
4788
5880
|
node.body.push(stmt);
|
|
4789
5881
|
}
|
|
4790
5882
|
if (this.inModule) for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {
|
|
@@ -4793,7 +5885,7 @@ pp$8.parseTopLevel = function(node) {
|
|
|
4793
5885
|
}
|
|
4794
5886
|
this.adaptDirectivePrologue(node.body);
|
|
4795
5887
|
this.next();
|
|
4796
|
-
node.sourceType = this.options.sourceType;
|
|
5888
|
+
node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
|
|
4797
5889
|
return this.finishNode(node, "Program");
|
|
4798
5890
|
};
|
|
4799
5891
|
var loopLabel = { kind: "loop" };
|
|
@@ -4802,15 +5894,17 @@ pp$8.isLet = function(context) {
|
|
|
4802
5894
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return false;
|
|
4803
5895
|
skipWhiteSpace.lastIndex = this.pos;
|
|
4804
5896
|
var skip = skipWhiteSpace.exec(this.input);
|
|
4805
|
-
var next = this.pos + skip[0].length, nextCh = this.
|
|
5897
|
+
var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);
|
|
4806
5898
|
if (nextCh === 91 || nextCh === 92) return true;
|
|
4807
5899
|
if (context) return false;
|
|
4808
|
-
if (nextCh === 123
|
|
4809
|
-
if (isIdentifierStart(nextCh
|
|
4810
|
-
var
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
5900
|
+
if (nextCh === 123) return true;
|
|
5901
|
+
if (isIdentifierStart(nextCh)) {
|
|
5902
|
+
var start = next;
|
|
5903
|
+
do
|
|
5904
|
+
next += nextCh <= 65535 ? 1 : 2;
|
|
5905
|
+
while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)));
|
|
5906
|
+
if (nextCh === 92) return true;
|
|
5907
|
+
var ident = this.input.slice(start, next);
|
|
4814
5908
|
if (!keywordRelationalOperator.test(ident)) return true;
|
|
4815
5909
|
}
|
|
4816
5910
|
return false;
|
|
@@ -4820,7 +5914,7 @@ pp$8.isAsyncFunction = function() {
|
|
|
4820
5914
|
skipWhiteSpace.lastIndex = this.pos;
|
|
4821
5915
|
var skip = skipWhiteSpace.exec(this.input);
|
|
4822
5916
|
var next = this.pos + skip[0].length, after;
|
|
4823
|
-
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.
|
|
5917
|
+
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92));
|
|
4824
5918
|
};
|
|
4825
5919
|
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
4826
5920
|
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) return false;
|
|
@@ -4829,20 +5923,29 @@ pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
|
4829
5923
|
var next = this.pos + skip[0].length;
|
|
4830
5924
|
if (lineBreak.test(this.input.slice(this.pos, next))) return false;
|
|
4831
5925
|
if (isAwaitUsing) {
|
|
4832
|
-
var
|
|
4833
|
-
if (this.input.slice(next,
|
|
4834
|
-
skipWhiteSpace.lastIndex =
|
|
5926
|
+
var usingEndPos = next + 5, after;
|
|
5927
|
+
if (this.input.slice(next, usingEndPos) !== "using" || usingEndPos === this.input.length || isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) || after === 92) return false;
|
|
5928
|
+
skipWhiteSpace.lastIndex = usingEndPos;
|
|
4835
5929
|
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
5930
|
+
next = usingEndPos + skipAfterUsing[0].length;
|
|
5931
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) return false;
|
|
5932
|
+
}
|
|
5933
|
+
var ch = this.fullCharCodeAt(next);
|
|
5934
|
+
if (!isIdentifierStart(ch) && ch !== 92) return false;
|
|
5935
|
+
var idStart = next;
|
|
5936
|
+
do
|
|
5937
|
+
next += ch <= 65535 ? 1 : 2;
|
|
5938
|
+
while (isIdentifierChar(ch = this.fullCharCodeAt(next)));
|
|
5939
|
+
if (ch === 92) return true;
|
|
5940
|
+
var id = this.input.slice(idStart, next);
|
|
5941
|
+
if (keywordRelationalOperator.test(id)) return false;
|
|
5942
|
+
if (isFor && !isAwaitUsing && id === "of") {
|
|
5943
|
+
skipWhiteSpace.lastIndex = next;
|
|
5944
|
+
var skipAfterOf = skipWhiteSpace.exec(this.input);
|
|
5945
|
+
next = next + skipAfterOf[0].length;
|
|
5946
|
+
if (this.input.charCodeAt(next) !== 61 || (ch = this.input.charCodeAt(next + 1)) === 61 || ch === 62) return false;
|
|
4843
5947
|
}
|
|
4844
|
-
|
|
4845
|
-
return isIdentifierStart(ch, true) || ch === 92;
|
|
5948
|
+
return true;
|
|
4846
5949
|
};
|
|
4847
5950
|
pp$8.isAwaitUsing = function(isFor) {
|
|
4848
5951
|
return this.isUsingKeyword(true, isFor);
|
|
@@ -4850,7 +5953,7 @@ pp$8.isAwaitUsing = function(isFor) {
|
|
|
4850
5953
|
pp$8.isUsing = function(isFor) {
|
|
4851
5954
|
return this.isUsingKeyword(false, isFor);
|
|
4852
5955
|
};
|
|
4853
|
-
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
5956
|
+
pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
4854
5957
|
var starttype = this.type, node = this.startNode(), kind;
|
|
4855
5958
|
if (this.isLet(context)) {
|
|
4856
5959
|
starttype = types$1._var;
|
|
@@ -4894,7 +5997,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
4894
5997
|
if (!topLevel) this.raise(this.start, "'import' and 'export' may only appear at the top level");
|
|
4895
5998
|
if (!this.inModule) this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
|
4896
5999
|
}
|
|
4897
|
-
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
|
|
6000
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1);
|
|
4898
6001
|
default:
|
|
4899
6002
|
if (this.isAsyncFunction()) {
|
|
4900
6003
|
if (context) this.unexpected();
|
|
@@ -4903,7 +6006,8 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
4903
6006
|
}
|
|
4904
6007
|
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
4905
6008
|
if (usingKind) {
|
|
4906
|
-
if (
|
|
6009
|
+
if (!this.allowUsing) this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
|
|
6010
|
+
if (context) this.raise(this.start, "Using declaration is not allowed in single-statement positions");
|
|
4907
6011
|
if (usingKind === "await using") {
|
|
4908
6012
|
if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
|
|
4909
6013
|
this.next();
|
|
@@ -4977,7 +6081,10 @@ pp$8.parseForStatement = function(node) {
|
|
|
4977
6081
|
if (usingKind) {
|
|
4978
6082
|
var init$2 = this.startNode();
|
|
4979
6083
|
this.next();
|
|
4980
|
-
if (usingKind === "await using")
|
|
6084
|
+
if (usingKind === "await using") {
|
|
6085
|
+
if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
|
|
6086
|
+
this.next();
|
|
6087
|
+
}
|
|
4981
6088
|
this.parseVar(init$2, true, usingKind);
|
|
4982
6089
|
this.finishNode(init$2, "VariableDeclaration");
|
|
4983
6090
|
return this.parseForAfterInit(node, init$2, awaitAt);
|
|
@@ -5004,9 +6111,10 @@ pp$8.parseForStatement = function(node) {
|
|
|
5004
6111
|
};
|
|
5005
6112
|
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
5006
6113
|
if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
|
|
5007
|
-
if (this.
|
|
5008
|
-
if (
|
|
5009
|
-
|
|
6114
|
+
if (this.type === types$1._in) {
|
|
6115
|
+
if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) this.raise(this.start, "Using declaration is not allowed in for-in loops");
|
|
6116
|
+
if (this.options.ecmaVersion >= 9 && awaitAt > -1) this.unexpected(awaitAt);
|
|
6117
|
+
} else if (this.options.ecmaVersion >= 9) node.await = awaitAt > -1;
|
|
5010
6118
|
return this.parseForIn(node, init);
|
|
5011
6119
|
}
|
|
5012
6120
|
if (awaitAt > -1) this.unexpected(awaitAt);
|
|
@@ -5024,7 +6132,7 @@ pp$8.parseIfStatement = function(node) {
|
|
|
5024
6132
|
return this.finishNode(node, "IfStatement");
|
|
5025
6133
|
};
|
|
5026
6134
|
pp$8.parseReturnStatement = function(node) {
|
|
5027
|
-
if (!this.
|
|
6135
|
+
if (!this.allowReturn) this.raise(this.start, "'return' outside of function");
|
|
5028
6136
|
this.next();
|
|
5029
6137
|
if (this.eat(types$1.semi) || this.insertSemicolon()) node.argument = null;
|
|
5030
6138
|
else {
|
|
@@ -5039,7 +6147,7 @@ pp$8.parseSwitchStatement = function(node) {
|
|
|
5039
6147
|
node.cases = [];
|
|
5040
6148
|
this.expect(types$1.braceL);
|
|
5041
6149
|
this.labels.push(switchLabel);
|
|
5042
|
-
this.enterScope(
|
|
6150
|
+
this.enterScope(SCOPE_SWITCH);
|
|
5043
6151
|
var cur;
|
|
5044
6152
|
for (var sawDefault = false; this.type !== types$1.braceR;) if (this.type === types$1._case || this.type === types$1._default) {
|
|
5045
6153
|
var isCase = this.type === types$1._case;
|
|
@@ -5408,10 +6516,10 @@ function checkKeyName(node, name) {
|
|
|
5408
6516
|
var key = node.key;
|
|
5409
6517
|
return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
|
|
5410
6518
|
}
|
|
5411
|
-
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
6519
|
+
pp$8.parseExportAllDeclaration = function(node, exports$1) {
|
|
5412
6520
|
if (this.options.ecmaVersion >= 11) if (this.eatContextual("as")) {
|
|
5413
6521
|
node.exported = this.parseModuleExportName();
|
|
5414
|
-
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
6522
|
+
this.checkExport(exports$1, node.exported, this.lastTokStart);
|
|
5415
6523
|
} else node.exported = null;
|
|
5416
6524
|
this.expectContextual("from");
|
|
5417
6525
|
if (this.type !== types$1.string) this.unexpected();
|
|
@@ -5420,24 +6528,24 @@ pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
|
5420
6528
|
this.semicolon();
|
|
5421
6529
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
5422
6530
|
};
|
|
5423
|
-
pp$8.parseExport = function(node, exports) {
|
|
6531
|
+
pp$8.parseExport = function(node, exports$1) {
|
|
5424
6532
|
this.next();
|
|
5425
|
-
if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports);
|
|
6533
|
+
if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports$1);
|
|
5426
6534
|
if (this.eat(types$1._default)) {
|
|
5427
|
-
this.checkExport(exports, "default", this.lastTokStart);
|
|
6535
|
+
this.checkExport(exports$1, "default", this.lastTokStart);
|
|
5428
6536
|
node.declaration = this.parseExportDefaultDeclaration();
|
|
5429
6537
|
return this.finishNode(node, "ExportDefaultDeclaration");
|
|
5430
6538
|
}
|
|
5431
6539
|
if (this.shouldParseExportStatement()) {
|
|
5432
6540
|
node.declaration = this.parseExportDeclaration(node);
|
|
5433
|
-
if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports, node.declaration.declarations);
|
|
5434
|
-
else this.checkExport(exports, node.declaration.id, node.declaration.id.start);
|
|
6541
|
+
if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports$1, node.declaration.declarations);
|
|
6542
|
+
else this.checkExport(exports$1, node.declaration.id, node.declaration.id.start);
|
|
5435
6543
|
node.specifiers = [];
|
|
5436
6544
|
node.source = null;
|
|
5437
6545
|
if (this.options.ecmaVersion >= 16) node.attributes = [];
|
|
5438
6546
|
} else {
|
|
5439
6547
|
node.declaration = null;
|
|
5440
|
-
node.specifiers = this.parseExportSpecifiers(exports);
|
|
6548
|
+
node.specifiers = this.parseExportSpecifiers(exports$1);
|
|
5441
6549
|
if (this.eatContextual("from")) {
|
|
5442
6550
|
if (this.type !== types$1.string) this.unexpected();
|
|
5443
6551
|
node.source = this.parseExprAtom();
|
|
@@ -5475,45 +6583,45 @@ pp$8.parseExportDefaultDeclaration = function() {
|
|
|
5475
6583
|
return declaration;
|
|
5476
6584
|
}
|
|
5477
6585
|
};
|
|
5478
|
-
pp$8.checkExport = function(exports, name, pos) {
|
|
5479
|
-
if (!exports) return;
|
|
6586
|
+
pp$8.checkExport = function(exports$1, name, pos) {
|
|
6587
|
+
if (!exports$1) return;
|
|
5480
6588
|
if (typeof name !== "string") name = name.type === "Identifier" ? name.name : name.value;
|
|
5481
|
-
if (hasOwn(exports, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
|
|
5482
|
-
exports[name] = true;
|
|
6589
|
+
if (hasOwn(exports$1, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
|
|
6590
|
+
exports$1[name] = true;
|
|
5483
6591
|
};
|
|
5484
|
-
pp$8.checkPatternExport = function(exports, pat) {
|
|
6592
|
+
pp$8.checkPatternExport = function(exports$1, pat) {
|
|
5485
6593
|
var type = pat.type;
|
|
5486
|
-
if (type === "Identifier") this.checkExport(exports, pat, pat.start);
|
|
6594
|
+
if (type === "Identifier") this.checkExport(exports$1, pat, pat.start);
|
|
5487
6595
|
else if (type === "ObjectPattern") for (var i = 0, list = pat.properties; i < list.length; i += 1) {
|
|
5488
6596
|
var prop = list[i];
|
|
5489
|
-
this.checkPatternExport(exports, prop);
|
|
6597
|
+
this.checkPatternExport(exports$1, prop);
|
|
5490
6598
|
}
|
|
5491
6599
|
else if (type === "ArrayPattern") for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
|
|
5492
6600
|
var elt = list$1[i$1];
|
|
5493
|
-
if (elt) this.checkPatternExport(exports, elt);
|
|
6601
|
+
if (elt) this.checkPatternExport(exports$1, elt);
|
|
5494
6602
|
}
|
|
5495
|
-
else if (type === "Property") this.checkPatternExport(exports, pat.value);
|
|
5496
|
-
else if (type === "AssignmentPattern") this.checkPatternExport(exports, pat.left);
|
|
5497
|
-
else if (type === "RestElement") this.checkPatternExport(exports, pat.argument);
|
|
6603
|
+
else if (type === "Property") this.checkPatternExport(exports$1, pat.value);
|
|
6604
|
+
else if (type === "AssignmentPattern") this.checkPatternExport(exports$1, pat.left);
|
|
6605
|
+
else if (type === "RestElement") this.checkPatternExport(exports$1, pat.argument);
|
|
5498
6606
|
};
|
|
5499
|
-
pp$8.checkVariableExport = function(exports, decls) {
|
|
5500
|
-
if (!exports) return;
|
|
6607
|
+
pp$8.checkVariableExport = function(exports$1, decls) {
|
|
6608
|
+
if (!exports$1) return;
|
|
5501
6609
|
for (var i = 0, list = decls; i < list.length; i += 1) {
|
|
5502
6610
|
var decl = list[i];
|
|
5503
|
-
this.checkPatternExport(exports, decl.id);
|
|
6611
|
+
this.checkPatternExport(exports$1, decl.id);
|
|
5504
6612
|
}
|
|
5505
6613
|
};
|
|
5506
6614
|
pp$8.shouldParseExportStatement = function() {
|
|
5507
6615
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
5508
6616
|
};
|
|
5509
|
-
pp$8.parseExportSpecifier = function(exports) {
|
|
6617
|
+
pp$8.parseExportSpecifier = function(exports$1) {
|
|
5510
6618
|
var node = this.startNode();
|
|
5511
6619
|
node.local = this.parseModuleExportName();
|
|
5512
6620
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
5513
|
-
this.checkExport(exports, node.exported, node.exported.start);
|
|
6621
|
+
this.checkExport(exports$1, node.exported, node.exported.start);
|
|
5514
6622
|
return this.finishNode(node, "ExportSpecifier");
|
|
5515
6623
|
};
|
|
5516
|
-
pp$8.parseExportSpecifiers = function(exports) {
|
|
6624
|
+
pp$8.parseExportSpecifiers = function(exports$1) {
|
|
5517
6625
|
var nodes = [], first = true;
|
|
5518
6626
|
this.expect(types$1.braceL);
|
|
5519
6627
|
while (!this.eat(types$1.braceR)) {
|
|
@@ -5521,7 +6629,7 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
5521
6629
|
this.expect(types$1.comma);
|
|
5522
6630
|
if (this.afterTrailingComma(types$1.braceR)) break;
|
|
5523
6631
|
} else first = false;
|
|
5524
|
-
nodes.push(this.parseExportSpecifier(exports));
|
|
6632
|
+
nodes.push(this.parseExportSpecifier(exports$1));
|
|
5525
6633
|
}
|
|
5526
6634
|
return nodes;
|
|
5527
6635
|
};
|
|
@@ -5952,15 +7060,18 @@ pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
|
|
|
5952
7060
|
other[kind] = true;
|
|
5953
7061
|
};
|
|
5954
7062
|
pp$5.parseExpression = function(forInit, refDestructuringErrors) {
|
|
5955
|
-
var
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
var
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
7063
|
+
var this$1$1 = this;
|
|
7064
|
+
return this.catchStackOverflow(function() {
|
|
7065
|
+
var startPos = this$1$1.start, startLoc = this$1$1.startLoc;
|
|
7066
|
+
var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
|
|
7067
|
+
if (this$1$1.type === types$1.comma) {
|
|
7068
|
+
var node = this$1$1.startNodeAt(startPos, startLoc);
|
|
7069
|
+
node.expressions = [expr];
|
|
7070
|
+
while (this$1$1.eat(types$1.comma)) node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors));
|
|
7071
|
+
return this$1$1.finishNode(node, "SequenceExpression");
|
|
7072
|
+
}
|
|
7073
|
+
return expr;
|
|
7074
|
+
});
|
|
5964
7075
|
};
|
|
5965
7076
|
pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
|
|
5966
7077
|
if (this.isContextual("yield")) if (this.inGenerator) return this.parseYield(forInit);
|
|
@@ -6004,7 +7115,7 @@ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
|
|
|
6004
7115
|
var startPos = this.start, startLoc = this.startLoc;
|
|
6005
7116
|
var expr = this.parseExprOps(forInit, refDestructuringErrors);
|
|
6006
7117
|
if (this.checkExpressionErrors(refDestructuringErrors)) return expr;
|
|
6007
|
-
if (this.eat(types$1.question)) {
|
|
7118
|
+
if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
|
|
6008
7119
|
var node = this.startNodeAt(startPos, startLoc);
|
|
6009
7120
|
node.test = expr;
|
|
6010
7121
|
node.consequent = this.parseMaybeAssign();
|
|
@@ -6080,7 +7191,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
6080
7191
|
expr = this.finishNode(node$1, "UpdateExpression");
|
|
6081
7192
|
}
|
|
6082
7193
|
}
|
|
6083
|
-
if (!incDec && this.eat(types$1.starstar)) if (sawUnary) this.unexpected(this.lastTokStart);
|
|
7194
|
+
if (!incDec && !(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.starstar)) if (sawUnary) this.unexpected(this.lastTokStart);
|
|
6084
7195
|
else return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false);
|
|
6085
7196
|
else return expr;
|
|
6086
7197
|
};
|
|
@@ -6383,6 +7494,7 @@ pp$5.parseNew = function() {
|
|
|
6383
7494
|
}
|
|
6384
7495
|
var startPos = this.start, startLoc = this.startLoc;
|
|
6385
7496
|
node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
|
|
7497
|
+
if (node.callee.type === "Super") this.raiseRecoverable(startPos, "Invalid use of 'super'");
|
|
6386
7498
|
if (this.eat(types$1.parenL)) node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
|
|
6387
7499
|
else node.arguments = empty;
|
|
6388
7500
|
return this.finishNode(node, "NewExpression");
|
|
@@ -6782,7 +7894,7 @@ pp$2.copyNode = function(node) {
|
|
|
6782
7894
|
for (var prop in node) newNode[prop] = node[prop];
|
|
6783
7895
|
return newNode;
|
|
6784
7896
|
};
|
|
6785
|
-
var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
|
|
7897
|
+
var scriptValuesAddedInUnicode = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz";
|
|
6786
7898
|
var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
|
|
6787
7899
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
6788
7900
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
@@ -7785,12 +8897,15 @@ pp.readToken = function(code) {
|
|
|
7785
8897
|
if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92) return this.readWord();
|
|
7786
8898
|
return this.getTokenFromCode(code);
|
|
7787
8899
|
};
|
|
7788
|
-
pp.
|
|
7789
|
-
var code = this.input.charCodeAt(
|
|
8900
|
+
pp.fullCharCodeAt = function(pos) {
|
|
8901
|
+
var code = this.input.charCodeAt(pos);
|
|
7790
8902
|
if (code <= 55295 || code >= 56320) return code;
|
|
7791
|
-
var next = this.input.charCodeAt(
|
|
8903
|
+
var next = this.input.charCodeAt(pos + 1);
|
|
7792
8904
|
return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888;
|
|
7793
8905
|
};
|
|
8906
|
+
pp.fullCharCodeAtPos = function() {
|
|
8907
|
+
return this.fullCharCodeAt(this.pos);
|
|
8908
|
+
};
|
|
7794
8909
|
pp.skipBlockComment = function() {
|
|
7795
8910
|
var startLoc = this.options.onComment && this.curPosition();
|
|
7796
8911
|
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
|
|
@@ -8336,7 +9451,7 @@ pp.readWord = function() {
|
|
|
8336
9451
|
};
|
|
8337
9452
|
Parser.acorn = {
|
|
8338
9453
|
Parser,
|
|
8339
|
-
version: "8.
|
|
9454
|
+
version: "8.18.0",
|
|
8340
9455
|
defaultOptions,
|
|
8341
9456
|
Position,
|
|
8342
9457
|
SourceLocation,
|
|
@@ -10437,6 +11552,9 @@ function getWebAppPluginData(webApp, pluginKey) {
|
|
|
10437
11552
|
return webApp.pluginData?.[pluginKey];
|
|
10438
11553
|
}
|
|
10439
11554
|
//#endregion
|
|
11555
|
+
//#region ../../packages/project-builder-lib/dist/schema/libraries/types.js
|
|
11556
|
+
var libraryEntityType = createEntityType("library");
|
|
11557
|
+
//#endregion
|
|
10440
11558
|
//#region ../../packages/project-builder-lib/dist/schema/apps/web/web-app.js
|
|
10441
11559
|
var createWebAppSchema = definitionSchemaWithSlots({ appSlot: appEntityType }, (ctx, { appSlot }) => {
|
|
10442
11560
|
const pluginKeys = ctx.plugins.getPluginKeys();
|
|
@@ -10450,14 +11568,24 @@ var createWebAppSchema = definitionSchemaWithSlots({ appSlot: appEntityType }, (
|
|
|
10450
11568
|
description: __mf_0.string().default(""),
|
|
10451
11569
|
enableSubscriptions: ctx.withDefault(__mf_0.boolean(), false),
|
|
10452
11570
|
pluginData: pluginDataSchema.optional(),
|
|
10453
|
-
adminApp: createAdminAppSchema(ctx, { appSlot })
|
|
11571
|
+
adminApp: createAdminAppSchema(ctx, { appSlot }),
|
|
11572
|
+
libraryRefs: __mf_0.array(ctx.withRef({
|
|
11573
|
+
type: libraryEntityType,
|
|
11574
|
+
onDelete: "RESTRICT"
|
|
11575
|
+
})).apply(withDefault([])),
|
|
11576
|
+
/**
|
|
11577
|
+
* Optional reference to a `react-library` package that supplies the
|
|
11578
|
+
* shared `react-components` UI primitive set (Button, Dialog, Toaster,
|
|
11579
|
+
* etc.) instead of generating them locally in this app.
|
|
11580
|
+
*/
|
|
11581
|
+
componentsLibraryRef: __mf_0.optional(ctx.withRef({
|
|
11582
|
+
type: libraryEntityType,
|
|
11583
|
+
onDelete: "RESTRICT"
|
|
11584
|
+
}))
|
|
10454
11585
|
});
|
|
10455
11586
|
});
|
|
10456
11587
|
var webAppEntryType = createAppEntryType("web");
|
|
10457
11588
|
//#endregion
|
|
10458
|
-
//#region ../../packages/project-builder-lib/dist/schema/libraries/types.js
|
|
10459
|
-
var libraryEntityType = createEntityType("library");
|
|
10460
|
-
//#endregion
|
|
10461
11589
|
//#region ../../packages/project-builder-lib/dist/schema/libraries/base.js
|
|
10462
11590
|
var baseLibraryValidators = {
|
|
10463
11591
|
id: __mf_0.string().default(libraryEntityType.generateNewId()),
|
|
@@ -10899,6 +12027,13 @@ var nodeLibraryDefinitionSchemaEntry = {
|
|
|
10899
12027
|
type: __mfDefaultExport.literal("node-library")
|
|
10900
12028
|
}))
|
|
10901
12029
|
};
|
|
12030
|
+
var reactLibraryDefinitionSchemaEntry = {
|
|
12031
|
+
name: "react-library",
|
|
12032
|
+
definitionSchema: definitionSchemaWithSlots({ librarySlot: libraryEntityType }, () => __mfDefaultExport.object({
|
|
12033
|
+
...baseLibraryValidators,
|
|
12034
|
+
type: __mfDefaultExport.literal("react-library")
|
|
12035
|
+
}))
|
|
12036
|
+
};
|
|
10902
12037
|
/**
|
|
10903
12038
|
* Creates a typed library web config
|
|
10904
12039
|
*/
|
|
@@ -10909,7 +12044,7 @@ function createLibraryWebConfig(config) {
|
|
|
10909
12044
|
* Package type spec for registering package schemas, compilers, and web configs.
|
|
10910
12045
|
*/
|
|
10911
12046
|
var libraryTypeSpec = createFieldMapSpec("core/library-type", (t) => ({
|
|
10912
|
-
schemaCreators: t.namedArrayToMap([nodeLibraryDefinitionSchemaEntry]),
|
|
12047
|
+
schemaCreators: t.namedArrayToMap([nodeLibraryDefinitionSchemaEntry, reactLibraryDefinitionSchemaEntry]),
|
|
10913
12048
|
compilerCreators: t.namedArrayToMap(),
|
|
10914
12049
|
webConfigs: t.namedArrayToMap()
|
|
10915
12050
|
}));
|
|
@@ -11315,10 +12450,24 @@ function byUniqueTypeOrThrow(projectDefinition, type) {
|
|
|
11315
12450
|
function getLibraryDirectory(libraryConfig, monorepoSettings) {
|
|
11316
12451
|
return `${monorepoSettings?.librariesFolder ?? "libs"}/${libraryConfig.name}`;
|
|
11317
12452
|
}
|
|
12453
|
+
/**
|
|
12454
|
+
* Given a library config and the app importing it, get the path to the
|
|
12455
|
+
* library's `src` directory relative to the app's `src` root (where
|
|
12456
|
+
* `styles.css` is rendered), for use in a Tailwind `@source` directive.
|
|
12457
|
+
*
|
|
12458
|
+
* @param libraryConfig The library config being imported
|
|
12459
|
+
* @param appConfig The app importing the library
|
|
12460
|
+
* @param monorepoSettings Optional monorepo settings to determine folder locations
|
|
12461
|
+
* @returns The relative path from the app's `src` root to the library's `src` directory
|
|
12462
|
+
*/
|
|
12463
|
+
function getLibraryRelativeSourcePath(libraryConfig, appConfig, monorepoSettings) {
|
|
12464
|
+
return computeRelativePath(`${AppUtils.getAppDirectory(appConfig, monorepoSettings)}/src`, `${getLibraryDirectory(libraryConfig, monorepoSettings)}/src`);
|
|
12465
|
+
}
|
|
11318
12466
|
var LibraryUtils = {
|
|
11319
12467
|
byId,
|
|
11320
12468
|
byUniqueTypeOrThrow,
|
|
11321
|
-
getLibraryDirectory
|
|
12469
|
+
getLibraryDirectory,
|
|
12470
|
+
getLibraryRelativeSourcePath
|
|
11322
12471
|
};
|
|
11323
12472
|
//#endregion
|
|
11324
12473
|
//#region ../../packages/project-builder-lib/dist/parser/parser.js
|
|
@@ -16788,6 +17937,37 @@ function previewIssueFix(issue, container) {
|
|
|
16788
17937
|
return diffSerializedDefinitions(schema, serializeSchema(schema, definition), serializeSchema(schema, fixedDefinition));
|
|
16789
17938
|
}
|
|
16790
17939
|
//#endregion
|
|
17940
|
+
//#region ../../packages/project-builder-lib/dist/parser/definition-issue-checkers/library-ref-type-checker.js
|
|
17941
|
+
/**
|
|
17942
|
+
* Checks that web apps only reference libraries of type `react-library`.
|
|
17943
|
+
*
|
|
17944
|
+
* `libraryRefs` and `componentsLibraryRef` accept any library entity, but
|
|
17945
|
+
* only a react-library package can be imported by a web app's generated code.
|
|
17946
|
+
*/
|
|
17947
|
+
function checkLibraryRefType(container) {
|
|
17948
|
+
const { apps, libraries } = container.definition;
|
|
17949
|
+
const issues = [];
|
|
17950
|
+
const webApps = apps.filter((app) => app.type === "web");
|
|
17951
|
+
for (const app of webApps) {
|
|
17952
|
+
for (const [refIndex, libraryId] of app.libraryRefs.entries()) {
|
|
17953
|
+
const library = libraries.find((lib) => lib.id === libraryId);
|
|
17954
|
+
if (!library || library.type === "react-library") continue;
|
|
17955
|
+
issues.push(createEntityIssue(container, app.id, ["libraryRefs", refIndex], {
|
|
17956
|
+
message: `App '${app.name}' references library '${library.name}' which is not a React library and cannot be imported`,
|
|
17957
|
+
severity: "error"
|
|
17958
|
+
}));
|
|
17959
|
+
}
|
|
17960
|
+
if (app.componentsLibraryRef) {
|
|
17961
|
+
const library = libraries.find((lib) => lib.id === app.componentsLibraryRef);
|
|
17962
|
+
if (library && library.type !== "react-library") issues.push(createEntityIssue(container, app.id, ["componentsLibraryRef"], {
|
|
17963
|
+
message: `App '${app.name}' references library '${library.name}' as its components library, which is not a React library`,
|
|
17964
|
+
severity: "error"
|
|
17965
|
+
}));
|
|
17966
|
+
}
|
|
17967
|
+
}
|
|
17968
|
+
return issues;
|
|
17969
|
+
}
|
|
17970
|
+
//#endregion
|
|
16791
17971
|
//#region ../../packages/project-builder-lib/dist/parser/definition-issue-checkers/mutation-roles-checker.js
|
|
16792
17972
|
var MUTATION_METHODS = [
|
|
16793
17973
|
"create",
|
|
@@ -16977,7 +18157,8 @@ var BUILT_IN_CHECKERS = [
|
|
|
16977
18157
|
checkRelationTypeMismatch,
|
|
16978
18158
|
checkMutationRoles,
|
|
16979
18159
|
checkPluginDependencies,
|
|
16980
|
-
checkPluginImplementations
|
|
18160
|
+
checkPluginImplementations,
|
|
18161
|
+
checkLibraryRefType
|
|
16981
18162
|
];
|
|
16982
18163
|
/**
|
|
16983
18164
|
* Splits issues into errors (block save) and warnings (block sync only).
|
|
@@ -17597,215 +18778,8 @@ function applyDefinitionDiff(current, diff, configuration) {
|
|
|
17597
18778
|
//#region ../../packages/project-builder-lib/dist/utils/theme.js
|
|
17598
18779
|
var import_inflection = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
17599
18780
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17600
|
-
exports.
|
|
17601
|
-
|
|
17602
|
-
* @description This is a list of nouns that use the same form for both singular and plural.
|
|
17603
|
-
* This list should remain entirely in lower case to correctly match Strings.
|
|
17604
|
-
*/
|
|
17605
|
-
var uncountableWords = [
|
|
17606
|
-
"accommodation",
|
|
17607
|
-
"adulthood",
|
|
17608
|
-
"advertising",
|
|
17609
|
-
"advice",
|
|
17610
|
-
"aggression",
|
|
17611
|
-
"aid",
|
|
17612
|
-
"air",
|
|
17613
|
-
"aircraft",
|
|
17614
|
-
"alcohol",
|
|
17615
|
-
"anger",
|
|
17616
|
-
"applause",
|
|
17617
|
-
"arithmetic",
|
|
17618
|
-
"assistance",
|
|
17619
|
-
"athletics",
|
|
17620
|
-
"bacon",
|
|
17621
|
-
"baggage",
|
|
17622
|
-
"beef",
|
|
17623
|
-
"biology",
|
|
17624
|
-
"blood",
|
|
17625
|
-
"botany",
|
|
17626
|
-
"bread",
|
|
17627
|
-
"butter",
|
|
17628
|
-
"carbon",
|
|
17629
|
-
"cardboard",
|
|
17630
|
-
"cash",
|
|
17631
|
-
"chalk",
|
|
17632
|
-
"chaos",
|
|
17633
|
-
"chess",
|
|
17634
|
-
"crossroads",
|
|
17635
|
-
"countryside",
|
|
17636
|
-
"dancing",
|
|
17637
|
-
"deer",
|
|
17638
|
-
"dignity",
|
|
17639
|
-
"dirt",
|
|
17640
|
-
"dust",
|
|
17641
|
-
"economics",
|
|
17642
|
-
"education",
|
|
17643
|
-
"electricity",
|
|
17644
|
-
"engineering",
|
|
17645
|
-
"enjoyment",
|
|
17646
|
-
"envy",
|
|
17647
|
-
"equipment",
|
|
17648
|
-
"ethics",
|
|
17649
|
-
"evidence",
|
|
17650
|
-
"evolution",
|
|
17651
|
-
"fame",
|
|
17652
|
-
"fiction",
|
|
17653
|
-
"flour",
|
|
17654
|
-
"flu",
|
|
17655
|
-
"food",
|
|
17656
|
-
"fuel",
|
|
17657
|
-
"fun",
|
|
17658
|
-
"furniture",
|
|
17659
|
-
"gallows",
|
|
17660
|
-
"garbage",
|
|
17661
|
-
"garlic",
|
|
17662
|
-
"genetics",
|
|
17663
|
-
"gold",
|
|
17664
|
-
"golf",
|
|
17665
|
-
"gossip",
|
|
17666
|
-
"gratitude",
|
|
17667
|
-
"grief",
|
|
17668
|
-
"guilt",
|
|
17669
|
-
"gymnastics",
|
|
17670
|
-
"happiness",
|
|
17671
|
-
"hardware",
|
|
17672
|
-
"harm",
|
|
17673
|
-
"hate",
|
|
17674
|
-
"hatred",
|
|
17675
|
-
"health",
|
|
17676
|
-
"heat",
|
|
17677
|
-
"help",
|
|
17678
|
-
"homework",
|
|
17679
|
-
"honesty",
|
|
17680
|
-
"honey",
|
|
17681
|
-
"hospitality",
|
|
17682
|
-
"housework",
|
|
17683
|
-
"humour",
|
|
17684
|
-
"hunger",
|
|
17685
|
-
"hydrogen",
|
|
17686
|
-
"ice",
|
|
17687
|
-
"importance",
|
|
17688
|
-
"inflation",
|
|
17689
|
-
"information",
|
|
17690
|
-
"innocence",
|
|
17691
|
-
"iron",
|
|
17692
|
-
"irony",
|
|
17693
|
-
"jam",
|
|
17694
|
-
"jewelry",
|
|
17695
|
-
"judo",
|
|
17696
|
-
"karate",
|
|
17697
|
-
"knowledge",
|
|
17698
|
-
"lack",
|
|
17699
|
-
"laughter",
|
|
17700
|
-
"lava",
|
|
17701
|
-
"leather",
|
|
17702
|
-
"leisure",
|
|
17703
|
-
"lightning",
|
|
17704
|
-
"linguine",
|
|
17705
|
-
"linguini",
|
|
17706
|
-
"linguistics",
|
|
17707
|
-
"literature",
|
|
17708
|
-
"litter",
|
|
17709
|
-
"livestock",
|
|
17710
|
-
"logic",
|
|
17711
|
-
"loneliness",
|
|
17712
|
-
"luck",
|
|
17713
|
-
"luggage",
|
|
17714
|
-
"macaroni",
|
|
17715
|
-
"machinery",
|
|
17716
|
-
"magic",
|
|
17717
|
-
"management",
|
|
17718
|
-
"mankind",
|
|
17719
|
-
"marble",
|
|
17720
|
-
"mathematics",
|
|
17721
|
-
"mayonnaise",
|
|
17722
|
-
"measles",
|
|
17723
|
-
"methane",
|
|
17724
|
-
"milk",
|
|
17725
|
-
"minus",
|
|
17726
|
-
"money",
|
|
17727
|
-
"mud",
|
|
17728
|
-
"music",
|
|
17729
|
-
"mumps",
|
|
17730
|
-
"nature",
|
|
17731
|
-
"news",
|
|
17732
|
-
"nitrogen",
|
|
17733
|
-
"nonsense",
|
|
17734
|
-
"nurture",
|
|
17735
|
-
"nutrition",
|
|
17736
|
-
"obedience",
|
|
17737
|
-
"obesity",
|
|
17738
|
-
"oxygen",
|
|
17739
|
-
"pasta",
|
|
17740
|
-
"patience",
|
|
17741
|
-
"physics",
|
|
17742
|
-
"poetry",
|
|
17743
|
-
"pollution",
|
|
17744
|
-
"poverty",
|
|
17745
|
-
"pride",
|
|
17746
|
-
"psychology",
|
|
17747
|
-
"publicity",
|
|
17748
|
-
"punctuation",
|
|
17749
|
-
"quartz",
|
|
17750
|
-
"racism",
|
|
17751
|
-
"relaxation",
|
|
17752
|
-
"reliability",
|
|
17753
|
-
"research",
|
|
17754
|
-
"respect",
|
|
17755
|
-
"revenge",
|
|
17756
|
-
"rice",
|
|
17757
|
-
"rubbish",
|
|
17758
|
-
"rum",
|
|
17759
|
-
"safety",
|
|
17760
|
-
"scenery",
|
|
17761
|
-
"seafood",
|
|
17762
|
-
"seaside",
|
|
17763
|
-
"series",
|
|
17764
|
-
"shame",
|
|
17765
|
-
"sheep",
|
|
17766
|
-
"shopping",
|
|
17767
|
-
"sleep",
|
|
17768
|
-
"smoke",
|
|
17769
|
-
"smoking",
|
|
17770
|
-
"snow",
|
|
17771
|
-
"soap",
|
|
17772
|
-
"software",
|
|
17773
|
-
"soil",
|
|
17774
|
-
"spaghetti",
|
|
17775
|
-
"species",
|
|
17776
|
-
"steam",
|
|
17777
|
-
"stuff",
|
|
17778
|
-
"stupidity",
|
|
17779
|
-
"sunshine",
|
|
17780
|
-
"symmetry",
|
|
17781
|
-
"tennis",
|
|
17782
|
-
"thirst",
|
|
17783
|
-
"thunder",
|
|
17784
|
-
"timber",
|
|
17785
|
-
"traffic",
|
|
17786
|
-
"transportation",
|
|
17787
|
-
"trust",
|
|
17788
|
-
"underwear",
|
|
17789
|
-
"unemployment",
|
|
17790
|
-
"unity",
|
|
17791
|
-
"validity",
|
|
17792
|
-
"veal",
|
|
17793
|
-
"vegetation",
|
|
17794
|
-
"vegetarianism",
|
|
17795
|
-
"vengeance",
|
|
17796
|
-
"violence",
|
|
17797
|
-
"vitality",
|
|
17798
|
-
"warmth",
|
|
17799
|
-
"wealth",
|
|
17800
|
-
"weather",
|
|
17801
|
-
"welfare",
|
|
17802
|
-
"wheat",
|
|
17803
|
-
"wildlife",
|
|
17804
|
-
"wisdom",
|
|
17805
|
-
"yoga",
|
|
17806
|
-
"zinc",
|
|
17807
|
-
"zoology"
|
|
17808
|
-
];
|
|
18781
|
+
exports.underscore = underscore;
|
|
18782
|
+
exports.dasherize = dasherize;
|
|
17809
18783
|
/**
|
|
17810
18784
|
* @description These rules translate from the singular form of a noun to its plural form.
|
|
17811
18785
|
*/
|
|
@@ -17863,6 +18837,7 @@ var import_inflection = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17863
18837
|
tium: /* @__PURE__ */ new RegExp("([ti])um$", "gi"),
|
|
17864
18838
|
sis: /* @__PURE__ */ new RegExp("sis$", "gi"),
|
|
17865
18839
|
ffe: /* @__PURE__ */ new RegExp("(?:([^f])fe|([lr])f)$", "gi"),
|
|
18840
|
+
focus: /* @__PURE__ */ new RegExp("^(focus)$", "gi"),
|
|
17866
18841
|
hive: /* @__PURE__ */ new RegExp("(hi|ti)ve$", "gi"),
|
|
17867
18842
|
aeiouyy: /* @__PURE__ */ new RegExp("([^aeiouy]|qu)y$", "gi"),
|
|
17868
18843
|
x: /* @__PURE__ */ new RegExp("(x|ch|ss|sh)$", "gi"),
|
|
@@ -17880,290 +18855,12 @@ var import_inflection = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17880
18855
|
common: /* @__PURE__ */ new RegExp("$", "gi")
|
|
17881
18856
|
}
|
|
17882
18857
|
};
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
[regex.plural.people],
|
|
17886
|
-
[regex.plural.children],
|
|
17887
|
-
[regex.plural.tia],
|
|
17888
|
-
[regex.plural.analyses],
|
|
17889
|
-
[regex.plural.databases],
|
|
17890
|
-
[regex.plural.drives],
|
|
17891
|
-
[regex.plural.hives],
|
|
17892
|
-
[regex.plural.curves],
|
|
17893
|
-
[regex.plural.lrves],
|
|
17894
|
-
[regex.plural.foves],
|
|
17895
|
-
[regex.plural.aeiouyies],
|
|
17896
|
-
[regex.plural.series],
|
|
17897
|
-
[regex.plural.movies],
|
|
17898
|
-
[regex.plural.xes],
|
|
17899
|
-
[regex.plural.mice],
|
|
17900
|
-
[regex.plural.buses],
|
|
17901
|
-
[regex.plural.oes],
|
|
17902
|
-
[regex.plural.shoes],
|
|
17903
|
-
[regex.plural.crises],
|
|
17904
|
-
[regex.plural.octopuses],
|
|
17905
|
-
[regex.plural.aliases],
|
|
17906
|
-
[regex.plural.summonses],
|
|
17907
|
-
[regex.plural.oxen],
|
|
17908
|
-
[regex.plural.matrices],
|
|
17909
|
-
[regex.plural.feet],
|
|
17910
|
-
[regex.plural.teeth],
|
|
17911
|
-
[regex.plural.geese],
|
|
17912
|
-
[regex.plural.quizzes],
|
|
17913
|
-
[regex.plural.whereases],
|
|
17914
|
-
[regex.plural.criteria],
|
|
17915
|
-
[regex.plural.genera],
|
|
17916
|
-
[regex.singular.man, "$1en"],
|
|
17917
|
-
[regex.singular.person, "$1ople"],
|
|
17918
|
-
[regex.singular.child, "$1ren"],
|
|
17919
|
-
[regex.singular.drive, "$1s"],
|
|
17920
|
-
[regex.singular.ox, "$1en"],
|
|
17921
|
-
[regex.singular.axis, "$1es"],
|
|
17922
|
-
[regex.singular.octopus, "$1uses"],
|
|
17923
|
-
[regex.singular.alias, "$1es"],
|
|
17924
|
-
[regex.singular.summons, "$1es"],
|
|
17925
|
-
[regex.singular.bus, "$1ses"],
|
|
17926
|
-
[regex.singular.buffalo, "$1oes"],
|
|
17927
|
-
[regex.singular.tium, "$1a"],
|
|
17928
|
-
[regex.singular.sis, "ses"],
|
|
17929
|
-
[regex.singular.ffe, "$1$2ves"],
|
|
17930
|
-
[regex.singular.hive, "$1ves"],
|
|
17931
|
-
[regex.singular.aeiouyy, "$1ies"],
|
|
17932
|
-
[regex.singular.matrix, "$1ices"],
|
|
17933
|
-
[regex.singular.vertex, "$1ices"],
|
|
17934
|
-
[regex.singular.x, "$1es"],
|
|
17935
|
-
[regex.singular.mouse, "$1ice"],
|
|
17936
|
-
[regex.singular.foot, "feet"],
|
|
17937
|
-
[regex.singular.tooth, "teeth"],
|
|
17938
|
-
[regex.singular.goose, "geese"],
|
|
17939
|
-
[regex.singular.quiz, "$1zes"],
|
|
17940
|
-
[regex.singular.whereas, "$1es"],
|
|
17941
|
-
[regex.singular.criterion, "$1a"],
|
|
17942
|
-
[regex.singular.genus, "genera"],
|
|
17943
|
-
[regex.singular.s, "s"],
|
|
17944
|
-
[regex.singular.common, "s"]
|
|
17945
|
-
];
|
|
17946
|
-
/**
|
|
17947
|
-
* @description These rules translate from the plural form of a noun to its singular form.
|
|
17948
|
-
*/
|
|
17949
|
-
var singularRules = [
|
|
17950
|
-
[regex.singular.man],
|
|
17951
|
-
[regex.singular.person],
|
|
17952
|
-
[regex.singular.child],
|
|
17953
|
-
[regex.singular.drive],
|
|
17954
|
-
[regex.singular.ox],
|
|
17955
|
-
[regex.singular.axis],
|
|
17956
|
-
[regex.singular.octopus],
|
|
17957
|
-
[regex.singular.alias],
|
|
17958
|
-
[regex.singular.summons],
|
|
17959
|
-
[regex.singular.bus],
|
|
17960
|
-
[regex.singular.buffalo],
|
|
17961
|
-
[regex.singular.tium],
|
|
17962
|
-
[regex.singular.sis],
|
|
17963
|
-
[regex.singular.ffe],
|
|
17964
|
-
[regex.singular.hive],
|
|
17965
|
-
[regex.singular.aeiouyy],
|
|
17966
|
-
[regex.singular.x],
|
|
17967
|
-
[regex.singular.matrix],
|
|
17968
|
-
[regex.singular.mouse],
|
|
17969
|
-
[regex.singular.foot],
|
|
17970
|
-
[regex.singular.tooth],
|
|
17971
|
-
[regex.singular.goose],
|
|
17972
|
-
[regex.singular.quiz],
|
|
17973
|
-
[regex.singular.whereas],
|
|
17974
|
-
[regex.singular.criterion],
|
|
17975
|
-
[regex.singular.genus],
|
|
17976
|
-
[regex.plural.men, "$1an"],
|
|
17977
|
-
[regex.plural.people, "$1rson"],
|
|
17978
|
-
[regex.plural.children, "$1"],
|
|
17979
|
-
[regex.plural.databases, "$1"],
|
|
17980
|
-
[regex.plural.drives, "$1"],
|
|
17981
|
-
[regex.plural.genera, "genus"],
|
|
17982
|
-
[regex.plural.criteria, "$1on"],
|
|
17983
|
-
[regex.plural.tia, "$1um"],
|
|
17984
|
-
[regex.plural.analyses, "$1$2sis"],
|
|
17985
|
-
[regex.plural.hives, "$1ve"],
|
|
17986
|
-
[regex.plural.curves, "$1"],
|
|
17987
|
-
[regex.plural.lrves, "$1f"],
|
|
17988
|
-
[regex.plural.aves, "$1ve"],
|
|
17989
|
-
[regex.plural.foves, "$1fe"],
|
|
17990
|
-
[regex.plural.movies, "$1ovie"],
|
|
17991
|
-
[regex.plural.aeiouyies, "$1y"],
|
|
17992
|
-
[regex.plural.series, "$1eries"],
|
|
17993
|
-
[regex.plural.xes, "$1"],
|
|
17994
|
-
[regex.plural.mice, "$1ouse"],
|
|
17995
|
-
[regex.plural.buses, "$1"],
|
|
17996
|
-
[regex.plural.oes, "$1"],
|
|
17997
|
-
[regex.plural.shoes, "$1"],
|
|
17998
|
-
[regex.plural.crises, "$1is"],
|
|
17999
|
-
[regex.plural.octopuses, "$1us"],
|
|
18000
|
-
[regex.plural.aliases, "$1"],
|
|
18001
|
-
[regex.plural.summonses, "$1"],
|
|
18002
|
-
[regex.plural.oxen, "$1"],
|
|
18003
|
-
[regex.plural.matrices, "$1ix"],
|
|
18004
|
-
[regex.plural.vertices, "$1ex"],
|
|
18005
|
-
[regex.plural.feet, "foot"],
|
|
18006
|
-
[regex.plural.teeth, "tooth"],
|
|
18007
|
-
[regex.plural.geese, "goose"],
|
|
18008
|
-
[regex.plural.quizzes, "$1"],
|
|
18009
|
-
[regex.plural.whereases, "$1"],
|
|
18010
|
-
[regex.plural.ss, "ss"],
|
|
18011
|
-
[regex.plural.s, ""]
|
|
18012
|
-
];
|
|
18013
|
-
/**
|
|
18014
|
-
* @description This is a list of words that should not be capitalized for title case.
|
|
18015
|
-
*/
|
|
18016
|
-
var nonTitlecasedWords = [
|
|
18017
|
-
"and",
|
|
18018
|
-
"or",
|
|
18019
|
-
"nor",
|
|
18020
|
-
"a",
|
|
18021
|
-
"an",
|
|
18022
|
-
"the",
|
|
18023
|
-
"so",
|
|
18024
|
-
"but",
|
|
18025
|
-
"to",
|
|
18026
|
-
"of",
|
|
18027
|
-
"at",
|
|
18028
|
-
"by",
|
|
18029
|
-
"from",
|
|
18030
|
-
"into",
|
|
18031
|
-
"on",
|
|
18032
|
-
"onto",
|
|
18033
|
-
"off",
|
|
18034
|
-
"out",
|
|
18035
|
-
"in",
|
|
18036
|
-
"over",
|
|
18037
|
-
"with",
|
|
18038
|
-
"for"
|
|
18039
|
-
];
|
|
18040
|
-
/**
|
|
18041
|
-
* @description These are regular expressions used for converting between String formats.
|
|
18042
|
-
*/
|
|
18043
|
-
var idSuffix = /* @__PURE__ */ new RegExp("(_ids|_id)$", "g");
|
|
18044
|
-
var underbar = /* @__PURE__ */ new RegExp("_", "g");
|
|
18858
|
+
regex.plural.men, regex.plural.people, regex.plural.children, regex.plural.tia, regex.plural.analyses, regex.plural.databases, regex.plural.drives, regex.plural.hives, regex.plural.curves, regex.plural.lrves, regex.plural.foves, regex.plural.aeiouyies, regex.plural.series, regex.plural.movies, regex.plural.xes, regex.plural.mice, regex.plural.buses, regex.plural.oes, regex.plural.shoes, regex.plural.crises, regex.plural.octopuses, regex.plural.aliases, regex.plural.summonses, regex.plural.oxen, regex.plural.matrices, regex.plural.feet, regex.plural.teeth, regex.plural.geese, regex.plural.quizzes, regex.plural.whereases, regex.plural.criteria, regex.plural.genera, regex.singular.man, regex.singular.person, regex.singular.child, regex.singular.drive, regex.singular.ox, regex.singular.axis, regex.singular.octopus, regex.singular.alias, regex.singular.summons, regex.singular.bus, regex.singular.buffalo, regex.singular.tium, regex.singular.sis, regex.singular.ffe, regex.singular.focus, regex.singular.hive, regex.singular.aeiouyy, regex.singular.matrix, regex.singular.vertex, regex.singular.x, regex.singular.mouse, regex.singular.foot, regex.singular.tooth, regex.singular.goose, regex.singular.quiz, regex.singular.whereas, regex.singular.criterion, regex.singular.genus, regex.singular.s, regex.singular.common;
|
|
18859
|
+
regex.singular.man, regex.singular.person, regex.singular.child, regex.singular.drive, regex.singular.ox, regex.singular.axis, regex.singular.octopus, regex.singular.alias, regex.singular.summons, regex.singular.bus, regex.singular.buffalo, regex.singular.tium, regex.singular.sis, regex.singular.ffe, regex.singular.focus, regex.singular.hive, regex.singular.aeiouyy, regex.singular.x, regex.singular.matrix, regex.singular.mouse, regex.singular.foot, regex.singular.tooth, regex.singular.goose, regex.singular.quiz, regex.singular.whereas, regex.singular.criterion, regex.singular.genus, regex.plural.men, regex.plural.people, regex.plural.children, regex.plural.databases, regex.plural.drives, regex.plural.genera, regex.plural.criteria, regex.plural.tia, regex.plural.analyses, regex.plural.hives, regex.plural.curves, regex.plural.lrves, regex.plural.aves, regex.plural.foves, regex.plural.movies, regex.plural.aeiouyies, regex.plural.series, regex.plural.xes, regex.plural.mice, regex.plural.buses, regex.plural.oes, regex.plural.shoes, regex.plural.crises, regex.plural.octopuses, regex.plural.aliases, regex.plural.summonses, regex.plural.oxen, regex.plural.matrices, regex.plural.vertices, regex.plural.feet, regex.plural.teeth, regex.plural.geese, regex.plural.quizzes, regex.plural.whereases, regex.plural.ss, regex.plural.s;
|
|
18045
18860
|
var spaceOrUnderbar = /* @__PURE__ */ new RegExp("[ _]", "g");
|
|
18046
18861
|
var uppercase = /* @__PURE__ */ new RegExp("([A-Z])", "g");
|
|
18047
18862
|
var underbarPrefix = /* @__PURE__ */ new RegExp("^_");
|
|
18048
18863
|
/**
|
|
18049
|
-
* A helper method that applies rules based replacement to a String.
|
|
18050
|
-
* @param str String to modify and return based on the passed rules.
|
|
18051
|
-
* @param rules Regexp to match paired with String to use for replacement
|
|
18052
|
-
* @param skip Strings to skip if they match
|
|
18053
|
-
* @param override String to return as though this method succeeded (used to conform to APIs)
|
|
18054
|
-
* @returns Return passed String modified by passed rules.
|
|
18055
|
-
* @example
|
|
18056
|
-
*
|
|
18057
|
-
* applyRules( 'cows', singular_rules ); // === 'cow'
|
|
18058
|
-
*/
|
|
18059
|
-
function applyRules(str, rules, skip, override) {
|
|
18060
|
-
if (override) return override;
|
|
18061
|
-
else {
|
|
18062
|
-
if (skip.includes(str.toLocaleLowerCase())) return str;
|
|
18063
|
-
for (const rule of rules) if (str.match(rule[0])) {
|
|
18064
|
-
if (rule[1] !== void 0) return str.replace(rule[0], rule[1]);
|
|
18065
|
-
return str;
|
|
18066
|
-
}
|
|
18067
|
-
}
|
|
18068
|
-
return str;
|
|
18069
|
-
}
|
|
18070
|
-
/**
|
|
18071
|
-
* This function adds pluralization support to every String object.
|
|
18072
|
-
* @param str The subject string.
|
|
18073
|
-
* @param plural Overrides normal output with said String.(optional)
|
|
18074
|
-
* @returns Singular English language nouns are returned in plural form.
|
|
18075
|
-
* @example
|
|
18076
|
-
*
|
|
18077
|
-
* const inflection = require( 'inflection' );
|
|
18078
|
-
*
|
|
18079
|
-
* inflection.pluralize( 'person' ); // === 'people'
|
|
18080
|
-
* inflection.pluralize( 'octopus' ); // === 'octopuses'
|
|
18081
|
-
* inflection.pluralize( 'Hat' ); // === 'Hats'
|
|
18082
|
-
* inflection.pluralize( 'person', 'guys' ); // === 'guys'
|
|
18083
|
-
*/
|
|
18084
|
-
function pluralize(str, plural) {
|
|
18085
|
-
return applyRules(str, pluralRules, uncountableWords, plural);
|
|
18086
|
-
}
|
|
18087
|
-
exports.pluralize = pluralize;
|
|
18088
|
-
/**
|
|
18089
|
-
* This function adds singularization support to every String object.
|
|
18090
|
-
* @param str The subject string.
|
|
18091
|
-
* @param singular Overrides normal output with said String.(optional)
|
|
18092
|
-
* @returns Plural English language nouns are returned in singular form.
|
|
18093
|
-
* @example
|
|
18094
|
-
*
|
|
18095
|
-
* const inflection = require( 'inflection' );
|
|
18096
|
-
*
|
|
18097
|
-
* inflection.singularize( 'people' ); // === 'person'
|
|
18098
|
-
* inflection.singularize( 'octopuses' ); // === 'octopus'
|
|
18099
|
-
* inflection.singularize( 'Hats' ); // === 'Hat'
|
|
18100
|
-
* inflection.singularize( 'guys', 'person' ); // === 'person'
|
|
18101
|
-
*/
|
|
18102
|
-
function singularize(str, singular) {
|
|
18103
|
-
return applyRules(str, singularRules, uncountableWords, singular);
|
|
18104
|
-
}
|
|
18105
|
-
exports.singularize = singularize;
|
|
18106
|
-
/**
|
|
18107
|
-
* This function will pluralize or singularlize a String appropriately based on a number value
|
|
18108
|
-
* @param str The subject string.
|
|
18109
|
-
* @param count The number to base pluralization off of.
|
|
18110
|
-
* @param singular Overrides normal output with said String.(optional)
|
|
18111
|
-
* @param plural Overrides normal output with said String.(optional)
|
|
18112
|
-
* @returns English language nouns are returned in the plural or singular form based on the count.
|
|
18113
|
-
* @example
|
|
18114
|
-
*
|
|
18115
|
-
* const inflection = require( 'inflection' );
|
|
18116
|
-
*
|
|
18117
|
-
* inflection.inflect( 'people' 1 ); // === 'person'
|
|
18118
|
-
* inflection.inflect( 'octopuses' 1 ); // === 'octopus'
|
|
18119
|
-
* inflection.inflect( 'Hats' 1 ); // === 'Hat'
|
|
18120
|
-
* inflection.inflect( 'guys', 1 , 'person' ); // === 'person'
|
|
18121
|
-
* inflection.inflect( 'inches', 1.5 ); // === 'inches'
|
|
18122
|
-
* inflection.inflect( 'person', 2 ); // === 'people'
|
|
18123
|
-
* inflection.inflect( 'octopus', 2 ); // === 'octopuses'
|
|
18124
|
-
* inflection.inflect( 'Hat', 2 ); // === 'Hats'
|
|
18125
|
-
* inflection.inflect( 'person', 2, null, 'guys' ); // === 'guys'
|
|
18126
|
-
*/
|
|
18127
|
-
function inflect(str, count, singular, plural) {
|
|
18128
|
-
if (isNaN(count)) return str;
|
|
18129
|
-
if (count === 1) return applyRules(str, singularRules, uncountableWords, singular);
|
|
18130
|
-
else return applyRules(str, pluralRules, uncountableWords, plural);
|
|
18131
|
-
}
|
|
18132
|
-
exports.inflect = inflect;
|
|
18133
|
-
/**
|
|
18134
|
-
* This function adds camelization support to every String object.
|
|
18135
|
-
* @param str The subject string.
|
|
18136
|
-
* @param lowFirstLetter Default is to capitalize the first letter of the results.(optional)
|
|
18137
|
-
* Passing true will lowercase it.
|
|
18138
|
-
* @returns Lower case underscored words will be returned in camel case.
|
|
18139
|
-
* additionally '/' is translated to '::'
|
|
18140
|
-
* @example
|
|
18141
|
-
*
|
|
18142
|
-
* const inflection = require( 'inflection' );
|
|
18143
|
-
*
|
|
18144
|
-
* inflection.camelize( 'message_properties' ); // === 'MessageProperties'
|
|
18145
|
-
* inflection.camelize( 'message_properties', true ); // === 'messageProperties'
|
|
18146
|
-
*/
|
|
18147
|
-
function camelize(str, lowFirstLetter) {
|
|
18148
|
-
const strPath = str.split("/");
|
|
18149
|
-
const j = strPath.length;
|
|
18150
|
-
let strArr, k, l, first;
|
|
18151
|
-
for (let i = 0; i < j; i++) {
|
|
18152
|
-
strArr = strPath[i].split("_");
|
|
18153
|
-
k = 0;
|
|
18154
|
-
l = strArr.length;
|
|
18155
|
-
for (; k < l; k++) {
|
|
18156
|
-
if (k !== 0) strArr[k] = strArr[k].toLowerCase();
|
|
18157
|
-
first = strArr[k].charAt(0);
|
|
18158
|
-
first = lowFirstLetter && i === 0 && k === 0 ? first.toLowerCase() : first.toUpperCase();
|
|
18159
|
-
strArr[k] = first + strArr[k].substring(1);
|
|
18160
|
-
}
|
|
18161
|
-
strPath[i] = strArr.join("");
|
|
18162
|
-
}
|
|
18163
|
-
return strPath.join("::");
|
|
18164
|
-
}
|
|
18165
|
-
exports.camelize = camelize;
|
|
18166
|
-
/**
|
|
18167
18864
|
* This function adds underscore support to every String object.
|
|
18168
18865
|
* @param str The subject string.
|
|
18169
18866
|
* @param allUpperCase Default is to lowercase and add underscore prefix.(optional)
|
|
@@ -18188,44 +18885,6 @@ var import_inflection = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18188
18885
|
}
|
|
18189
18886
|
return strPath.join("/").toLowerCase();
|
|
18190
18887
|
}
|
|
18191
|
-
exports.underscore = underscore;
|
|
18192
|
-
/**
|
|
18193
|
-
* This function adds humanize support to every String object.
|
|
18194
|
-
* @param str The subject string.
|
|
18195
|
-
* @param lowFirstLetter Default is to capitalize the first letter of the results.(optional)
|
|
18196
|
-
* Passing true will lowercase it.
|
|
18197
|
-
* @returns Lower case underscored words will be returned in humanized form.
|
|
18198
|
-
* @example
|
|
18199
|
-
*
|
|
18200
|
-
* const inflection = require( 'inflection' );
|
|
18201
|
-
*
|
|
18202
|
-
* inflection.humanize( 'message_properties' ); // === 'Message properties'
|
|
18203
|
-
* inflection.humanize( 'message_properties', true ); // === 'message properties'
|
|
18204
|
-
*/
|
|
18205
|
-
function humanize(str, lowFirstLetter) {
|
|
18206
|
-
str = str.toLowerCase();
|
|
18207
|
-
str = str.replace(idSuffix, "");
|
|
18208
|
-
str = str.replace(underbar, " ");
|
|
18209
|
-
if (!lowFirstLetter) str = capitalize(str);
|
|
18210
|
-
return str;
|
|
18211
|
-
}
|
|
18212
|
-
exports.humanize = humanize;
|
|
18213
|
-
/**
|
|
18214
|
-
* This function adds capitalization support to every String object.
|
|
18215
|
-
* @param str The subject string.
|
|
18216
|
-
* @returns All characters will be lower case and the first will be upper.
|
|
18217
|
-
* @example
|
|
18218
|
-
*
|
|
18219
|
-
* const inflection = require( 'inflection' );
|
|
18220
|
-
*
|
|
18221
|
-
* inflection.capitalize( 'message_properties' ); // === 'Message_properties'
|
|
18222
|
-
* inflection.capitalize( 'message properties', true ); // === 'Message properties'
|
|
18223
|
-
*/
|
|
18224
|
-
function capitalize(str) {
|
|
18225
|
-
str = str.toLowerCase();
|
|
18226
|
-
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
|
18227
|
-
}
|
|
18228
|
-
exports.capitalize = capitalize;
|
|
18229
18888
|
/**
|
|
18230
18889
|
* This function replaces underscores with dashes in the string.
|
|
18231
18890
|
* @param str The subject string.
|
|
@@ -18240,165 +18899,6 @@ var import_inflection = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18240
18899
|
function dasherize(str) {
|
|
18241
18900
|
return str.replace(spaceOrUnderbar, "-");
|
|
18242
18901
|
}
|
|
18243
|
-
exports.dasherize = dasherize;
|
|
18244
|
-
/**
|
|
18245
|
-
* This function adds titleize support to every String object.
|
|
18246
|
-
* @param str The subject string.
|
|
18247
|
-
* @returns Capitalizes words as you would for a book title.
|
|
18248
|
-
* @example
|
|
18249
|
-
*
|
|
18250
|
-
* const inflection = require( 'inflection' );
|
|
18251
|
-
*
|
|
18252
|
-
* inflection.titleize( 'message_properties' ); // === 'Message Properties'
|
|
18253
|
-
* inflection.titleize( 'message properties to keep' ); // === 'Message Properties to Keep'
|
|
18254
|
-
*/
|
|
18255
|
-
function titleize(str) {
|
|
18256
|
-
str = str.toLowerCase().replace(underbar, " ");
|
|
18257
|
-
const strArr = str.split(" ");
|
|
18258
|
-
const j = strArr.length;
|
|
18259
|
-
let d, l;
|
|
18260
|
-
for (let i = 0; i < j; i++) {
|
|
18261
|
-
d = strArr[i].split("-");
|
|
18262
|
-
l = d.length;
|
|
18263
|
-
for (let k = 0; k < l; k++) if (nonTitlecasedWords.indexOf(d[k].toLowerCase()) < 0) d[k] = capitalize(d[k]);
|
|
18264
|
-
strArr[i] = d.join("-");
|
|
18265
|
-
}
|
|
18266
|
-
str = strArr.join(" ");
|
|
18267
|
-
str = str.substring(0, 1).toUpperCase() + str.substring(1);
|
|
18268
|
-
return str;
|
|
18269
|
-
}
|
|
18270
|
-
exports.titleize = titleize;
|
|
18271
|
-
/**
|
|
18272
|
-
* This function adds demodulize support to every String object.
|
|
18273
|
-
* @param str The subject string.
|
|
18274
|
-
* @returns Removes module names leaving only class names.(Ruby style)
|
|
18275
|
-
* @example
|
|
18276
|
-
*
|
|
18277
|
-
* const inflection = require( 'inflection' );
|
|
18278
|
-
*
|
|
18279
|
-
* inflection.demodulize( 'Message::Bus::Properties' ); // === 'Properties'
|
|
18280
|
-
*/
|
|
18281
|
-
function demodulize(str) {
|
|
18282
|
-
const strArr = str.split("::");
|
|
18283
|
-
return strArr[strArr.length - 1];
|
|
18284
|
-
}
|
|
18285
|
-
exports.demodulize = demodulize;
|
|
18286
|
-
/**
|
|
18287
|
-
* This function adds tableize support to every String object.
|
|
18288
|
-
* @param str The subject string.
|
|
18289
|
-
* @returns Return camel cased words into their underscored plural form.
|
|
18290
|
-
* @example
|
|
18291
|
-
*
|
|
18292
|
-
* const inflection = require( 'inflection' );
|
|
18293
|
-
*
|
|
18294
|
-
* inflection.tableize( 'MessageBusProperty' ); // === 'message_bus_properties'
|
|
18295
|
-
*/
|
|
18296
|
-
function tableize(str) {
|
|
18297
|
-
str = underscore(str);
|
|
18298
|
-
str = pluralize(str);
|
|
18299
|
-
return str;
|
|
18300
|
-
}
|
|
18301
|
-
exports.tableize = tableize;
|
|
18302
|
-
/**
|
|
18303
|
-
* This function adds classification support to every String object.
|
|
18304
|
-
* @param str The subject string.
|
|
18305
|
-
* @returns Underscored plural nouns become the camel cased singular form.
|
|
18306
|
-
* @example
|
|
18307
|
-
*
|
|
18308
|
-
* const inflection = require( 'inflection' );
|
|
18309
|
-
*
|
|
18310
|
-
* inflection.classify( 'message_bus_properties' ); // === 'MessageBusProperty'
|
|
18311
|
-
*/
|
|
18312
|
-
function classify(str) {
|
|
18313
|
-
str = camelize(str);
|
|
18314
|
-
str = singularize(str);
|
|
18315
|
-
return str;
|
|
18316
|
-
}
|
|
18317
|
-
exports.classify = classify;
|
|
18318
|
-
/**
|
|
18319
|
-
* This function adds foreign key support to every String object.
|
|
18320
|
-
* @param str The subject string.
|
|
18321
|
-
* @param dropIdUbar Default is to seperate id with an underbar at the end of the class name,
|
|
18322
|
-
you can pass true to skip it.(optional)
|
|
18323
|
-
* @returns Underscored plural nouns become the camel cased singular form.
|
|
18324
|
-
* @example
|
|
18325
|
-
*
|
|
18326
|
-
* const inflection = require( 'inflection' );
|
|
18327
|
-
*
|
|
18328
|
-
* inflection.foreign_key( 'MessageBusProperty' ); // === 'message_bus_property_id'
|
|
18329
|
-
* inflection.foreign_key( 'MessageBusProperty', true ); // === 'message_bus_propertyid'
|
|
18330
|
-
*/
|
|
18331
|
-
function foreignKey(str, dropIdUbar) {
|
|
18332
|
-
str = demodulize(str);
|
|
18333
|
-
str = underscore(str) + (dropIdUbar ? "" : "_") + "id";
|
|
18334
|
-
return str;
|
|
18335
|
-
}
|
|
18336
|
-
exports.foreignKey = foreignKey;
|
|
18337
|
-
/**
|
|
18338
|
-
* This function adds ordinalize support to every String object.
|
|
18339
|
-
* @param str The subject string.
|
|
18340
|
-
* @returns Return all found numbers their sequence like '22nd'.
|
|
18341
|
-
* @example
|
|
18342
|
-
*
|
|
18343
|
-
* const inflection = require( 'inflection' );
|
|
18344
|
-
*
|
|
18345
|
-
* inflection.ordinalize( 'the 1 pitch' ); // === 'the 1st pitch'
|
|
18346
|
-
*/
|
|
18347
|
-
function ordinalize(str) {
|
|
18348
|
-
const strArr = str.split(" ");
|
|
18349
|
-
const j = strArr.length;
|
|
18350
|
-
for (let i = 0; i < j; i++) {
|
|
18351
|
-
const k = parseInt(strArr[i], 10);
|
|
18352
|
-
if (!isNaN(k)) {
|
|
18353
|
-
const ltd = strArr[i].substring(strArr[i].length - 2);
|
|
18354
|
-
const ld = strArr[i].substring(strArr[i].length - 1);
|
|
18355
|
-
let suf = "th";
|
|
18356
|
-
if (ltd != "11" && ltd != "12" && ltd != "13") {
|
|
18357
|
-
if (ld === "1") suf = "st";
|
|
18358
|
-
else if (ld === "2") suf = "nd";
|
|
18359
|
-
else if (ld === "3") suf = "rd";
|
|
18360
|
-
}
|
|
18361
|
-
strArr[i] += suf;
|
|
18362
|
-
}
|
|
18363
|
-
}
|
|
18364
|
-
return strArr.join(" ");
|
|
18365
|
-
}
|
|
18366
|
-
exports.ordinalize = ordinalize;
|
|
18367
|
-
var transformFunctions = {
|
|
18368
|
-
pluralize,
|
|
18369
|
-
singularize,
|
|
18370
|
-
camelize,
|
|
18371
|
-
underscore,
|
|
18372
|
-
humanize,
|
|
18373
|
-
capitalize,
|
|
18374
|
-
dasherize,
|
|
18375
|
-
titleize,
|
|
18376
|
-
demodulize,
|
|
18377
|
-
tableize,
|
|
18378
|
-
classify,
|
|
18379
|
-
foreignKey,
|
|
18380
|
-
ordinalize
|
|
18381
|
-
};
|
|
18382
|
-
/**
|
|
18383
|
-
* This function performs multiple inflection methods on a string
|
|
18384
|
-
* @param str The subject string.
|
|
18385
|
-
* @param arr An array of inflection methods.
|
|
18386
|
-
* @returns
|
|
18387
|
-
* @example
|
|
18388
|
-
*
|
|
18389
|
-
* const inflection = require( 'inflection' );
|
|
18390
|
-
*
|
|
18391
|
-
* inflection.transform( 'all job', [ 'pluralize', 'capitalize', 'dasherize' ]); // === 'All-jobs'
|
|
18392
|
-
*/
|
|
18393
|
-
function transform(str, arr) {
|
|
18394
|
-
const j = arr.length;
|
|
18395
|
-
for (let i = 0; i < j; i++) {
|
|
18396
|
-
const methodFn = transformFunctions[arr[i]];
|
|
18397
|
-
if (methodFn) str = methodFn(str);
|
|
18398
|
-
}
|
|
18399
|
-
return str;
|
|
18400
|
-
}
|
|
18401
|
-
exports.transform = transform;
|
|
18402
18902
|
})))();
|
|
18403
18903
|
function getDefaultOklch(palettes, color) {
|
|
18404
18904
|
if ("color" in color) return convertColorNameToOklch(color.color);
|
|
@@ -18448,6 +18948,6 @@ function generateDefaultTheme() {
|
|
|
18448
18948
|
};
|
|
18449
18949
|
}
|
|
18450
18950
|
//#endregion
|
|
18451
|
-
export { AVAILABLE_FLAGS, AppUtils, AuthorizerExpressionParseError, AuthorizerExpressionParser, BUILT_IN_ADMIN_CRUD_ACTIONS, BUILT_IN_ADMIN_CRUD_COLUMNS, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, DEFAULT_APPS_FOLDER, DEFAULT_LIBRARIES_FOLDER, DefinitionDiffArrayIncludesField, DefinitionDiffKeyedArrayField, DefinitionDiffReplacementField, DefinitionEntityType, EnumUtils, FIXED_COLOR_MAPPINGS, FeatureUtils, LibraryCompiler, LibraryUtils, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PackageCompiler, PluginSpecStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, RefExpressionParser, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS, adminCrudActionCompilerSpec, adminCrudActionEntityType, adminCrudActionSpec, adminCrudColumnCompilerSpec, adminCrudColumnEntityType, adminCrudColumnSpec, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedInputType, adminCrudEmbeddedLocalInputType, adminCrudInputCompilerSpec, adminCrudInputEntityType, adminCrudInputSpec, adminCrudSectionColumnEntityType, adminSectionEntityType, appCompilerSpec, appEntityType, applyDefinitionDiff, applyDefinitionFixes, applyExpressionRenames, applyMergedDefinition, assignEntityIds, authConfigSpec, authModelsSpec, authRoleEntityType, backendAppEntryType, baseAdminCrudActionSchema, baseAdminCrudColumnSchema, baseAdminCrudInputSchema, baseAppSchema, baseAppValidators, baseLibrarySchema, baseLibraryValidators, basePluginDefinitionSchema, baseTransformerFields, baseTransformerSchema, buildEnabledPluginFqnSet, buildModelExpressionContext, buildPackageName, checkUniqueField, checkUniqueFieldValue, cleanDefaultValues, collectDefinitionIssues, collectEntityArrays, collectEntityMetadata, collectExpressionIssues, collectFieldIssues, convertColorNameToOklch, convertHexToOklch, convertOklchToColorName, convertOklchToHex, createAdminAppSchema, createAdminCrudActionSchema, createAdminCrudActionType, createAdminCrudColumnCompiler, createAdminCrudColumnSchema, createAdminCrudColumnType, createAdminCrudDeleteActionSchema, createAdminCrudEditActionSchema, createAdminCrudEmbeddedFormSchema, createAdminCrudEmbeddedInputSchema, createAdminCrudEmbeddedLocalInputSchema, createAdminCrudEnumInputSchema, createAdminCrudForeignColumnSchema, createAdminCrudForeignInputSchema, createAdminCrudInputSchema, createAdminCrudInputType, createAdminCrudPasswordInputSchema, createAdminCrudSectionSchema, createAdminCrudTextColumnSchema, createAdminCrudTextInputSchema, createAppCompiler, createAppEntryType, createAppSchema, createAuthorizerRoleSchema, createBackendAppSchema, createBaseAdminSectionValidators, createDefinitionDiff, createDefinitionDiffConfig, createDefinitionEntityNameResolver, createDefinitionSchemaParserContext, createEmbeddedRelationTransformerSchema, createEntity, createEntityIssue, createEntityType, createEnumBaseSchema, createEnumSchema, createEnumValueSchema, createExpressionParserRef, createFeatureSchema, createFeaturesSchema, createFieldMapSpec, createIssueFixSetter, createLibraryWebConfig, createModelAuthorizerSchema, createModelBaseSchema, createModelGraphqlSchema, createModelIndexSchema, createModelRelationFieldSchema, createModelScalarFieldSchema, createModelSchema, createModelServiceSchema, createModelTransformerType, createModelUniqueConstraintSchema, createPluginFieldMap, createPluginImplementationStoreWithNewPlugins, createPluginModelSyncChecker, createPluginModule, createPluginSpec, createPluginSpecStore, createPluginWithConfigSchema, createPluginsSchema, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createRefContextSlot, createRefContextSlotMap, createRefSchemaCollector, createRefSchemaVisitor, createSettingsSchema, createTemplateExtractorSchema, createThemeSchema, createTransformerSchema, createWebAdminSectionSchema, createWebAppSchema, definitionFieldIssueRegistry, definitionFixRegistry, definitionIssueCheckerSpec, definitionRefRegistry, definitionSchema, definitionSchemaWithSlots, deleteEntity, deserializeSchemaWithTransformedReferences, diffDefinition, diffSerializedDefinitions, expressionParserCoreModule, expressionParserSpec, extractDefinitionRefs, featureEntityType, featureNameSchema, findDiscriminatedUnionMatch, findOrphanedUnionItems, fixDefinitionRefs, fixRefDeletions, formatOklch, generalSettingsSchema, generateCssBlockFromThemeColors, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getEntity, getEntityName, getLatestMigrationVersion, getManagedPluginsForPlugin, getMergeRule, getPackageDirectory, getPluginContext, getPluginDependencies, getPluginMetadataByKey, getPluginMetadataByKeyOrThrow, getUnmetPluginDependencies, getWebAppPluginData, infrastructureSettingsSchema, initializePlugins, isMigrateableProjectDefinition, libraryEntityType, libraryTypeSpec, listEntities, mergeDataWithSchema, mergeDefinition, mergeDefinitionContainer, modelAuthorizerRoleEntityType, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelIndexEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, monorepoSettingsSchema, nodeLibraryDefinitionSchemaEntry, normalizeOklch, oklchColor, paletteSchema, palettesSchema, parseAuthorizerExpression, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, partitionIssuesBySeverity, patchEntity, pluginAppCompiler, pluginConfigSpec, pluginDefaultsSpec, pluginDependencySchema, pluginEntityType, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, previewIssueFix, resolveIssuePath, rootCompilerSpec, runInPluginContext, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, sortEntityArrays, stripEmptyGeneratorChildren, stripUndefinedValues, themeColorSchema, transformDataWithSchema, undefinedIfEmpty, undefinedIfFalsy, updateEntity, validateAuthorizerExpression, validatePluginDependencyGraph, visitAuthorizerExpression, walkDataWithSchema, walkSchemaStructure, webAppEntryType, webAppSchemaExtensionSpec, webConfigSpec, withByKeyMergeRule, withDefault, withEnt, withFix, withIssueChecker, withMergeRule, withPlaceholderSlots, withRef };
|
|
18951
|
+
export { AVAILABLE_FLAGS, AppUtils, AuthorizerExpressionParseError, AuthorizerExpressionParser, BUILT_IN_ADMIN_CRUD_ACTIONS, BUILT_IN_ADMIN_CRUD_COLUMNS, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, DEFAULT_APPS_FOLDER, DEFAULT_LIBRARIES_FOLDER, DefinitionDiffArrayIncludesField, DefinitionDiffKeyedArrayField, DefinitionDiffReplacementField, DefinitionEntityType, EnumUtils, FIXED_COLOR_MAPPINGS, FeatureUtils, LibraryCompiler, LibraryUtils, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PackageCompiler, PluginSpecStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, RefExpressionParser, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS, adminCrudActionCompilerSpec, adminCrudActionEntityType, adminCrudActionSpec, adminCrudColumnCompilerSpec, adminCrudColumnEntityType, adminCrudColumnSpec, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedInputType, adminCrudEmbeddedLocalInputType, adminCrudInputCompilerSpec, adminCrudInputEntityType, adminCrudInputSpec, adminCrudSectionColumnEntityType, adminSectionEntityType, appCompilerSpec, appEntityType, applyDefinitionDiff, applyDefinitionFixes, applyExpressionRenames, applyMergedDefinition, assignEntityIds, authConfigSpec, authModelsSpec, authRoleEntityType, backendAppEntryType, baseAdminCrudActionSchema, baseAdminCrudColumnSchema, baseAdminCrudInputSchema, baseAppSchema, baseAppValidators, baseLibrarySchema, baseLibraryValidators, basePluginDefinitionSchema, baseTransformerFields, baseTransformerSchema, buildEnabledPluginFqnSet, buildModelExpressionContext, buildPackageName, checkUniqueField, checkUniqueFieldValue, cleanDefaultValues, collectDefinitionIssues, collectEntityArrays, collectEntityMetadata, collectExpressionIssues, collectFieldIssues, convertColorNameToOklch, convertHexToOklch, convertOklchToColorName, convertOklchToHex, createAdminAppSchema, createAdminCrudActionSchema, createAdminCrudActionType, createAdminCrudColumnCompiler, createAdminCrudColumnSchema, createAdminCrudColumnType, createAdminCrudDeleteActionSchema, createAdminCrudEditActionSchema, createAdminCrudEmbeddedFormSchema, createAdminCrudEmbeddedInputSchema, createAdminCrudEmbeddedLocalInputSchema, createAdminCrudEnumInputSchema, createAdminCrudForeignColumnSchema, createAdminCrudForeignInputSchema, createAdminCrudInputSchema, createAdminCrudInputType, createAdminCrudPasswordInputSchema, createAdminCrudSectionSchema, createAdminCrudTextColumnSchema, createAdminCrudTextInputSchema, createAppCompiler, createAppEntryType, createAppSchema, createAuthorizerRoleSchema, createBackendAppSchema, createBaseAdminSectionValidators, createDefinitionDiff, createDefinitionDiffConfig, createDefinitionEntityNameResolver, createDefinitionSchemaParserContext, createEmbeddedRelationTransformerSchema, createEntity, createEntityIssue, createEntityType, createEnumBaseSchema, createEnumSchema, createEnumValueSchema, createExpressionParserRef, createFeatureSchema, createFeaturesSchema, createFieldMapSpec, createIssueFixSetter, createLibraryWebConfig, createModelAuthorizerSchema, createModelBaseSchema, createModelGraphqlSchema, createModelIndexSchema, createModelRelationFieldSchema, createModelScalarFieldSchema, createModelSchema, createModelServiceSchema, createModelTransformerType, createModelUniqueConstraintSchema, createPluginFieldMap, createPluginImplementationStoreWithNewPlugins, createPluginModelSyncChecker, createPluginModule, createPluginSpec, createPluginSpecStore, createPluginWithConfigSchema, createPluginsSchema, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createRefContextSlot, createRefContextSlotMap, createRefSchemaCollector, createRefSchemaVisitor, createSettingsSchema, createTemplateExtractorSchema, createThemeSchema, createTransformerSchema, createWebAdminSectionSchema, createWebAppSchema, definitionFieldIssueRegistry, definitionFixRegistry, definitionIssueCheckerSpec, definitionRefRegistry, definitionSchema, definitionSchemaWithSlots, deleteEntity, deserializeSchemaWithTransformedReferences, diffDefinition, diffSerializedDefinitions, expressionParserCoreModule, expressionParserSpec, extractDefinitionRefs, featureEntityType, featureNameSchema, findDiscriminatedUnionMatch, findOrphanedUnionItems, fixDefinitionRefs, fixRefDeletions, formatOklch, generalSettingsSchema, generateCssBlockFromThemeColors, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getEntity, getEntityName, getLatestMigrationVersion, getManagedPluginsForPlugin, getMergeRule, getPackageDirectory, getPluginContext, getPluginDependencies, getPluginMetadataByKey, getPluginMetadataByKeyOrThrow, getUnmetPluginDependencies, getWebAppPluginData, infrastructureSettingsSchema, initializePlugins, isMigrateableProjectDefinition, libraryEntityType, libraryTypeSpec, listEntities, mergeDataWithSchema, mergeDefinition, mergeDefinitionContainer, modelAuthorizerRoleEntityType, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelIndexEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, monorepoSettingsSchema, nodeLibraryDefinitionSchemaEntry, normalizeOklch, oklchColor, paletteSchema, palettesSchema, parseAuthorizerExpression, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, partitionIssuesBySeverity, patchEntity, pluginAppCompiler, pluginConfigSpec, pluginDefaultsSpec, pluginDependencySchema, pluginEntityType, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, previewIssueFix, reactLibraryDefinitionSchemaEntry, resolveIssuePath, rootCompilerSpec, runInPluginContext, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, sortEntityArrays, stripEmptyGeneratorChildren, stripUndefinedValues, themeColorSchema, transformDataWithSchema, undefinedIfEmpty, undefinedIfFalsy, updateEntity, validateAuthorizerExpression, validatePluginDependencyGraph, visitAuthorizerExpression, walkDataWithSchema, walkSchemaStructure, webAppEntryType, webAppSchemaExtensionSpec, webConfigSpec, withByKeyMergeRule, withDefault, withEnt, withFix, withIssueChecker, withMergeRule, withPlaceholderSlots, withRef };
|
|
18452
18952
|
|
|
18453
|
-
//# sourceMappingURL=dist-
|
|
18953
|
+
//# sourceMappingURL=dist-BjxypexQ.js.map
|