{"ast":null,"code":"import { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { filter } from './filter';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { take } from './take';\nexport function elementAt(index, defaultValue) {\n  if (index < 0) {\n    throw new ArgumentOutOfRangeError();\n  }\n\n  var hasDefaultValue = arguments.length >= 2;\n  return function (source) {\n    return source.pipe(filter(function (v, i) {\n      return i === index;\n    }), take(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(function () {\n      return new ArgumentOutOfRangeError();\n    }));\n  };\n} //# sourceMappingURL=elementAt.js.map","map":null,"metadata":{},"sourceType":"module"}