@twin.org/core 0.0.2-next.16 → 0.0.2-next.18

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.
@@ -398,26 +398,26 @@ class Is {
398
398
  */
399
399
  class StringHelper {
400
400
  /**
401
- * Trim trailing slashes from a string.
401
+ * Implementation signature for trimTrailingSlashes.
402
402
  * @param value The value to trim.
403
- * @returns The trimmed value.
403
+ * @returns The trimmed string or the original.
404
404
  */
405
405
  static trimTrailingSlashes(value) {
406
- if (Is.stringValue(value)) {
406
+ if (Is.string(value)) {
407
407
  return value.replace(/\/+$/, "");
408
408
  }
409
- return "";
409
+ return value;
410
410
  }
411
411
  /**
412
- * Trim leading slashes from a string.
412
+ * Implementation signature for trimLeadingSlashes.
413
413
  * @param value The value to trim.
414
- * @returns The trimmed value.
414
+ * @returns The trimmed string or the original.
415
415
  */
416
416
  static trimLeadingSlashes(value) {
417
- if (Is.stringValue(value)) {
417
+ if (Is.string(value)) {
418
418
  return value.replace(/^\/+/, "");
419
419
  }
420
- return "";
420
+ return value;
421
421
  }
422
422
  /**
423
423
  * Convert the input string to kebab case.
@@ -2705,7 +2705,7 @@ class ObjectHelper {
2705
2705
  * @returns The object as bytes.
2706
2706
  */
2707
2707
  static toBytes(obj, format = false) {
2708
- if (obj === undefined) {
2708
+ if (Is.undefined(obj)) {
2709
2709
  return new Uint8Array();
2710
2710
  }
2711
2711
  const json = format ? JSON.stringify(obj, undefined, "\t") : JSON.stringify(obj);
@@ -396,26 +396,26 @@ class Is {
396
396
  */
397
397
  class StringHelper {
398
398
  /**
399
- * Trim trailing slashes from a string.
399
+ * Implementation signature for trimTrailingSlashes.
400
400
  * @param value The value to trim.
401
- * @returns The trimmed value.
401
+ * @returns The trimmed string or the original.
402
402
  */
403
403
  static trimTrailingSlashes(value) {
404
- if (Is.stringValue(value)) {
404
+ if (Is.string(value)) {
405
405
  return value.replace(/\/+$/, "");
406
406
  }
407
- return "";
407
+ return value;
408
408
  }
409
409
  /**
410
- * Trim leading slashes from a string.
410
+ * Implementation signature for trimLeadingSlashes.
411
411
  * @param value The value to trim.
412
- * @returns The trimmed value.
412
+ * @returns The trimmed string or the original.
413
413
  */
414
414
  static trimLeadingSlashes(value) {
415
- if (Is.stringValue(value)) {
415
+ if (Is.string(value)) {
416
416
  return value.replace(/^\/+/, "");
417
417
  }
418
- return "";
418
+ return value;
419
419
  }
420
420
  /**
421
421
  * Convert the input string to kebab case.
@@ -2703,7 +2703,7 @@ class ObjectHelper {
2703
2703
  * @returns The object as bytes.
2704
2704
  */
2705
2705
  static toBytes(obj, format = false) {
2706
- if (obj === undefined) {
2706
+ if (Is.undefined(obj)) {
2707
2707
  return new Uint8Array();
2708
2708
  }
2709
2709
  const json = format ? JSON.stringify(obj, undefined, "\t") : JSON.stringify(obj);
@@ -3,17 +3,17 @@
3
3
  */
4
4
  export declare class StringHelper {
5
5
  /**
6
- * Trim trailing slashes from a string.
6
+ * Implementation signature for trimTrailingSlashes.
7
7
  * @param value The value to trim.
8
- * @returns The trimmed value.
8
+ * @returns The trimmed string or the original.
9
9
  */
10
- static trimTrailingSlashes(value: string | undefined): string;
10
+ static trimTrailingSlashes(value: string): string;
11
11
  /**
12
- * Trim leading slashes from a string.
12
+ * Implementation signature for trimLeadingSlashes.
13
13
  * @param value The value to trim.
14
- * @returns The trimmed value.
14
+ * @returns The trimmed string or the original.
15
15
  */
16
- static trimLeadingSlashes(value: string | undefined): string;
16
+ static trimLeadingSlashes(value: string): string;
17
17
  /**
18
18
  * Convert the input string to kebab case.
19
19
  * @param input The input to convert.
package/docs/changelog.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @twin.org/core - Changelog
2
2
 
3
+ ## [0.0.2-next.18](https://github.com/twinfoundation/framework/compare/core-v0.0.2-next.17...core-v0.0.2-next.18) (2025-09-29)
4
+
5
+
6
+ ### Features
7
+
8
+ * simplify StringHelper signature ([0390403](https://github.com/twinfoundation/framework/commit/039040344952f91ee3c671249bc0e1c8f3b38e17))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/nameof bumped from 0.0.2-next.17 to 0.0.2-next.18
16
+ * devDependencies
17
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.17 to 0.0.2-next.18
18
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.17 to 0.0.2-next.18
19
+
20
+ ## [0.0.2-next.17](https://github.com/twinfoundation/framework/compare/core-v0.0.2-next.16...core-v0.0.2-next.17) (2025-09-29)
21
+
22
+
23
+ ### Features
24
+
25
+ * additional nameof operators ([a5aab60](https://github.com/twinfoundation/framework/commit/a5aab60bf66a86f1b7ff8af7c4f044cb03706d50))
26
+
27
+
28
+ ### Dependencies
29
+
30
+ * The following workspace dependencies were updated
31
+ * dependencies
32
+ * @twin.org/nameof bumped from 0.0.2-next.16 to 0.0.2-next.17
33
+ * devDependencies
34
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.16 to 0.0.2-next.17
35
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.16 to 0.0.2-next.17
36
+
3
37
  ## [0.0.2-next.16](https://github.com/twinfoundation/framework/compare/core-v0.0.2-next.15...core-v0.0.2-next.16) (2025-09-28)
4
38
 
5
39
 
@@ -18,21 +18,21 @@ Class to help with string.
18
18
 
19
19
  > `static` **trimTrailingSlashes**(`value`): `string`
20
20
 
21
- Trim trailing slashes from a string.
21
+ Implementation signature for trimTrailingSlashes.
22
22
 
23
23
  #### Parameters
24
24
 
25
25
  ##### value
26
26
 
27
- The value to trim.
27
+ `string`
28
28
 
29
- `undefined` | `string`
29
+ The value to trim.
30
30
 
31
31
  #### Returns
32
32
 
33
33
  `string`
34
34
 
35
- The trimmed value.
35
+ The trimmed string or the original.
36
36
 
37
37
  ***
38
38
 
@@ -40,21 +40,21 @@ The trimmed value.
40
40
 
41
41
  > `static` **trimLeadingSlashes**(`value`): `string`
42
42
 
43
- Trim leading slashes from a string.
43
+ Implementation signature for trimLeadingSlashes.
44
44
 
45
45
  #### Parameters
46
46
 
47
47
  ##### value
48
48
 
49
- The value to trim.
49
+ `string`
50
50
 
51
- `undefined` | `string`
51
+ The value to trim.
52
52
 
53
53
  #### Returns
54
54
 
55
55
  `string`
56
56
 
57
- The trimmed value.
57
+ The trimmed string or the original.
58
58
 
59
59
  ***
60
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/core",
3
- "version": "0.0.2-next.16",
3
+ "version": "0.0.2-next.18",
4
4
  "description": "Helper methods/classes for data type checking/validation/guarding/error handling",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/nameof": "0.0.2-next.16",
17
+ "@twin.org/nameof": "0.0.2-next.18",
18
18
  "intl-messageformat": "10.7.16",
19
19
  "rfc6902": "5.1.2"
20
20
  },