Skip to content

Commit 9f05e4c

Browse files
committed
feat: added toBoolean pipe
1 parent a313cd9 commit 9f05e4c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Pipe, PipeTransform } from '@angular/core';
2+
import { toBoolean } from '../helpers/to-boolean';
3+
import { BooleanLike } from '../models/boolean-like';
4+
5+
@Pipe({
6+
name: 'toBoolean'
7+
})
8+
export class ToBooleanPipe implements PipeTransform {
9+
public transform(value: BooleanLike): boolean {
10+
return toBoolean(value);
11+
}
12+
}

projects/mantic-ui/src/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export * from './lib/pipes/round.pipe';
199199
export * from './lib/pipes/safe.pipe';
200200
export * from './lib/pipes/slice.pipe';
201201
export * from './lib/pipes/title.pipe';
202+
export * from './lib/pipes/to-boolean.pipe';
202203
export * from './lib/pipes/validation.pipe';
203204
export * from './lib/services/base-href.service';
204205
export * from './lib/services/environment.service';

0 commit comments

Comments
 (0)