New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-truth-helpers

Package Overview
Dependencies
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-truth-helpers

Ember Truth Helpers

  • 3.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
103K
decreased by-7.96%
Maintainers
3
Weekly downloads
 
Created
Source

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

HelperJavaScriptHTMLBarsVariable argument count allowed
eqif (a === b){{if (eq a b)}}No
not-eqif (a !== b){{if (not-eq a b)}}No
notif (!a){{if (not a)}}Yes
andif (a && b)*{{if (and a b)}}Yes
orif (a || b) *{{if (or a b)}}    Yes
xorif (a && !b || !a && b)*{{if (xor a b)}}No
gtif (a > b){{if (gt a b)}}No
gteif (a >= b){{if (gte a b)}}No
ltif (a < b){{if (lt a b)}}No
lteif (a <= b){{if (lte a b)}}No
is-arrayif (Ember.isArray(a)){{if (is-array a)}}Yes
is-emptyif (Ember.isEmpty(a)){{if (is-empty a)}}No
is-equalif (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.

Keywords

FAQs

Package last updated on 28 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc