nuxt-ignis 0.5.0-rc.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.data/content/contents.sqlite +0 -0
- package/.env +1 -1
- package/.nuxt/components.d.ts +414 -232
- package/.nuxt/content/components.ts +206 -108
- package/.nuxt/dev/index.mjs +1092 -726
- package/.nuxt/dev/index.mjs.map +1 -1
- package/.nuxt/dist/server/client.manifest.mjs +1 -18
- package/.nuxt/dist/server/client.precomputed.mjs +1 -0
- package/.nuxt/eslint-typegen.d.ts +115 -7
- package/.nuxt/eslint.config.d.mts +3 -3
- package/.nuxt/eslint.config.mjs +11 -11
- package/.nuxt/imports.d.ts +63 -59
- package/.nuxt/manifest/latest.json +1 -1
- package/.nuxt/manifest/meta/dev.json +1 -1
- package/.nuxt/mdc-highlighter.mjs +4 -0
- package/.nuxt/mdc-image-component.mjs +1 -1
- package/.nuxt/module/nuxt-robots.d.ts +12 -12
- package/.nuxt/module/nuxt-seo-utils.d.ts +10 -10
- package/.nuxt/module/nuxt-site-config.d.ts +11 -8
- package/.nuxt/module/nuxt-sitemap.d.ts +17 -17
- package/.nuxt/nitro.json +5 -5
- package/.nuxt/nuxt.d.ts +13 -9
- package/.nuxt/nuxt.json +2 -2
- package/.nuxt/nuxt.node.d.ts +13 -8
- package/.nuxt/tsconfig.app.json +197 -173
- package/.nuxt/tsconfig.json +199 -172
- package/.nuxt/tsconfig.node.json +108 -91
- package/.nuxt/tsconfig.server.json +131 -127
- package/.nuxt/tsconfig.shared.json +61 -56
- package/.nuxt/types/build.d.ts +2 -1
- package/.nuxt/types/components.d.ts +482 -300
- package/.nuxt/types/i18n-plugin.d.ts +2 -2
- package/.nuxt/types/imports.d.ts +689 -679
- package/.nuxt/types/modules.d.ts +36 -16
- package/.nuxt/types/nitro-imports.d.ts +250 -250
- package/.nuxt/types/nitro-nuxt.d.ts +4 -1
- package/.nuxt/types/nitro-routes.d.ts +20 -20
- package/.nuxt/types/plugins.d.ts +37 -37
- package/.nuxt/types/ui.d.ts +3 -3
- package/.nuxt/ui/drawer.ts +23 -0
- package/.nuxt/ui/progress.ts +3 -3
- package/.nuxt/ui-image-component.ts +1 -1
- package/.output/nitro.json +3 -3
- package/.output/public/_fonts/31PZhXd_YTCmsoiPQZc-xVtAWAkLogRFRj5mWplmKFE-6WsTw05QKugcwLySGc_b9CIheG8j8LRyo47qPL430Mk.woff2 +0 -0
- package/.output/public/_fonts/9FWLUGCSCYLRIRMtCzLrt4Go7DMFXOeN_pyCOJD_44Y-Yh2wNaqrq_e759vVlc3tX81lMwRu9ktkQJX_Svgs-VI.woff2 +0 -0
- package/.output/public/_fonts/BQnDL9FFy0Q_jvURlmv87luvmXLSMbSuXsfZv_R2Rkk-y5MVrLtP4J_1al8rz8R-MDaUOMAHckAWCwDrKhw25fY.woff2 +0 -0
- package/.output/public/_fonts/JSrPAbQHsQEdUrIE5Ts6fIQ2ymsa4i7HhiCpui6ulCc-_AoyGWssOn06OMh3ZY_GddBBPRny4Igxin4fT_1K6F4.woff2 +0 -0
- package/.output/public/_fonts/Jtqhy44WKYEjGWTSusP5YJfJv7Wf74QqgkBOI9u_77s-Rl_Bht5SvmaotE20bkavBEAJEEGEa0hcz3d_8yOeXmw.woff +0 -0
- package/.output/public/_fonts/M-60tFLmAJxdPjHsK-2ILWom5zPbu37lb3Qex2waL14-A9y4QcXALPi_RvQsmRsSFUxrT3_J213W4zPFIXetlbw.woff2 +0 -0
- package/.output/public/_fonts/T-ozk-QJ_Ck37B2RHPl2i-s_gAGGo7suFgagWoJ8bO4-maDXQ_nEXKAaLHm4Joud3DJR9EVzS7QXWMWK8YOTIcs.woff2 +0 -0
- package/.output/public/_fonts/TTYbISAfwy-y4uVGS9AH32sK7b2xJsoCESo64ryf8LU-y87nRMqBGo42rUOW9tWZa06o4oTa0USJrAMMoKDamgs.woff2 +0 -0
- package/.output/public/_fonts/Y_5DOsLit49q2i2tbcNxnyUen9__GPCX8mwAi03q1aA-pBCjVKDT5tBT3BJckh9uzNkfUWeUIBPz9Y8T55vcj8E.woff2 +0 -0
- package/.output/public/_fonts/ZHaz3DhCHNWhsElqYfuM71rfBBDgjuU2sd34vaYJwQg-71NZaZSGjxzAGjCMnCc2zS5rS_EGA0xHKPGCggWuXik.woff +0 -0
- package/.output/public/_fonts/h9PwCjip_BNPVO50hT4v29USWFv6H3ZlYx_IestfqgY-sYfLVuZXl9E1aYbn1S0pAr4zfdQ_WT7iBZhrgQY6N-4.woff2 +0 -0
- package/.output/public/_fonts/l00UCz_-QvI_NO8AGcu7ooAcrFDlxYUdxCSCh6gBwd4-vPjTZ3ztgw27A2TnHeCycxPvUtXWEVpG33_97ra6su8.woff2 +0 -0
- package/.output/public/_fonts/nuenOq7ZFSZ65QudJO7uQ0sOjDqow2WjfXrQh4S9gEc-uF81rxcswER5srfhzyLfPoGlKNAIt2C_BvkXFOc19rw.woff2 +0 -0
- package/.output/public/_fonts/pWMvGwciZ-EfQsfR2ueelhC7Jnt5K-8Px8PjPK0mDII-eT9iD0iZ9WWhTJs6V5GxXr0iaUwx_WxgGGriOiGb81o.woff2 +0 -0
- package/.output/public/_fonts/y3mP_zJcojQwJn30TpF_XxDzgeM6Nbk7MaRg1Ne0YcI-lFx13nqMCMgk_S70gRmwEHXlE5BLp1B4W82RpFihpMs.woff2 +0 -0
- package/.output/public/_fonts/zr3WxpLd5PmlBr7e4PWGkhZv6XTg70Pi4sCbC-CEV0Q-v2yL98XOiD3FkbiYlYYeAeTSVSkgAckeOp55Q5kHJmU.woff2 +0 -0
- package/.output/public/_ignis-config.json +1789 -1
- package/.output/public/_nuxt/0gZNo08M.js +1 -0
- package/.output/public/_nuxt/4etphg87.js +1 -0
- package/.output/public/_nuxt/7oEH3i-J.js +1 -0
- package/.output/public/_nuxt/B0GskE-x.js +1 -0
- package/.output/public/_nuxt/B2rRIZLd.js +1 -0
- package/.output/public/_nuxt/B3Twp4np.js +1 -0
- package/.output/public/_nuxt/B4dafB1u.js +1 -0
- package/.output/public/_nuxt/B5v-AhRa.js +1 -0
- package/.output/public/_nuxt/BGIWR6zS.js +1 -0
- package/.output/public/_nuxt/BPF61Z69.js +1 -0
- package/.output/public/_nuxt/BX7sSsxl.js +1 -0
- package/.output/public/_nuxt/BcGXkrpD.js +1 -0
- package/.output/public/_nuxt/Bdmjn2k2.js +1 -0
- package/.output/public/_nuxt/BkwIJBVH.js +1 -0
- package/.output/public/_nuxt/{DXBpKbsa.js → Bs7HqoDE.js} +47 -42
- package/.output/public/_nuxt/BxBcowlq.js +1 -0
- package/.output/public/_nuxt/BxjWLNqQ.js +1 -0
- package/.output/public/_nuxt/CJT046op.js +1 -0
- package/.output/public/_nuxt/CNoaFijS.js +1 -0
- package/.output/public/_nuxt/COOHDsMA.js +1 -0
- package/.output/public/_nuxt/CT_jQ1c7.js +1 -0
- package/.output/public/_nuxt/CzjEkwvT.js +1 -0
- package/.output/public/_nuxt/D0gc1iwv.js +35 -0
- package/.output/public/_nuxt/DHbdVh9f.js +94 -0
- package/.output/public/_nuxt/DPk_8xPF.js +1 -0
- package/.output/public/_nuxt/DS02jnv_.js +1 -0
- package/.output/public/_nuxt/DcZxay5W.js +1 -0
- package/.output/public/_nuxt/Dj4M1E-R.js +1 -0
- package/.output/public/_nuxt/DrlW3O6H.js +1 -0
- package/.output/public/_nuxt/DzHDVFEa.js +1 -0
- package/.output/public/_nuxt/Kgt6q5rz.js +1 -0
- package/.output/public/_nuxt/_RaG-8ca.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/458d3dfb-5eef-4d52-b92b-109ceaa7a1ab.json +1 -0
- package/.output/public/_nuxt/entry.CtpkPzPO.css +1 -0
- package/.output/public/_nuxt/error-404.DzDu4Ean.css +1 -0
- package/.output/public/_nuxt/error-500.BdNqqJx7.css +1 -0
- package/.output/public/_nuxt/nE6m0q_v.js +1 -0
- package/.output/public/_nuxt/vueform.CkWb7x1C.css +1 -0
- package/.output/public/_nuxt/wTHp3vgs.js +1 -0
- package/.output/public/_nuxt/zBYuFSAQ.js +1 -0
- package/.output/public/nuxt-spec.png +0 -0
- package/.output/server/chunks/_/error-500.mjs +1 -1
- package/.output/server/chunks/_/error-500.mjs.map +1 -1
- package/.output/server/chunks/_/nitro.mjs +624 -580
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +4 -0
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +10 -33
- package/.output/server/chunks/routes/renderer.mjs.map +1 -1
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@babel/parser/lib/index.js +212 -145
- package/.output/server/node_modules/@babel/parser/package.json +3 -3
- package/.output/server/node_modules/@poppinss/utils/package.json +1 -1
- package/.output/server/node_modules/@shikijs/core/package.json +2 -2
- package/.output/server/node_modules/@shikijs/engine-javascript/package.json +2 -2
- package/.output/server/node_modules/@shikijs/engine-oniguruma/package.json +2 -2
- package/.output/server/node_modules/@shikijs/langs/dist/javascript.mjs +1 -1
- package/.output/server/node_modules/@shikijs/langs/dist/typescript.mjs +1 -1
- package/.output/server/node_modules/@shikijs/langs/package.json +11 -3
- package/.output/server/node_modules/@shikijs/themes/package.json +3 -3
- package/.output/server/node_modules/@shikijs/transformers/package.json +3 -3
- package/.output/server/node_modules/@shikijs/types/package.json +1 -1
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +131 -96
- package/.output/server/node_modules/@vue/compiler-core/package.json +4 -4
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +4 -1
- package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +10 -1
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +4 -3
- package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +25 -27
- package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +40 -14
- package/.output/server/node_modules/@vue/runtime-dom/package.json +4 -4
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +1 -1
- package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
- package/.output/server/node_modules/@vue/shared/package.json +1 -1
- package/.output/server/node_modules/debug/package.json +1 -1
- package/.output/server/node_modules/detect-libc/lib/detect-libc.js +59 -13
- package/.output/server/node_modules/detect-libc/lib/elf.js +39 -0
- package/.output/server/node_modules/detect-libc/lib/filesystem.js +18 -8
- package/.output/server/node_modules/detect-libc/package.json +5 -2
- package/.output/server/node_modules/devalue/package.json +1 -1
- package/.output/server/node_modules/devalue/src/parse.js +7 -1
- package/.output/server/node_modules/devalue/src/uneval.js +9 -8
- package/.output/server/node_modules/fast-xml-parser/package.json +1 -1
- package/.output/server/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +297 -287
- package/.output/server/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +3 -2
- package/.output/server/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +4 -4
- package/.output/server/node_modules/image-meta/dist/index.mjs +85 -4
- package/.output/server/node_modules/image-meta/package.json +12 -12
- package/.output/server/node_modules/is-arrayish/package.json +1 -1
- package/.output/server/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -2
- package/.output/server/node_modules/node-fetch-native/dist/node.mjs +10 -10
- package/.output/server/node_modules/node-fetch-native/package.json +13 -13
- package/.output/server/node_modules/node-mock-http/dist/index.mjs +1 -1
- package/.output/server/node_modules/node-mock-http/package.json +6 -6
- package/.output/server/node_modules/oauth4webapi/build/index.js +10 -8
- package/.output/server/node_modules/oauth4webapi/package.json +12 -12
- package/.output/server/node_modules/openid-client/build/index.js +1 -1
- package/.output/server/node_modules/openid-client/package.json +7 -7
- package/.output/server/node_modules/secure-json-parse/index.js +35 -0
- package/.output/server/node_modules/secure-json-parse/package.json +2 -3
- package/.output/server/node_modules/semver/classes/semver.js +19 -5
- package/.output/server/node_modules/semver/internal/identifiers.js +4 -0
- package/.output/server/node_modules/semver/package.json +3 -3
- package/.output/server/node_modules/shiki/package.json +9 -9
- package/.output/server/node_modules/simple-swizzle/package.json +1 -1
- package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +6 -513
- package/.output/server/node_modules/unhead/package.json +5 -1
- package/.output/server/node_modules/unist-util-is/lib/index.js +10 -5
- package/.output/server/node_modules/unist-util-is/package.json +12 -9
- package/.output/server/node_modules/unist-util-visit-parents/lib/index.js +8 -7
- package/.output/server/node_modules/unist-util-visit-parents/package.json +18 -13
- package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
- package/.output/server/node_modules/vue/package.json +6 -6
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +158 -53
- package/.output/server/node_modules/vue-bundle-renderer/package.json +16 -11
- package/.output/server/node_modules/vue-router/dist/devtools-BLCumUwL.mjs +1218 -0
- package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1459 -3688
- package/.output/server/node_modules/vue-router/package.json +43 -38
- package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringifyString.js +1 -1
- package/.output/server/node_modules/yaml/package.json +2 -1
- package/.output/server/package.json +39 -39
- package/README.md +4 -0
- package/app/app.vue +2 -2
- package/app/assets/css/ignis-open-props.css +4 -5
- package/app/components/CurrentTime.vue +8 -1
- package/app/components/ignis/{IgnisInfo.vue → IgnisContent.vue} +3 -3
- package/app/components/ignis/{IgnisConfig.vue → IgnisContentConfig.vue} +5 -1
- package/app/components/ignis/IgnisContentFeatures.vue +102 -0
- package/app/components/ignis/{IgnisWelcome.vue → IgnisContentWelcome.vue} +2 -2
- package/app/components/ignis/IgnisFooter.vue +11 -3
- package/app/pages/_ignis-config.vue +1 -1
- package/app/pages/_ignis-info.vue +1 -1
- package/app/pages/_ignis-welcome.vue +1 -1
- package/app/pages/index.vue +2 -2
- package/bin/cli.js +66 -0
- package/bin/set-app-vue.js +20 -0
- package/bin/set-css.js +5 -8
- package/bin/set-eslint.js +5 -8
- package/bin/setup.js +211 -45
- package/features.ts +17 -8
- package/nuxt.config.ts +10 -5
- package/package.json +19 -21
- package/public/_ignis-config.json +1789 -1
- package/test/config/css-multiple.txt +30 -24
- package/test/config/css-nuxt-ui.txt +34 -28
- package/test/config/css-open-props.txt +1812 -1805
- package/test/config/css-single.txt +28 -22
- package/test/config/css-tailwind.txt +55 -48
- package/test/config/custom-lang.txt +27 -21
- package/test/config/db-neon.txt +28 -22
- package/test/config/db-supabase.txt +31 -25
- package/test/config/default.txt +27 -21
- package/test/config/equipment-1-composable.txt +33 -27
- package/test/config/equipment-2-plugins.txt +34 -28
- package/test/config/equipment-all.txt +38 -32
- package/test/config/forms-formkit.txt +32 -26
- package/test/config/forms-vueform.txt +28 -22
- package/test/config/i18n.txt +36 -30
- package/test/config/no-default-css.txt +24 -18
- package/test/config/open-props.txt +1811 -1804
- package/test/config/seo-ssr-false.txt +35 -29
- package/test/config/ui-nuxt-ui.txt +33 -27
- package/test/config/ui-tailwind.txt +54 -47
- package/test/features.test.ts +33 -33
- package/.nuxt/dist/server/client.manifest.json +0 -18
- package/.nuxt/i18n.options.mjs +0 -165
- package/.nuxt/nuxt-i18n-logger.mjs +0 -1
- package/.output/public/_nuxt/1soVlS0z.js +0 -1
- package/.output/public/_nuxt/B7rsWaa2.js +0 -1
- package/.output/public/_nuxt/BA2WKEAc.js +0 -1
- package/.output/public/_nuxt/BE_a_Zhd.js +0 -1
- package/.output/public/_nuxt/BFreiu22.js +0 -1
- package/.output/public/_nuxt/BLcTglbc.js +0 -1
- package/.output/public/_nuxt/Bhd4_yFT.js +0 -1
- package/.output/public/_nuxt/Bi2eMDmd.js +0 -1
- package/.output/public/_nuxt/BiUZ9mZX.js +0 -1
- package/.output/public/_nuxt/Bm30MqE0.js +0 -1
- package/.output/public/_nuxt/Bnm5Nral.js +0 -1
- package/.output/public/_nuxt/BrY1radz.js +0 -35
- package/.output/public/_nuxt/Bs3IGOdt.js +0 -1
- package/.output/public/_nuxt/ByaiRTkI.js +0 -1
- package/.output/public/_nuxt/CA578xwz.js +0 -1
- package/.output/public/_nuxt/CDttUXKg.js +0 -1
- package/.output/public/_nuxt/CSN71QT8.js +0 -1
- package/.output/public/_nuxt/CmzFGS1a.js +0 -90
- package/.output/public/_nuxt/CqCaqSd2.js +0 -1
- package/.output/public/_nuxt/D8v-efI7.js +0 -1
- package/.output/public/_nuxt/DR4hWRk7.js +0 -1
- package/.output/public/_nuxt/DRroQ-Xq.js +0 -1
- package/.output/public/_nuxt/DStnBfJS.js +0 -1
- package/.output/public/_nuxt/DXTYyv-V.js +0 -1
- package/.output/public/_nuxt/DXbccJ2T.js +0 -1
- package/.output/public/_nuxt/DeS1g0YT.js +0 -1
- package/.output/public/_nuxt/Deb6R53f.js +0 -1
- package/.output/public/_nuxt/DiDHllLr.js +0 -1
- package/.output/public/_nuxt/DyCICqRh.js +0 -1
- package/.output/public/_nuxt/DzT4wm3Y.js +0 -1
- package/.output/public/_nuxt/E8nje24C.js +0 -1
- package/.output/public/_nuxt/builds/meta/9a624d26-216d-4e69-b3a7-54b68357876f.json +0 -1
- package/.output/public/_nuxt/dJ-vStNn.js +0 -1
- package/.output/public/_nuxt/entry.jMyW6Sg0.css +0 -1
- package/.output/public/_nuxt/error-404.BGUbR0Uk.css +0 -1
- package/.output/public/_nuxt/error-500.CQfkKpQ2.css +0 -1
- package/.output/public/_nuxt/sHsV3x2B.js +0 -1
- package/.output/public/_nuxt/sQEqbbg2.js +0 -1
- package/.output/public/_nuxt/vueform.ChEauysg.css +0 -1
- package/.output/server/chunks/build/client.manifest.mjs +0 -511
- package/.output/server/chunks/build/client.manifest.mjs.map +0 -1
- package/.output/server/node_modules/vue-router/dist/vue-router.node.mjs +0 -2
- package/app/components/ignis/IgnisFeatureList.vue +0 -111
- /package/app/components/ignis/{IgnisFeature.vue → IgnisContentFeaturesDetail.vue} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import {getAllMatches, isExist} from '../util.js';
|
|
5
5
|
import xmlNode from './xmlNode.js';
|
|
6
|
-
import
|
|
6
|
+
import DocTypeReader from './DocTypeReader.js';
|
|
7
7
|
import toNumber from "strnum";
|
|
8
8
|
import getIgnoreAttributesFn from "../ignoreAttributes.js";
|
|
9
9
|
|
|
@@ -189,6 +189,7 @@ const parseXml = function(xmlData) {
|
|
|
189
189
|
let currentNode = xmlObj;
|
|
190
190
|
let textData = "";
|
|
191
191
|
let jPath = "";
|
|
192
|
+
const docTypeReader = new DocTypeReader(this.options.processEntities);
|
|
192
193
|
for(let i=0; i< xmlData.length; i++){//for each char in XML data
|
|
193
194
|
const ch = xmlData[i];
|
|
194
195
|
if(ch === '<'){
|
|
@@ -262,7 +263,7 @@ const parseXml = function(xmlData) {
|
|
|
262
263
|
}
|
|
263
264
|
i = endIndex;
|
|
264
265
|
} else if( xmlData.substr(i + 1, 2) === '!D') {
|
|
265
|
-
const result = readDocType(xmlData, i);
|
|
266
|
+
const result = docTypeReader.readDocType(xmlData, i);
|
|
266
267
|
this.docTypeEntities = result.entities;
|
|
267
268
|
i = result.i;
|
|
268
269
|
}else if(xmlData.substr(i + 1, 2) === '![') {
|
|
@@ -13,16 +13,16 @@ export default class XMLParser{
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Parse XML dats to JS object
|
|
16
|
-
* @param {string|
|
|
16
|
+
* @param {string|Uint8Array} xmlData
|
|
17
17
|
* @param {boolean|Object} validationOption
|
|
18
18
|
*/
|
|
19
19
|
parse(xmlData,validationOption){
|
|
20
|
-
if(typeof xmlData
|
|
21
|
-
}else if( xmlData.toString){
|
|
20
|
+
if(typeof xmlData !== "string" && xmlData.toString){
|
|
22
21
|
xmlData = xmlData.toString();
|
|
23
|
-
}else{
|
|
22
|
+
}else if(typeof xmlData !== "string"){
|
|
24
23
|
throw new Error("XML data is accepted in String or Bytes[] form.")
|
|
25
24
|
}
|
|
25
|
+
|
|
26
26
|
if( validationOption){
|
|
27
27
|
if(validationOption === true) validationOption = {}; //validate with default options
|
|
28
28
|
|
|
@@ -105,6 +105,89 @@ const GIF = {
|
|
|
105
105
|
})
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
const HEIC = {
|
|
109
|
+
validate: (input) => {
|
|
110
|
+
const ftypBox = findBox$1(input, "ftyp");
|
|
111
|
+
if (!ftypBox) return false;
|
|
112
|
+
const majorBrand = toUTF8String(
|
|
113
|
+
input,
|
|
114
|
+
ftypBox.offset + 8,
|
|
115
|
+
ftypBox.offset + 12
|
|
116
|
+
);
|
|
117
|
+
return ["heic", "heix", "hevc", "hevx", "mif1", "msf1"].includes(
|
|
118
|
+
majorBrand
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
calculate: (input) => {
|
|
122
|
+
const metaBox = findBox$1(input, "meta");
|
|
123
|
+
if (!metaBox) throw new TypeError("heic: meta box not found");
|
|
124
|
+
const iprpBox = findBox$1(
|
|
125
|
+
input,
|
|
126
|
+
"iprp",
|
|
127
|
+
metaBox.offset + 12,
|
|
128
|
+
metaBox.offset + metaBox.size
|
|
129
|
+
);
|
|
130
|
+
if (!iprpBox) throw new TypeError("heic: iprp box not found");
|
|
131
|
+
const ipcoBox = findBox$1(
|
|
132
|
+
input,
|
|
133
|
+
"ipco",
|
|
134
|
+
iprpBox.offset + 8,
|
|
135
|
+
iprpBox.offset + iprpBox.size
|
|
136
|
+
);
|
|
137
|
+
if (!ipcoBox) throw new TypeError("heic: ipco box not found");
|
|
138
|
+
const dimensions = findAllBoxes(
|
|
139
|
+
input,
|
|
140
|
+
"ispe",
|
|
141
|
+
ipcoBox.offset + 8,
|
|
142
|
+
ipcoBox.offset + ipcoBox.size
|
|
143
|
+
).map((box) => ({
|
|
144
|
+
width: readUInt32BE(input, box.offset + 12),
|
|
145
|
+
height: readUInt32BE(input, box.offset + 16)
|
|
146
|
+
}));
|
|
147
|
+
if (dimensions.length === 0)
|
|
148
|
+
throw new TypeError("heic: ispe box not found");
|
|
149
|
+
let largestDimension = dimensions[0];
|
|
150
|
+
for (let i = 1; i < dimensions.length; i++) {
|
|
151
|
+
const curr = dimensions[i];
|
|
152
|
+
if (curr.width * curr.height > largestDimension.width * largestDimension.height) {
|
|
153
|
+
largestDimension = curr;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return largestDimension;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
function findBox$1(input, type, startOffset = 0, endOffset = input.length) {
|
|
160
|
+
let offset = startOffset;
|
|
161
|
+
while (offset < endOffset) {
|
|
162
|
+
const size = readUInt32BE(input, offset);
|
|
163
|
+
const boxType = toUTF8String(input, offset + 4, offset + 8);
|
|
164
|
+
if (boxType === type) {
|
|
165
|
+
return { offset, size };
|
|
166
|
+
}
|
|
167
|
+
if (size <= 0 || offset + size > endOffset) {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
offset += size;
|
|
171
|
+
}
|
|
172
|
+
return void 0;
|
|
173
|
+
}
|
|
174
|
+
function findAllBoxes(input, type, startOffset = 0, endOffset = input.length) {
|
|
175
|
+
let offset = startOffset;
|
|
176
|
+
const boxes = [];
|
|
177
|
+
while (offset < endOffset) {
|
|
178
|
+
const size = readUInt32BE(input, offset);
|
|
179
|
+
const boxType = toUTF8String(input, offset + 4, offset + 8);
|
|
180
|
+
if (boxType === type) {
|
|
181
|
+
boxes.push({ offset, size });
|
|
182
|
+
}
|
|
183
|
+
if (size <= 0 || offset + size > endOffset) {
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
offset += size;
|
|
187
|
+
}
|
|
188
|
+
return boxes;
|
|
189
|
+
}
|
|
190
|
+
|
|
108
191
|
const SIZE_HEADER = 4 + 4;
|
|
109
192
|
const FILE_LENGTH_OFFSET = 4;
|
|
110
193
|
const ENTRY_LENGTH_OFFSET = 4;
|
|
@@ -199,12 +282,9 @@ const J2C = {
|
|
|
199
282
|
|
|
200
283
|
const BoxTypes = {
|
|
201
284
|
ftyp: "66747970",
|
|
202
|
-
ihdr: "69686472",
|
|
203
285
|
jp2h: "6a703268",
|
|
204
286
|
jp__: "6a502020",
|
|
205
|
-
rreq: "72726571"
|
|
206
|
-
xml_: "786d6c20"
|
|
207
|
-
};
|
|
287
|
+
rreq: "72726571"};
|
|
208
288
|
const calculateRREQLength = (box) => {
|
|
209
289
|
const unit = box[0];
|
|
210
290
|
let offset = 1 + 2 * unit;
|
|
@@ -727,6 +807,7 @@ const typeHandlers = {
|
|
|
727
807
|
cur: CUR,
|
|
728
808
|
dds: DDS,
|
|
729
809
|
gif: GIF,
|
|
810
|
+
heic: HEIC,
|
|
730
811
|
icns: ICNS,
|
|
731
812
|
ico: ICO,
|
|
732
813
|
j2c: J2C,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "image-meta",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Detect image type and size using pure javascript",
|
|
5
5
|
"repository": "unjs/image-meta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"test:types": "tsc --noEmit --skipLibCheck"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"@vitest/coverage-v8": "^
|
|
36
|
-
"changelogen": "^0.
|
|
37
|
-
"eslint": "^9.
|
|
38
|
-
"eslint-config-unjs": "^0.
|
|
39
|
-
"jiti": "^
|
|
40
|
-
"prettier": "^3.
|
|
41
|
-
"typescript": "^5.
|
|
42
|
-
"unbuild": "^
|
|
43
|
-
"vitest": "^
|
|
34
|
+
"@types/node": "^24.7.0",
|
|
35
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
36
|
+
"changelogen": "^0.6.2",
|
|
37
|
+
"eslint": "^9.37.0",
|
|
38
|
+
"eslint-config-unjs": "^0.5.0",
|
|
39
|
+
"jiti": "^2.6.1",
|
|
40
|
+
"prettier": "^3.6.2",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
42
|
+
"unbuild": "^3.6.1",
|
|
43
|
+
"vitest": "^3.2.4"
|
|
44
44
|
},
|
|
45
|
-
"packageManager": "pnpm@
|
|
45
|
+
"packageManager": "pnpm@10.18.1"
|
|
46
46
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
--`+
|
|
1
|
+
var B=Object.defineProperty;var E=(u,a)=>B(u,"name",{value:a,configurable:!0});import{FormData as V,File as Y}from"../node.mjs";import"node:http";import"node:https";import"node:zlib";import"node:stream";import"node:buffer";import"node:util";import"../shared/node-fetch-native.DfbY2q-x.mjs";import"node:url";import"node:net";import"node:fs";import"node:path";let D=0;const t={START_BOUNDARY:D++,HEADER_FIELD_START:D++,HEADER_FIELD:D++,HEADER_VALUE_START:D++,HEADER_VALUE:D++,HEADER_VALUE_ALMOST_DONE:D++,HEADERS_ALMOST_DONE:D++,PART_DATA_START:D++,PART_DATA:D++,END:D++};let w=1;const R={PART_BOUNDARY:w,LAST_BOUNDARY:w*=2},g=10,N=13,x=32,P=45,C=58,I=97,M=122,$=E(u=>u|32,"lower"),m=E(()=>{},"noop"),F=class F{constructor(a){this.index=0,this.flags=0,this.onHeaderEnd=m,this.onHeaderField=m,this.onHeadersEnd=m,this.onHeaderValue=m,this.onPartBegin=m,this.onPartData=m,this.onPartEnd=m,this.boundaryChars={},a=`\r
|
|
2
|
+
--`+a;const n=new Uint8Array(a.length);for(let r=0;r<a.length;r++)n[r]=a.charCodeAt(r),this.boundaryChars[n[r]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=t.START_BOUNDARY}write(a){let n=0;const r=a.length;let d=this.index,{lookbehind:l,boundary:c,boundaryChars:p,index:e,state:i,flags:A}=this;const H=this.boundary.length,O=H-1,y=a.length;let o,L;const f=E(h=>{this[h+"Mark"]=n},"mark"),s=E(h=>{delete this[h+"Mark"]},"clear"),T=E((h,S,_,U)=>{(S===void 0||S!==_)&&this[h](U&&U.subarray(S,_))},"callback"),b=E((h,S)=>{const _=h+"Mark";_ in this&&(S?(T(h,this[_],n,a),delete this[_]):(T(h,this[_],a.length,a),this[_]=0))},"dataCallback");for(n=0;n<r;n++)switch(o=a[n],i){case t.START_BOUNDARY:if(e===c.length-2){if(o===P)A|=R.LAST_BOUNDARY;else if(o!==N)return;e++;break}else if(e-1===c.length-2){if(A&R.LAST_BOUNDARY&&o===P)i=t.END,A=0;else if(!(A&R.LAST_BOUNDARY)&&o===g)e=0,T("onPartBegin"),i=t.HEADER_FIELD_START;else return;break}o!==c[e+2]&&(e=-2),o===c[e+2]&&e++;break;case t.HEADER_FIELD_START:i=t.HEADER_FIELD,f("onHeaderField"),e=0;case t.HEADER_FIELD:if(o===N){s("onHeaderField"),i=t.HEADERS_ALMOST_DONE;break}if(e++,o===P)break;if(o===C){if(e===1)return;b("onHeaderField",!0),i=t.HEADER_VALUE_START;break}if(L=$(o),L<I||L>M)return;break;case t.HEADER_VALUE_START:if(o===x)break;f("onHeaderValue"),i=t.HEADER_VALUE;case t.HEADER_VALUE:o===N&&(b("onHeaderValue",!0),T("onHeaderEnd"),i=t.HEADER_VALUE_ALMOST_DONE);break;case t.HEADER_VALUE_ALMOST_DONE:if(o!==g)return;i=t.HEADER_FIELD_START;break;case t.HEADERS_ALMOST_DONE:if(o!==g)return;T("onHeadersEnd"),i=t.PART_DATA_START;break;case t.PART_DATA_START:i=t.PART_DATA,f("onPartData");case t.PART_DATA:if(d=e,e===0){for(n+=O;n<y&&!(a[n]in p);)n+=H;n-=O,o=a[n]}if(e<c.length)c[e]===o?(e===0&&b("onPartData",!0),e++):e=0;else if(e===c.length)e++,o===N?A|=R.PART_BOUNDARY:o===P?A|=R.LAST_BOUNDARY:e=0;else if(e-1===c.length)if(A&R.PART_BOUNDARY){if(e=0,o===g){A&=~R.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),i=t.HEADER_FIELD_START;break}}else A&R.LAST_BOUNDARY&&o===P?(T("onPartEnd"),i=t.END,A=0):e=0;if(e>0)l[e-1]=o;else if(d>0){const h=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);T("onPartData",0,d,h),d=0,f("onPartData"),n--}break;case t.END:break;default:throw new Error(`Unexpected state entered: ${i}`)}b("onHeaderField"),b("onHeaderValue"),b("onPartData"),this.index=e,this.state=i,this.flags=A}end(){if(this.state===t.HEADER_FIELD_START&&this.index===0||this.state===t.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==t.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};E(F,"MultipartParser");let k=F;function v(u){const a=u.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!a)return;const n=a[2]||a[3]||"";let r=n.slice(n.lastIndexOf("\\")+1);return r=r.replace(/%22/g,'"'),r=r.replace(/&#(\d{4});/g,(d,l)=>String.fromCharCode(l)),r}E(v,"_fileName");async function Z(u,a){if(!/multipart/i.test(a))throw new TypeError("Failed to fetch");const n=a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");const r=new k(n[1]||n[2]);let d,l,c,p,e,i;const A=[],H=new V,O=E(s=>{c+=f.decode(s,{stream:!0})},"onPartData"),y=E(s=>{A.push(s)},"appendToFile"),o=E(()=>{const s=new Y(A,i,{type:e});H.append(p,s)},"appendFileToFormData"),L=E(()=>{H.append(p,c)},"appendEntryToFormData"),f=new TextDecoder("utf-8");f.decode(),r.onPartBegin=function(){r.onPartData=O,r.onPartEnd=L,d="",l="",c="",p="",e="",i=null,A.length=0},r.onHeaderField=function(s){d+=f.decode(s,{stream:!0})},r.onHeaderValue=function(s){l+=f.decode(s,{stream:!0})},r.onHeaderEnd=function(){if(l+=f.decode(),d=d.toLowerCase(),d==="content-disposition"){const s=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);s&&(p=s[2]||s[3]||""),i=v(l),i&&(r.onPartData=y,r.onPartEnd=o)}else d==="content-type"&&(e=l);l="",d=""};for await(const s of u)r.write(s);return r.end(),H}E(Z,"toFormData");export{Z as toFormData};
|