source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/elementAt.js@ 8d391a1

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

initial commit

  • Property mode set to 100644
File size: 832 bytes
Line 
1/** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */
2import { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';
3import { filter } from './filter';
4import { throwIfEmpty } from './throwIfEmpty';
5import { defaultIfEmpty } from './defaultIfEmpty';
6import { take } from './take';
7export function elementAt(index, defaultValue) {
8 if (index < 0) {
9 throw new ArgumentOutOfRangeError();
10 }
11 var hasDefaultValue = arguments.length >= 2;
12 return function (source) {
13 return source.pipe(filter(function (v, i) { return i === index; }), take(1), hasDefaultValue
14 ? defaultIfEmpty(defaultValue)
15 : throwIfEmpty(function () { return new ArgumentOutOfRangeError(); }));
16 };
17}
18//# sourceMappingURL=elementAt.js.map
Note: See TracBrowser for help on using the repository browser.