@skipruntime/core 0.0.2 → 0.0.4
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/binding.d.ts +4 -6
- package/dist/binding.d.ts.map +1 -1
- package/dist/binding.js.map +1 -1
- package/dist/index.d.ts +14 -56
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -102
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +42 -16
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +32 -25
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/binding.js +14 -0
- package/src/binding.ts +11 -6
- package/src/errors.js +26 -0
- package/src/index.js +742 -0
- package/src/index.ts +106 -163
- package/src/internal.js +2 -0
- package/src/utils.js +57 -0
- package/src/utils.ts +55 -40
- package/dist/remote.d.ts +0 -22
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -71
- package/dist/remote.js.map +0 -1
- package/src/remote.ts +0 -94
package/dist/utils.js
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
var _a, _b, _c, _d;
|
|
2
|
+
import { sknative } from "@skiplang/std";
|
|
3
|
+
/**
|
|
4
|
+
* `Reducer` to maintain the sum of input values.
|
|
5
|
+
*
|
|
6
|
+
* A `Reducer` that maintains the sum of values as they are added and removed from a collection.
|
|
7
|
+
*/
|
|
2
8
|
export class Sum {
|
|
3
9
|
constructor() {
|
|
4
|
-
this
|
|
5
|
-
}
|
|
6
|
-
add(acc, value) {
|
|
7
|
-
return acc + value;
|
|
8
|
-
}
|
|
9
|
-
remove(acc, value) {
|
|
10
|
-
return acc - value;
|
|
10
|
+
this[_a] = "sum";
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
_a = sknative;
|
|
14
|
+
/**
|
|
15
|
+
* `Reducer` to maintain the minimum of input values.
|
|
16
|
+
*
|
|
17
|
+
* A `Reducer` that maintains the minimum of values as they are added and removed from a collection.
|
|
18
|
+
*/
|
|
13
19
|
export class Min {
|
|
14
20
|
constructor() {
|
|
15
|
-
this
|
|
16
|
-
}
|
|
17
|
-
add(acc, value) {
|
|
18
|
-
return acc === null ? value : Math.min(acc, value);
|
|
19
|
-
}
|
|
20
|
-
remove(acc, value) {
|
|
21
|
-
return value > acc ? acc : null;
|
|
21
|
+
this[_b] = "min";
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
_b = sknative;
|
|
25
|
+
/**
|
|
26
|
+
* `Reducer` to maintain the maximum of input values.
|
|
27
|
+
*
|
|
28
|
+
* A `Reducer` that maintains the maximum of values as they are added and removed from a collection.
|
|
29
|
+
*/
|
|
24
30
|
export class Max {
|
|
25
31
|
constructor() {
|
|
26
|
-
this
|
|
27
|
-
}
|
|
28
|
-
add(acc, value) {
|
|
29
|
-
return acc === null ? value : Math.max(acc, value);
|
|
30
|
-
}
|
|
31
|
-
remove(acc, value) {
|
|
32
|
-
return value < acc ? acc : null;
|
|
32
|
+
this[_c] = "max";
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
_c = sknative;
|
|
36
|
+
/**
|
|
37
|
+
* `Reducer` to maintain the count of input values.
|
|
38
|
+
*
|
|
39
|
+
* A `Reducer` that maintains the number of values as they are added and removed from a collection.
|
|
40
|
+
*/
|
|
41
|
+
export class Count {
|
|
42
|
+
constructor() {
|
|
43
|
+
this[_d] = "count";
|
|
38
44
|
}
|
|
39
45
|
}
|
|
46
|
+
_d = sknative;
|
|
40
47
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AACA,OAAO,EAAmB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D;;;;GAIG;AACH,MAAM,OAAO,GAAG;IAAhB;QACE,QAAU,GAAG,KAAK,CAAC;IAOrB,CAAC;CAAA;KAPE,QAAQ;AASX;;;;GAIG;AACH,MAAM,OAAO,GAAG;IAAhB;QACE,QAAU,GAAG,KAAK,CAAC;IAOrB,CAAC;CAAA;KAPE,QAAQ;AASX;;;;GAIG;AACH,MAAM,OAAO,GAAG;IAAhB;QACE,QAAU,GAAG,KAAK,CAAC;IAOrB,CAAC;CAAA;KAPE,QAAQ;AASX;;;;GAIG;AACH,MAAM,OAAO,KAAK;IAAlB;QACE,QAAU,GAAG,OAAO,CAAC;IAOvB,CAAC;CAAA;KAPE,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skipruntime/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"lint": "eslint"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@skipruntime/api": "^0.0.
|
|
16
|
+
"@skipruntime/api": "^0.0.5"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/src/binding.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceBuilder = void 0;
|
|
4
|
+
var ResourceBuilder = /** @class */ (function () {
|
|
5
|
+
function ResourceBuilder(builder) {
|
|
6
|
+
this.builder = builder;
|
|
7
|
+
}
|
|
8
|
+
ResourceBuilder.prototype.build = function (parameters) {
|
|
9
|
+
var builder = this.builder;
|
|
10
|
+
return new builder(parameters);
|
|
11
|
+
};
|
|
12
|
+
return ResourceBuilder;
|
|
13
|
+
}());
|
|
14
|
+
exports.ResourceBuilder = ResourceBuilder;
|
package/src/binding.ts
CHANGED
|
@@ -14,13 +14,9 @@ import {
|
|
|
14
14
|
export type Handle<T> = Internal.Opaque<number, { handle_for: T }>;
|
|
15
15
|
|
|
16
16
|
export class ResourceBuilder {
|
|
17
|
-
constructor(
|
|
18
|
-
private readonly builder: new (params: {
|
|
19
|
-
[param: string]: string;
|
|
20
|
-
}) => Resource,
|
|
21
|
-
) {}
|
|
17
|
+
constructor(private readonly builder: new (params: Json) => Resource) {}
|
|
22
18
|
|
|
23
|
-
build(parameters:
|
|
19
|
+
build(parameters: Json): Resource {
|
|
24
20
|
const builder = this.builder;
|
|
25
21
|
return new builder(parameters);
|
|
26
22
|
}
|
|
@@ -146,11 +142,20 @@ export interface FromBinding {
|
|
|
146
142
|
mapper: Pointer<Internal.Mapper>,
|
|
147
143
|
reducer: Pointer<Internal.Reducer>,
|
|
148
144
|
): string;
|
|
145
|
+
SkipRuntime_Collection__nativeMapReduce(
|
|
146
|
+
collection: string,
|
|
147
|
+
mapper: Pointer<Internal.Mapper>,
|
|
148
|
+
reducer: string,
|
|
149
|
+
): string;
|
|
149
150
|
|
|
150
151
|
SkipRuntime_Collection__reduce(
|
|
151
152
|
collection: string,
|
|
152
153
|
reducer: Pointer<Internal.Reducer>,
|
|
153
154
|
): string;
|
|
155
|
+
SkipRuntime_Collection__nativeReduce(
|
|
156
|
+
collection: string,
|
|
157
|
+
reducer: string,
|
|
158
|
+
): string;
|
|
154
159
|
|
|
155
160
|
SkipRuntime_Collection__slice(
|
|
156
161
|
collection: string,
|
package/src/errors.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.UnknownCollectionError = void 0;
|
|
19
|
+
var UnknownCollectionError = /** @class */ (function (_super) {
|
|
20
|
+
__extends(UnknownCollectionError, _super);
|
|
21
|
+
function UnknownCollectionError() {
|
|
22
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
}
|
|
24
|
+
return UnknownCollectionError;
|
|
25
|
+
}(Error));
|
|
26
|
+
exports.UnknownCollectionError = UnknownCollectionError;
|