Skip to content

Commit

Permalink
fix(dfts-helper): unwanted breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafnik committed Nov 18, 2024
1 parent 98edb3d commit 3b4e958
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libs/dfts-helper/src/lib/helper/string/imploder/imploder.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { s_from } from '../from/from';

export function s_imploder(): ImploderBuilder {
return new ImploderBuilder();
}
Expand Down Expand Up @@ -27,6 +29,18 @@ export class ImploderBuilder {
return this;
}

/**
* @DEPRECATED Please use .source([], (it: T) => string)
*/
mappedSource<T>(source?: T[] | null, mapFn?: (it: T) => string): this {
if (mapFn && source) {
this._source = source.map(mapFn);
} else if (source && source.every((it: T) => typeof it === 'string' || typeof it === 'boolean' || typeof it === 'number')) {
this._source = source.map((it) => s_from(it as string | boolean | number));
}
return this;
}

maxLength(maxLength?: number | null): this {
this._maxLength = maxLength;
return this;
Expand Down

0 comments on commit 3b4e958

Please sign in to comment.