@hello.nrfcloud.com/proto-map 16.6.27 → 16.6.29
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,3 +1,81 @@
|
|
|
1
|
+
function _inherits(subClass, superClass) {
|
|
2
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
3
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
4
|
+
}
|
|
5
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
6
|
+
constructor: {
|
|
7
|
+
value: subClass,
|
|
8
|
+
writable: true,
|
|
9
|
+
configurable: true
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
13
|
+
}
|
|
14
|
+
function _set_prototype_of(o, p) {
|
|
15
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
16
|
+
o.__proto__ = p;
|
|
17
|
+
return o;
|
|
18
|
+
};
|
|
19
|
+
return _set_prototype_of(o, p);
|
|
20
|
+
}
|
|
21
|
+
function _wrap_reg_exp(re, groups) {
|
|
22
|
+
_wrap_reg_exp = function(re, groups) {
|
|
23
|
+
return new WrappedRegExp(re, undefined, groups);
|
|
24
|
+
};
|
|
25
|
+
var _super = RegExp.prototype;
|
|
26
|
+
var _groups = new WeakMap();
|
|
27
|
+
function WrappedRegExp(re, flags, groups) {
|
|
28
|
+
var _re = new RegExp(re, flags);
|
|
29
|
+
_groups.set(_re, groups || _groups.get(re));
|
|
30
|
+
return _set_prototype_of(_re, WrappedRegExp.prototype);
|
|
31
|
+
}
|
|
32
|
+
_inherits(WrappedRegExp, RegExp);
|
|
33
|
+
WrappedRegExp.prototype.exec = function(str) {
|
|
34
|
+
var result = _super.exec.call(this, str);
|
|
35
|
+
if (result) {
|
|
36
|
+
result.groups = buildGroups(result, this);
|
|
37
|
+
var indices = result.indices;
|
|
38
|
+
if (indices) indices.groups = buildGroups(indices, this);
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
WrappedRegExp.prototype[Symbol.replace] = function(str, substitution) {
|
|
43
|
+
if (typeof substitution === "string") {
|
|
44
|
+
var groups = _groups.get(this);
|
|
45
|
+
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function(_, name) {
|
|
46
|
+
var group = groups ? groups[name] : undefined;
|
|
47
|
+
if (group === undefined) return "";
|
|
48
|
+
return "$" + (Array.isArray(group) ? group.join("$") : group);
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
if (typeof substitution === "function") {
|
|
52
|
+
var _this = this;
|
|
53
|
+
return _super[Symbol.replace].call(this, str, function() {
|
|
54
|
+
var args = arguments;
|
|
55
|
+
if (typeof args[args.length - 1] !== "object") {
|
|
56
|
+
args = [].slice.call(args);
|
|
57
|
+
args.push(buildGroups(args, _this));
|
|
58
|
+
}
|
|
59
|
+
return substitution.apply(this, args);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return _super[Symbol.replace].call(this, str, substitution);
|
|
63
|
+
};
|
|
64
|
+
function buildGroups(result, re) {
|
|
65
|
+
var g = _groups.get(re);
|
|
66
|
+
return Object.keys(g).reduce(function(groups, name) {
|
|
67
|
+
var i = g[name];
|
|
68
|
+
if (typeof i === "number") groups[name] = result[i];
|
|
69
|
+
else {
|
|
70
|
+
var k = 0;
|
|
71
|
+
while(result[i[k]] === undefined && k + 1 < i.length)k++;
|
|
72
|
+
groups[name] = result[i[k]];
|
|
73
|
+
}
|
|
74
|
+
return groups;
|
|
75
|
+
}, Object.create(null));
|
|
76
|
+
}
|
|
77
|
+
return _wrap_reg_exp.apply(this, arguments);
|
|
78
|
+
}
|
|
1
79
|
import { Type } from '@sinclair/typebox';
|
|
2
80
|
var ResourceType = Type.Union([
|
|
3
81
|
Type.Literal('String'),
|
|
@@ -7,7 +85,10 @@ var ResourceType = Type.Union([
|
|
|
7
85
|
Type.Literal('Opaque'),
|
|
8
86
|
Type.Literal('Time')
|
|
9
87
|
]);
|
|
10
|
-
export var RangeEnumerationRegExp =
|
|
88
|
+
export var RangeEnumerationRegExp = _wrap_reg_exp(/^(-?[0-9]+(?:\.[0-9]+)?)\.\.(-?[0-9]+(?:\.[0-9]+)?)$/, {
|
|
89
|
+
min: 1,
|
|
90
|
+
max: 2
|
|
91
|
+
});
|
|
11
92
|
var RangeEnumeration = Type.RegExp(RangeEnumerationRegExp, {
|
|
12
93
|
title: 'RangeEnumeration'
|
|
13
94
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hello.nrfcloud.com/proto-map",
|
|
3
|
-
"version": "16.6.
|
|
3
|
+
"version": "16.6.29",
|
|
4
4
|
"description": "Documents the communication protocol between devices, the hello.nrfcloud.com/map backend and web application",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@bifravst/prettier-config": "1.1.17",
|
|
40
40
|
"@commitlint/config-conventional": "20.5.0",
|
|
41
41
|
"@swc/cli": "0.8.0",
|
|
42
|
-
"@swc/core": "1.15.
|
|
42
|
+
"@swc/core": "1.15.21",
|
|
43
43
|
"@types/node": "25.5.0",
|
|
44
44
|
"@types/xml2js": "0.4.14",
|
|
45
45
|
"chalk": "5.6.2",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"tsx": "4.21.0",
|
|
52
52
|
"typescript": "5.9.3",
|
|
53
53
|
"xml2js": "0.6.2",
|
|
54
|
-
"yaml": "2.8.
|
|
54
|
+
"yaml": "2.8.3"
|
|
55
55
|
},
|
|
56
56
|
"lint-staged": {
|
|
57
57
|
"*.{ts,tsx}": [
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"lwm2m"
|
|
98
98
|
],
|
|
99
99
|
"peerDependencies": {
|
|
100
|
-
"@aws-sdk/client-timestream-write": "^3.
|
|
100
|
+
"@aws-sdk/client-timestream-write": "^3.1015.0",
|
|
101
101
|
"@sinclair/typebox": "^0.34.48"
|
|
102
102
|
}
|
|
103
103
|
}
|