UNPKG

@lxlib/theme

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.

29 lines 2.17 kB
/** * @fileoverview added by tsickle * Generated from: src/pipes/keys/keys.pipe.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Pipe } from '@angular/core'; /** * @see https://ng-alain.com/theme/keys */ export class KeysPipe { /** * @param {?} value * @param {?=} keyIsNumber * @return {?} */ transform(value, keyIsNumber = false) { /** @type {?} */ const ret = []; // tslint:disable-next-line: forin for (const key in value) { ret.push({ key: keyIsNumber ? +key : key, value: value[key] }); } return ret; } } KeysPipe.decorators = [ { type: Pipe, args: [{ name: 'keys' },] } ]; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5cy5waXBlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGx4bGliL3RoZW1lLyIsInNvdXJjZXMiOlsic3JjL3BpcGVzL2tleXMva2V5cy5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLElBQUksRUFBaUIsTUFBTSxlQUFlLENBQUM7Ozs7QUFNcEQsTUFBTSxPQUFPLFFBQVE7Ozs7OztJQUNuQixTQUFTLENBQUMsS0FBVSxFQUFFLGNBQXVCLEtBQUs7O2NBQzFDLEdBQUcsR0FBVSxFQUFFO1FBQ3JCLGtDQUFrQztRQUNsQyxLQUFLLE1BQU0sR0FBRyxJQUFJLEtBQUssRUFBRTtZQUN2QixHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUUsR0FBRyxFQUFFLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEdBQUcsRUFBRSxLQUFLLEVBQUUsS0FBSyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQztTQUNoRTtRQUNELE9BQU8sR0FBRyxDQUFDO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