node-opcua-enum 2.64.1 → 2.66.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/enum.d.ts +78 -74
- package/dist/enum.js +243 -231
- package/dist/enum.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +21 -17
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/source/enum.ts +33 -25
package/dist/enum.d.ts
CHANGED
|
@@ -1,74 +1,78 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-enum
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Represents an Item of an Enum.
|
|
7
|
-
*
|
|
8
|
-
* @class Enum
|
|
9
|
-
*/
|
|
10
|
-
export declare class EnumItem {
|
|
11
|
-
key: string;
|
|
12
|
-
value: number;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param key the enum key
|
|
16
|
-
* @param value the enum value
|
|
17
|
-
*/
|
|
18
|
-
constructor(key: string, value: number);
|
|
19
|
-
/**
|
|
20
|
-
* Checks if the EnumItem is the same as the passing object.
|
|
21
|
-
* @method is
|
|
22
|
-
* @param {EnumItem | String | Number} item The object to check with.
|
|
23
|
-
* @return {Boolean} The check result.
|
|
24
|
-
*/
|
|
25
|
-
is(item: EnumItem | string | number): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Checks if the flagged EnumItem has the passing object.
|
|
28
|
-
* @method has
|
|
29
|
-
* @param {EnumItem | String |Number} value The object to check with.
|
|
30
|
-
* @return {Boolean} The check result.
|
|
31
|
-
*/
|
|
32
|
-
has(value: string | number | EnumItem): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Returns String representation of this EnumItem.
|
|
35
|
-
* @method toString
|
|
36
|
-
* @return {String} String representation of this EnumItem.
|
|
37
|
-
*/
|
|
38
|
-
toString(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Returns JSON object representation of this EnumItem.
|
|
41
|
-
* @method toJSON
|
|
42
|
-
* @return {String} JSON object representation of this EnumItem.
|
|
43
|
-
*/
|
|
44
|
-
toJSON(): any;
|
|
45
|
-
/**
|
|
46
|
-
* Returns the value to compare with.
|
|
47
|
-
* @method valueOf
|
|
48
|
-
* @return {String} The value to compare with.
|
|
49
|
-
*/
|
|
50
|
-
valueOf(): number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-enum
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents an Item of an Enum.
|
|
7
|
+
*
|
|
8
|
+
* @class Enum
|
|
9
|
+
*/
|
|
10
|
+
export declare class EnumItem {
|
|
11
|
+
key: string;
|
|
12
|
+
value: number;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param key the enum key
|
|
16
|
+
* @param value the enum value
|
|
17
|
+
*/
|
|
18
|
+
constructor(key: string, value: number);
|
|
19
|
+
/**
|
|
20
|
+
* Checks if the EnumItem is the same as the passing object.
|
|
21
|
+
* @method is
|
|
22
|
+
* @param {EnumItem | String | Number} item The object to check with.
|
|
23
|
+
* @return {Boolean} The check result.
|
|
24
|
+
*/
|
|
25
|
+
is(item: EnumItem | string | number): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the flagged EnumItem has the passing object.
|
|
28
|
+
* @method has
|
|
29
|
+
* @param {EnumItem | String |Number} value The object to check with.
|
|
30
|
+
* @return {Boolean} The check result.
|
|
31
|
+
*/
|
|
32
|
+
has(value: string | number | EnumItem): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Returns String representation of this EnumItem.
|
|
35
|
+
* @method toString
|
|
36
|
+
* @return {String} String representation of this EnumItem.
|
|
37
|
+
*/
|
|
38
|
+
toString(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Returns JSON object representation of this EnumItem.
|
|
41
|
+
* @method toJSON
|
|
42
|
+
* @return {String} JSON object representation of this EnumItem.
|
|
43
|
+
*/
|
|
44
|
+
toJSON(): any;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the value to compare with.
|
|
47
|
+
* @method valueOf
|
|
48
|
+
* @return {String} The value to compare with.
|
|
49
|
+
*/
|
|
50
|
+
valueOf(): number;
|
|
51
|
+
}
|
|
52
|
+
export interface _TypescriptEnum {
|
|
53
|
+
[key: string | number]: number | string;
|
|
54
|
+
}
|
|
55
|
+
export declare function adaptTypescriptEnum(map: _TypescriptEnum | string[]): _TypescriptEnum;
|
|
56
|
+
/**
|
|
57
|
+
* @class Enum
|
|
58
|
+
* @constructor
|
|
59
|
+
* Represents an Enum with enum items.
|
|
60
|
+
* @param {Array || Object} map This are the enum items.
|
|
61
|
+
*/
|
|
62
|
+
export declare class Enum {
|
|
63
|
+
private readonly enumItems;
|
|
64
|
+
private readonly _isFlaggable;
|
|
65
|
+
constructor(map: _TypescriptEnum | string[]);
|
|
66
|
+
get isFlaggable(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the appropriate EnumItem.
|
|
69
|
+
* @method get
|
|
70
|
+
* @param key The object to get with.
|
|
71
|
+
* @return the get result.
|
|
72
|
+
*/
|
|
73
|
+
get(key: EnumItem | string | number): EnumItem | null;
|
|
74
|
+
getDefaultValue(): EnumItem;
|
|
75
|
+
toString(): string;
|
|
76
|
+
private _getByString;
|
|
77
|
+
private _getByNum;
|
|
78
|
+
}
|
package/dist/enum.js
CHANGED
|
@@ -1,232 +1,244 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-enum
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
// tslint:disable:no-bitwise
|
|
7
|
-
// tslint:disable:max-classes-per-file
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Enum = exports.EnumItem = void 0;
|
|
10
|
-
/**
|
|
11
|
-
* Represents an Item of an Enum.
|
|
12
|
-
*
|
|
13
|
-
* @class Enum
|
|
14
|
-
*/
|
|
15
|
-
class EnumItem {
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @param key the enum key
|
|
19
|
-
* @param value the enum value
|
|
20
|
-
*/
|
|
21
|
-
constructor(key, value) {
|
|
22
|
-
this.key = key;
|
|
23
|
-
this.value = value;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Checks if the EnumItem is the same as the passing object.
|
|
27
|
-
* @method is
|
|
28
|
-
* @param {EnumItem | String | Number} item The object to check with.
|
|
29
|
-
* @return {Boolean} The check result.
|
|
30
|
-
*/
|
|
31
|
-
is(item) {
|
|
32
|
-
if (item instanceof EnumItem) {
|
|
33
|
-
return this.value === item.value;
|
|
34
|
-
}
|
|
35
|
-
else if (typeof item === "string") {
|
|
36
|
-
return this.key === item;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return this.value === item;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Checks if the flagged EnumItem has the passing object.
|
|
44
|
-
* @method has
|
|
45
|
-
* @param {EnumItem | String |Number} value The object to check with.
|
|
46
|
-
* @return {Boolean} The check result.
|
|
47
|
-
*/
|
|
48
|
-
has(value) {
|
|
49
|
-
if (value instanceof EnumItem) {
|
|
50
|
-
return (value.value & this.value) !== 0;
|
|
51
|
-
}
|
|
52
|
-
else if (typeof value === "string") {
|
|
53
|
-
return this.key.indexOf(value) >= 0;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
return (value & this.value) !== 0;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Returns String representation of this EnumItem.
|
|
61
|
-
* @method toString
|
|
62
|
-
* @return {String} String representation of this EnumItem.
|
|
63
|
-
*/
|
|
64
|
-
toString() {
|
|
65
|
-
return this.key;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Returns JSON object representation of this EnumItem.
|
|
69
|
-
* @method toJSON
|
|
70
|
-
* @return {String} JSON object representation of this EnumItem.
|
|
71
|
-
*/
|
|
72
|
-
toJSON() {
|
|
73
|
-
return this.key;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Returns the value to compare with.
|
|
77
|
-
* @method valueOf
|
|
78
|
-
* @return {String} The value to compare with.
|
|
79
|
-
*/
|
|
80
|
-
valueOf() {
|
|
81
|
-
return this.value;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.EnumItem = EnumItem;
|
|
85
|
-
function powerOfTwo(n) {
|
|
86
|
-
return n &&
|
|
87
|
-
}
|
|
88
|
-
// check if enum is flaggable
|
|
89
|
-
function checkIsFlaggable(enums) {
|
|
90
|
-
for (const e of enums) {
|
|
91
|
-
const value = +e.value;
|
|
92
|
-
if (isNaN(value)) {
|
|
93
|
-
continue; // skipping none number value
|
|
94
|
-
}
|
|
95
|
-
if (
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
c
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-enum
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
// tslint:disable:no-bitwise
|
|
7
|
+
// tslint:disable:max-classes-per-file
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Enum = exports.adaptTypescriptEnum = exports.EnumItem = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Represents an Item of an Enum.
|
|
12
|
+
*
|
|
13
|
+
* @class Enum
|
|
14
|
+
*/
|
|
15
|
+
class EnumItem {
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param key the enum key
|
|
19
|
+
* @param value the enum value
|
|
20
|
+
*/
|
|
21
|
+
constructor(key, value) {
|
|
22
|
+
this.key = key;
|
|
23
|
+
this.value = value;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the EnumItem is the same as the passing object.
|
|
27
|
+
* @method is
|
|
28
|
+
* @param {EnumItem | String | Number} item The object to check with.
|
|
29
|
+
* @return {Boolean} The check result.
|
|
30
|
+
*/
|
|
31
|
+
is(item) {
|
|
32
|
+
if (item instanceof EnumItem) {
|
|
33
|
+
return this.value === item.value;
|
|
34
|
+
}
|
|
35
|
+
else if (typeof item === "string") {
|
|
36
|
+
return this.key === item;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return this.value === item;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Checks if the flagged EnumItem has the passing object.
|
|
44
|
+
* @method has
|
|
45
|
+
* @param {EnumItem | String |Number} value The object to check with.
|
|
46
|
+
* @return {Boolean} The check result.
|
|
47
|
+
*/
|
|
48
|
+
has(value) {
|
|
49
|
+
if (value instanceof EnumItem) {
|
|
50
|
+
return (value.value & this.value) !== 0;
|
|
51
|
+
}
|
|
52
|
+
else if (typeof value === "string") {
|
|
53
|
+
return this.key.indexOf(value) >= 0;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return (value & this.value) !== 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Returns String representation of this EnumItem.
|
|
61
|
+
* @method toString
|
|
62
|
+
* @return {String} String representation of this EnumItem.
|
|
63
|
+
*/
|
|
64
|
+
toString() {
|
|
65
|
+
return this.key;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns JSON object representation of this EnumItem.
|
|
69
|
+
* @method toJSON
|
|
70
|
+
* @return {String} JSON object representation of this EnumItem.
|
|
71
|
+
*/
|
|
72
|
+
toJSON() {
|
|
73
|
+
return this.key;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Returns the value to compare with.
|
|
77
|
+
* @method valueOf
|
|
78
|
+
* @return {String} The value to compare with.
|
|
79
|
+
*/
|
|
80
|
+
valueOf() {
|
|
81
|
+
return this.value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.EnumItem = EnumItem;
|
|
85
|
+
function powerOfTwo(n) {
|
|
86
|
+
return n && !(n & (n - 1)) ? true : false;
|
|
87
|
+
}
|
|
88
|
+
// check if enum is flaggable
|
|
89
|
+
function checkIsFlaggable(enums) {
|
|
90
|
+
for (const e of enums) {
|
|
91
|
+
const value = +e.value;
|
|
92
|
+
if (isNaN(value)) {
|
|
93
|
+
continue; // skipping none number value
|
|
94
|
+
}
|
|
95
|
+
if (value !== 0 && value !== 1 && !powerOfTwo(value)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
function adaptTypescriptEnum(map) {
|
|
102
|
+
if (Array.isArray(map)) {
|
|
103
|
+
let mm = null;
|
|
104
|
+
// create map as flaggable enum
|
|
105
|
+
mm = {};
|
|
106
|
+
for (let i = 0; i < map.length; i++) {
|
|
107
|
+
mm[map[i]] = 1 << i;
|
|
108
|
+
}
|
|
109
|
+
return mm;
|
|
110
|
+
}
|
|
111
|
+
return map;
|
|
112
|
+
}
|
|
113
|
+
exports.adaptTypescriptEnum = adaptTypescriptEnum;
|
|
114
|
+
/**
|
|
115
|
+
* @class Enum
|
|
116
|
+
* @constructor
|
|
117
|
+
* Represents an Enum with enum items.
|
|
118
|
+
* @param {Array || Object} map This are the enum items.
|
|
119
|
+
*/
|
|
120
|
+
class Enum {
|
|
121
|
+
constructor(map) {
|
|
122
|
+
this.enumItems = [];
|
|
123
|
+
let mm = null;
|
|
124
|
+
let isFlaggable = null;
|
|
125
|
+
if (Array.isArray(map)) {
|
|
126
|
+
mm = adaptTypescriptEnum(map);
|
|
127
|
+
isFlaggable = true;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
mm = map;
|
|
131
|
+
}
|
|
132
|
+
for (const key of Object.keys(mm)) {
|
|
133
|
+
if (typeof key !== "string") {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const val = mm[key];
|
|
137
|
+
if (undefined === val) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const kv = new EnumItem(key, val);
|
|
141
|
+
const pThis = this;
|
|
142
|
+
pThis[key] = kv;
|
|
143
|
+
pThis[val] = kv;
|
|
144
|
+
this.enumItems.push(kv);
|
|
145
|
+
}
|
|
146
|
+
if (!isFlaggable) {
|
|
147
|
+
isFlaggable = checkIsFlaggable(this.enumItems);
|
|
148
|
+
}
|
|
149
|
+
this._isFlaggable = isFlaggable;
|
|
150
|
+
}
|
|
151
|
+
get isFlaggable() {
|
|
152
|
+
return this._isFlaggable;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Returns the appropriate EnumItem.
|
|
156
|
+
* @method get
|
|
157
|
+
* @param key The object to get with.
|
|
158
|
+
* @return the get result.
|
|
159
|
+
*/
|
|
160
|
+
get(key) {
|
|
161
|
+
const pThis = this;
|
|
162
|
+
if (key instanceof EnumItem) {
|
|
163
|
+
if (!pThis[key.key]) {
|
|
164
|
+
throw new Error("Invalid key");
|
|
165
|
+
}
|
|
166
|
+
return key;
|
|
167
|
+
}
|
|
168
|
+
if (key === null || key === undefined) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
const prop = pThis[key];
|
|
172
|
+
if (prop) {
|
|
173
|
+
return prop;
|
|
174
|
+
}
|
|
175
|
+
else if (this._isFlaggable) {
|
|
176
|
+
if (typeof key === "string") {
|
|
177
|
+
return this._getByString(key);
|
|
178
|
+
}
|
|
179
|
+
else if (typeof key === "number") {
|
|
180
|
+
return this._getByNum(key);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
getDefaultValue() {
|
|
186
|
+
return this.enumItems[0];
|
|
187
|
+
}
|
|
188
|
+
toString() {
|
|
189
|
+
return this.enumItems.join(" , ");
|
|
190
|
+
}
|
|
191
|
+
_getByString(key) {
|
|
192
|
+
const pThis = this;
|
|
193
|
+
const parts = key.split(" | ");
|
|
194
|
+
let val = 0;
|
|
195
|
+
for (const part of parts) {
|
|
196
|
+
const item = pThis[part];
|
|
197
|
+
if (undefined === item) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
val |= item.value;
|
|
201
|
+
}
|
|
202
|
+
const kv = new EnumItem(key, val);
|
|
203
|
+
// add in cache for later
|
|
204
|
+
let prop = pThis[val];
|
|
205
|
+
if (prop === undefined) {
|
|
206
|
+
pThis[val] = kv;
|
|
207
|
+
}
|
|
208
|
+
prop = pThis[key];
|
|
209
|
+
if (prop === undefined) {
|
|
210
|
+
pThis[key] = kv;
|
|
211
|
+
}
|
|
212
|
+
return kv;
|
|
213
|
+
}
|
|
214
|
+
_getByNum(key) {
|
|
215
|
+
if (key === 0) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
const pThis = this;
|
|
219
|
+
let name;
|
|
220
|
+
let c = 1;
|
|
221
|
+
for (let i = 0; c < key; i++) {
|
|
222
|
+
if ((c & key) === c) {
|
|
223
|
+
const item = pThis[c];
|
|
224
|
+
if (undefined === item) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
if (name) {
|
|
228
|
+
name = name + " | " + item.key;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
name = item.key;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
c *= 2;
|
|
235
|
+
}
|
|
236
|
+
const kv = new EnumItem(name, key);
|
|
237
|
+
// add in cache for later
|
|
238
|
+
pThis[name] = kv;
|
|
239
|
+
pThis[key] = kv;
|
|
240
|
+
return kv;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exports.Enum = Enum;
|
|
232
244
|
//# sourceMappingURL=enum.js.map
|
package/dist/enum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../source/enum.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,4BAA4B;AAC5B,sCAAsC;;;AAEtC;;;;GAIG;AACH,MAAa,QAAQ;IAIjB;;;;OAIG;IACH,YAAmB,GAAW,EAAE,KAAa;QACzC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACI,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../source/enum.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,4BAA4B;AAC5B,sCAAsC;;;AAEtC;;;;GAIG;AACH,MAAa,QAAQ;IAIjB;;;;OAIG;IACH,YAAmB,GAAW,EAAE,KAAa;QACzC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACI,EAAE,CAAC,IAAgC;QACtC,IAAI,IAAI,YAAY,QAAQ,EAAE;YAC1B,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CA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M,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACtB,IAAI,SAAS,KAAK,IAAI,EAAE;oBACpB,OAAO,IAAI,CAAC;iBACf;gBACD,IAAI,IAAI,EAAE;oBACN,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC;iBAClC;qBAAM;oBACH,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;iBACnB;aACJ;YACD,CAAC,IAAI,CAAC,CAAC;SACV;QACD,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACnC,yBAAyB;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACjB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;IACd,CAAC;CACJ;AAtID,oBAsIC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-enum
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export * from "./enum";
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-enum
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export * from "./enum";
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @module node-opcua-enum
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
__exportStar(require("./enum"), exports);
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,yCAAuB"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-enum",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.66.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -enum",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -b",
|
|
7
7
|
"lint": "eslint source/**/*.ts",
|
|
8
|
-
"clean": "
|
|
8
|
+
"clean": "npx rimraf dist *.tsbuildinfo",
|
|
9
9
|
"test": "mocha"
|
|
10
10
|
},
|
|
11
11
|
"main": "./dist/index.js",
|
|
12
12
|
"@types": "./dist/index.d.ts",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"node-opcua-assert": "2.
|
|
14
|
+
"node-opcua-assert": "2.66.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"enum": "3.0.4",
|
|
18
|
-
"node-opcua-benchmarker": "2.
|
|
18
|
+
"node-opcua-benchmarker": "2.66.0",
|
|
19
19
|
"should": "^13.2.3"
|
|
20
20
|
},
|
|
21
21
|
"author": "Etienne Rossignon",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"internet of things"
|
|
34
34
|
],
|
|
35
35
|
"homepage": "http://node-opcua.github.io/",
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "97f47e2e242a1fd737495fd64cb65e8fb7a9964b"
|
|
37
37
|
}
|
package/source/enum.ts
CHANGED
|
@@ -30,7 +30,7 @@ export class EnumItem {
|
|
|
30
30
|
* @param {EnumItem | String | Number} item The object to check with.
|
|
31
31
|
* @return {Boolean} The check result.
|
|
32
32
|
*/
|
|
33
|
-
public is(item: EnumItem|string|number): boolean {
|
|
33
|
+
public is(item: EnumItem | string | number): boolean {
|
|
34
34
|
if (item instanceof EnumItem) {
|
|
35
35
|
return this.value === item.value;
|
|
36
36
|
} else if (typeof item === "string") {
|
|
@@ -86,24 +86,40 @@ export class EnumItem {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
function powerOfTwo(n: number): boolean
|
|
90
|
-
|
|
91
|
-
return n && (!(n & (n-1))) ? true: false;
|
|
89
|
+
function powerOfTwo(n: number): boolean {
|
|
90
|
+
return n && !(n & (n - 1)) ? true : false;
|
|
92
91
|
}
|
|
93
92
|
// check if enum is flaggable
|
|
94
93
|
function checkIsFlaggable(enums: EnumItem[]): boolean {
|
|
95
94
|
for (const e of enums) {
|
|
96
|
-
const value =
|
|
95
|
+
const value = +e.value;
|
|
97
96
|
if (isNaN(value)) {
|
|
98
97
|
continue; // skipping none number value
|
|
99
98
|
}
|
|
100
|
-
if (
|
|
99
|
+
if (value !== 0 && value !== 1 && !powerOfTwo(value)) {
|
|
101
100
|
return false;
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
return true;
|
|
105
104
|
}
|
|
106
105
|
|
|
106
|
+
export interface _TypescriptEnum {
|
|
107
|
+
[key: string | number]: number | string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function adaptTypescriptEnum(map: _TypescriptEnum | string[]) {
|
|
111
|
+
if (Array.isArray(map)) {
|
|
112
|
+
let mm: _TypescriptEnum | null = null;
|
|
113
|
+
// create map as flaggable enum
|
|
114
|
+
mm = {};
|
|
115
|
+
for (let i = 0; i < map.length; i++) {
|
|
116
|
+
mm[map[i]] = 1 << i;
|
|
117
|
+
}
|
|
118
|
+
return mm;
|
|
119
|
+
}
|
|
120
|
+
return map as _TypescriptEnum;
|
|
121
|
+
}
|
|
122
|
+
|
|
107
123
|
/**
|
|
108
124
|
* @class Enum
|
|
109
125
|
* @constructor
|
|
@@ -111,28 +127,25 @@ function checkIsFlaggable(enums: EnumItem[]): boolean {
|
|
|
111
127
|
* @param {Array || Object} map This are the enum items.
|
|
112
128
|
*/
|
|
113
129
|
export class Enum {
|
|
114
|
-
|
|
115
130
|
private readonly enumItems: EnumItem[];
|
|
116
131
|
private readonly _isFlaggable: boolean;
|
|
117
132
|
|
|
118
|
-
constructor(map:
|
|
119
|
-
|
|
133
|
+
constructor(map: _TypescriptEnum | string[]) {
|
|
120
134
|
this.enumItems = [];
|
|
121
|
-
let mm:
|
|
135
|
+
let mm: _TypescriptEnum | null = null;
|
|
122
136
|
let isFlaggable = null;
|
|
123
137
|
if (Array.isArray(map)) {
|
|
124
|
-
|
|
125
|
-
mm = {};
|
|
126
|
-
for (let i = 0; i < map.length; i++) {
|
|
127
|
-
mm[map[i]] = 1 << i;
|
|
128
|
-
}
|
|
138
|
+
mm = adaptTypescriptEnum(map);
|
|
129
139
|
isFlaggable = true;
|
|
130
140
|
} else {
|
|
131
141
|
mm = map;
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
for (const key of Object.keys(mm)) {
|
|
135
|
-
|
|
145
|
+
if (typeof key !== "string") {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const val = mm[key] as number;
|
|
136
149
|
if (undefined === val) {
|
|
137
150
|
continue;
|
|
138
151
|
}
|
|
@@ -150,7 +163,7 @@ export class Enum {
|
|
|
150
163
|
}
|
|
151
164
|
this._isFlaggable = isFlaggable;
|
|
152
165
|
}
|
|
153
|
-
|
|
166
|
+
|
|
154
167
|
public get isFlaggable(): boolean {
|
|
155
168
|
return this._isFlaggable;
|
|
156
169
|
}
|
|
@@ -160,8 +173,7 @@ export class Enum {
|
|
|
160
173
|
* @param key The object to get with.
|
|
161
174
|
* @return the get result.
|
|
162
175
|
*/
|
|
163
|
-
public get(key: EnumItem | string | number):
|
|
164
|
-
|
|
176
|
+
public get(key: EnumItem | string | number): EnumItem | null {
|
|
165
177
|
const pThis = this as any;
|
|
166
178
|
if (key instanceof EnumItem) {
|
|
167
179
|
if (!pThis[key.key]) {
|
|
@@ -194,8 +206,7 @@ export class Enum {
|
|
|
194
206
|
return this.enumItems.join(" , ");
|
|
195
207
|
}
|
|
196
208
|
|
|
197
|
-
private _getByString(key: string):
|
|
198
|
-
|
|
209
|
+
private _getByString(key: string): EnumItem | null {
|
|
199
210
|
const pThis = this as any;
|
|
200
211
|
const parts = key.split(" | ");
|
|
201
212
|
|
|
@@ -221,8 +232,7 @@ export class Enum {
|
|
|
221
232
|
return kv;
|
|
222
233
|
}
|
|
223
234
|
|
|
224
|
-
private _getByNum(key: number):
|
|
225
|
-
|
|
235
|
+
private _getByNum(key: number): EnumItem | null {
|
|
226
236
|
if (key === 0) {
|
|
227
237
|
return null;
|
|
228
238
|
}
|
|
@@ -250,6 +260,4 @@ export class Enum {
|
|
|
250
260
|
pThis[key] = kv;
|
|
251
261
|
return kv;
|
|
252
262
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
263
|
}
|