jmurphyau / ember-truth-helpers

Ember HTMLBars Helpers for {{if}} & {{unless}}: not, and, or, eq & is-array
MIT License
706 stars 95 forks source link

(fix): infer return type in "or" and "and" helpers #185

Closed SergeAstapov closed 1 year ago

SergeAstapov commented 1 year ago

with v4.0.0-beta.0, return type for and and or is boolean which does not match the semantics of the helper itself.

see https://github.com/jmurphyau/ember-truth-helpers/blob/v4.0.0-beta.0/packages/ember-truth-helpers/src/helpers/or.ts#L9

This PR tries to infer the return type from the arguments, kinda similar to what was previously done in https://github.com/Gavant/glint-template-types/blob/v0.3.5/types/ember-truth-helpers/or.d.ts without limiting to 5 arguments.

This still does not work as intended, so more work needed.

SergeAstapov commented 1 year ago

we went slightly different route with #188