UNPKG

@arthurgubaidullin/nx-embed-dependencies

Version:

This plugin for [Nx](https://nx.dev) helps injecting local dependencies into a package.

25 lines (24 loc) 640 B
/** * @since 1.5.0 */ import { Index, Optional } from '..'; import { updateAt } from 'fp-ts/es6/NonEmptyArray'; import { lookup } from 'fp-ts/es6/Array'; import { isNone } from 'fp-ts/es6/Option'; /** * @category constructor * @since 1.5.0 */ export function indexNonEmptyArray() { return new Index(function (i) { return new Optional(function (s) { return lookup(i, s); }, function (a) { return function (nea) { var onea = updateAt(i, a)(nea); if (isNone(onea)) { return nea; } else { return onea.value; } }; }); }); }