@webdeveric/utils 0.41.0 → 0.42.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.
package/dist/cjs/index.js CHANGED
@@ -45,15 +45,18 @@ __exportStar(require("./getOwnProperties.js"), exports);
45
45
  __exportStar(require("./getType.js"), exports);
46
46
  __exportStar(require("./inRange.js"), exports);
47
47
  __exportStar(require("./isEmpty.js"), exports);
48
+ __exportStar(require("./iterateForever.js"), exports);
48
49
  __exportStar(require("./joinStrings.js"), exports);
49
50
  __exportStar(require("./looksLikeURL.js"), exports);
50
51
  __exportStar(require("./normalize.js"), exports);
51
52
  __exportStar(require("./parseNumber.js"), exports);
53
+ __exportStar(require("./prefix.js"), exports);
52
54
  __exportStar(require("./redactCredentialsInURL.js"), exports);
53
55
  __exportStar(require("./resultify.js"), exports);
54
56
  __exportStar(require("./secToString.js"), exports);
55
57
  __exportStar(require("./sort-factory.js"), exports);
56
58
  __exportStar(require("./sort.js"), exports);
59
+ __exportStar(require("./suffix.js"), exports);
57
60
  __exportStar(require("./toPascalCase.js"), exports);
58
61
  __exportStar(require("./trimEnd.js"), exports);
59
62
  __exportStar(require("./trimIndentation.js"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.iterateForever = iterateForever;
4
+ function* iterateForever(items) {
5
+ while (true) {
6
+ yield* items;
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prefix = void 0;
4
+ const prefix = (prefixString, value, defaultValue = '') => {
5
+ if (value == null || (typeof value == 'string' && value.length === 0)) {
6
+ return defaultValue;
7
+ }
8
+ return `${prefixString}${value}`;
9
+ };
10
+ exports.prefix = prefix;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.suffix = void 0;
4
+ const suffix = (suffixString, value, defaultValue = '') => {
5
+ if (value == null || (typeof value == 'string' && value.length === 0)) {
6
+ return defaultValue;
7
+ }
8
+ return `${value}${suffixString}`;
9
+ };
10
+ exports.suffix = suffix;
package/dist/mjs/index.js CHANGED
@@ -29,15 +29,18 @@ export * from './getOwnProperties.js';
29
29
  export * from './getType.js';
30
30
  export * from './inRange.js';
31
31
  export * from './isEmpty.js';
32
+ export * from './iterateForever.js';
32
33
  export * from './joinStrings.js';
33
34
  export * from './looksLikeURL.js';
34
35
  export * from './normalize.js';
35
36
  export * from './parseNumber.js';
37
+ export * from './prefix.js';
36
38
  export * from './redactCredentialsInURL.js';
37
39
  export * from './resultify.js';
38
40
  export * from './secToString.js';
39
41
  export * from './sort-factory.js';
40
42
  export * from './sort.js';
43
+ export * from './suffix.js';
41
44
  export * from './toPascalCase.js';
42
45
  export * from './trimEnd.js';
43
46
  export * from './trimIndentation.js';
@@ -0,0 +1,5 @@
1
+ export function* iterateForever(items) {
2
+ while (true) {
3
+ yield* items;
4
+ }
5
+ }
@@ -0,0 +1,6 @@
1
+ export const prefix = (prefixString, value, defaultValue = '') => {
2
+ if (value == null || (typeof value == 'string' && value.length === 0)) {
3
+ return defaultValue;
4
+ }
5
+ return `${prefixString}${value}`;
6
+ };
@@ -0,0 +1,6 @@
1
+ export const suffix = (suffixString, value, defaultValue = '') => {
2
+ if (value == null || (typeof value == 'string' && value.length === 0)) {
3
+ return defaultValue;
4
+ }
5
+ return `${value}${suffixString}`;
6
+ };
@@ -29,15 +29,18 @@ export * from './getOwnProperties.js';
29
29
  export * from './getType.js';
30
30
  export * from './inRange.js';
31
31
  export * from './isEmpty.js';
32
+ export * from './iterateForever.js';
32
33
  export * from './joinStrings.js';
33
34
  export * from './looksLikeURL.js';
34
35
  export * from './normalize.js';
35
36
  export * from './parseNumber.js';
37
+ export * from './prefix.js';
36
38
  export * from './redactCredentialsInURL.js';
37
39
  export * from './resultify.js';
38
40
  export * from './secToString.js';
39
41
  export * from './sort-factory.js';
40
42
  export * from './sort.js';
43
+ export * from './suffix.js';
41
44
  export * from './toPascalCase.js';
42
45
  export * from './trimEnd.js';
43
46
  export * from './trimIndentation.js';
@@ -0,0 +1 @@
1
+ export declare function iterateForever<T>(items: Iterable<T>): Generator<T, undefined, undefined>;
@@ -0,0 +1,2 @@
1
+ import type { Primitive } from './types/common.js';
2
+ export declare const prefix: (prefixString: string, value: Exclude<Primitive, symbol>, defaultValue?: string) => string;
@@ -0,0 +1,2 @@
1
+ import type { Primitive } from './types/common.js';
2
+ export declare const suffix: (suffixString: string, value: Exclude<Primitive, symbol>, defaultValue?: string) => string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webdeveric/utils",
3
3
  "description": "Just another collection of utilities.",
4
- "version": "0.41.0",
4
+ "version": "0.42.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -66,7 +66,7 @@
66
66
  "url": "https://github.com/webdeveric/utils/issues"
67
67
  },
68
68
  "homepage": "https://github.com/webdeveric/utils/#readme",
69
- "packageManager": "pnpm@9.14.4+sha512.c8180b3fbe4e4bca02c94234717896b5529740a6cbadf19fa78254270403ea2f27d4e1d46a08a0f56c89b63dc8ebfd3ee53326da720273794e6200fcf0d184ab",
69
+ "packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c",
70
70
  "scripts": {
71
71
  "clean": "rimraf ./dist/",
72
72
  "prebuild": "pnpm clean",
@@ -87,21 +87,21 @@
87
87
  "devDependencies": {
88
88
  "@commitlint/config-conventional": "^19.6.0",
89
89
  "@commitlint/types": "^19.5.0",
90
- "@types/node": "^22.10.1",
90
+ "@types/node": "^22.10.2",
91
91
  "@vitest/coverage-v8": "^2.1.8",
92
92
  "@webdeveric/eslint-config-ts": "^0.11.0",
93
93
  "@webdeveric/prettier-config": "^0.3.0",
94
- "commitlint": "^19.6.0",
94
+ "commitlint": "^19.6.1",
95
95
  "commitlint-plugin-cspell": "^0.1.1",
96
96
  "conventional-changelog-conventionalcommits": "^8.0.0",
97
- "cspell": "^8.16.1",
97
+ "cspell": "^8.17.1",
98
98
  "eslint": "^8.57.1",
99
99
  "eslint-config-prettier": "^9.1.0",
100
100
  "eslint-import-resolver-typescript": "^3.7.0",
101
101
  "eslint-plugin-import": "^2.31.0",
102
102
  "husky": "^9.1.7",
103
103
  "jsdom": "^25.0.1",
104
- "lint-staged": "^15.2.10",
104
+ "lint-staged": "^15.2.11",
105
105
  "prettier": "^3.4.2",
106
106
  "rimraf": "^6.0.1",
107
107
  "semantic-release": "^24.2.0",