node-opcua-address-space 2.181.1 → 2.182.2
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/api/helpers/ensure_secure_access.ts +53 -2
- package/api/index.ts +30 -1
- package/api/loader/generateAddressSpaceRaw.ts +44 -139
- package/api/loader/load_nodeset2.ts +5 -0
- package/api/loader/narrow_instance_datatypes.ts +264 -0
- package/api/loader/nodeset_builtin_formats.ts +143 -0
- package/api/loader/nodeset_format.ts +153 -0
- package/api/loader/nodeset_image.ts +37 -4
- package/api/loader/nodeset_image_codec.ts +153 -34
- package/api/loader/nodeset_record.ts +26 -2
- package/api/loader/nodeset_record_applier.ts +54 -3
- package/api/loader/nodeset_records_to_xml.ts +620 -0
- package/api/loader/nodeset_source.ts +185 -26
- package/api/loader/nodeset_to_image.ts +16 -5
- package/api/loader/nodeset_xml_header.ts +119 -0
- package/api/loader/nodeset_xml_primitives.ts +209 -0
- package/api/loader/nodeset_xml_producer.ts +61 -2
- package/api/loader/parsers/variant_parser.ts +9 -0
- package/bin/nodeset_equivalence.js +750 -0
- package/bin/nodeset_tool_common.js +72 -0
- package/bin/opcua-nodeset-image.js +93 -103
- package/bin/opcua-nodeset-live.js +139 -0
- package/dist/api/helpers/ensure_secure_access.d.ts +20 -0
- package/dist/api/helpers/ensure_secure_access.js +39 -0
- package/dist/api/helpers/ensure_secure_access.js.map +1 -1
- package/dist/api/index.d.ts +7 -2
- package/dist/api/index.js +21 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/loader/generateAddressSpaceRaw.d.ts +1 -7
- package/dist/api/loader/generateAddressSpaceRaw.js +32 -125
- package/dist/api/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/api/loader/load_nodeset2.js +4 -0
- package/dist/api/loader/load_nodeset2.js.map +1 -1
- package/dist/api/loader/narrow_instance_datatypes.d.ts +30 -0
- package/dist/api/loader/narrow_instance_datatypes.js +217 -0
- package/dist/api/loader/narrow_instance_datatypes.js.map +1 -0
- package/dist/api/loader/nodeset_builtin_formats.d.ts +27 -0
- package/dist/api/loader/nodeset_builtin_formats.js +133 -0
- package/dist/api/loader/nodeset_builtin_formats.js.map +1 -0
- package/dist/api/loader/nodeset_format.d.ts +123 -0
- package/dist/api/loader/nodeset_format.js +63 -0
- package/dist/api/loader/nodeset_format.js.map +1 -0
- package/dist/api/loader/nodeset_image.d.ts +17 -1
- package/dist/api/loader/nodeset_image.js +32 -4
- package/dist/api/loader/nodeset_image.js.map +1 -1
- package/dist/api/loader/nodeset_image_codec.d.ts +4 -0
- package/dist/api/loader/nodeset_image_codec.js +142 -53
- package/dist/api/loader/nodeset_image_codec.js.map +1 -1
- package/dist/api/loader/nodeset_record.d.ts +26 -2
- package/dist/api/loader/nodeset_record.js +11 -2
- package/dist/api/loader/nodeset_record.js.map +1 -1
- package/dist/api/loader/nodeset_record_applier.js +52 -3
- package/dist/api/loader/nodeset_record_applier.js.map +1 -1
- package/dist/api/loader/nodeset_records_to_xml.d.ts +16 -0
- package/dist/api/loader/nodeset_records_to_xml.js +536 -0
- package/dist/api/loader/nodeset_records_to_xml.js.map +1 -0
- package/dist/api/loader/nodeset_source.d.ts +68 -7
- package/dist/api/loader/nodeset_source.js +157 -20
- package/dist/api/loader/nodeset_source.js.map +1 -1
- package/dist/api/loader/nodeset_to_image.d.ts +4 -4
- package/dist/api/loader/nodeset_to_image.js +14 -4
- package/dist/api/loader/nodeset_to_image.js.map +1 -1
- package/dist/api/loader/nodeset_xml_header.d.ts +22 -0
- package/dist/api/loader/nodeset_xml_header.js +113 -0
- package/dist/api/loader/nodeset_xml_header.js.map +1 -0
- package/dist/api/loader/nodeset_xml_primitives.d.ts +37 -0
- package/dist/api/loader/nodeset_xml_primitives.js +196 -0
- package/dist/api/loader/nodeset_xml_primitives.js.map +1 -0
- package/dist/api/loader/nodeset_xml_producer.js +56 -1
- package/dist/api/loader/nodeset_xml_producer.js.map +1 -1
- package/dist/api/loader/parsers/variant_parser.js +7 -0
- package/dist/api/loader/parsers/variant_parser.js.map +1 -1
- package/dist/impl/_instantiate_helpers.js +1 -0
- package/dist/impl/_instantiate_helpers.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js +4 -0
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +14 -0
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/impl/base_node_impl.d.ts +9 -0
- package/dist/impl/base_node_impl.js +11 -0
- package/dist/impl/base_node_impl.js.map +1 -1
- package/dist/impl/base_node_private.js +67 -97
- package/dist/impl/base_node_private.js.map +1 -1
- package/dist/impl/nodeset_tools/construct_namespace_dependency.js +5 -1
- package/dist/impl/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/impl/nodeset_tools/nodeset_to_records.js +61 -15
- package/dist/impl/nodeset_tools/nodeset_to_records.js.map +1 -1
- package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts +1 -8
- package/dist/impl/nodeset_tools/nodeset_to_xml.js +174 -190
- package/dist/impl/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/impl/ua_data_type_impl.d.ts +21 -0
- package/dist/impl/ua_data_type_impl.js +27 -2
- package/dist/impl/ua_data_type_impl.js.map +1 -1
- package/dist/impl/ua_object_type_impl.d.ts +9 -0
- package/dist/impl/ua_object_type_impl.js +12 -1
- package/dist/impl/ua_object_type_impl.js.map +1 -1
- package/dist/impl/ua_variable_impl.js +27 -10
- package/dist/impl/ua_variable_impl.js.map +1 -1
- package/dist/impl/ua_variable_impl_ext_obj.js +19 -2
- package/dist/impl/ua_variable_impl_ext_obj.js.map +1 -1
- package/dist/impl/ua_variable_type_impl.d.ts +8 -1
- package/dist/impl/ua_variable_type_impl.js +39 -2
- package/dist/impl/ua_variable_type_impl.js.map +1 -1
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/distNodeJS/generate_address_space.js +4 -0
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/impl/_instantiate_helpers.ts +3 -0
- package/impl/alarms_and_conditions/ua_alarm_condition_impl.ts +10 -0
- package/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +17 -0
- package/impl/base_node_impl.ts +15 -0
- package/impl/base_node_private.ts +97 -146
- package/impl/nodeset_tools/construct_namespace_dependency.ts +5 -1
- package/impl/nodeset_tools/nodeset_to_records.ts +66 -16
- package/impl/nodeset_tools/nodeset_to_xml.ts +127 -160
- package/impl/ua_data_type_impl.ts +40 -2
- package/impl/ua_object_type_impl.ts +16 -3
- package/impl/ua_variable_impl.ts +27 -10
- package/impl/ua_variable_impl_ext_obj.ts +20 -2
- package/impl/ua_variable_type_impl.ts +48 -2
- package/package.json +29 -27
- package/source_nodejs/generate_address_space.ts +7 -1
|
@@ -484,6 +484,20 @@ function isVariableContainingExtensionObject(uaVariable: UAVariableImpl): boolea
|
|
|
484
484
|
return true;
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
+
/**
|
|
488
|
+
* the dimensions to iterate an extension object array over. "ArrayDimensions=0" and an absent
|
|
489
|
+
* ArrayDimensions both mean "one dimension, length unknown", so the length has to come from the
|
|
490
|
+
* array itself -- but that is a fact about this iteration, not a correction to the node: the
|
|
491
|
+
* ArrayDimensions attribute is what the nodeset declared and stays that way.
|
|
492
|
+
*/
|
|
493
|
+
function effectiveArrayDimensions(declared: number[] | null | undefined, totalLength: number): number[] {
|
|
494
|
+
const dimensions = declared ?? [];
|
|
495
|
+
if (dimensions.length === 0 || dimensions.every((d) => d === 0)) {
|
|
496
|
+
return [totalLength];
|
|
497
|
+
}
|
|
498
|
+
return dimensions;
|
|
499
|
+
}
|
|
500
|
+
|
|
487
501
|
function _innerBindExtensionObjectScalar(
|
|
488
502
|
uaVariable: UAVariableImpl,
|
|
489
503
|
{
|
|
@@ -696,7 +710,11 @@ export function _bindExtensionObjectArrayOrMatrix(
|
|
|
696
710
|
if (uaVariable.valueRank < 1) {
|
|
697
711
|
throw new Error("Variable must be a MultiDimensional array");
|
|
698
712
|
}
|
|
699
|
-
|
|
713
|
+
// a copy: the ArrayDimensions attribute of the node is not this function's to change, and the
|
|
714
|
+
// fallback below writes into this array. Taken by reference, that write rewrote what the
|
|
715
|
+
// nodeset declared -- a variable that said ArrayDimensions="0" came back saying "1", on the
|
|
716
|
+
// server as well as in any export
|
|
717
|
+
const arrayDimensions = [...(uaVariable.arrayDimensions || [])];
|
|
700
718
|
// c8 ignore next
|
|
701
719
|
if (!isVariableContainingExtensionObject(uaVariable)) {
|
|
702
720
|
return [];
|
|
@@ -887,8 +905,8 @@ export function extractPartialData(path: string | string[], extensionObject: Ext
|
|
|
887
905
|
|
|
888
906
|
export function propagateTouchValueDownwardArray(uaVariable: UAVariableImpl, now: PreciseClock, cache: Set<UAVariable>) {
|
|
889
907
|
if (!uaVariable.$$extensionObjectArray) return;
|
|
890
|
-
const arrayDimensions = uaVariable.arrayDimensions || [];
|
|
891
908
|
const totalLength = uaVariable.$$extensionObjectArray.length;
|
|
909
|
+
const arrayDimensions = effectiveArrayDimensions(uaVariable.arrayDimensions, totalLength);
|
|
892
910
|
|
|
893
911
|
const indexIterator = new IndexIterator(arrayDimensions);
|
|
894
912
|
for (let i = 0; i < totalLength; i++) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
4
|
import type {
|
|
5
|
+
AddReferenceOpts,
|
|
5
6
|
AddVariableOptions,
|
|
6
7
|
BaseNode,
|
|
7
8
|
BaseNodeEvents,
|
|
@@ -12,6 +13,7 @@ import type {
|
|
|
12
13
|
UAMethod,
|
|
13
14
|
UAObject,
|
|
14
15
|
UAObjectType,
|
|
16
|
+
UAReferenceType,
|
|
15
17
|
UAVariable,
|
|
16
18
|
UAVariableType
|
|
17
19
|
} from "node-opcua-address-space-base";
|
|
@@ -48,10 +50,47 @@ const errorLog = make_errorLog("ua_variable_type_impl");
|
|
|
48
50
|
interface InstantiateS {
|
|
49
51
|
propertyOf?: NodeIdLike | UAObject | UAObjectType | UAVariable | UAVariableType | UAMethod;
|
|
50
52
|
componentOf?: NodeIdLike | BaseNode;
|
|
53
|
+
references?: AddReferenceOpts[];
|
|
51
54
|
modellingRule?: ModellingRuleType;
|
|
52
55
|
copyAlsoModellingRules?: boolean;
|
|
53
56
|
copyAlsoAllOptionals?: boolean;
|
|
54
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* the parent given through `options.references` as an inverse aggregate
|
|
61
|
+
* reference (HasOrderedComponent, HasPhysicalComponent ...), if any.
|
|
62
|
+
* See InstantiateOptions.references.
|
|
63
|
+
*/
|
|
64
|
+
export function findAggregateParentInReferences(
|
|
65
|
+
addressSpace: AddressSpacePrivate,
|
|
66
|
+
references: AddReferenceOpts[] | undefined
|
|
67
|
+
): BaseNode | null {
|
|
68
|
+
if (!references || references.length === 0) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const aggregates = addressSpace.findReferenceType("Aggregates");
|
|
72
|
+
if (!aggregates) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
for (const ref of references) {
|
|
76
|
+
if (ref.isForward !== false) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const referenceType =
|
|
80
|
+
typeof ref.referenceType === "object" && "nodeClass" in (ref.referenceType as object)
|
|
81
|
+
? (ref.referenceType as UAReferenceType)
|
|
82
|
+
: addressSpace.findReferenceType(ref.referenceType as NodeIdLike);
|
|
83
|
+
if (!referenceType?.isSubtypeOf(aggregates)) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const parent = addressSpace._coerceNode(ref.nodeId as BaseNode | NodeIdLike);
|
|
87
|
+
if (parent) {
|
|
88
|
+
return parent;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
55
94
|
export function topMostParentIsObjectTypeOrVariableType(addressSpace: AddressSpacePrivate, options: InstantiateS): boolean {
|
|
56
95
|
if (options.copyAlsoModellingRules) {
|
|
57
96
|
return true;
|
|
@@ -60,7 +99,7 @@ export function topMostParentIsObjectTypeOrVariableType(addressSpace: AddressSpa
|
|
|
60
99
|
return true;
|
|
61
100
|
}
|
|
62
101
|
|
|
63
|
-
const parent = options.propertyOf || options.componentOf;
|
|
102
|
+
const parent = options.propertyOf || options.componentOf || findAggregateParentInReferences(addressSpace, options.references);
|
|
64
103
|
if (!parent) {
|
|
65
104
|
return false;
|
|
66
105
|
}
|
|
@@ -292,6 +331,9 @@ export class UAVariableTypeImpl extends BaseNodeImpl<BaseNodeEvents> implements
|
|
|
292
331
|
nodeId: options.nodeId,
|
|
293
332
|
notifierOf: options.notifierOf,
|
|
294
333
|
organizedBy: options.organizedBy,
|
|
334
|
+
// see InstantiateOptions.references: created with the node so the
|
|
335
|
+
// NodeIdManager derives the symbolic name from that parent
|
|
336
|
+
references: options.references,
|
|
295
337
|
typeDefinition: this.nodeId,
|
|
296
338
|
value: options.value || defaultValue,
|
|
297
339
|
valueRank
|
|
@@ -353,7 +395,11 @@ function hasChildWithBrowseName(parent: BaseNode, childBrowseName: QualifiedName
|
|
|
353
395
|
}
|
|
354
396
|
|
|
355
397
|
function getParent(addressSpace: IAddressSpace, options: InstantiateVariableOptions) {
|
|
356
|
-
const parent =
|
|
398
|
+
const parent =
|
|
399
|
+
options.componentOf ||
|
|
400
|
+
options.organizedBy ||
|
|
401
|
+
findAggregateParentInReferences(addressSpace as AddressSpacePrivate, options.references) ||
|
|
402
|
+
undefined;
|
|
357
403
|
if (parent instanceof NodeId) {
|
|
358
404
|
return addressSpace.findNode(parent as NodeId);
|
|
359
405
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-address-space",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.182.2",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module address-space",
|
|
5
5
|
"main": "./dist/api/index.js",
|
|
6
6
|
"types": "./dist/api/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc -b",
|
|
12
12
|
"test": "mocha",
|
|
13
|
+
"test:long": "mocha --spec \"test_long/**/*.ts\" --timeout 900000",
|
|
13
14
|
"test:check": "tsc --noEmit -p test/tsconfig.json",
|
|
14
15
|
"lint": "biome check --no-errors-on-unmatched .",
|
|
15
16
|
"format": "biome check --write --no-errors-on-unmatched .",
|
|
@@ -21,36 +22,36 @@
|
|
|
21
22
|
"@types/semver": "7.8.0",
|
|
22
23
|
"chalk": "4.1.2",
|
|
23
24
|
"dequeue": "^1.0.5",
|
|
24
|
-
"node-opcua-address-space-base": "2.
|
|
25
|
+
"node-opcua-address-space-base": "2.182.0",
|
|
25
26
|
"node-opcua-assert": "2.179.0",
|
|
26
|
-
"node-opcua-basic-types": "2.
|
|
27
|
+
"node-opcua-basic-types": "2.182.0",
|
|
27
28
|
"node-opcua-binary-stream": "2.181.0",
|
|
28
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
29
|
+
"node-opcua-client-dynamic-extension-object": "2.182.1",
|
|
29
30
|
"node-opcua-constants": "2.181.0",
|
|
30
31
|
"node-opcua-crypto": "5.10.1",
|
|
31
|
-
"node-opcua-data-access": "2.
|
|
32
|
-
"node-opcua-data-model": "2.
|
|
33
|
-
"node-opcua-data-value": "2.
|
|
32
|
+
"node-opcua-data-access": "2.182.0",
|
|
33
|
+
"node-opcua-data-model": "2.182.0",
|
|
34
|
+
"node-opcua-data-value": "2.182.0",
|
|
34
35
|
"node-opcua-date-time": "2.181.0",
|
|
35
36
|
"node-opcua-debug": "2.181.0",
|
|
36
37
|
"node-opcua-enum": "2.181.0",
|
|
37
|
-
"node-opcua-extension-object": "2.
|
|
38
|
-
"node-opcua-factory": "2.
|
|
39
|
-
"node-opcua-nodeid": "2.
|
|
40
|
-
"node-opcua-nodeset-ua": "2.
|
|
41
|
-
"node-opcua-numeric-range": "2.
|
|
38
|
+
"node-opcua-extension-object": "2.182.0",
|
|
39
|
+
"node-opcua-factory": "2.182.0",
|
|
40
|
+
"node-opcua-nodeid": "2.182.0",
|
|
41
|
+
"node-opcua-nodeset-ua": "2.182.0",
|
|
42
|
+
"node-opcua-numeric-range": "2.182.0",
|
|
42
43
|
"node-opcua-object-registry": "2.181.0",
|
|
43
|
-
"node-opcua-pseudo-session": "2.
|
|
44
|
-
"node-opcua-service-browse": "2.
|
|
45
|
-
"node-opcua-service-call": "2.
|
|
46
|
-
"node-opcua-service-history": "2.
|
|
47
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
48
|
-
"node-opcua-service-write": "2.
|
|
44
|
+
"node-opcua-pseudo-session": "2.182.1",
|
|
45
|
+
"node-opcua-service-browse": "2.182.0",
|
|
46
|
+
"node-opcua-service-call": "2.182.0",
|
|
47
|
+
"node-opcua-service-history": "2.182.0",
|
|
48
|
+
"node-opcua-service-translate-browse-path": "2.182.0",
|
|
49
|
+
"node-opcua-service-write": "2.182.0",
|
|
49
50
|
"node-opcua-status-code": "2.181.0",
|
|
50
|
-
"node-opcua-types": "2.
|
|
51
|
+
"node-opcua-types": "2.182.0",
|
|
51
52
|
"node-opcua-utils": "2.181.0",
|
|
52
|
-
"node-opcua-variant": "2.
|
|
53
|
-
"node-opcua-xml2json": "2.
|
|
53
|
+
"node-opcua-variant": "2.182.0",
|
|
54
|
+
"node-opcua-xml2json": "2.182.0",
|
|
54
55
|
"semver": "^7.8.5",
|
|
55
56
|
"thenify-ex": "4.4.0",
|
|
56
57
|
"xml-writer": "^1.7.0"
|
|
@@ -59,10 +60,10 @@
|
|
|
59
60
|
"humanize": "0.0.9",
|
|
60
61
|
"node-opcua-benchmarker": "2.181.0",
|
|
61
62
|
"node-opcua-leak-detector": "2.181.0",
|
|
62
|
-
"node-opcua-nodesets": "2.
|
|
63
|
-
"node-opcua-packet-analyzer": "2.
|
|
64
|
-
"node-opcua-schemas": "2.
|
|
65
|
-
"node-opcua-service-filter": "2.
|
|
63
|
+
"node-opcua-nodesets": "2.182.0",
|
|
64
|
+
"node-opcua-packet-analyzer": "2.182.0",
|
|
65
|
+
"node-opcua-schemas": "2.182.0",
|
|
66
|
+
"node-opcua-service-filter": "2.182.2",
|
|
66
67
|
"node-opcua-test-fixtures": "2.181.0",
|
|
67
68
|
"node-opcua-test-helpers": "2.181.0"
|
|
68
69
|
},
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"internet of things"
|
|
82
83
|
],
|
|
83
84
|
"homepage": "http://node-opcua.github.io/",
|
|
84
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "cb72d06e8bcb611479f44f9f45f67bbee93bc32e",
|
|
85
86
|
"files": [
|
|
86
87
|
"dist",
|
|
87
88
|
"distHelpers",
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
"bin"
|
|
98
99
|
],
|
|
99
100
|
"bin": {
|
|
100
|
-
"opcua-nodeset-image": "bin/opcua-nodeset-image.js"
|
|
101
|
+
"opcua-nodeset-image": "bin/opcua-nodeset-image.js",
|
|
102
|
+
"opcua-nodeset-live": "bin/opcua-nodeset-live.js"
|
|
101
103
|
}
|
|
102
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
|
-
import zlib, { gunzip } from "node:zlib";
|
|
4
|
+
import zlib, { gunzip, gzip as gzipCb } from "node:zlib";
|
|
5
5
|
import type { IAddressSpace } from "node-opcua-address-space-base";
|
|
6
6
|
import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
|
|
7
7
|
import {
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
nodesetImageProblem,
|
|
14
14
|
nodesetToImage as nodesetToImageRaw,
|
|
15
15
|
readNodesetImageInfo,
|
|
16
|
+
setImageDeflater,
|
|
16
17
|
setImageInflater,
|
|
17
18
|
sha256Hex
|
|
18
19
|
} from "../dist/api/index.js";
|
|
@@ -23,6 +24,11 @@ import { FileNodesetImageStore } from "./nodeset_image_file_store.js";
|
|
|
23
24
|
const gunzipAsync = promisify(gunzip);
|
|
24
25
|
setImageInflater(async (image) => (await gunzipAsync(image)).toString("utf8"));
|
|
25
26
|
|
|
27
|
+
// and out through zlib at level 9: CompressionStream has no level to ask for, and an image is
|
|
28
|
+
// written once and read many times, so the extra work at build time is free at load time
|
|
29
|
+
const gzipAsync = promisify(gzipCb);
|
|
30
|
+
setImageDeflater(async (text) => new Uint8Array(await gzipAsync(Buffer.from(text, "utf8"), { level: 9 })));
|
|
31
|
+
|
|
26
32
|
const _doDebug = checkDebugFlag("generate_address_space");
|
|
27
33
|
const debugLog = make_debugLog("generate_address_space");
|
|
28
34
|
const errorLog = make_errorLog("generate_address_space");
|