3.1.1 • Published 2 years ago

fluent-flags v3.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Decorates a function with arbitrary fluent boolean flags and passes them as the first parameter.

API

const cb = FluentFlags(
  ['foo', 'bar'],
  flags => (arg: string) => [flags.foo, flags.bar, arg]
)
expect(cb()).toMatchObject([void 0, void 0, void 0])
expect(cb('hello')).toMatchObject([void 0, void 0, 'hello'])
expect(cb.bar('hello')).toMatchObject([void 0, true, 'hello'])
expect(cb.foo.bar('hello')).toMatchObject([true, true, 'hello'])

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

3.1.1

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago