functionalscript 0.0.204 → 0.0.205

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.
@@ -5,28 +5,31 @@
5
5
  ```js
6
6
  /** @typedef {(packageName: string) => PackageMap|Package|undefined} PackageMap */
7
7
 
8
- /**
9
- * @typedef {{
10
- * readonly id: string,
11
- * readonly packages: PackageMap,
12
- * readonly files: (fileName: string) => string|undefined,
13
- * }} Package
8
+ /**
9
+ * @typedef {readonly[
10
+ * string,
11
+ * PackageMap,
12
+ * (fileName: string) => string|undefined
13
+ * ]} Package
14
14
  */
15
15
  ```
16
16
 
17
17
  ## Runner IO
18
18
 
19
+ The main target of this design is to simplify `RunnerIo` as much as possible.
20
+
19
21
  ```js
20
- /**
21
- * @typedef {(require: Require<T>) => (info: T) => (source: string) => readonly[Result<unknown, Error>, T]} RunnerIo
22
+ /**
23
+ * @template T
24
+ * @typedef {readonly[Result<unknown, Error>, Require<T>]} RunnerResult
22
25
  */
23
- ```
24
26
 
25
- ```js
27
+ /** @typedef {<T>(require: Require<T>) => (source: string) => RunnerResult<T>} RunnerIo */
28
+
26
29
  /**
27
30
  * @template T
28
- * @typedef {(info: T) => (module: string) => readonly[Result<unknown, Error>, T]} Require<T>
31
+ * @typedef {readonly[(path: string) => RunnerResult<T>, T]} Require<T>
29
32
  */
30
33
  ```
31
34
 
32
- `Require` is using a `Package` to provide sources.
35
+ `Require` is using a `Package` and it contains also `RunnerIo` to provide sources also it contains
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.0.204",
3
+ "version": "0.0.205",
4
4
  "description": "FunctionalScript is a functional subset of JavaScript",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @template T
3
+ * @typedef {readonly['ok', T]} Ok
4
+ */
5
+
6
+ /**
7
+ * @template E
8
+ * @typedef {readonly['error', E]} Error
9
+ */
10
+
11
+ /**
12
+ * @template T
13
+ * @template E
14
+ * @typedef {Ok<T>|Error<E>} Result
15
+ */
16
+
17
+ module.exports = {}