@spacet.me/chain
Version:
Like `_.chain` but only contains `thru` and `value` methods. Comes with TypeScript typings.
15 lines • 520 B
JavaScript
import { chain } from '.';
it('works', function () {
expect(chain(325)
.thru(function (x) { return x * 64499; })
.thru(function (x) { return x.toString(36); })
.thru(function (x) { return x.toUpperCase(); })
.value()).toEqual('CHAIN');
});
it('delegates toJSON to its value', function () {
expect(JSON.stringify(chain(42))).toEqual('42');
});
it('delegates valueOf to its value', function () {
expect(chain(1) < chain(2)).toBe(true);
});
//# sourceMappingURL=index.test.js.map