vivth 1.0.4 → 1.0.6

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 CHANGED
@@ -901,7 +901,7 @@ npm i vivth
901
901
 
902
902
  ```js
903
903
  /**
904
- * @template {AnyButUndefinedType} T
904
+ * @template {AnyButUndefined} T
905
905
  */
906
906
  ```
907
907
 
@@ -910,7 +910,7 @@ npm i vivth
910
910
 
911
911
  ```js
912
912
  /**
913
- * @param {Map<AnyButUndefinedType, [Promise<any>, {}]>} uniqueMap
913
+ * @param {Map<AnyButUndefined, [Promise<any>, {}]>} uniqueMap
914
914
  * @returns {typeof QChannel}
915
915
  * - usefull for Queue primitive on multiple library but single reference, like the Web by making the `Map` on `window` object;
916
916
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vivth",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "extremely simple signal as library primitives",
5
5
  "main": "index.mjs",
6
6
  "types": "./types/index.d.mts",
@@ -6,18 +6,18 @@ import { TryAsync } from '../function/TryAsync.mjs';
6
6
  /**
7
7
  * @description
8
8
  * - class for `Queue` handling;
9
- * @template {AnyButUndefinedType} T
9
+ * @template {AnyButUndefined} T
10
10
  */
11
11
  export class QChannel {
12
12
  /**
13
- * @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined} AnyButUndefinedType
13
+ * @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined} AnyButUndefined
14
14
  * @typedef {import('../types/QCBReturn.mjs').QCBReturn} QCBReturn
15
15
  * @typedef {import('../types/QCBFIFOReturn.mjs').QCBFIFOReturn} QCBFIFOReturn
16
16
  */
17
17
  /**
18
18
  * @description
19
19
  * - to modify `MapReference`
20
- * @param {Map<AnyButUndefinedType, [Promise<any>, {}]>} uniqueMap
20
+ * @param {Map<AnyButUndefined, [Promise<any>, {}]>} uniqueMap
21
21
  * @returns {typeof QChannel}
22
22
  * - usefull for Queue primitive on multiple library but single reference, like the Web by making the `Map` on `window` object;
23
23
  */
@@ -26,13 +26,13 @@ export class QChannel {
26
26
  return QChannel;
27
27
  };
28
28
  /**
29
- * @type {Map<AnyButUndefinedType, [Promise<any>, {}]>}
29
+ * @type {Map<AnyButUndefined, [Promise<any>, {}]>}
30
30
  */
31
31
  static #uniquePromiser = new Map();
32
32
  /**
33
33
  * - ensures that each id has only one task running at a time.
34
34
  * - calls with the same id will wait for the previous call to finish.
35
- * @param {AnyButUndefinedType} id
35
+ * @param {AnyButUndefined} id
36
36
  * @returns {Promise<QCBReturn>} Resolves when it's safe to proceed for the given id, returning a cleanup function
37
37
  */
38
38
  static #uniqueCB = async (id) => {
@@ -257,6 +257,7 @@ export class JSautoDOC {
257
257
  path: { relative: relativePath },
258
258
  baseName: { noExt },
259
259
  } = (await this.#parsedFilesRef.get(path_)).value;
260
+ const hasNoAutoDoc = /\/\*\*[\s\*]*?@noautodoc[\s\*]*?\*\//.test(await content.string());
260
261
  if (hasValidExportObject) {
261
262
  mjsMain.push(
262
263
  `export { ${noExt} } from '${
@@ -264,9 +265,6 @@ export class JSautoDOC {
264
265
  }';`
265
266
  );
266
267
  }
267
- if (/\/\*\*[\s\*]*?@noautodoc[\s\*]*?\*\//.test(await content.string())) {
268
- continue;
269
- }
270
268
  const currentDescription = [];
271
269
  const { readme, typedef } = documented;
272
270
  const [typedefString, error] = await TryAsync(async () => {
@@ -278,27 +276,29 @@ export class JSautoDOC {
278
276
  });
279
277
  if (!error && typedefString) {
280
278
  mjsTypes.push(typedefString.module);
281
- const nameVarID = noExt.toLowerCase();
282
- tableOfContent.push(`[${noExt}](#${nameVarID})`);
283
- apiDocuments.push(
284
- `<h2 id="${nameVarID}">${noExt}</h2>\n\n- jsdoc types:\n\n\`\`\`js\n${
285
- typedefString.readme
286
- }\n\`\`\`\n*) <sub>[go to ${this.#tableOfContentTitle}](#${tableID})</sub>`
287
- );
279
+ if (!hasNoAutoDoc) {
280
+ const nameVarID = noExt.toLowerCase();
281
+ tableOfContent.push(`[${noExt}](#${nameVarID})`);
282
+ apiDocuments.push(
283
+ `<h2 id="${nameVarID}">${noExt}</h2>\n\n- jsdoc types:\n\n\`\`\`js\n${
284
+ typedefString.readme
285
+ }\n\`\`\`\n*) <sub>[go to ${this.#tableOfContentTitle}](#${tableID})</sub>`
286
+ );
287
+ }
288
288
  }
289
- readme.forEach((ref) => {
290
- const {
291
- // fullDescription,
292
- // instanceOrStatic,
293
- // namedVar,
294
- // typeOfVar,
295
- parsedFullDescription,
296
- reference,
297
- } = ref;
298
- const { description, jsPreview } = parsedFullDescription;
299
- currentDescription.push(`\n#### reference:${reference}\n${description}\n${jsPreview}`);
300
- });
301
- if (hasValidExportObject) {
289
+ if (!hasNoAutoDoc && hasValidExportObject) {
290
+ readme.forEach((ref) => {
291
+ const {
292
+ // fullDescription,
293
+ // instanceOrStatic,
294
+ // namedVar,
295
+ // typeOfVar,
296
+ parsedFullDescription,
297
+ reference,
298
+ } = ref;
299
+ const { description, jsPreview } = parsedFullDescription;
300
+ currentDescription.push(`\n#### reference:${reference}\n${description}\n${jsPreview}`);
301
+ });
302
302
  const nameVarID = noExt.toLowerCase();
303
303
  tableOfContent.push(`[${noExt}](#${noExt.toLowerCase()})`);
304
304
  apiDocuments.push(
@@ -1,5 +1,4 @@
1
1
  // @ts-check
2
-
3
2
  /**
4
3
  * - type helper for ID or objects;
5
4
  * @typedef {{}|null|number|string|boolean|symbol|bigint|function} AnyButUndefined
@@ -1,30 +1,30 @@
1
1
  /**
2
2
  * @description
3
3
  * - class for `Queue` handling;
4
- * @template {AnyButUndefinedType} T
4
+ * @template {AnyButUndefined} T
5
5
  */
6
6
  export class QChannel<T extends import("../types/AnyButUndefined.mjs").AnyButUndefined> {
7
7
  /**
8
- * @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined} AnyButUndefinedType
8
+ * @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined} AnyButUndefined
9
9
  * @typedef {import('../types/QCBReturn.mjs').QCBReturn} QCBReturn
10
10
  * @typedef {import('../types/QCBFIFOReturn.mjs').QCBFIFOReturn} QCBFIFOReturn
11
11
  */
12
12
  /**
13
13
  * @description
14
14
  * - to modify `MapReference`
15
- * @param {Map<AnyButUndefinedType, [Promise<any>, {}]>} uniqueMap
15
+ * @param {Map<AnyButUndefined, [Promise<any>, {}]>} uniqueMap
16
16
  * @returns {typeof QChannel}
17
17
  * - usefull for Queue primitive on multiple library but single reference, like the Web by making the `Map` on `window` object;
18
18
  */
19
19
  static makeQClass: (uniqueMap: Map<import("../types/AnyButUndefined.mjs").AnyButUndefined, [Promise<any>, {}]>) => typeof QChannel;
20
20
  /**
21
- * @type {Map<AnyButUndefinedType, [Promise<any>, {}]>}
21
+ * @type {Map<AnyButUndefined, [Promise<any>, {}]>}
22
22
  */
23
23
  static #uniquePromiser: Map<import("../types/AnyButUndefined.mjs").AnyButUndefined, [Promise<any>, {}]>;
24
24
  /**
25
25
  * - ensures that each id has only one task running at a time.
26
26
  * - calls with the same id will wait for the previous call to finish.
27
- * @param {AnyButUndefinedType} id
27
+ * @param {AnyButUndefined} id
28
28
  * @returns {Promise<QCBReturn>} Resolves when it's safe to proceed for the given id, returning a cleanup function
29
29
  */
30
30
  static #uniqueCB: (id: import("../types/AnyButUndefined.mjs").AnyButUndefined) => Promise<import("../types/QCBReturn.mjs").QCBReturn>;