@ifc-lite/ifcx 2.2.2 → 2.3.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/dist/bake.d.ts +34 -0
- package/dist/bake.d.ts.map +1 -0
- package/dist/bake.js +92 -0
- package/dist/bake.js.map +1 -0
- package/dist/canonical.d.ts +22 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +141 -0
- package/dist/canonical.js.map +1 -0
- package/dist/composition.d.ts +2 -0
- package/dist/composition.d.ts.map +1 -1
- package/dist/composition.js +18 -3
- package/dist/composition.js.map +1 -1
- package/dist/federated-composition.d.ts.map +1 -1
- package/dist/federated-composition.js +14 -2
- package/dist/federated-composition.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -16
- package/dist/index.js.map +1 -1
- package/dist/property-extractor.d.ts +12 -0
- package/dist/property-extractor.d.ts.map +1 -1
- package/dist/property-extractor.js +46 -6
- package/dist/property-extractor.js.map +1 -1
- package/dist/provenance.d.ts +122 -0
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +145 -0
- package/dist/provenance.js.map +1 -0
- package/dist/tombstones.d.ts +35 -0
- package/dist/tombstones.d.ts.map +1 -0
- package/dist/tombstones.js +64 -0
- package/dist/tombstones.js.map +1 -0
- package/dist/types.d.ts +62 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +83 -0
- package/dist/types.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tombstone (deletion overlay) semantics for IFCX composition.
|
|
3
|
+
*
|
|
4
|
+
* A tombstone is an opinion `{ "ifclite::deleted": true }` at an entity
|
|
5
|
+
* path. Composition resolves the attribute with normal layer strength
|
|
6
|
+
* (stronger layers override weaker ones), so:
|
|
7
|
+
*
|
|
8
|
+
* - a tombstone shadows all weaker opinions for that path, including the
|
|
9
|
+
* entity's child subtree (entity tombstones delete the subtree), and
|
|
10
|
+
* - a stronger layer may resurrect the entity by asserting
|
|
11
|
+
* `"ifclite::deleted": false` (this is how a revert layer undoes a
|
|
12
|
+
* deletion).
|
|
13
|
+
*
|
|
14
|
+
* The filter runs after attribute merging, so the surviving value of
|
|
15
|
+
* `ifclite::deleted` is already the strongest opinion in the stack.
|
|
16
|
+
*
|
|
17
|
+
* Spec: docs/architecture/layer-prs/02-layer-format.md §2.3.
|
|
18
|
+
*/
|
|
19
|
+
import type { ComposedNode } from './types.js';
|
|
20
|
+
/** True when a merged attribute record marks the node as deleted. */
|
|
21
|
+
export declare function isTombstoned(attributes: Map<string, unknown>): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Remove tombstoned nodes (and their subtrees) from a composed node map.
|
|
24
|
+
*
|
|
25
|
+
* - Nodes whose strongest `ifclite::deleted` opinion is `true` are removed.
|
|
26
|
+
* - Their descendants (reachable through `children`) are removed with them.
|
|
27
|
+
* - References to removed nodes are dropped from surviving parents.
|
|
28
|
+
* - The `ifclite::deleted` marker itself is stripped from survivors so the
|
|
29
|
+
* composed state is clean for extractors and export.
|
|
30
|
+
*
|
|
31
|
+
* The input map is mutated in place (composition owns these structures)
|
|
32
|
+
* and returned for convenience.
|
|
33
|
+
*/
|
|
34
|
+
export declare function applyTombstones<T extends ComposedNode>(composed: Map<string, T>): Map<string, T>;
|
|
35
|
+
//# sourceMappingURL=tombstones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tombstones.d.ts","sourceRoot":"","sources":["../src/tombstones.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAEtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACpD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GACvB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAwChB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { IFCLITE_ATTR } from './types.js';
|
|
5
|
+
/** True when a merged attribute record marks the node as deleted. */
|
|
6
|
+
export function isTombstoned(attributes) {
|
|
7
|
+
return attributes.get(IFCLITE_ATTR.DELETED) === true;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Remove tombstoned nodes (and their subtrees) from a composed node map.
|
|
11
|
+
*
|
|
12
|
+
* - Nodes whose strongest `ifclite::deleted` opinion is `true` are removed.
|
|
13
|
+
* - Their descendants (reachable through `children`) are removed with them.
|
|
14
|
+
* - References to removed nodes are dropped from surviving parents.
|
|
15
|
+
* - The `ifclite::deleted` marker itself is stripped from survivors so the
|
|
16
|
+
* composed state is clean for extractors and export.
|
|
17
|
+
*
|
|
18
|
+
* The input map is mutated in place (composition owns these structures)
|
|
19
|
+
* and returned for convenience.
|
|
20
|
+
*/
|
|
21
|
+
export function applyTombstones(composed) {
|
|
22
|
+
const deleted = new Set();
|
|
23
|
+
for (const [path, node] of composed) {
|
|
24
|
+
if (isTombstoned(node.attributes))
|
|
25
|
+
deleted.add(path);
|
|
26
|
+
}
|
|
27
|
+
if (deleted.size === 0) {
|
|
28
|
+
// Still strip explicit `deleted: false` resurrect markers.
|
|
29
|
+
for (const node of composed.values()) {
|
|
30
|
+
node.attributes.delete(IFCLITE_ATTR.DELETED);
|
|
31
|
+
}
|
|
32
|
+
return composed;
|
|
33
|
+
}
|
|
34
|
+
// Entity tombstones shadow child paths: expand to full subtrees.
|
|
35
|
+
const queue = [...deleted];
|
|
36
|
+
while (queue.length > 0) {
|
|
37
|
+
const path = queue.pop();
|
|
38
|
+
if (path === undefined)
|
|
39
|
+
break;
|
|
40
|
+
const node = composed.get(path);
|
|
41
|
+
if (!node)
|
|
42
|
+
continue;
|
|
43
|
+
for (const child of node.children.values()) {
|
|
44
|
+
// A child carrying its own resurrect opinion stays only if it is
|
|
45
|
+
// also referenced by a surviving parent; subtree shadowing wins here.
|
|
46
|
+
if (!deleted.has(child.path)) {
|
|
47
|
+
deleted.add(child.path);
|
|
48
|
+
queue.push(child.path);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (const path of deleted) {
|
|
53
|
+
composed.delete(path);
|
|
54
|
+
}
|
|
55
|
+
for (const node of composed.values()) {
|
|
56
|
+
node.attributes.delete(IFCLITE_ATTR.DELETED);
|
|
57
|
+
for (const [name, child] of node.children) {
|
|
58
|
+
if (deleted.has(child.path))
|
|
59
|
+
node.children.delete(name);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return composed;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=tombstones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tombstones.js","sourceRoot":"","sources":["../src/tombstones.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAsB/D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,qEAAqE;AACrE,MAAM,UAAU,YAAY,CAAC,UAAgC;IAC3D,OAAO,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAwB;IAExB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;QACpC,IAAI,YAAY,CAAC,IAAI,CAAC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AO,CAAC,CAAC;QAC7C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -69,7 +69,69 @@ export declare const ATTR: {
|
|
|
69
69
|
readonly MATERIAL: "bsi::ifc::material";
|
|
70
70
|
readonly PROP_PREFIX: "bsi::ifc::prop::";
|
|
71
71
|
readonly SPACE_BOUNDARY: "bsi::ifc::spaceBoundary";
|
|
72
|
+
readonly PART_OF_SYSTEM: "bsi::ifc::system::partofsystem";
|
|
72
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* IFClite extension attributes for layered change tracking
|
|
76
|
+
* (docs/architecture/layer-prs/). Tools unaware of the namespace ignore
|
|
77
|
+
* these and still get valid IFCX composition (modulo deletion overlays,
|
|
78
|
+
* which `bakeLayers` can materialize away for foreign tools).
|
|
79
|
+
*/
|
|
80
|
+
export declare const IFCLITE_ATTR: {
|
|
81
|
+
/**
|
|
82
|
+
* Tombstone opinion: `true` deletes the entity (and shadows all weaker
|
|
83
|
+
* opinions for the path, including child paths); `false` resurrects it.
|
|
84
|
+
*/
|
|
85
|
+
readonly DELETED: "ifclite::deleted";
|
|
86
|
+
/** Marks derived (cache) content excluded from canonical hashing. */
|
|
87
|
+
readonly DERIVED: "ifclite::derived";
|
|
88
|
+
/**
|
|
89
|
+
* Collab structured-branch carriers (#1031): the collab runtime keeps
|
|
90
|
+
* classifications / materials / geometry refs as dedicated CRDT
|
|
91
|
+
* branches; on the IFCX wire they travel as ordinary attributes under
|
|
92
|
+
* these keys (psets/quantities use the `bsi::ifc::v5a::<Set>::<Name>`
|
|
93
|
+
* convention instead, so merge component keys stay `pset:`/`qset:`).
|
|
94
|
+
*/
|
|
95
|
+
readonly CLASSIFICATIONS: "ifclite::classifications";
|
|
96
|
+
readonly MATERIALS: "ifclite::materials";
|
|
97
|
+
readonly GEOMETRY_REF: "ifclite::geometryRef";
|
|
98
|
+
};
|
|
99
|
+
/** Header key carrying the provenance manifest (see provenance.ts). */
|
|
100
|
+
export declare const PROVENANCE_KEY = "ifclite::provenance";
|
|
101
|
+
/**
|
|
102
|
+
* IFC5-alpha namespaced property/quantity prefix (#1031): keys are
|
|
103
|
+
* `bsi::ifc::v5a::<Set>::<Name>`. Within this namespace the routing
|
|
104
|
+
* dialect is fixed (see `routesToQuantityTable` and the collab
|
|
105
|
+
* structured-branch inflation): `Pset_*` members are properties, `Qto_*`
|
|
106
|
+
* members are quantities, custom sets route typed records to properties
|
|
107
|
+
* and raw numbers to quantities.
|
|
108
|
+
*/
|
|
109
|
+
export declare const V5A_ATTR_PREFIX = "bsi::ifc::v5a::";
|
|
110
|
+
/** Split a v5a key into set + member name; null when not a v5a set key. */
|
|
111
|
+
export declare function parseV5aKey(key: string): {
|
|
112
|
+
setName: string;
|
|
113
|
+
name: string;
|
|
114
|
+
} | null;
|
|
115
|
+
/**
|
|
116
|
+
* Canonical wire shape for typed property values (#1031): pset
|
|
117
|
+
* properties under `bsi::ifc::v5a::<Set>::<Prop>` carry this record so
|
|
118
|
+
* the IFC type, unit, and provenance survive round-trips. Every writer
|
|
119
|
+
* (collab snapshots, MCP draft ops) and reader (property extraction,
|
|
120
|
+
* seed inflation) shares this one definition.
|
|
121
|
+
*/
|
|
122
|
+
export interface TypedPropertyValue {
|
|
123
|
+
type: string;
|
|
124
|
+
value: string | number | boolean | null;
|
|
125
|
+
unit?: string;
|
|
126
|
+
source?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Strict shape test for TypedPropertyValue. Deliberately rejects any
|
|
130
|
+
* extra keys: legacy/migrated attributes carry raw scalars or foreign
|
|
131
|
+
* objects, never this exact record, so the test is what disambiguates
|
|
132
|
+
* "typed property" from "leave it alone".
|
|
133
|
+
*/
|
|
134
|
+
export declare function isTypedPropertyValue(value: unknown): value is TypedPropertyValue;
|
|
73
135
|
export interface UsdMesh {
|
|
74
136
|
points: number[][];
|
|
75
137
|
faceVertexIndices: number[];
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAMH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAMD,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,SAAS,GACT,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,OAAO,GACP,QAAQ,GACR,WAAW,GACX,MAAM,CAAC;AAEX,MAAM,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EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB;AAMD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAMD,eAAO,MAAM,aAAa,aAMxB,CAAC;AAEH,eAAO,MAAM,sBAAsB,aAgBjC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -24,8 +24,91 @@ export const ATTR = {
|
|
|
24
24
|
PROP_PREFIX: 'bsi::ifc::prop::',
|
|
25
25
|
// IFC Relationships (evolving)
|
|
26
26
|
SPACE_BOUNDARY: 'bsi::ifc::spaceBoundary',
|
|
27
|
+
// IFC5 system membership (bsi::ifc::system schema): sits on the MEMBER
|
|
28
|
+
// node as `[{ ref }]` pointing at the IfcSystem-family node — the ECS
|
|
29
|
+
// successor of IfcRelAssignsToGroup (see the buildingSMART
|
|
30
|
+
// Domestic_Hot_Water sample).
|
|
31
|
+
PART_OF_SYSTEM: 'bsi::ifc::system::partofsystem',
|
|
27
32
|
};
|
|
28
33
|
// ============================================================================
|
|
34
|
+
// IFClite Layer Extension Namespace (`ifclite::`)
|
|
35
|
+
// ============================================================================
|
|
36
|
+
/**
|
|
37
|
+
* IFClite extension attributes for layered change tracking
|
|
38
|
+
* (docs/architecture/layer-prs/). Tools unaware of the namespace ignore
|
|
39
|
+
* these and still get valid IFCX composition (modulo deletion overlays,
|
|
40
|
+
* which `bakeLayers` can materialize away for foreign tools).
|
|
41
|
+
*/
|
|
42
|
+
export const IFCLITE_ATTR = {
|
|
43
|
+
/**
|
|
44
|
+
* Tombstone opinion: `true` deletes the entity (and shadows all weaker
|
|
45
|
+
* opinions for the path, including child paths); `false` resurrects it.
|
|
46
|
+
*/
|
|
47
|
+
DELETED: 'ifclite::deleted',
|
|
48
|
+
/** Marks derived (cache) content excluded from canonical hashing. */
|
|
49
|
+
DERIVED: 'ifclite::derived',
|
|
50
|
+
/**
|
|
51
|
+
* Collab structured-branch carriers (#1031): the collab runtime keeps
|
|
52
|
+
* classifications / materials / geometry refs as dedicated CRDT
|
|
53
|
+
* branches; on the IFCX wire they travel as ordinary attributes under
|
|
54
|
+
* these keys (psets/quantities use the `bsi::ifc::v5a::<Set>::<Name>`
|
|
55
|
+
* convention instead, so merge component keys stay `pset:`/`qset:`).
|
|
56
|
+
*/
|
|
57
|
+
CLASSIFICATIONS: 'ifclite::classifications',
|
|
58
|
+
MATERIALS: 'ifclite::materials',
|
|
59
|
+
GEOMETRY_REF: 'ifclite::geometryRef',
|
|
60
|
+
};
|
|
61
|
+
/** Header key carrying the provenance manifest (see provenance.ts). */
|
|
62
|
+
export const PROVENANCE_KEY = 'ifclite::provenance';
|
|
63
|
+
/**
|
|
64
|
+
* IFC5-alpha namespaced property/quantity prefix (#1031): keys are
|
|
65
|
+
* `bsi::ifc::v5a::<Set>::<Name>`. Within this namespace the routing
|
|
66
|
+
* dialect is fixed (see `routesToQuantityTable` and the collab
|
|
67
|
+
* structured-branch inflation): `Pset_*` members are properties, `Qto_*`
|
|
68
|
+
* members are quantities, custom sets route typed records to properties
|
|
69
|
+
* and raw numbers to quantities.
|
|
70
|
+
*/
|
|
71
|
+
export const V5A_ATTR_PREFIX = 'bsi::ifc::v5a::';
|
|
72
|
+
/** Split a v5a key into set + member name; null when not a v5a set key. */
|
|
73
|
+
export function parseV5aKey(key) {
|
|
74
|
+
if (!key.startsWith(V5A_ATTR_PREFIX))
|
|
75
|
+
return null;
|
|
76
|
+
const rest = key.slice(V5A_ATTR_PREFIX.length);
|
|
77
|
+
const sep = rest.indexOf('::');
|
|
78
|
+
if (sep <= 0 || sep >= rest.length - 2)
|
|
79
|
+
return null;
|
|
80
|
+
return { setName: rest.slice(0, sep), name: rest.slice(sep + 2) };
|
|
81
|
+
}
|
|
82
|
+
const TYPED_PROPERTY_KEYS = new Set(['type', 'value', 'unit', 'source']);
|
|
83
|
+
/**
|
|
84
|
+
* Strict shape test for TypedPropertyValue. Deliberately rejects any
|
|
85
|
+
* extra keys: legacy/migrated attributes carry raw scalars or foreign
|
|
86
|
+
* objects, never this exact record, so the test is what disambiguates
|
|
87
|
+
* "typed property" from "leave it alone".
|
|
88
|
+
*/
|
|
89
|
+
export function isTypedPropertyValue(value) {
|
|
90
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
91
|
+
return false;
|
|
92
|
+
const record = value;
|
|
93
|
+
if (typeof record.type !== 'string')
|
|
94
|
+
return false;
|
|
95
|
+
if (!('value' in record))
|
|
96
|
+
return false;
|
|
97
|
+
const v = record.value;
|
|
98
|
+
if (v !== null && typeof v !== 'string' && typeof v !== 'number' && typeof v !== 'boolean') {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
for (const key of Object.keys(record)) {
|
|
102
|
+
if (!TYPED_PROPERTY_KEYS.has(key))
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if ('unit' in record && record.unit !== undefined && typeof record.unit !== 'string')
|
|
106
|
+
return false;
|
|
107
|
+
if ('source' in record && record.source !== undefined && typeof record.source !== 'string')
|
|
108
|
+
return false;
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
// ============================================================================
|
|
29
112
|
// Spatial Types
|
|
30
113
|
// ============================================================================
|
|
31
114
|
export const SPATIAL_TYPES = new Set([
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA6F/D,+EAA+E;AAC/E,gCAAgC;AAChC,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,8BAA8B;IAC9B,KAAK,EAAE,iBAAiB;IAExB,gDAAgD;IAChD,IAAI,EAAE,oBAAoB;IAC1B,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE,0BAA0B;IAEtC,4BAA4B;IAC5B,aAAa,EAAE,sCA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MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;IAClD,CAAC;IACD,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACnG,IAAI,QAAQ,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACzG,OAAO,IAAI,CAAC;AACd,CAAC;AA0BD,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IACnC,YAAY;IACZ,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IAC5C,SAAS;IACT,qBAAqB;IACrB,SAAS;IACT,WAAW;IACX,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,YAAY;IACZ,mBAAmB;IACnB,yBAAyB;CAC1B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/ifcx",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "IFC5 (IFCX) parser for IFC-Lite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@ifc-lite/
|
|
18
|
-
"@ifc-lite/
|
|
16
|
+
"@noble/hashes": "^2.2.0",
|
|
17
|
+
"@ifc-lite/pointcloud": "^0.3.5",
|
|
18
|
+
"@ifc-lite/data": "^2.5.3",
|
|
19
|
+
"@ifc-lite/mutations": "^1.19.0"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"tsx": "^4.23.0",
|