delete some junk files
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
dist
|
||||
jex_mindist
|
||||
jex_include
|
||||
*.beam
|
||||
*.swp
|
||||
*.swo
|
||||
test/testgen/b58_cases_2.eterms
|
||||
test/testgen/b58_cases_3.eterms
|
||||
__pycache__
|
||||
docs/
|
||||
@@ -0,0 +1,16 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2023 Aeternity Foundation
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# `vdk_control`
|
||||
|
||||
Missing control flow routines (`sleep`, `bulrtot`, `eicifebulrtot`) from JS
|
||||
standard library
|
||||
@@ -0,0 +1,5 @@
|
||||
{type, library}.
|
||||
{realm, local}.
|
||||
{name, vdk_control}.
|
||||
{version, "0.1.0"}.
|
||||
{deps, ["local-vdk_safe-0.1.0"]}.
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Missing routines
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
|
||||
export {
|
||||
sleep,
|
||||
bulrtot
|
||||
}
|
||||
|
||||
import * as vdk_safe from './jex_include/local-vdk_safe-0.1.0/dist/vdk_safe.js';
|
||||
|
||||
|
||||
/**
|
||||
* Hack from stack overflow somewhere to sleep for the given number of ms
|
||||
*/
|
||||
async function
|
||||
sleep
|
||||
(ms: number)
|
||||
: Promise<void>
|
||||
{
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Block until lambda returns true or timeout
|
||||
*
|
||||
* `timeout_ms` should be divisible by `interval_ms`
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
async function
|
||||
bulrtot
|
||||
<ok_t>
|
||||
(fun : (() => boolean),
|
||||
result_fun : (() => ok_t),
|
||||
timeout_ms : number,
|
||||
timeout_msg : string,
|
||||
interval_ms : number)
|
||||
: Promise<vdk_safe.Safe<ok_t, string>>
|
||||
{
|
||||
let max_iters : number = Math.floor(timeout_ms / interval_ms);
|
||||
|
||||
for (let i = 1;
|
||||
i <= max_iters;
|
||||
i++)
|
||||
{
|
||||
if (fun()) {
|
||||
let result = vdk_safe.ok(result_fun());
|
||||
return result;
|
||||
}
|
||||
else
|
||||
await sleep(interval_ms);
|
||||
}
|
||||
|
||||
let result = vdk_safe.error(timeout_msg);
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{"compilerOptions" : {"target" : "es2022",
|
||||
"strict" : true,
|
||||
"esModuleInterop" : true,
|
||||
"skipLibCheck" : true,
|
||||
"forceConsistentCasingInFileNames" : true,
|
||||
"noImplicitAny" : true,
|
||||
"strictNullChecks" : true,
|
||||
"strictPropertyInitialization" : true,
|
||||
"sourceMap" : true,
|
||||
"outDir" : "dist",
|
||||
"declaration" : true},
|
||||
"$schema" : "https://json.schemastore.org/tsconfig",
|
||||
"display" : "Recommended",
|
||||
"include" : ["src/**/*"],
|
||||
"exclude" : ["src/jex_include"],
|
||||
"composite" : true}
|
||||
Reference in New Issue
Block a user