UNPKG

@ynmstudio/utils

Version:
31 lines (27 loc) 1.1 kB
import * as i0 from '@angular/core'; import { Pipe } from '@angular/core'; import { isArray, getProperty } from '@ynmstudio/utils/helpers'; class PluckPipe { transform(input, key) { if (!isArray(input) || !key) { return input; } return input.map((value) => { return getProperty(value, key); }); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: PluckPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); } static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.13", ngImport: i0, type: PluckPipe, isStandalone: true, name: "pluck" }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: PluckPipe, decorators: [{ type: Pipe, args: [{ standalone: true, name: 'pluck', }] }] }); /** * Generated bundle index. Do not edit. */ export { PluckPipe }; //# sourceMappingURL=ynmstudio-utils-pipes-pluck.mjs.map