@nyaomaru/divider 1.3.3 → 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.
@@ -14,9 +14,9 @@ function divider(input, ...args) {
14
14
  // Extract the options from the input
15
15
  const clonedArgs = [...args];
16
16
  const lastArg = clonedArgs.at(-1);
17
- const options = (0, is_1.isOptions)(lastArg) ? (clonedArgs.slice(0, -1), lastArg) : {};
17
+ const options = (0, is_1.isOptions)(lastArg) ? (clonedArgs.pop(), lastArg) : {};
18
18
  // Filter out only numbers and strings
19
- const { numSeparators, strSeparators } = args.reduce((acc, arg) => {
19
+ const { numSeparators, strSeparators } = clonedArgs.reduce((acc, arg) => {
20
20
  if ((0, is_1.isNumber)(arg)) {
21
21
  acc.numSeparators.push(arg);
22
22
  }
@@ -11,9 +11,9 @@ export function divider(input, ...args) {
11
11
  // Extract the options from the input
12
12
  const clonedArgs = [...args];
13
13
  const lastArg = clonedArgs.at(-1);
14
- const options = isOptions(lastArg) ? (clonedArgs.slice(0, -1), lastArg) : {};
14
+ const options = isOptions(lastArg) ? (clonedArgs.pop(), lastArg) : {};
15
15
  // Filter out only numbers and strings
16
- const { numSeparators, strSeparators } = args.reduce((acc, arg) => {
16
+ const { numSeparators, strSeparators } = clonedArgs.reduce((acc, arg) => {
17
17
  if (isNumber(arg)) {
18
18
  acc.numSeparators.push(arg);
19
19
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nyaomaru/divider",
3
3
  "type": "module",
4
- "version": "1.3.3",
4
+ "version": "1.3.4",
5
5
  "description": "To divide string or string[] with a given separator",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.js",