source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/last.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 777 bytes
Line 
1/** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */
2import { EmptyError } from '../util/EmptyError';
3import { filter } from './filter';
4import { takeLast } from './takeLast';
5import { throwIfEmpty } from './throwIfEmpty';
6import { defaultIfEmpty } from './defaultIfEmpty';
7import { identity } from '../util/identity';
8export function last(predicate, defaultValue) {
9 var hasDefaultValue = arguments.length >= 2;
10 return function (source) { return source.pipe(predicate ? filter(function (v, i) { return predicate(v, i, source); }) : identity, takeLast(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(function () { return new EmptyError(); })); };
11}
12//# sourceMappingURL=last.js.map
Note: See TracBrowser for help on using the repository browser.