1 | {"version":3,"file":"duration.pipe.js","sourceRoot":"","sources":["duration.pipe.ts"],"names":[],"mappings":";;;;;;;;AAAA,sCAAkD;AAClD,+BAAiC;AAGjC;IAAA;IAOA,CAAC;IANC,gCAAS,GAAT,UAAU,KAAU;QAAE,cAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,6BAAiB;;QACrC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;YACrD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAA0C,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC7F,CAAC;IANU,YAAY;QADxB,WAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;OAChB,YAAY,CAOxB;IAAD,mBAAC;CAAA,AAPD,IAOC;AAPY,oCAAY","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\r\nimport * as moment from 'moment';\r\n\r\n@Pipe({ name: 'amDuration' })\r\nexport class DurationPipe implements PipeTransform {\r\n transform(value: any, ...args: string[]): string {\r\n if (typeof args === 'undefined' || args.length !== 1) {\r\n throw new Error('DurationPipe: missing required time unit argument');\r\n }\r\n return moment.duration(value, args[0] as moment.unitOfTime.DurationConstructor).humanize();\r\n }\r\n}\r\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} |