functionalscript 0.6.9 → 0.6.11
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/README.md +2 -2
- package/bnf/data/module.f.d.ts +3 -1
- package/bnf/data/module.f.js +4 -2
- package/bnf/data/test.f.d.ts +3 -1
- package/bnf/data/test.f.js +71 -3
- package/bnf/module.f.d.ts +8 -0
- package/bnf/module.f.js +1 -1
- package/bnf/testlib.f.js +1 -0
- package/crypto/hmac/module.f.js +9 -4
- package/crypto/sha2/module.f.d.ts +1 -1
- package/crypto/sign/module.f.d.ts +5 -0
- package/crypto/sign/module.f.js +53 -0
- package/crypto/sign/test.f.d.ts +2 -0
- package/crypto/sign/test.f.js +1 -0
- package/deno/module.d.ts +8 -0
- package/deno/module.js +53 -0
- package/deno/test.d.ts +1 -0
- package/deno/test.js +2 -0
- package/dev/module.f.d.ts +1 -1
- package/dev/module.f.js +7 -4
- package/dev/test/module.f.d.ts +3 -1
- package/dev/test/module.f.js +12 -12
- package/djs/module.f.js +2 -1
- package/djs/parser/module.f.d.ts +7 -2
- package/djs/parser/module.f.js +80 -52
- package/djs/parser/test.f.d.ts +1 -0
- package/djs/parser/test.f.js +104 -76
- package/djs/tokenizer/module.f.d.ts +6 -2
- package/djs/tokenizer/module.f.js +12 -7
- package/djs/tokenizer/test.f.d.ts +1 -0
- package/djs/tokenizer/test.f.js +103 -87
- package/djs/transpiler/module.f.d.ts +3 -2
- package/djs/transpiler/module.f.js +3 -3
- package/djs/transpiler/test.f.js +2 -2
- package/io/module.f.d.ts +7 -0
- package/io/module.js +5 -1
- package/io/virtual/module.f.js +3 -0
- package/issues/31-json.f.d.ts +1 -1
- package/issues/31-json.f.js +1 -1
- package/issues/demo/data/data.f.js +12 -0
- package/issues/demo/data/shared.f.js +3 -0
- package/issues/demo/fs/app.js +4 -0
- package/issues/demo/fs/math.f.js +4 -0
- package/issues/demo/test/test.f.js +13 -0
- package/js/tokenizer/module.f.d.ts +14 -2
- package/js/tokenizer/module.f.js +30 -17
- package/js/tokenizer/test.f.d.ts +1 -0
- package/js/tokenizer/test.f.js +159 -149
- package/json/parser/module.f.js +18 -9
- package/json/parser/test.f.js +16 -16
- package/json/tokenizer/module.f.d.ts +1 -1
- package/json/tokenizer/module.f.js +7 -6
- package/json/tokenizer/test.f.js +68 -68
- package/package.json +10 -11
- package/text/sgr/module.f.d.ts +5 -0
- package/text/sgr/module.f.js +10 -1
- package/types/bit_vec/module.f.d.ts +1 -0
- package/types/bit_vec/module.f.js +1 -0
package/package.json
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functionalscript",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
7
7
|
"**/*.d.ts"
|
|
8
8
|
],
|
|
9
|
-
"description": "FunctionalScript is a functional subset of JavaScript",
|
|
9
|
+
"description": "FunctionalScript is a purely functional subset of JavaScript",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"n": "node --trace-uncaught",
|
|
13
|
-
"prepack": "npm run tsc-emit",
|
|
11
|
+
"prepack": "tsc --NoEmit false",
|
|
14
12
|
"git-clean": "git clean -xf",
|
|
15
|
-
"test20": "npm run
|
|
16
|
-
"test22": "tsc &&
|
|
17
|
-
"test": "tsc &&
|
|
18
|
-
"index": "
|
|
19
|
-
"fsc": "
|
|
13
|
+
"test20": "npm run prepack && node ./dev/test/module.js",
|
|
14
|
+
"test22": "tsc && node --experimental-strip-types ./dev/test/module.ts",
|
|
15
|
+
"test": "tsc && node ./dev/test/module.ts",
|
|
16
|
+
"index": "node ./dev/index/module.ts",
|
|
17
|
+
"fsc": "node ./fsc/module.ts",
|
|
20
18
|
"update": "npm run index && npm install"
|
|
21
19
|
},
|
|
22
20
|
"engines": {
|
|
@@ -46,7 +44,8 @@
|
|
|
46
44
|
},
|
|
47
45
|
"homepage": "https://github.com/functionalscript/functionalscript#readme",
|
|
48
46
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^
|
|
47
|
+
"@types/node": "^24.0.15",
|
|
48
|
+
"@typescript/native-preview": "^7.0.0-dev.20250719.1",
|
|
50
49
|
"typescript": "^5.8.3"
|
|
51
50
|
}
|
|
52
51
|
}
|
package/text/sgr/module.f.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Io, Writable } from "../../io/module.f.ts";
|
|
1
2
|
export declare const backspace: string;
|
|
2
3
|
type End = 'm';
|
|
3
4
|
type Csi = (code: number | string) => string;
|
|
@@ -23,4 +24,8 @@ export type Stdout = {
|
|
|
23
24
|
};
|
|
24
25
|
export type WriteText = (text: string) => WriteText;
|
|
25
26
|
export declare const createConsoleText: (stdout: Stdout) => WriteText;
|
|
27
|
+
export type CsiConsole = (s: string) => void;
|
|
28
|
+
export declare const console: ({ fs: { writeSync } }: Io) => (w: Writable) => CsiConsole;
|
|
29
|
+
export declare const stdio: (io: Io) => CsiConsole;
|
|
30
|
+
export declare const stderr: (io: Io) => CsiConsole;
|
|
26
31
|
export {};
|
package/text/sgr/module.f.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Co control codes
|
|
2
2
|
// https://en.wikipedia.org/wiki/ANSI_escape_code#C0_control_codes
|
|
3
3
|
export const backspace = '\x08';
|
|
4
|
+
const begin = '\x1b[';
|
|
4
5
|
/**
|
|
5
6
|
* Control Sequence Introducer (CSI) escape sequence.
|
|
6
7
|
* https://en.wikipedia.org/wiki/ANSI_escape_code#Control_Sequence_Introducer_commands
|
|
@@ -8,7 +9,7 @@ export const backspace = '\x08';
|
|
|
8
9
|
* @param end - The final character that indicates the type of sequence.
|
|
9
10
|
* @returns A function that takes a code (number or string) and returns the complete ANSI escape sequence.
|
|
10
11
|
*/
|
|
11
|
-
export const csi = (end) => code =>
|
|
12
|
+
export const csi = (end) => code => `${begin}${code.toString()}${end}`;
|
|
12
13
|
/**
|
|
13
14
|
* Specialization of CSI for Select Graphic Rendition (SGR) sequences.
|
|
14
15
|
* https://en.wikipedia.org/wiki/ANSI_escape_code#SGR
|
|
@@ -31,3 +32,11 @@ export const createConsoleText = (stdout) => {
|
|
|
31
32
|
};
|
|
32
33
|
return f('');
|
|
33
34
|
};
|
|
35
|
+
export const console = ({ fs: { writeSync } }) => (w) => {
|
|
36
|
+
const { isTTY } = w;
|
|
37
|
+
return isTTY
|
|
38
|
+
? (s) => writeSync(w.fd, s + '\n')
|
|
39
|
+
: (s) => writeSync(w.fd, s.replace(/\x1b\[[0-9;]*m/g, '') + '\n');
|
|
40
|
+
};
|
|
41
|
+
export const stdio = (io) => console(io)(io.process.stdout);
|
|
42
|
+
export const stderr = (io) => console(io)(io.process.stderr);
|
|
@@ -152,3 +152,4 @@ export declare const u8ListToVec: (bo: BitOrder) => (list: List<number>) => Vec;
|
|
|
152
152
|
* @returns A thunk that produces a list of unsigned 8-bit integers.
|
|
153
153
|
*/
|
|
154
154
|
export declare const u8List: ({ popFront }: BitOrder) => (v: Vec) => Thunk<number>;
|
|
155
|
+
export declare const listToVec: (bo: BitOrder) => (list: List<Vec>) => Vec;
|