@react-hive/honey-utils 3.23.0 → 3.25.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.
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Splits a string into parts, transforms each part, then joins them back together.
3
+ *
4
+ * Common use cases:
5
+ *
6
+ * - Transforming selector groups:
7
+ *
8
+ * ```ts
9
+ * splitMapJoin(".a, .b", ",", part => `.scope ${part}`);
10
+ * // ".scope .a, .scope .b"
11
+ * ```
12
+ *
13
+ * - Normalizing spacing:
14
+ *
15
+ * ```ts
16
+ * splitMapJoin("a , b ,c", ",", part => part);
17
+ * // "a,b,c"
18
+ * ```
19
+ *
20
+ * - Custom join formatting:
21
+ *
22
+ * ```ts
23
+ * splitMapJoin("a,b,c", ",", part => part.toUpperCase(), ".");
24
+ * // "A.B.C"
25
+ * ```
26
+ *
27
+ * @param input - The raw input string to process.
28
+ * @param separator - The delimiter used to split the input (e.g. `","`, `" "`).
29
+ * @param mapFn - Function applied to each trimmed part.
30
+ * @param joinWith - Optional join separator (defaults to the same value as `separator`).
31
+ *
32
+ * @returns The transformed and re-joined string.
33
+ */
34
+ export declare const splitMapJoin: (input: string, separator: string, mapFn: (part: string, index: number) => string, joinWith?: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-hive/honey-utils",
3
- "version": "3.23.0",
3
+ "version": "3.25.0",
4
4
  "description": "A lightweight TypeScript utility library providing a collection of helper functions for common programming tasks",
5
5
  "keywords": [
6
6
  "utils",
@@ -24,10 +24,6 @@
24
24
  },
25
25
  "author": "Mike Aliinyk <m.aliynik@gmail.com>",
26
26
  "license": "MIT",
27
- "scripts": {
28
- "build": "webpack --config webpack.config.mjs",
29
- "test": "jest --collect-coverage"
30
- },
31
27
  "type": "module",
32
28
  "main": "dist/index.cjs",
33
29
  "module": "dist/index.mjs",
@@ -67,5 +63,10 @@
67
63
  "moduleNameMapper": {
68
64
  "^~/(.*)$": "<rootDir>/src/$1"
69
65
  }
66
+ },
67
+ "scripts": {
68
+ "clean": "rm -rf dist coverage",
69
+ "build": "webpack --config webpack.config.mjs",
70
+ "test": "jest --coverage"
70
71
  }
71
- }
72
+ }