ember-truth-helpers

WebJar for ember-truth-helpers

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-jmurphyau-ember-truth-helpers
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

ember-truth-helpers
WebJar for ember-truth-helpers
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/jmurphyau/ember-truth-helpers

Download github-com-jmurphyau-ember-truth-helpers

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-jmurphyau-ember-truth-helpers/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-jmurphyau-ember-truth-helpers</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jmurphyau-ember-truth-helpers/
implementation 'org.webjars.npm:github-com-jmurphyau-ember-truth-helpers:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jmurphyau-ember-truth-helpers/
implementation ("org.webjars.npm:github-com-jmurphyau-ember-truth-helpers:2.1.0")
'org.webjars.npm:github-com-jmurphyau-ember-truth-helpers:jar:2.1.0'
<dependency org="org.webjars.npm" name="github-com-jmurphyau-ember-truth-helpers" rev="2.1.0">
  <artifact name="github-com-jmurphyau-ember-truth-helpers" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-jmurphyau-ember-truth-helpers', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-jmurphyau-ember-truth-helpers" % "2.1.0"
[org.webjars.npm/github-com-jmurphyau-ember-truth-helpers "2.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : ember-cli-babel jar [6.6.0,7)

Project Modules

There are no modules declared in this project.

Ember Truth Helpers Build Status

HTMLBars template helpers for additional truth logic in if and unless statements.

Compatibility

  • Ember.js v3.16 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-truth-helpers

Usage

Helper JavaScript HTMLBars Variable argument count allowed
eq if (a === b) {{if (eq a b)}} No
not-eq if (a !== b) {{if (not-eq a b)}} No
not if (!a) {{if (not a)}} Yes
and if (a && b)* {{if (and a b)}} Yes
or if (a || b) * {{if (or a b)}}     Yes
xor if (a && !b || !a && b)* {{if (xor a b)}} No
gt if (a > b) {{if (gt a b)}} No
gte if (a >= b) {{if (gte a b)}} No
lt if (a < b) {{if (lt a b)}} No
lte if (a <= b) {{if (lte a b)}} No
is-array if (Ember.isArray(a)) {{if (is-array a)}} Yes
is-empty if (Ember.isEmpty(a)) {{if (is-empty a)}} No
is-equal if (Ember.isEqual(a, b)) {{if (is-equal a b)}} No
* Unlike their JavaScript counterparts, these expressions do not short circuit. For example, with (or a b), even if a is truthy, b will still be evaluated. See this explanation.

API

is-equal

is-equal uses Ember.isEqual helper to evaluate equality of two values. eq should be sufficient for most applications. is-equal is necessary when trying to compare a complex object to a primitive value.

Other Helpers

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Versions

Version
2.1.0