@dialecte/core 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { AnyDialecteConfig, Namespace } from '../types';
1
+ import { AnyDialecteConfig, Namespace, Wildcard } from '../types';
2
2
  /**
3
3
  * Resolve a namespace declared in the config by its prefix (e.g. `ext`,
4
4
  * `dev`). Returns `undefined` for an empty prefix or an unknown one —
@@ -44,4 +44,9 @@ export declare function orderAttributesBySequence<GenericAttribute extends {
44
44
  name: string;
45
45
  namespace?: Namespace;
46
46
  }>(attributes: readonly GenericAttribute[], sequence: readonly string[]): GenericAttribute[];
47
+ /** Whether a wildcard allows a namespace (`''` = none): the namespaces it lists, or every one it does not exclude. */
48
+ export declare function isNamespaceAllowedByWildcard(params: {
49
+ wildcard: Wildcard | undefined;
50
+ namespaceUri: string;
51
+ }): boolean;
47
52
  //# sourceMappingURL=namespaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"namespaces.d.ts","sourceRoot":"","sources":["../../src/utils/namespaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE3D;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,EACrD,MAAM,EAAE,MAAM,GACZ,SAAS,GAAG,SAAS,CAIvB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,EACrD,KAAK,EAAE,MAAM,GACX,SAAS,GAAG,SAAS,CAGvB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC5C,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,EACrD,cAAc,EAAE,MAAM,GACpB,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAg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AAC,EAAE,SAAS,CAAA;CAAE,GACxC,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACxC,gBAAgB,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,EAC/D,UAAU,EAAE,SAAS,gBAAgB,EAAE,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAS1F;AAED,sHAAsH;AACtH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACpD,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;CACpB,GAAG,OAAO,CAMV"}
@@ -574,9 +574,13 @@ function Y(e, t) {
574
574
  let n = t.flatMap((t) => e.filter((e) => e.name === t)), r = e.filter((e) => !t.includes(e.name)).sort(J);
575
575
  return [...n, ...r];
576
576
  }
577
+ function X(e) {
578
+ let { wildcard: t, namespaceUri: n } = e;
579
+ return t === void 0 ? !1 : t.namespace === void 0 ? !(t.notNamespace ?? []).includes(n) : t.namespace.includes(n);
580
+ }
577
581
  //#endregion
578
582
  //#region src/utils/order-children.ts
579
- function X(e) {
583
+ function Z(e) {
580
584
  let { parentTagName: t, children: n, childrenConfig: r } = e, i = r[t];
581
585
  if (!i || i.length === 0) return n;
582
586
  let a = new Set(i), o = /* @__PURE__ */ new Map();
@@ -595,7 +599,7 @@ function X(e) {
595
599
  }
596
600
  //#endregion
597
601
  //#region src/utils/save-to-disk.ts
598
- async function Z(e) {
602
+ async function Q(e) {
599
603
  let { data: t, filename: n, pickerType: r } = e;
600
604
  if ("showSaveFilePicker" in window) try {
601
605
  let e = await (await window.showSaveFilePicker({
@@ -613,4 +617,4 @@ async function Z(e) {
613
617
  a.href = i, a.download = n, document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(i);
614
618
  }
615
619
  //#endregion
616
- export { g as A, C, d as D, u as E, o as F, t as I, a as L, p as M, n as N, _ as O, r as P, e as R, x as S, f as T, E as _, G as a, v as b, W as c, F as d, I as f, M as g, N as h, Y as i, m as j, h as k, U as l, j as m, X as n, K as o, P as p, J as r, q as s, Z as t, L as u, T as v, y as w, b as x, S as y };
620
+ export { h as A, x as C, u as D, f as E, r as F, o as I, t as L, m as M, p as N, d as O, n as P, a as R, b as S, y as T, M as _, Y as a, S as b, q as c, L as d, F as f, N as g, j as h, X as i, g as j, _ as k, W as l, P as m, Z as n, G as o, I as p, J as r, K as s, Q as t, U as u, E as v, C as w, v as x, T as y, e as z };
package/dist/utils.js CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, x as v, y } from "./utils-CZ12wsuC.js";
2
- export { e as admittedXsiTypes, y as canonicalXsiType, p as compareQualifiedAttributes, r as enumeratedValues, f as extractLocalName, c as formatEmbeddedXml, g as formatXml, l as getAttributeRules, n as invariant, o as isSchemaDefaultValue, s as orderAttributesBySequence, u as orderByConfigSequence, _ as resolveDefinition, t as resolveNamespaceByPrefix, d as resolveNamespaceByScope, m as resolvePrefixByNamespaceScope, a as resolveSchemaAttributeValue, v as resolveXsiType, h as saveToDisk, i as valuePatterns };
1
+ import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, y as b } from "./utils-CTBHUFs9.js";
2
+ export { y as admittedXsiTypes, r as canonicalXsiType, h as compareQualifiedAttributes, o as enumeratedValues, d as extractLocalName, v as formatEmbeddedXml, a as formatXml, c as getAttributeRules, u as invariant, l as isNamespaceAllowedByWildcard, s as isSchemaDefaultValue, n as orderAttributesBySequence, f as orderByConfigSequence, b as resolveDefinition, p as resolveNamespaceByPrefix, g as resolveNamespaceByScope, i as resolvePrefixByNamespaceScope, t as resolveSchemaAttributeValue, e as resolveXsiType, _ as saveToDisk, m as valuePatterns };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialecte/core",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Dialecte - Core functionality for Dialecte SDK",
5
5
  "license": "MIT",
6
6
  "repository": {