{"id":13806980,"url":"https://github.com/jmurphyau/ember-truth-helpers","last_synced_at":"2026-02-22T11:33:40.504Z","repository":{"id":25557184,"uuid":"28990310","full_name":"jmurphyau/ember-truth-helpers","owner":"jmurphyau","description":"Ember HTMLBars Helpers for {{if}} \u0026 {{unless}}: not, and, or, eq \u0026 is-array","archived":false,"fork":false,"pushed_at":"2024-08-30T17:31:14.000Z","size":1288,"stargazers_count":706,"open_issues_count":18,"forks_count":95,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-09-23T11:03:16.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmurphyau.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-08T22:55:43.000Z","updated_at":"2024-09-02T16:19:28.000Z","dependencies_parsed_at":"2024-06-18T12:16:57.481Z","dependency_job_id":"5b322e4b-db17-4a54-b871-90897efacc36","html_url":"https://github.com/jmurphyau/ember-truth-helpers","commit_stats":{"total_commits":180,"total_committers":38,"mean_commits":"4.7368421052631575","dds":0.7833333333333333,"last_synced_commit":"93ba8bc7e96422c88c60d0c43469ed166e0a163a"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurphyau%2Fember-truth-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurphyau%2Fember-truth-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurphyau%2Fember-truth-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurphyau%2Fember-truth-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmurphyau","download_url":"https://codeload.github.com/jmurphyau/ember-truth-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225267434,"owners_count":17447154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:01:18.943Z","updated_at":"2025-10-22T14:45:37.233Z","avatar_url":"https://github.com/jmurphyau.png","language":"JavaScript","funding_links":[],"categories":["Packages","Addons / Support"],"sub_categories":["Helpers","Awesome Addons"],"readme":"# Ember Truth Helpers [![CI](https://github.com/jmurphyau/ember-truth-helpers/actions/workflows/ci.yml/badge.svg)](https://github.com/jmurphyau/ember-truth-helpers/actions/workflows/ci.yml)\n\nHTMLBars template helpers for additional truth logic in `if` and `unless` statements.\n\n## Compatibility\n\n- Ember.js v4.8 or above\n- Embroider or ember-auto-import \u003e= 2 (this is [v2 addon](https://emberjs.github.io/rfcs/0507-embroider-v2-package-format.html))\n\n## Installation\n\n```\nember install ember-truth-helpers\n```\n\n## Usage\n\nHelper   | JavaScript                                      | HTMLBars                | Import                                            | Variable argument count allowed|\n---------|-------------------------------------------------|-------------------------|-------------------------------------------------- |--------------------------------|\neq       | `if (a === b)`                                  | `{{if (eq a b)}}`       | import { eq } from 'ember-truth-helpers';         |No                              |\nnot-eq   | `if (a !== b)`                                  | `{{if (not-eq a b)}}`   | import { notEq } from 'ember-truth-helpers';      |No                              |\nnot      | `if (!a)`                                       | `{{if (not a)}}`        | import { not } from 'ember-truth-helpers';        |Yes                             |\nand      | `if (a \u0026\u0026 b)`                                   | `{{if (and a b)}}`      | import { and } from 'ember-truth-helpers';        |Yes                             |\nor       | \u003ccode\u003eif (a \u0026#124;\u0026#124; b)\u003c/code\u003e              | `{{if (or a b)}}`       | import { or } from 'ember-truth-helpers';         |Yes                             |\nxor      | \u003ccode\u003eif (a !== b)\u003c/code\u003e                       | `{{if (xor a b)}}`      | import { xor } from 'ember-truth-helpers';        |No                              |\ngt       | `if (a \u003e b)`                                    | `{{if (gt a b)}}`       | import { gt } from 'ember-truth-helpers';         |No                              |\ngte      | `if (a \u003e= b)`                                   | `{{if (gte a b)}}`      | import { gte } from 'ember-truth-helpers';        |No                              |\nlt       | `if (a \u003c b)`                                    | `{{if (lt a b)}}`       | import { lt } from 'ember-truth-helpers';         |No                              |\nlte      | `if (a \u003c= b)`                                   | `{{if (lte a b)}}`      | import { eq } from 'ember-truth-helpers';         |No                              |\nis-array | `if (Ember.isArray(a))`                         | `{{if (is-array a)}}`   | import { isArray } from 'ember-truth-helpers';    |Yes                             |\nis-empty | `if (Ember.isEmpty(a))`                         | `{{if (is-empty a)}}`   | import { isEmpty } from 'ember-truth-helpers';    |No                              |\nis-equal | `if (Ember.isEqual(a, b))`                      | `{{if (is-equal a b)}}` | import { isEqual } from 'ember-truth-helpers';    |No                              |\n\n## API\n\n### is-equal\n\n`is-equal` uses [`Ember.isEqual`](https://api.emberjs.com/ember/3.14/functions/@ember%2Futils/isEqual) helper to evaluate equality of two values.\n `eq` should be sufficient for most applications. `is-equal` is necessary when trying to compare a complex object to\n a primitive value.\n\n## Other Helpers\n\n* [ember-get-helper](https://github.com/jmurphyau/ember-get-helper)\n* [ember-composable-helpers](https://github.com/DockYard/ember-composable-helpers)\n\n## Usage with Glint\n\n`ember-truth-helpers` is a glint enabled addon. Add this to your\n`types/global.d.ts` file:\n\n```ts\nimport '@glint/environment-ember-loose';\n\nimport type EmberTruthRegistry from 'ember-truth-helpers/template-registry';\n\ndeclare module '@glint/environment-ember-loose/registry' {\n  export default interface Registry extends EmberTruthRegistry, /* other addon registries */ {\n    // local entries\n  }\n}\n```\n\nFor the entire guide, please refer to [Using\nAddons](https://typed-ember.gitbook.io/glint/environments/ember/using-addons#using-glint-enabled-addons)\nsection on the glint handbook.\n\nTypes are made available through package.json `exports` field. In order for TS\nto recognize this (beginning from TS 4.7), you must set\n[`moduleResolution`](https://www.typescriptlang.org/tsconfig#moduleResolution)\nto `node16` or `nodenext`.\n\n## Usage in Single File Components\n\nFor usage in `gts` or `gjs` files, all helpers are exported from the index:\n\n```gts\nimport { or } from 'ember-truth-helpers';\n\n\u003ctemplate\u003e\n  {{#if (or @admin @user)}}\n    Admin Controls are going here\n  {{/if}}\n\u003c/template\u003e\n```\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmurphyau%2Fember-truth-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmurphyau%2Fember-truth-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmurphyau%2Fember-truth-helpers/lists"}