functionalscript 0.0.369 → 0.0.372

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.
Files changed (74) hide show
  1. package/.vscode/tasks.json +41 -0
  2. package/com/cpp/com.hpp +18 -12
  3. package/com/cpp/module.f.cjs +78 -0
  4. package/com/cpp/test/build.cjs +5 -3
  5. package/com/cpp/test/main.cpp +4 -0
  6. package/com/cpp/test.f.cjs +35 -2
  7. package/com/cs/{main.f.cjs → module.f.cjs} +14 -20
  8. package/com/cs/test.f.cjs +9 -26
  9. package/com/{main.f.cjs → module.f.cjs} +1 -1
  10. package/com/types/{main.f.cjs → module.f.cjs} +25 -2
  11. package/com/types/test.f.cjs +25 -0
  12. package/commonjs/build/{main.f.cjs → module.f.cjs} +7 -7
  13. package/commonjs/build/test.f.cjs +6 -6
  14. package/commonjs/module/function/{main.f.cjs → module.f.cjs} +1 -1
  15. package/commonjs/module/{main.f.cjs → module.f.cjs} +2 -2
  16. package/commonjs/{main.f.cjs → module.f.cjs} +4 -4
  17. package/commonjs/package/dependencies/{main.f.cjs → module.f.cjs} +2 -2
  18. package/commonjs/package/dependencies/test.f.cjs +1 -1
  19. package/commonjs/package/{main.f.cjs → module.f.cjs} +2 -2
  20. package/commonjs/package/test.f.cjs +1 -1
  21. package/commonjs/path/{main.f.cjs → module.f.cjs} +3 -3
  22. package/commonjs/path/test.f.cjs +7 -7
  23. package/dev/{main.f.cjs → module.f.cjs} +0 -0
  24. package/html/{main.f.cjs → module.f.cjs} +3 -3
  25. package/html/test.f.cjs +1 -1
  26. package/io/commonjs/{main.cjs → module.cjs} +3 -3
  27. package/io/commonjs/test.cjs +2 -2
  28. package/io/result/{main.cjs → module.cjs} +1 -1
  29. package/json/{main.f.cjs → module.f.cjs} +5 -5
  30. package/json/test.f.cjs +3 -3
  31. package/json/tokenizer/{main.f.cjs → module.f.cjs} +3 -3
  32. package/json/tokenizer/test.f.cjs +4 -4
  33. package/module.f.cjs +14 -0
  34. package/package.json +2 -2
  35. package/sha2/{main.f.cjs → module.f.cjs} +1 -1
  36. package/sha2/test.f.cjs +4 -4
  37. package/test.f.cjs +2 -1
  38. package/text/encoding/{main.f.cjs → module.f.cjs} +2 -2
  39. package/text/encoding/test.f.cjs +4 -4
  40. package/text/{main.f.cjs → module.f.cjs} +1 -1
  41. package/text/test.f.cjs +2 -2
  42. package/tsconfig.json +1 -1
  43. package/types/array/{main.f.cjs → module.f.cjs} +1 -1
  44. package/types/array/test.f.cjs +3 -3
  45. package/types/btree/find/{main.f.cjs → module.f.cjs} +4 -4
  46. package/types/btree/find/test.f.cjs +7 -7
  47. package/types/btree/{main.f.cjs → module.f.cjs} +6 -6
  48. package/types/btree/remove/{main.f.cjs → module.f.cjs} +6 -6
  49. package/types/btree/remove/test.f.cjs +6 -6
  50. package/types/btree/set/{main.f.cjs → module.f.cjs} +4 -4
  51. package/types/btree/set/test.f.cjs +5 -5
  52. package/types/btree/test.f.cjs +8 -8
  53. package/types/btree/types/{main.f.cjs → module.f.cjs} +0 -0
  54. package/types/function/compare/{main.f.cjs → module.f.cjs} +1 -1
  55. package/types/function/compare/test.f.cjs +1 -1
  56. package/types/function/{main.f.cjs → module.f.cjs} +2 -2
  57. package/types/function/operator/{main.f.cjs → module.f.cjs} +0 -0
  58. package/types/list/{main.f.cjs → module.f.cjs} +2 -2
  59. package/types/list/test.f.cjs +4 -4
  60. package/types/map/{main.f.cjs → module.f.cjs} +9 -9
  61. package/types/map/test.f.cjs +3 -3
  62. package/types/module.f.cjs +20 -0
  63. package/types/object/{main.f.cjs → module.f.cjs} +2 -2
  64. package/types/object/test.f.cjs +1 -1
  65. package/types/option/{main.f.cjs → module.f.cjs} +0 -0
  66. package/types/option/test.f.cjs +1 -1
  67. package/types/range/{main.f.cjs → module.f.cjs} +0 -0
  68. package/types/range/test.f.cjs +1 -1
  69. package/types/result/{main.f.cjs → module.f.cjs} +0 -0
  70. package/types/stringset/{main.f.cjs → module.f.cjs} +5 -5
  71. package/types/stringset/test.f.cjs +1 -1
  72. package/com/cpp/main.f.cjs +0 -10
  73. package/main.f.cjs +0 -14
  74. package/types/main.f.cjs +0 -20
@@ -0,0 +1,41 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "build",
6
+ "command": "dotnet",
7
+ "type": "process",
8
+ "args": [
9
+ "build",
10
+ "${workspaceFolder}/com/cs/test/test.csproj",
11
+ "/property:GenerateFullPaths=true",
12
+ "/consoleloggerparameters:NoSummary"
13
+ ],
14
+ "problemMatcher": "$msCompile"
15
+ },
16
+ {
17
+ "label": "publish",
18
+ "command": "dotnet",
19
+ "type": "process",
20
+ "args": [
21
+ "publish",
22
+ "${workspaceFolder}/com/cs/test/test.csproj",
23
+ "/property:GenerateFullPaths=true",
24
+ "/consoleloggerparameters:NoSummary"
25
+ ],
26
+ "problemMatcher": "$msCompile"
27
+ },
28
+ {
29
+ "label": "watch",
30
+ "command": "dotnet",
31
+ "type": "process",
32
+ "args": [
33
+ "watch",
34
+ "run",
35
+ "--project",
36
+ "${workspaceFolder}/com/cs/test/test.csproj"
37
+ ],
38
+ "problemMatcher": "$msCompile"
39
+ }
40
+ ]
41
+ }
package/com/cpp/com.hpp CHANGED
@@ -1,7 +1,15 @@
1
- #ifndef COM_HPP
2
- #define COM_HPP
1
+ #pragma once
3
2
 
4
3
  #include <cstdint>
4
+ #include <cstddef>
5
+
6
+ #if defined(__aarch64__)
7
+ #define COM_STDCALL
8
+ #elif defined(__clang__)
9
+ #define COM_STDCALL __attribute__((stdcall))
10
+ #else
11
+ #define COM_STDCALL __stdcall
12
+ #endif
5
13
 
6
14
  namespace com
7
15
  {
@@ -14,34 +22,32 @@ namespace com
14
22
 
15
23
  typedef uint32_t HRESULT;
16
24
  typedef uint32_t ULONG;
25
+ typedef int32_t BOOL;
17
26
 
18
27
  class IUnknown
19
28
  {
20
29
  public:
21
- virtual HRESULT __stdcall QueryInterface(GUID const &riid, IUnknown **const ppvObject) noexcept = 0;
22
- virtual ULONG __stdcall AddRef() noexcept = 0;
23
- virtual ULONG __stdcall Release() noexcept = 0;
30
+ virtual HRESULT COM_STDCALL QueryInterface(GUID const &riid, IUnknown **const ppvObject) noexcept = 0;
31
+ virtual ULONG COM_STDCALL AddRef() noexcept = 0;
32
+ virtual ULONG COM_STDCALL Release() noexcept = 0;
24
33
  };
25
34
 
26
35
  template <class I>
27
- class Ref
36
+ class ref
28
37
  {
29
38
  public:
30
- explicit Ref(I &other) noexcept : p(other.p)
39
+ explicit ref(I &other) noexcept : p(other.p)
31
40
  {
32
41
  p.AddRef();
33
42
  }
34
- Ref(Ref const &other) noexcept : Ref(other.p)
43
+ ref(ref const &other) noexcept : ref(other.p)
35
44
  {
36
45
  }
37
- ~Ref() noexcept
46
+ ~ref() noexcept
38
47
  {
39
48
  p.Release();
40
49
  }
41
-
42
50
  private:
43
51
  I &p;
44
52
  };
45
53
  }
46
-
47
- #endif
@@ -0,0 +1,78 @@
1
+ const types = require('../types/module.f.cjs')
2
+ const text = require('../../text/module.f.cjs')
3
+ const obj = require('../../types/object/module.f.cjs')
4
+ const { list } = require('../../types/module.f.cjs')
5
+
6
+ /** @type {(name: string) => (body: text.Block) => text.Block} */
7
+ const struct = name => body => [`struct ${name}`, '{', body, '};']
8
+
9
+ /** @type {(t: types.BaseType) => string} */
10
+ const baseType = t => {
11
+ switch (t) {
12
+ case 'u8': return 'uint8_t'
13
+ case 'i8': return 'int8_t'
14
+ case 'u16': return 'uint16_t'
15
+ case 'i16': return 'int16_t'
16
+ case 'u32': return 'uint32_t'
17
+ case 'i32': return 'int32_t'
18
+ case 'u64': return 'uint64_t'
19
+ case 'i64': return 'int64_t'
20
+ case 'usize': return 'size_t'
21
+ case 'isize': return 'ptrdiff_t'
22
+ case 'f32': return 'float'
23
+ case 'f64': return 'double'
24
+ case 'bool': return '::com::BOOL'
25
+ }
26
+ }
27
+
28
+ /** @type {(name: string) => (lib: types.Library) => text.Block} */
29
+ const cpp = name => lib => {
30
+
31
+ /** @type {(i: (t: string) => string) => (t: types.Type) => string} */
32
+ const objectType = i => t => {
33
+ if (typeof(t) === 'string') { return baseType(t) }
34
+ if (t.length === 2) { return `${type(t[1])}*` }
35
+ const [id] = t
36
+ if (lib[id].interface === undefined) { return id }
37
+ return i(id)
38
+ }
39
+
40
+ const type = objectType(id => `::com::ref<${id}>`)
41
+
42
+ /** @type {(s: types.Field) => text.Item} */
43
+ const field = ([name, t]) => `${type(t)} ${name};`
44
+
45
+ /** @type {(s: types.Struct) => text.Block} */
46
+ const defStruct = s => list.map(field)(Object.entries(s.struct))
47
+
48
+ /** @type {(fa: types.FieldArray) => string} */
49
+ const result = types.result('void')(type)
50
+
51
+ /** @type {(p: types.Field) => string} */
52
+ const param = ([name, t]) => `${objectType(id => `${id}&`)(t)} ${name}`
53
+
54
+ /** @type {(m: types.Method) => text.Item} */
55
+ const method = ([name, paramArray]) =>
56
+ `virtual ${result(paramArray)} COM_STDCALL ${name}(${list.join(', ')(list.map(param)(types.paramList(paramArray)))}) = 0;`
57
+
58
+ /** @type {(i: types.Interface) => text.Block} */
59
+ const defInterface = i => list.map(method)(Object.entries(i.interface))
60
+
61
+ /** @type {(kv: obj.Entry<types.Definition>) => text.Block} */
62
+ const def = ([name, d]) => d.interface === undefined
63
+ ? struct(name)(defStruct(d))
64
+ : struct(`${name}: ::com::IUnknown`)(defInterface(d))
65
+
66
+ return list.flat([
67
+ ['#pragma once', ''],
68
+ text.curly
69
+ ('namespace')
70
+ (name)
71
+ (list.flatMap(def)(Object.entries(lib)))
72
+ ])
73
+ }
74
+
75
+ module.exports = {
76
+ /** @readonly */
77
+ cpp,
78
+ }
@@ -1,10 +1,12 @@
1
1
  const fs = require('node:fs')
2
2
  const cp = require('node:child_process')
3
- // const cs = require('../test.f.js').result
3
+ const cpp = require('../test.f.cjs').result
4
+ const os = require('node:os');
4
5
 
5
- // fs.writeFileSync('_result.cpp', cs)
6
+ fs.writeFileSync('_result.hpp', cpp)
6
7
  try {
7
- console.log(cp.execSync('clang main.cpp').toString())
8
+ const flags = os.platform() === 'win32' ? '' : ' -std=c++11 -lc++'
9
+ console.log(cp.execSync(`clang${flags} main.cpp`).toString())
8
10
  } catch (e) {
9
11
  // @ts-ignore
10
12
  console.error(e.output.toString())
@@ -1,5 +1,9 @@
1
1
  #include "../com.hpp"
2
+ #include "_result.hpp"
3
+
4
+ #include <iostream>
2
5
 
3
6
  int main()
4
7
  {
8
+ std::cout << "Hello world!" << std::endl;
5
9
  }
@@ -1,3 +1,36 @@
1
- const _ = require('./main.f.cjs')
1
+ const _ = require('./module.f.cjs')
2
+ const library = require('../types/test.f.cjs')
3
+ const text = require('../../text/module.f.cjs')
4
+ const list = require('../../types/list/module.f.cjs')
2
5
 
3
- module.exports = {}
6
+ const f = () =>
7
+ {
8
+ const r = list.join('\n')(text.flat(' ')(_.cpp('My')(library)))
9
+ const e =
10
+ '#pragma once\n' +
11
+ '\n' +
12
+ 'namespace My\n' +
13
+ '{\n' +
14
+ ' struct Slice\n' +
15
+ ' {\n' +
16
+ ' uint8_t* Start;\n' +
17
+ ' size_t Size;\n' +
18
+ ' };\n' +
19
+ ' struct IMy: ::com::IUnknown\n' +
20
+ ' {\n' +
21
+ ' virtual Slice COM_STDCALL GetSlice() = 0;\n' +
22
+ ' virtual void COM_STDCALL SetSlice(Slice slice) = 0;\n' +
23
+ ' virtual ::com::BOOL* COM_STDCALL GetUnsafe() = 0;\n' +
24
+ ' virtual void COM_STDCALL SetUnsafe(Slice* p, uint32_t size) = 0;\n' +
25
+ ' virtual ::com::BOOL COM_STDCALL Some(IMy& p) = 0;\n' +
26
+ ' virtual ::com::ref<IMy> COM_STDCALL GetIMy() = 0;\n' +
27
+ ' };\n' +
28
+ '}'
29
+ if (r !== e) { throw r }
30
+ return r
31
+ }
32
+
33
+ module.exports = {
34
+ /** @readonly */
35
+ result: f()
36
+ }
@@ -1,7 +1,7 @@
1
- const types = require('../types/main.f.cjs')
2
- const text = require('../../text/main.f.cjs')
3
- const list = require('../../types/list/main.f.cjs')
4
- const obj = require('../../types/object/main.f.cjs')
1
+ const types = require('../types/module.f.cjs')
2
+ const text = require('../../text/module.f.cjs')
3
+ const list = require('../../types/list/module.f.cjs')
4
+ const obj = require('../../types/object/module.f.cjs')
5
5
 
6
6
  /** @type {(v: string) => string} */
7
7
  const using = v => `using ${v};`
@@ -42,40 +42,34 @@ const baseType = t => {
42
42
  const unsafe = isUnsafe => isUnsafe ? 'unsafe ' : ''
43
43
 
44
44
  /** @type {(t: types.Type) => readonly[boolean, string]} */
45
- const type = t =>
45
+ const fullType = t =>
46
46
  typeof (t) === 'string' ? [false, baseType(t)] :
47
47
  t.length === 1 ? [false, t[0]] :
48
- [true, `${type(t[1])[1]}*`]
48
+ [true, `${type(t[1])}*`]
49
+
50
+ /** @type {(m: types.Type) => string} */
51
+ const type = t => fullType(t)[1]
49
52
 
50
53
  /** @type {(f: types.Field) => string} */
51
- const param = ([name, t]) => `${type(t)[1]} ${name}`
54
+ const param = ([name, t]) => `${type(t)} ${name}`
52
55
 
53
56
  /** @type {(f: types.Field) => string} */
54
57
  const field = ([name, comType]) => {
55
- const [isUnsafe, t] = type(comType)
58
+ const [isUnsafe, t] = fullType(comType)
56
59
  return `public ${unsafe(isUnsafe)}${t} ${name};`
57
60
  }
58
61
 
59
- /** @type {(m: types.FieldArray) => string} */
60
- const result = m => {
61
- const result = m._
62
- return result === undefined ? 'void' : type(result)[1]
63
- }
64
-
65
62
  /** @type {(field: types.Field) => boolean} */
66
- const isUnsafeField = field => type(field[1])[0]
67
-
68
- /** @type {(kv: obj.Entry<types.Type>) => boolean} */
69
- const isParam = kv => kv[0] !== '_'
63
+ const isUnsafeField = field => fullType(field[1])[0]
70
64
 
71
65
  /** @type {(e: obj.Entry<types.FieldArray>) => readonly string[]} */
72
66
  const method = ([name, m]) => {
73
67
  const paramAndResultList = Object.entries(m)
74
- const paramList = list.filter(isParam)(paramAndResultList)
68
+ const pl = types.paramList(m)
75
69
  const isUnsafe = list.some(list.map(isUnsafeField)(paramAndResultList))
76
70
  return [
77
71
  '[PreserveSig]',
78
- `${unsafe(isUnsafe)}${result(m)} ${name}(${list.join(', ')(list.map(param)(paramList))});`
72
+ `${unsafe(isUnsafe)}${types.result('void')(type)(m)} ${name}(${list.join(', ')(list.map(param)(pl))});`
79
73
  ]
80
74
  }
81
75
 
package/com/cs/test.f.cjs CHANGED
@@ -1,29 +1,8 @@
1
- const types = require('../types/main.f.cjs')
2
- const _ = require('./main.f.cjs')
3
- const list = require('../../types/list/main.f.cjs')
4
- const text = require('../../text/main.f.cjs')
5
-
6
- /** @type {types.Library} */
7
- const library = {
8
- Slice: {
9
- struct: {
10
- Start: ['*', 'u8'],
11
- Size: 'usize',
12
- },
13
- },
14
- IMy: {
15
- guid: 'C66FB270-2D80-49AD-BB6E-88C1F90B805D',
16
- interface: {
17
- GetSlice: { _: ['Slice'] },
18
- SetSlice: { slice: ['Slice'] },
19
- GetUnsafe: { _: ['*', 'bool'] },
20
- SetUnsafe: {
21
- p: ['*', ['Slice']],
22
- size: 'u32'
23
- },
24
- },
25
- }
26
- }
1
+ const types = require('../types/module.f.cjs')
2
+ const _ = require('./module.f.cjs')
3
+ const list = require('../../types/list/module.f.cjs')
4
+ const text = require('../../text/module.f.cjs')
5
+ const library = require('../types/test.f.cjs')
27
6
 
28
7
  const f = () =>
29
8
  {
@@ -52,6 +31,10 @@ const f = () =>
52
31
  ' unsafe bool* GetUnsafe();\n' +
53
32
  ' [PreserveSig]\n' +
54
33
  ' unsafe void SetUnsafe(Slice* p, uint size);\n' +
34
+ ' [PreserveSig]\n' +
35
+ ' bool Some(IMy p);\n' +
36
+ ' [PreserveSig]\n' +
37
+ ' IMy GetIMy();\n' +
55
38
  ' }\n' +
56
39
  '}'
57
40
  if (cs !== e) { throw [cs,e] }
@@ -1,4 +1,4 @@
1
- const types = require('./types/main.f.cjs');
1
+ const types = require('./types/module.f.cjs');
2
2
 
3
3
  module.exports = {
4
4
  /** @readonly */
@@ -1,3 +1,7 @@
1
+ const obj = require('../../types/object/module.f.cjs')
2
+ const list = require('../../types/list/module.f.cjs')
3
+ const { types } = require('../module.f.cjs')
4
+
1
5
  /** @typedef {{readonly[k in string]: Definition}} Library */
2
6
 
3
7
  /** @typedef {Struct|Interface} Definition */
@@ -11,7 +15,7 @@
11
15
 
12
16
  /** @typedef {{readonly[k in string]: Type}} FieldArray */
13
17
 
14
- /** @typedef {readonly[string, Type]} Field */
18
+ /** @typedef {obj.Entry<Type>} Field */
15
19
 
16
20
  /**
17
21
  * @typedef {{
@@ -22,6 +26,8 @@
22
26
 
23
27
  /** @typedef {{readonly[k in string]: FieldArray}} MethodArray */
24
28
 
29
+ /** @typedef {obj.Entry<FieldArray>} Method */
30
+
25
31
  /** @typedef {BaseType|Id|Pointer} Type */
26
32
 
27
33
  /** @typedef {readonly[string]} Id */
@@ -46,4 +52,21 @@
46
52
 
47
53
  /** @typedef {readonly['*', Type]} Pointer */
48
54
 
49
- module.exports = {}
55
+ /** @type {(kv: obj.Entry<Type>) => boolean} */
56
+ const isParam = ([name]) => name !== '_'
57
+
58
+ /** @type {(fa: FieldArray) => list.List<Field> } */
59
+ const paramList = fa => list.filter(isParam)(Object.entries(fa))
60
+
61
+ /** @type {<T>(v: T) => (f: (type: Type) => T) => (fa: FieldArray) => T} */
62
+ const result = v => f => fa => {
63
+ const type = fa._
64
+ return type === undefined ? v : f(type)
65
+ }
66
+
67
+ module.exports = {
68
+ /** @readonly */
69
+ paramList,
70
+ /** @readonly */
71
+ result,
72
+ }
@@ -0,0 +1,25 @@
1
+ const _ = require('./module.f.cjs')
2
+
3
+ /** @type {_.Library} */
4
+ module.exports = {
5
+ Slice: {
6
+ struct: {
7
+ Start: ['*', 'u8'],
8
+ Size: 'usize',
9
+ },
10
+ },
11
+ IMy: {
12
+ guid: 'C66FB270-2D80-49AD-BB6E-88C1F90B805D',
13
+ interface: {
14
+ GetSlice: { _: ['Slice'] },
15
+ SetSlice: { slice: ['Slice'] },
16
+ GetUnsafe: { _: ['*', 'bool'] },
17
+ SetUnsafe: {
18
+ p: ['*', ['Slice']],
19
+ size: 'u32'
20
+ },
21
+ Some: { p: ['IMy'], _: 'bool' },
22
+ GetIMy: { _: ['IMy'] }
23
+ },
24
+ }
25
+ }
@@ -1,10 +1,10 @@
1
- const package_ = require('../package/main.f.cjs')
2
- const module_ = require('../module/main.f.cjs')
3
- const function_ = require('../module/function/main.f.cjs')
4
- const map = require('../../types/map/main.f.cjs')
5
- const object = require('../../types/object/main.f.cjs')
6
- const path = require('../path/main.f.cjs')
7
- const stringSet = require('../../types/stringset/main.f.cjs')
1
+ const package_ = require('../package/module.f.cjs')
2
+ const module_ = require('../module/module.f.cjs')
3
+ const function_ = require('../module/function/module.f.cjs')
4
+ const map = require('../../types/map/module.f.cjs')
5
+ const object = require('../../types/object/module.f.cjs')
6
+ const path = require('../path/module.f.cjs')
7
+ const stringSet = require('../../types/stringset/module.f.cjs')
8
8
 
9
9
  /**
10
10
  * @template M
@@ -1,9 +1,9 @@
1
- const _ = require('./main.f.cjs')
2
- const map = require('../../types/map/main.f.cjs')
3
- const module_ = require('../module/main.f.cjs')
4
- const function_ = require('../module/function/main.f.cjs')
5
- const result = require('../../types/result/main.f.cjs')
6
- const package_ = require('../package/main.f.cjs')
1
+ const _ = require('./module.f.cjs')
2
+ const map = require('../../types/map/module.f.cjs')
3
+ const module_ = require('../module/module.f.cjs')
4
+ const function_ = require('../module/function/module.f.cjs')
5
+ const result = require('../../types/result/module.f.cjs')
6
+ const package_ = require('../package/module.f.cjs')
7
7
 
8
8
  /** @type {{ readonly [k in string]?: result.Result<function_.Function_, unknown> }} */
9
9
  const compileMap = {
@@ -2,7 +2,7 @@
2
2
  * An IO interface for creating and running module functions.
3
3
  */
4
4
 
5
- const result = require('../../../types/result/main.f.cjs')
5
+ const result = require('../../../types/result/module.f.cjs')
6
6
 
7
7
  /** @typedef {<M>(require: Require<M>) => (prior: M) => Result<M>} Function_ */
8
8
 
@@ -1,4 +1,4 @@
1
- const object = require('../../types/object/main.f.cjs')
1
+ const object = require('../../types/object/module.f.cjs')
2
2
 
3
3
  /**
4
4
  * @template M
@@ -53,7 +53,7 @@ const idToString = id => `${id.package}/${id.path.join('/')}`
53
53
 
54
54
  module.exports = {
55
55
  /** @readonly */
56
- function: require('./function/main.f.cjs'),
56
+ function: require('./function/module.f.cjs'),
57
57
  /** @readonly */
58
58
  dir,
59
59
  /** @readonly */
@@ -10,11 +10,11 @@
10
10
 
11
11
  module.exports = {
12
12
  /** @readonly */
13
- build: require('./build/main.f.cjs'),
13
+ build: require('./build/module.f.cjs'),
14
14
  /** @readonly */
15
- module: require('./module/main.f.cjs'),
15
+ module: require('./module/module.f.cjs'),
16
16
  /** @readonly */
17
- package: require('./package/main.f.cjs'),
17
+ package: require('./package/module.f.cjs'),
18
18
  /** @readonly */
19
- path: require('./path/main.f.cjs'),
19
+ path: require('./path/module.f.cjs'),
20
20
  }
@@ -1,5 +1,5 @@
1
- const json = require('../../../json/main.f.cjs')
2
- const list = require('../../../types/list/main.f.cjs')
1
+ const json = require('../../../json/module.f.cjs')
2
+ const list = require('../../../types/list/module.f.cjs')
3
3
 
4
4
  /** @typedef {readonly[string, string]} DependencyJson */
5
5
 
@@ -1,4 +1,4 @@
1
- const _ = require('./main.f.cjs')
1
+ const _ = require('./module.f.cjs')
2
2
 
3
3
  {
4
4
  if (!_.isDependenciesJson(undefined)) { throw 'error' }
@@ -1,5 +1,5 @@
1
- const json = require('../../json/main.f.cjs')
2
- const dependencies = require('./dependencies/main.f.cjs')
1
+ const json = require('../../json/module.f.cjs')
2
+ const dependencies = require('./dependencies/module.f.cjs')
3
3
 
4
4
  /**
5
5
  * @typedef {{
@@ -1,4 +1,4 @@
1
- const _ = require('./main.f.cjs')
1
+ const _ = require('./module.f.cjs')
2
2
 
3
3
  require('./dependencies/test.f.cjs')
4
4
 
@@ -1,6 +1,6 @@
1
- const list = require("../../types/list/main.f.cjs")
2
- const package_ = require("../package/main.f.cjs")
3
- const module_ = require("../module/main.f.cjs")
1
+ const list = require("../../types/list/module.f.cjs")
2
+ const package_ = require("../package/module.f.cjs")
3
+ const module_ = require("../module/module.f.cjs")
4
4
 
5
5
  /** @typedef {readonly string[]} Items */
6
6
 
@@ -1,10 +1,10 @@
1
- const _ = require('./main.f.cjs')
2
- const { todo } = require('../../dev/main.f.cjs')
3
- const json = require('../../json/main.f.cjs')
4
- const { identity } = require('../../types/function/main.f.cjs')
5
- const object = require('../../types/object/main.f.cjs')
6
- const { at } = require('../../types/object/main.f.cjs')
7
- const package_ = require('../package/main.f.cjs')
1
+ const _ = require('./module.f.cjs')
2
+ const { todo } = require('../../dev/module.f.cjs')
3
+ const json = require('../../json/module.f.cjs')
4
+ const { identity } = require('../../types/function/module.f.cjs')
5
+ const object = require('../../types/object/module.f.cjs')
6
+ const { at } = require('../../types/object/module.f.cjs')
7
+ const package_ = require('../package/module.f.cjs')
8
8
 
9
9
  /** @type {(g: json.Unknown|undefined) => string} */
10
10
  const stringify = g => {
File without changes
@@ -1,6 +1,6 @@
1
- const list = require('../types/list/main.f.cjs')
2
- const object = require('../types/object/main.f.cjs')
3
- const { operator, compose } = require('../types/function/main.f.cjs')
1
+ const list = require('../types/list/module.f.cjs')
2
+ const object = require('../types/object/module.f.cjs')
3
+ const { operator, compose } = require('../types/function/module.f.cjs')
4
4
 
5
5
  /**
6
6
  * @typedef {|
package/html/test.f.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const _ = require('./main.f.cjs')
1
+ const _ = require('./module.f.cjs')
2
2
 
3
3
  {
4
4
  const r = _.htmlToString(['html', []])
@@ -1,6 +1,6 @@
1
- const { tryCatch } = require('../result/main.cjs')
2
- const { unwrap } = require('../../types/result/main.f.cjs')
3
- const moduleFunction = require('../../commonjs/module/function/main.f.cjs')
1
+ const { tryCatch } = require('../result/module.cjs')
2
+ const { unwrap } = require('../../types/result/module.f.cjs')
3
+ const moduleFunction = require('../../commonjs/module/function/module.f.cjs')
4
4
 
5
5
  /** @type {(f: Function) => moduleFunction.Function_} */
6
6
  const build = f => immutableRequire => mutableData => {
@@ -1,5 +1,5 @@
1
- const _ = require('./main.cjs')
2
- const run = require('../../commonjs/module/function/main.f.cjs')
1
+ const _ = require('./module.cjs')
2
+ const run = require('../../commonjs/module/function/module.f.cjs')
3
3
 
4
4
  // ok:
5
5
  {
@@ -1,4 +1,4 @@
1
- const result = require('../../types/result/main.f.cjs')
1
+ const result = require('../../types/result/module.f.cjs')
2
2
 
3
3
  /** @type {<T>(f: () => T) => result.Result<T, unknown>} */
4
4
  const tryCatch = f => {
@@ -1,7 +1,7 @@
1
- const list = require('../types/list/main.f.cjs')
2
- const object = require('../types/object/main.f.cjs')
3
- const operator = require('../types/function/operator/main.f.cjs')
4
- const { compose } = require('../types/function/main.f.cjs')
1
+ const list = require('../types/list/module.f.cjs')
2
+ const object = require('../types/object/module.f.cjs')
3
+ const operator = require('../types/function/operator/module.f.cjs')
4
+ const { compose } = require('../types/function/module.f.cjs')
5
5
 
6
6
  /**
7
7
  * @typedef {{
@@ -111,7 +111,7 @@ const isObject = value => typeof value === 'object' && value !== null && !(value
111
111
 
112
112
  module.exports = {
113
113
  /** @readonly */
114
- tokenizer: require('./tokenizer/main.f.cjs'),
114
+ tokenizer: require('./tokenizer/module.f.cjs'),
115
115
  /** @readonly */
116
116
  setProperty,
117
117
  /** @readonly */