vivth 1.5.6 → 1.5.8

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
@@ -6229,7 +6229,6 @@ const esWatcherInstance = this.registerObjectWithAutoCleanup(
6229
6229
 
6230
6230
  ````js
6231
6231
  /**
6232
- * @preserve
6233
6232
  * @description
6234
6233
  * - extract unique string from ArrayString[];
6235
6234
  * - Takes an array/tuple type and returns a unique UNION of its elements.
@@ -6366,7 +6365,6 @@ const esWatcherInstance = this.registerObjectWithAutoCleanup(
6366
6365
 
6367
6366
  ```js
6368
6367
  /**
6369
- * @preserve
6370
6368
  * @description
6371
6369
  * - type helper to create decorator;
6372
6370
  * >- matches argument with host method;
@@ -6386,7 +6384,6 @@ const esWatcherInstance = this.registerObjectWithAutoCleanup(
6386
6384
 
6387
6385
  ```js
6388
6386
  /**
6389
- * @preserve
6390
6387
  * @description
6391
6388
  * - type helper to create decorator for monkeypatching class/instance method;
6392
6389
  * >- matches argument with host method;
@@ -6541,7 +6538,6 @@ const esWatcherInstance = this.registerObjectWithAutoCleanup(
6541
6538
 
6542
6539
  ```js
6543
6540
  /**
6544
- * @preserve
6545
6541
  * @description
6546
6542
  * - Drop the first N parameters from METHOD and return the rest;
6547
6543
  * @template {(...args: any[]) => any} METHOD
@@ -7105,7 +7101,6 @@ text.nodeValue = "hello world";
7105
7101
 
7106
7102
  ```js
7107
7103
  /**
7108
- * @preserve
7109
7104
  * @description
7110
7105
  * Validates whether a string follows the strict custom-element layout:
7111
7106
  * - Must contain a hyphen (-)
@@ -7126,7 +7121,6 @@ text.nodeValue = "hello world";
7126
7121
 
7127
7122
  ```js
7128
7123
  /**
7129
- * @preserve
7130
7124
  * @template {string} T
7131
7125
  * @typedef {import('../../../src/web/EnsureValidTag.mts').EnsureValidTag<T>} EnsureValidTag
7132
7126
  */
@@ -18,8 +18,6 @@ export declare const TypeMap: {
18
18
  * @description
19
19
  * A type-safe `typeof` helper.
20
20
  * @template {keyof typeof TypeMap} K
21
- * @param {unknown} object - The value to check.
22
- * @param {K} type - The type string to compare against.
23
- * @returns {object is typeof TypeMap[K]} - Returns true if the type matches, narrowing the type.
21
+ * @[blank]typedef {import('./IsTypeOf.mts').IsTypeOf<K>} IsTypeOf
24
22
  */
25
23
  export declare function IsTypeOf<K extends keyof typeof TypeMap>(object: unknown, type: K): object is (typeof TypeMap)[K];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vivth",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "library primitives",
5
5
  "devDependencies": {
6
6
  "@types/bun": "^1.3.3",
@@ -20,7 +20,9 @@ export const cleanPreserveTypedef = (sourceCode) => {
20
20
 
21
21
  return sourceCode.replace(jsDocRegex, (fullMatch, commentContent) => {
22
22
  if (commentContent.includes('@preserve')) {
23
- return fullMatch.replace(/@\[blank\]typedef/gi, '@typedef');
23
+ return fullMatch
24
+ .replace(/@\[blank\]typedef/gi, '@typedef')
25
+ .replace(/\s+\*\s*\@preserve/g, '');
24
26
  }
25
27
  return fullMatch;
26
28
  });
@@ -10,13 +10,10 @@ const TypeMap = {
10
10
  bigint: 0n
11
11
  };
12
12
  /**
13
- * @preserve
14
13
  * @description
15
14
  * A type-safe `typeof` helper.
16
15
  * @template {keyof typeof TypeMap} K
17
- * @param {unknown} object - The value to check.
18
- * @param {K} type - The type string to compare against.
19
- * @returns {object is typeof TypeMap[K]} - Returns true if the type matches, narrowing the type.
16
+ * @typedef {import('./IsTypeOf.mts').IsTypeOf<K>} IsTypeOf
20
17
  */
21
18
  function IsTypeOf(object, type) {
22
19
  return typeof object === type;
@@ -19,9 +19,7 @@ export const TypeMap = {
19
19
  * @description
20
20
  * A type-safe `typeof` helper.
21
21
  * @template {keyof typeof TypeMap} K
22
- * @param {unknown} object - The value to check.
23
- * @param {K} type - The type string to compare against.
24
- * @returns {object is typeof TypeMap[K]} - Returns true if the type matches, narrowing the type.
22
+ * @[blank]typedef {import('./IsTypeOf.mts').IsTypeOf<K>} IsTypeOf
25
23
  */
26
24
  export function IsTypeOf<K extends keyof typeof TypeMap>(
27
25
  object: unknown,
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @preserve
3
2
  * @description
4
3
  * - extract unique string from ArrayString[];
5
4
  * - Takes an array/tuple type and returns a unique UNION of its elements.
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @preserve
3
2
  * @description
4
3
  * - type helper to create decorator;
5
4
  * >- matches argument with host method;
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @preserve
3
2
  * @description
4
3
  * - type helper to create decorator for monkeypatching class/instance method;
5
4
  * >- matches argument with host method;
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @preserve
3
2
  * @description
4
3
  * - Drop the first N parameters from METHOD and return the rest;
5
4
  * @template {(...args: any[]) => any} METHOD
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @preserve
3
2
  * @template {string} T
4
3
  * @typedef {import('./EnsureValidTag.mts').EnsureValidTag<T>} EnsureValidTag
5
4
  */
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @preserve
3
2
  * @description
4
3
  * Validates whether a string follows the strict custom-element layout:
5
4
  * - Must contain a hyphen (-)