@nyaomaru/divider 1.3.2 → 1.3.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/core/divider.js
CHANGED
|
@@ -12,10 +12,11 @@ function divider(input, ...args) {
|
|
|
12
12
|
return ((0, is_1.isString)(input) ? [input] : input);
|
|
13
13
|
}
|
|
14
14
|
// Extract the options from the input
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const clonedArgs = [...args];
|
|
16
|
+
const lastArg = clonedArgs.at(-1);
|
|
17
|
+
const options = (0, is_1.isOptions)(lastArg) ? (clonedArgs.pop(), lastArg) : {};
|
|
17
18
|
// Filter out only numbers and strings
|
|
18
|
-
const { numSeparators, strSeparators } =
|
|
19
|
+
const { numSeparators, strSeparators } = clonedArgs.reduce((acc, arg) => {
|
|
19
20
|
if ((0, is_1.isNumber)(arg)) {
|
|
20
21
|
acc.numSeparators.push(arg);
|
|
21
22
|
}
|
package/dist/esm/core/divider.js
CHANGED
|
@@ -9,10 +9,11 @@ export function divider(input, ...args) {
|
|
|
9
9
|
return (isString(input) ? [input] : input);
|
|
10
10
|
}
|
|
11
11
|
// Extract the options from the input
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const clonedArgs = [...args];
|
|
13
|
+
const lastArg = clonedArgs.at(-1);
|
|
14
|
+
const options = isOptions(lastArg) ? (clonedArgs.pop(), lastArg) : {};
|
|
14
15
|
// Filter out only numbers and strings
|
|
15
|
-
const { numSeparators, strSeparators } =
|
|
16
|
+
const { numSeparators, strSeparators } = clonedArgs.reduce((acc, arg) => {
|
|
16
17
|
if (isNumber(arg)) {
|
|
17
18
|
acc.numSeparators.push(arg);
|
|
18
19
|
}
|