@budsbox/lib-es 1.0.1 → 2.0.0
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/dist/string.d.ts +2 -2
- package/dist/string.js +2 -2
- package/package.json +1 -1
package/dist/string.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare function parsePackageName(packageName: string, clean?: boolean):
|
|
|
16
16
|
* @param parsedPackageName - An object representing the parsed package name with fields such as `scope` and `name`.
|
|
17
17
|
* @returns The string representation of the package name, including the scope if it exists.
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function serializePackageName(parsedPackageName: Readonly<ParsedPackageName>): string;
|
|
20
20
|
/**
|
|
21
21
|
* Converts a parsed package name object or a Nil value into a string representation.
|
|
22
22
|
*
|
|
@@ -24,7 +24,7 @@ export declare function stringifyPackageName(parsedPackageName: Readonly<ParsedP
|
|
|
24
24
|
* @param allowNil - A boolean flag specifying whether Nil values are allowed for conversion.
|
|
25
25
|
* @returns The string representation of the package name if valid, or an empty string if `allowNil` is true and the input is Nil.
|
|
26
26
|
*/
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function serializePackageName(parsedPackageName: Readonly<ParsedPackageName> | Nil, allowNil: true): string;
|
|
28
28
|
/**
|
|
29
29
|
* Converts the provided value to a string representation suitable for debugging purposes.
|
|
30
30
|
*
|
package/dist/string.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNil, isNotNil } from '
|
|
1
|
+
import { isNil, isNotNil } from './guards.js';
|
|
2
2
|
/**
|
|
3
3
|
* Parses a package name string to extract its scope and name.
|
|
4
4
|
*
|
|
@@ -13,7 +13,7 @@ export function parsePackageName(packageName, clean = false) {
|
|
|
13
13
|
name: packageName.replace(scope ?? '', ''),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export function
|
|
16
|
+
export function serializePackageName(parsedPackageName, allowNil = false) {
|
|
17
17
|
if (!allowNil && isNil(parsedPackageName)) {
|
|
18
18
|
throw new TypeError('Expected a non-nil value');
|
|
19
19
|
}
|