@magmacomputing/tempo 1.0.0 → 1.0.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.
- package/dist/cipher.class.js +117 -50
- package/dist/enumerate.library.js +55 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -2
- package/dist/logify.class.js +88 -39
- package/dist/pledge.class.js +185 -115
- package/dist/tempo.class.d.ts +1 -0
- package/dist/tempo.class.js +1325 -1292
- package/package.json +5 -1
package/dist/cipher.class.js
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
36
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
37
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
38
|
+
};
|
|
39
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
40
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
41
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
42
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
43
|
+
};
|
|
1
44
|
import { toHex } from './number.library.js';
|
|
2
45
|
import { asString } from './string.library.js';
|
|
3
46
|
import { Immutable, Static } from './class.library.js';
|
|
@@ -12,54 +55,78 @@ const keys = {
|
|
|
12
55
|
TypeKey: 'AES-GCM',
|
|
13
56
|
};
|
|
14
57
|
/** Static-only cryptographic methods */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
let Cipher = (() => {
|
|
59
|
+
var _Cipher_cryptoKey, _Cipher_vector, _Cipher_asymmetricKey;
|
|
60
|
+
let _classDecorators = [Immutable, Static];
|
|
61
|
+
let _classDescriptor;
|
|
62
|
+
let _classExtraInitializers = [];
|
|
63
|
+
let _classThis;
|
|
64
|
+
var Cipher = class {
|
|
65
|
+
static { _classThis = this; }
|
|
66
|
+
static { __setFunctionName(this, "Cipher"); }
|
|
67
|
+
static {
|
|
68
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
69
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
70
|
+
Cipher = _classThis = _classDescriptor.value;
|
|
71
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
72
|
+
}
|
|
73
|
+
static {
|
|
74
|
+
_Cipher_cryptoKey = { value: subtle.generateKey({ name: keys.TypeKey, length: 128 }, false, ['encrypt', 'decrypt']) };
|
|
75
|
+
}
|
|
76
|
+
static {
|
|
77
|
+
_Cipher_vector = { value: crypto.getRandomValues(new Uint8Array(16)) };
|
|
78
|
+
}
|
|
79
|
+
static {
|
|
80
|
+
_Cipher_asymmetricKey = { value: subtle.generateKey({
|
|
81
|
+
name: keys.SignKey,
|
|
82
|
+
modulusLength: 2048,
|
|
83
|
+
publicExponent: new Uint8Array([1, 0, 1]),
|
|
84
|
+
hash: { name: keys.Algorithm },
|
|
85
|
+
}, false, ['sign', 'verify']) };
|
|
86
|
+
}
|
|
87
|
+
/** random UUID */
|
|
88
|
+
static randomKey = () => crypto.randomUUID().split('-')[0];
|
|
89
|
+
/** decode base64 back into object */
|
|
90
|
+
static decodeBase64 = (buf = '') => {
|
|
91
|
+
const uint8 = base64DecToArr(buf); // first, convert to UInt8Array
|
|
92
|
+
const str = UTF8ArrToStr(uint8); // convert to string
|
|
93
|
+
return objectify(str); // rebuild the original object
|
|
94
|
+
};
|
|
95
|
+
/** encode object into base64 */
|
|
96
|
+
static encodeBase64 = (buf) => {
|
|
97
|
+
const str = stringify(buf); // first, stringify the incoming buffer
|
|
98
|
+
const uint8 = strToUTF8Arr(str); // convert to Uint8Array
|
|
99
|
+
return base64EncArr(uint8); // convert to string
|
|
100
|
+
};
|
|
101
|
+
static hmac = async (source, secret, alg = 'SHA-512', len) => {
|
|
102
|
+
const encoder = new TextEncoder();
|
|
103
|
+
const keyData = encoder.encode(secret);
|
|
104
|
+
const messageData = encoder.encode(asString(source));
|
|
105
|
+
const key = await subtle.importKey('raw', keyData, { name: 'HMAC', hash: { name: alg } }, false, ['sign']);
|
|
106
|
+
const signature = await subtle.sign('HMAC', key, messageData);
|
|
107
|
+
return toHex(Array.from(new Uint8Array(signature)), len);
|
|
108
|
+
};
|
|
109
|
+
static hash = async (source, len, alg = 'SHA-256') => {
|
|
110
|
+
const buffer = Cipher.encodeBuffer(asString(source));
|
|
111
|
+
const hash = await subtle.digest(alg, buffer);
|
|
112
|
+
return toHex(Array.from(new Uint8Array(hash)), len);
|
|
113
|
+
};
|
|
114
|
+
static encodeBuffer = (str) => new Uint16Array(new TextEncoder().encode(str));
|
|
115
|
+
static decodeBuffer = (buf) => new TextDecoder(keys.Encoding).decode(buf);
|
|
116
|
+
static encrypt = async (data) => subtle.encrypt({ name: keys.TypeKey, iv: __classPrivateFieldGet(Cipher, _classThis, "f", _Cipher_vector) }, await __classPrivateFieldGet(Cipher, _classThis, "f", _Cipher_cryptoKey), Cipher.encodeBuffer(data))
|
|
117
|
+
.then(result => new Uint16Array(result))
|
|
118
|
+
.then(Cipher.decodeBuffer);
|
|
119
|
+
static decrypt = async (secret) => subtle.decrypt({ name: keys.TypeKey, iv: __classPrivateFieldGet(Cipher, _classThis, "f", _Cipher_vector) }, await __classPrivateFieldGet(Cipher, _classThis, "f", _Cipher_cryptoKey), await secret)
|
|
120
|
+
.then(result => new Uint16Array(result))
|
|
121
|
+
.then(Cipher.decodeBuffer);
|
|
122
|
+
static sign = async (doc) => subtle.sign(keys.SignKey, (await __classPrivateFieldGet(Cipher, _classThis, "f", _Cipher_asymmetricKey)).privateKey, Cipher.encodeBuffer(doc))
|
|
123
|
+
.then(result => new Uint16Array(result))
|
|
124
|
+
.then(Cipher.decodeBuffer);
|
|
125
|
+
static verify = async (signature, doc) => subtle.verify(keys.SignKey, (await __classPrivateFieldGet(Cipher, _classThis, "f", _Cipher_asymmetricKey)).publicKey, await signature, Cipher.encodeBuffer(doc));
|
|
126
|
+
static {
|
|
127
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
128
|
+
}
|
|
52
129
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.then(result => new Uint16Array(result))
|
|
57
|
-
.then(Cipher.decodeBuffer);
|
|
58
|
-
static decrypt = async (secret) => subtle.decrypt({ name: keys.TypeKey, iv: Cipher.#vector }, await Cipher.#cryptoKey, await secret)
|
|
59
|
-
.then(result => new Uint16Array(result))
|
|
60
|
-
.then(Cipher.decodeBuffer);
|
|
61
|
-
static sign = async (doc) => subtle.sign(keys.SignKey, (await Cipher.#asymmetricKey).privateKey, Cipher.encodeBuffer(doc))
|
|
62
|
-
.then(result => new Uint16Array(result))
|
|
63
|
-
.then(Cipher.decodeBuffer);
|
|
64
|
-
static verify = async (signature, doc) => subtle.verify(keys.SignKey, (await Cipher.#asymmetricKey).publicKey, await signature, Cipher.encodeBuffer(doc));
|
|
65
|
-
}
|
|
130
|
+
return Cipher = _classThis;
|
|
131
|
+
})();
|
|
132
|
+
export { Cipher };
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
1
35
|
import { secure } from './utility.library.js';
|
|
2
36
|
import { Serializable } from './class.library.js';
|
|
3
37
|
import { stringify } from './serialize.library.js';
|
|
@@ -46,9 +80,24 @@ export function enumify(list) {
|
|
|
46
80
|
return secure(Object.create(ENUM, Object.getOwnPropertyDescriptors(stash)));
|
|
47
81
|
}
|
|
48
82
|
/** create an entry in the Serialization Registry to describe how to rebuild an Enum */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
83
|
+
let Enumify = (() => {
|
|
84
|
+
let _classDecorators = [Serializable];
|
|
85
|
+
let _classDescriptor;
|
|
86
|
+
let _classExtraInitializers = [];
|
|
87
|
+
let _classThis;
|
|
88
|
+
var Enumify = class {
|
|
89
|
+
static { _classThis = this; }
|
|
90
|
+
static {
|
|
91
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
92
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
93
|
+
Enumify = _classThis = _classDescriptor.value;
|
|
94
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
95
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
96
|
+
}
|
|
97
|
+
constructor(list) {
|
|
98
|
+
return enumify(list);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return Enumify = _classThis;
|
|
102
|
+
})();
|
|
103
|
+
export { Enumify };
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/logify.class.js
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
1
35
|
import { Immutable } from './class.library.js';
|
|
2
36
|
import { asType } from './type.library.js';
|
|
3
37
|
const Method = {
|
|
@@ -10,44 +44,59 @@ const Method = {
|
|
|
10
44
|
/**
|
|
11
45
|
* provide standard logging methods to the console for a class
|
|
12
46
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (this.#opts.catch) {
|
|
27
|
-
this.warn(...msg); // show a warning on the console
|
|
28
|
-
return; // safe-return
|
|
47
|
+
let Logify = (() => {
|
|
48
|
+
let _classDecorators = [Immutable];
|
|
49
|
+
let _classDescriptor;
|
|
50
|
+
let _classExtraInitializers = [];
|
|
51
|
+
let _classThis;
|
|
52
|
+
var Logify = class {
|
|
53
|
+
static { _classThis = this; }
|
|
54
|
+
static {
|
|
55
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
56
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
57
|
+
Logify = _classThis = _classDescriptor.value;
|
|
58
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
59
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
29
60
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/** console.warn */ warn = this.#log.bind(this, Method.Warn);
|
|
36
|
-
/** console.debug */ debug = this.#log.bind(this, Method.Debug);
|
|
37
|
-
/** console.error */ error = this.#log.bind(this, Method.Error);
|
|
38
|
-
constructor(self, opts = {}) {
|
|
39
|
-
const arg = asType(self);
|
|
40
|
-
switch (arg.type) {
|
|
41
|
-
case 'String':
|
|
42
|
-
this.#name = arg.value;
|
|
43
|
-
break;
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
case 'Object':
|
|
46
|
-
Object.assign(opts, arg.value);
|
|
47
|
-
default:
|
|
48
|
-
this.#name = (self ?? this).constructor.name.concat(': ') ?? '';
|
|
61
|
+
#name;
|
|
62
|
+
#opts = {};
|
|
63
|
+
#log(method, ...msg) {
|
|
64
|
+
if (this.#opts.debug)
|
|
65
|
+
console[method](this.#name, ...msg);
|
|
49
66
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
67
|
+
/**
|
|
68
|
+
* if {catch:true} then show a warning on the console and return
|
|
69
|
+
* otherwise show an error on the console and re-throw the error
|
|
70
|
+
*/
|
|
71
|
+
catch(...msg) {
|
|
72
|
+
if (this.#opts.catch) {
|
|
73
|
+
this.warn(...msg); // show a warning on the console
|
|
74
|
+
return; // safe-return
|
|
75
|
+
}
|
|
76
|
+
this.error(...msg); // this goes to the console
|
|
77
|
+
throw new Error(`${this.#name}${msg}`); // this goes back to the caller
|
|
78
|
+
}
|
|
79
|
+
/** console.log */ log = this.#log.bind(this, Method.Log);
|
|
80
|
+
/** console.info */ info = this.#log.bind(this, Method.Info);
|
|
81
|
+
/** console.warn */ warn = this.#log.bind(this, Method.Warn);
|
|
82
|
+
/** console.debug */ debug = this.#log.bind(this, Method.Debug);
|
|
83
|
+
/** console.error */ error = this.#log.bind(this, Method.Error);
|
|
84
|
+
constructor(self, opts = {}) {
|
|
85
|
+
const arg = asType(self);
|
|
86
|
+
switch (arg.type) {
|
|
87
|
+
case 'String':
|
|
88
|
+
this.#name = arg.value;
|
|
89
|
+
break;
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
case 'Object':
|
|
92
|
+
Object.assign(opts, arg.value);
|
|
93
|
+
default:
|
|
94
|
+
this.#name = (self ?? this).constructor.name.concat(': ') ?? '';
|
|
95
|
+
}
|
|
96
|
+
this.#opts.debug = opts.debug ?? false; // default debug to 'false'
|
|
97
|
+
this.#opts.catch = opts.catch ?? false; // default catch to 'false'
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return Logify = _classThis;
|
|
101
|
+
})();
|
|
102
|
+
export { Logify };
|