@nyaomaru/divider 1.0.3 → 1.0.4
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/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +4 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function divider(input, ...args) {
|
|
|
10
10
|
return divideString(input, separators);
|
|
11
11
|
}
|
|
12
12
|
const result = input.map((item) => divideString(item, separators));
|
|
13
|
-
return options.flatten ? result.flat() : result;
|
|
13
|
+
return (options.flatten ? result.flat() : result);
|
|
14
14
|
}
|
|
15
15
|
function divideString(input, separators) {
|
|
16
16
|
if (separators.length === 0) {
|
package/dist/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export function divider(input, ...args) {
|
|
|
7
7
|
return divideString(input, separators);
|
|
8
8
|
}
|
|
9
9
|
const result = input.map((item) => divideString(item, separators));
|
|
10
|
-
return options.flatten ? result.flat() : result;
|
|
10
|
+
return (options.flatten ? result.flat() : result);
|
|
11
11
|
}
|
|
12
12
|
function divideString(input, separators) {
|
|
13
13
|
if (separators.length === 0) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
type DividerResult<T extends string | string[], F extends boolean | undefined> = T extends string ? string[] : F extends true ? string[] : string[][];
|
|
2
|
+
export declare function divider<T extends string | string[]>(input: string | string[], ...args: (number | string | {
|
|
2
3
|
flatten?: boolean;
|
|
3
|
-
})[]):
|
|
4
|
+
})[]): DividerResult<T, boolean>;
|
|
5
|
+
export {};
|