@nyaomaru/divider 1.0.2 → 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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Divider
2
2
 
3
3
  <p align="center">
4
- <img src="logo.svg" width="200px" align="center" alt="Divider logo" />
4
+ <img src="https://raw.githubusercontent.com/nyaomaru/divider/main/logo.svg" width="200px" align="center" alt="Divider logo" />
5
5
  </p>
6
6
 
7
7
  <p align="center">
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
- export declare function divider(input: string | string[], ...args: (number | string | {
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
- })[]): string[] | string[][];
4
+ })[]): DividerResult<T, boolean>;
5
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nyaomaru/divider",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.0.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",
@@ -22,8 +22,7 @@
22
22
  "dist",
23
23
  "README.md",
24
24
  "package.json",
25
- "LICENSE",
26
- "logo.svg"
25
+ "LICENSE"
27
26
  ],
28
27
  "repository": {
29
28
  "type": "git",
package/logo.svg DELETED
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?><svg id="_レイヤー_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 202.68 226.44"><defs><style>.cls-1{fill:#8ff476;}.cls-2{fill:#fff;}</style></defs><path class="cls-2" d="M5.99,196.51h12.52c9.24,0,14.75,4.83,14.75,12.48,0,10.56-7.57,17.45-18.64,17.45H0l5.99-29.93ZM14.84,220.76c7.18,0,11.42-4.88,11.42-11.38,0-4.44-2.87-7.18-8.51-7.18h-5.95l-3.72,18.56h6.76Z"/><path class="cls-2" d="M42.62,196.51h6.97l-5.99,29.93h-6.97l5.99-29.93Z"/><path class="cls-2" d="M88.39,196.51l-18.94,29.93h-6.8l-6.97-29.93h7.14l4.83,21.34,13.55-21.34h7.18Z"/><path class="cls-2" d="M94.73,196.51h6.97l-5.99,29.93h-6.97l5.99-29.93Z"/><path class="cls-2" d="M110.9,196.51h12.52c9.24,0,14.75,4.83,14.75,12.48,0,10.56-7.57,17.45-18.64,17.45h-14.62l5.99-29.93ZM119.74,220.76c7.18,0,11.42-4.88,11.42-11.38,0-4.44-2.87-7.18-8.51-7.18h-5.95l-3.72,18.56h6.76Z"/><path class="cls-2" d="M153.71,202.07l-1.28,6.5h13.9l-1.06,5.39h-13.94l-1.37,6.93h16.33l-1.15,5.56h-23.17l5.99-29.93h22.62l-1.16,5.56h-15.69Z"/><path class="cls-2" d="M194.13,217.2l5.21,9.24h-7.31l-4.7-8.38h-5.9l-1.67,8.38h-6.97l5.99-29.93h12.18c7.44,0,11.72,3.42,11.72,9.28s-3.21,9.75-8.55,11.41ZM195.67,206.43c0-2.91-2.05-4.27-5.6-4.27h-5.47l-2.09,10.39h5.9c4.57,0,7.27-2.14,7.27-6.12Z"/><polygon class="cls-1" points="186.42 3.89 135.99 168.36 106.58 168.36 106.58 168.46 54.61 168.46 54.61 161.35 87 161.35 160.49 0 170.69 11.22 186.42 3.89"/></svg>