File tree 1 file changed +14
-0
lines changed
libs/dfts-helper/src/lib/helper/string/imploder
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { s_from } from '../from/from' ;
2
+
1
3
export function s_imploder ( ) : ImploderBuilder {
2
4
return new ImploderBuilder ( ) ;
3
5
}
@@ -27,6 +29,18 @@ export class ImploderBuilder {
27
29
return this ;
28
30
}
29
31
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
+
30
44
maxLength ( maxLength ?: number | null ) : this {
31
45
this . _maxLength = maxLength ;
32
46
return this ;
You can’t perform that action at this time.
0 commit comments