greybel-interpreter 2.8.5 → 2.8.6
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/context.js +2 -2
- package/dist/utils/error.d.ts +1 -1
- package/dist/utils/error.js +2 -2
- package/dist/utils/uuid.d.ts +1 -0
- package/dist/utils/uuid.js +36 -0
- package/package.json +2 -3
package/dist/context.js
CHANGED
|
@@ -19,7 +19,7 @@ const default_1 = require("./types/default");
|
|
|
19
19
|
const map_1 = require("./types/map");
|
|
20
20
|
const path_1 = require("./utils/path");
|
|
21
21
|
const set_immediate_1 = require("./utils/set-immediate");
|
|
22
|
-
const uuid_1 = require("uuid");
|
|
22
|
+
const uuid_1 = require("./utils/uuid");
|
|
23
23
|
var ContextType;
|
|
24
24
|
(function (ContextType) {
|
|
25
25
|
ContextType[ContextType["Api"] = 0] = "Api";
|
|
@@ -136,7 +136,7 @@ class ProcessState extends events_1.EventEmitter {
|
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
createExitObserver() {
|
|
139
|
-
const id = (0, uuid_1.
|
|
139
|
+
const id = (0, uuid_1.uuid)();
|
|
140
140
|
this.observer.add(id);
|
|
141
141
|
return {
|
|
142
142
|
occured: () => this.observerWithExitOccurence.has(id),
|
package/dist/utils/error.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare class RuntimeError extends Error {
|
|
|
8
8
|
target: string;
|
|
9
9
|
stackTrace: Operation[];
|
|
10
10
|
source?: Error;
|
|
11
|
-
constructor(message: string, context
|
|
11
|
+
constructor(message: string, context?: RuntimeContext, source?: Error);
|
|
12
12
|
private createTrace;
|
|
13
13
|
}
|
|
14
14
|
interface PrepareContext {
|
package/dist/utils/error.js
CHANGED
|
@@ -5,8 +5,8 @@ class RuntimeError extends Error {
|
|
|
5
5
|
constructor(message, context, source) {
|
|
6
6
|
var _a;
|
|
7
7
|
super(message);
|
|
8
|
-
this.target = context.target;
|
|
9
|
-
this.stackTrace = (_a = context.stackTrace) !== null && _a !== void 0 ? _a : [];
|
|
8
|
+
this.target = context === null || context === void 0 ? void 0 : context.target;
|
|
9
|
+
this.stackTrace = (_a = context === null || context === void 0 ? void 0 : context.stackTrace) !== null && _a !== void 0 ? _a : [];
|
|
10
10
|
this.stack = this.createTrace();
|
|
11
11
|
this.source = source;
|
|
12
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const uuid: () => string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uuid = void 0;
|
|
4
|
+
// Source: https://gist.github.com/alemures/ba4cd1b37a4b11346d7f54f05c826d24
|
|
5
|
+
function createUUIDFactory() {
|
|
6
|
+
const lut = [];
|
|
7
|
+
for (let i = 0; i < 256; i++)
|
|
8
|
+
lut[i] = (i < 16 ? '0' : '') + i.toString(16);
|
|
9
|
+
return function () {
|
|
10
|
+
const d0 = (Math.random() * 0xffffffff) | 0;
|
|
11
|
+
const d1 = (Math.random() * 0xffffffff) | 0;
|
|
12
|
+
const d2 = (Math.random() * 0xffffffff) | 0;
|
|
13
|
+
const d3 = (Math.random() * 0xffffffff) | 0;
|
|
14
|
+
return (lut[d0 & 0xff] +
|
|
15
|
+
lut[(d0 >> 8) & 0xff] +
|
|
16
|
+
lut[(d0 >> 16) & 0xff] +
|
|
17
|
+
lut[(d0 >> 24) & 0xff] +
|
|
18
|
+
'-' +
|
|
19
|
+
lut[d1 & 0xff] +
|
|
20
|
+
lut[(d1 >> 8) & 0xff] +
|
|
21
|
+
'-' +
|
|
22
|
+
lut[((d1 >> 16) & 0x0f) | 0x40] +
|
|
23
|
+
lut[(d1 >> 24) & 0xff] +
|
|
24
|
+
'-' +
|
|
25
|
+
lut[(d2 & 0x3f) | 0x80] +
|
|
26
|
+
lut[(d2 >> 8) & 0xff] +
|
|
27
|
+
'-' +
|
|
28
|
+
lut[(d2 >> 16) & 0xff] +
|
|
29
|
+
lut[(d2 >> 24) & 0xff] +
|
|
30
|
+
lut[d3 & 0xff] +
|
|
31
|
+
lut[(d3 >> 8) & 0xff] +
|
|
32
|
+
lut[(d3 >> 16) & 0xff] +
|
|
33
|
+
lut[(d3 >> 24) & 0xff]);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.uuid = createUUIDFactory();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "greybel-interpreter",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.6",
|
|
4
4
|
"description": "Interpreter",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index",
|
|
@@ -50,8 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"greybel-core": "^0.10.0",
|
|
52
52
|
"greyscript-core": "^0.10.0",
|
|
53
|
-
"lru-cache": "^10.0.1"
|
|
54
|
-
"uuid": "^9.0.1"
|
|
53
|
+
"lru-cache": "^10.0.1"
|
|
55
54
|
},
|
|
56
55
|
"keywords": [
|
|
57
56
|
"greyscript",
|