Skip to content

Commit 3b4e958

Browse files
committed
fix(dfts-helper): unwanted breaking change
1 parent 98edb3d commit 3b4e958

File tree

1 file changed

+14
-0
lines changed
  • libs/dfts-helper/src/lib/helper/string/imploder

1 file changed

+14
-0
lines changed

libs/dfts-helper/src/lib/helper/string/imploder/imploder.ts

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { s_from } from '../from/from';
2+
13
export function s_imploder(): ImploderBuilder {
24
return new ImploderBuilder();
35
}
@@ -27,6 +29,18 @@ export class ImploderBuilder {
2729
return this;
2830
}
2931

32+
/**
33+
* @DEPRECATED Please use .source([], (it: T) => string)
34+
*/
35+
mappedSource<T>(source?: T[] | null, mapFn?: (it: T) => string): this {
36+
if (mapFn && source) {
37+
this._source = source.map(mapFn);
38+
} else if (source && source.every((it: T) => typeof it === 'string' || typeof it === 'boolean' || typeof it === 'number')) {
39+
this._source = source.map((it) => s_from(it as string | boolean | number));
40+
}
41+
return this;
42+
}
43+
3044
maxLength(maxLength?: number | null): this {
3145
this._maxLength = maxLength;
3246
return this;

0 commit comments

Comments
 (0)