@typeberry/lib 0.1.1-4a6ffa9 → 0.1.1-b537c8b
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/index.cjs +4 -32
- package/index.d.ts +4 -29
- package/index.js +4 -32
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -18,10 +18,10 @@ var TestSuite;
|
|
|
18
18
|
})(TestSuite || (TestSuite = {}));
|
|
19
19
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
20
20
|
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
21
|
-
const env
|
|
21
|
+
const env = typeof process === "undefined" ? {} : process.env;
|
|
22
22
|
const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
23
|
-
let CURRENT_VERSION = parseCurrentVersion(env
|
|
24
|
-
let CURRENT_SUITE = parseCurrentSuite(env
|
|
23
|
+
let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
24
|
+
let CURRENT_SUITE = parseCurrentSuite(env.TEST_SUITE) ?? DEFAULT_SUITE;
|
|
25
25
|
function parseCurrentVersion(env) {
|
|
26
26
|
if (env === undefined) {
|
|
27
27
|
return undefined;
|
|
@@ -200,33 +200,6 @@ class WithDebug {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
const env = typeof process === "undefined" ? {} : process.env;
|
|
204
|
-
/**
|
|
205
|
-
* The function will produce relative path resolver that is adjusted
|
|
206
|
-
* for package location within the workspace.
|
|
207
|
-
*
|
|
208
|
-
* Example:
|
|
209
|
-
* $ npm start -w @typeberry/jam
|
|
210
|
-
*
|
|
211
|
-
* The above command will run `./bin/jam/index.js`, however we would
|
|
212
|
-
* still want relative paths to be resolved according to top-level workspace
|
|
213
|
-
* directory.
|
|
214
|
-
*
|
|
215
|
-
* So the caller, passes the absolute workspace path as argument and get's
|
|
216
|
-
* a function that can properly resolve relative paths.
|
|
217
|
-
*
|
|
218
|
-
* NOTE: the translation happens only for development build! When
|
|
219
|
-
* we build a single library from our project, we no longer mangle the paths.
|
|
220
|
-
*/
|
|
221
|
-
const workspacePathFix = env.NODE_ENV === "development"
|
|
222
|
-
? (workspacePath) => (p) => {
|
|
223
|
-
if (p.startsWith("/")) {
|
|
224
|
-
return p;
|
|
225
|
-
}
|
|
226
|
-
return `${workspacePath}/${p}`;
|
|
227
|
-
}
|
|
228
|
-
: () => (p) => p;
|
|
229
|
-
|
|
230
203
|
/**
|
|
231
204
|
* @fileoverview `Opaque<Type, Token>` constructs a unique type which is a subset of Type with a
|
|
232
205
|
* specified unique token Token. It means that base type cannot be assigned to unique type by accident.
|
|
@@ -579,8 +552,7 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
579
552
|
isBrowser: isBrowser,
|
|
580
553
|
measure: measure,
|
|
581
554
|
resultToString: resultToString,
|
|
582
|
-
seeThrough: seeThrough
|
|
583
|
-
workspacePathFix: workspacePathFix
|
|
555
|
+
seeThrough: seeThrough
|
|
584
556
|
});
|
|
585
557
|
|
|
586
558
|
/**
|
package/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ declare enum TestSuite {
|
|
|
12
12
|
declare const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
13
13
|
|
|
14
14
|
declare const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
15
|
+
|
|
16
|
+
declare const env = typeof process === "undefined" ? {} : process.env;
|
|
15
17
|
declare const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
16
18
|
declare let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
17
19
|
declare let CURRENT_SUITE = parseCurrentSuite(env.TEST_SUITE) ?? DEFAULT_SUITE;
|
|
@@ -233,33 +235,6 @@ declare abstract class WithDebug {
|
|
|
233
235
|
}
|
|
234
236
|
}
|
|
235
237
|
|
|
236
|
-
/**
|
|
237
|
-
* The function will produce relative path resolver that is adjusted
|
|
238
|
-
* for package location within the workspace.
|
|
239
|
-
*
|
|
240
|
-
* Example:
|
|
241
|
-
* $ npm start -w @typeberry/jam
|
|
242
|
-
*
|
|
243
|
-
* The above command will run `./bin/jam/index.js`, however we would
|
|
244
|
-
* still want relative paths to be resolved according to top-level workspace
|
|
245
|
-
* directory.
|
|
246
|
-
*
|
|
247
|
-
* So the caller, passes the absolute workspace path as argument and get's
|
|
248
|
-
* a function that can properly resolve relative paths.
|
|
249
|
-
*
|
|
250
|
-
* NOTE: the translation happens only for development build! When
|
|
251
|
-
* we build a single library from our project, we no longer mangle the paths.
|
|
252
|
-
*/
|
|
253
|
-
declare const workspacePathFix =
|
|
254
|
-
env.NODE_ENV === "development"
|
|
255
|
-
? (workspacePath: string) => (p: string) => {
|
|
256
|
-
if (p.startsWith("/")) {
|
|
257
|
-
return p;
|
|
258
|
-
}
|
|
259
|
-
return `${workspacePath}/${p}`;
|
|
260
|
-
}
|
|
261
|
-
: () => (p: string) => p;
|
|
262
|
-
|
|
263
238
|
/**
|
|
264
239
|
* @fileoverview `Opaque<Type, Token>` constructs a unique type which is a subset of Type with a
|
|
265
240
|
* specified unique token Token. It means that base type cannot be assigned to unique type by accident.
|
|
@@ -737,6 +712,7 @@ declare const index$s_assertNever: typeof assertNever;
|
|
|
737
712
|
declare const index$s_callCompareFunction: typeof callCompareFunction;
|
|
738
713
|
declare const index$s_check: typeof check;
|
|
739
714
|
declare const index$s_deepEqual: typeof deepEqual;
|
|
715
|
+
declare const index$s_env: typeof env;
|
|
740
716
|
declare const index$s_getAllKeysSorted: typeof getAllKeysSorted;
|
|
741
717
|
declare const index$s_inspect: typeof inspect;
|
|
742
718
|
declare const index$s_isBrowser: typeof isBrowser;
|
|
@@ -750,9 +726,8 @@ declare const index$s_parseCurrentVersion: typeof parseCurrentVersion;
|
|
|
750
726
|
declare const index$s_resultToString: typeof resultToString;
|
|
751
727
|
declare const index$s_seeThrough: typeof seeThrough;
|
|
752
728
|
declare const index$s_trimStack: typeof trimStack;
|
|
753
|
-
declare const index$s_workspacePathFix: typeof workspacePathFix;
|
|
754
729
|
declare namespace index$s {
|
|
755
|
-
export { index$s_ALL_VERSIONS_IN_ORDER as ALL_VERSIONS_IN_ORDER, index$s_CURRENT_SUITE as CURRENT_SUITE, index$s_CURRENT_VERSION as CURRENT_VERSION, index$s_Compatibility as Compatibility, index$s_DEFAULT_SUITE as DEFAULT_SUITE, index$s_DEFAULT_VERSION as DEFAULT_VERSION, index$s_ErrorsCollector as ErrorsCollector, index$s_GpVersion as GpVersion, Result$2 as Result, index$s_RichTaggedError as RichTaggedError, index$s_TEST_COMPARE_USING as TEST_COMPARE_USING, index$s_TestSuite as TestSuite, index$s_WithDebug as WithDebug, index$s___OPAQUE_TYPE__ as __OPAQUE_TYPE__, index$s_asOpaqueType as asOpaqueType, index$s_assertEmpty as assertEmpty, index$s_assertNever as assertNever, index$s_callCompareFunction as callCompareFunction, index$s_check as check, index$s_deepEqual as deepEqual, index$s_getAllKeysSorted as getAllKeysSorted, index$s_inspect as inspect, index$s_isBrowser as isBrowser, index$s_isResult as isResult, index$s_isTaggedError as isTaggedError, index$s_maybeTaggedErrorToString as maybeTaggedErrorToString, index$s_measure as measure, index$s_oomWarningPrinted as oomWarningPrinted, index$s_parseCurrentSuite as parseCurrentSuite, index$s_parseCurrentVersion as parseCurrentVersion, index$s_resultToString as resultToString, index$s_seeThrough as seeThrough, index$s_trimStack as trimStack
|
|
730
|
+
export { index$s_ALL_VERSIONS_IN_ORDER as ALL_VERSIONS_IN_ORDER, index$s_CURRENT_SUITE as CURRENT_SUITE, index$s_CURRENT_VERSION as CURRENT_VERSION, index$s_Compatibility as Compatibility, index$s_DEFAULT_SUITE as DEFAULT_SUITE, index$s_DEFAULT_VERSION as DEFAULT_VERSION, index$s_ErrorsCollector as ErrorsCollector, index$s_GpVersion as GpVersion, Result$2 as Result, index$s_RichTaggedError as RichTaggedError, index$s_TEST_COMPARE_USING as TEST_COMPARE_USING, index$s_TestSuite as TestSuite, index$s_WithDebug as WithDebug, index$s___OPAQUE_TYPE__ as __OPAQUE_TYPE__, index$s_asOpaqueType as asOpaqueType, index$s_assertEmpty as assertEmpty, index$s_assertNever as assertNever, index$s_callCompareFunction as callCompareFunction, index$s_check as check, index$s_deepEqual as deepEqual, index$s_env as env, index$s_getAllKeysSorted as getAllKeysSorted, index$s_inspect as inspect, index$s_isBrowser as isBrowser, index$s_isResult as isResult, index$s_isTaggedError as isTaggedError, index$s_maybeTaggedErrorToString as maybeTaggedErrorToString, index$s_measure as measure, index$s_oomWarningPrinted as oomWarningPrinted, index$s_parseCurrentSuite as parseCurrentSuite, index$s_parseCurrentVersion as parseCurrentVersion, index$s_resultToString as resultToString, index$s_seeThrough as seeThrough, index$s_trimStack as trimStack };
|
|
756
731
|
export type { index$s_DeepEqualOptions as DeepEqualOptions, index$s_EnumMapping as EnumMapping, index$s_ErrorResult as ErrorResult, index$s_OK as OK, index$s_OkResult as OkResult, index$s_Opaque as Opaque, index$s_StringLiteral as StringLiteral, index$s_TaggedError as TaggedError, index$s_TokenOf as TokenOf, index$s_Uninstantiable as Uninstantiable, index$s_WithOpaque as WithOpaque };
|
|
757
732
|
}
|
|
758
733
|
|
package/index.js
CHANGED
|
@@ -15,10 +15,10 @@ var TestSuite;
|
|
|
15
15
|
})(TestSuite || (TestSuite = {}));
|
|
16
16
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
17
17
|
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
18
|
-
const env
|
|
18
|
+
const env = typeof process === "undefined" ? {} : process.env;
|
|
19
19
|
const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
20
|
-
let CURRENT_VERSION = parseCurrentVersion(env
|
|
21
|
-
let CURRENT_SUITE = parseCurrentSuite(env
|
|
20
|
+
let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
21
|
+
let CURRENT_SUITE = parseCurrentSuite(env.TEST_SUITE) ?? DEFAULT_SUITE;
|
|
22
22
|
function parseCurrentVersion(env) {
|
|
23
23
|
if (env === undefined) {
|
|
24
24
|
return undefined;
|
|
@@ -197,33 +197,6 @@ class WithDebug {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
const env = typeof process === "undefined" ? {} : process.env;
|
|
201
|
-
/**
|
|
202
|
-
* The function will produce relative path resolver that is adjusted
|
|
203
|
-
* for package location within the workspace.
|
|
204
|
-
*
|
|
205
|
-
* Example:
|
|
206
|
-
* $ npm start -w @typeberry/jam
|
|
207
|
-
*
|
|
208
|
-
* The above command will run `./bin/jam/index.js`, however we would
|
|
209
|
-
* still want relative paths to be resolved according to top-level workspace
|
|
210
|
-
* directory.
|
|
211
|
-
*
|
|
212
|
-
* So the caller, passes the absolute workspace path as argument and get's
|
|
213
|
-
* a function that can properly resolve relative paths.
|
|
214
|
-
*
|
|
215
|
-
* NOTE: the translation happens only for development build! When
|
|
216
|
-
* we build a single library from our project, we no longer mangle the paths.
|
|
217
|
-
*/
|
|
218
|
-
const workspacePathFix = env.NODE_ENV === "development"
|
|
219
|
-
? (workspacePath) => (p) => {
|
|
220
|
-
if (p.startsWith("/")) {
|
|
221
|
-
return p;
|
|
222
|
-
}
|
|
223
|
-
return `${workspacePath}/${p}`;
|
|
224
|
-
}
|
|
225
|
-
: () => (p) => p;
|
|
226
|
-
|
|
227
200
|
/**
|
|
228
201
|
* @fileoverview `Opaque<Type, Token>` constructs a unique type which is a subset of Type with a
|
|
229
202
|
* specified unique token Token. It means that base type cannot be assigned to unique type by accident.
|
|
@@ -576,8 +549,7 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
576
549
|
isBrowser: isBrowser,
|
|
577
550
|
measure: measure,
|
|
578
551
|
resultToString: resultToString,
|
|
579
|
-
seeThrough: seeThrough
|
|
580
|
-
workspacePathFix: workspacePathFix
|
|
552
|
+
seeThrough: seeThrough
|
|
581
553
|
});
|
|
582
554
|
|
|
583
555
|
/**
|