forked from DockYard/ember-composable-helpers
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from eflexsystems/6.0
- Loading branch information
Showing
93 changed files
with
18,264 additions
and
20,762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
/vendor/ | ||
|
||
# compiled output | ||
/declarations/ | ||
/dist/ | ||
/tmp/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
# compiled output | ||
/dist/ | ||
/tmp/ | ||
/declarations/ | ||
|
||
# dependencies | ||
/bower_components/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,7 @@ | |
# misc | ||
/coverage/ | ||
!.* | ||
.eslintcache | ||
.lint-todo/ | ||
.*/ | ||
|
||
# ember-try | ||
/.node_modules.ember-try/ | ||
|
2 changes: 1 addition & 1 deletion
2
addon/-private/get-value-array-and-use-deep-equal-from-params.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
export function append([...arrays]) { | ||
return [].concat(...arrays); | ||
export function append() { | ||
return [].concat(...arguments); | ||
} | ||
|
||
export default helper(append); | ||
export default append; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
import asArray from '../utils/as-array'; | ||
|
||
export function drop([dropAmount, array]) { | ||
export function drop(dropAmount, array) { | ||
return asArray(array).slice(dropAmount); | ||
} | ||
|
||
export default helper(drop); | ||
export default drop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
export function entries([object]) { | ||
export function entries(object) { | ||
if (!object) { | ||
return object; | ||
} | ||
return Object.entries(object); | ||
} | ||
|
||
export default helper(entries); | ||
export default entries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import { helper } from '@ember/component/helper'; | ||
import { isEmpty } from '@ember/utils'; | ||
import asArray from '../utils/as-array'; | ||
|
||
export function filter([callback, array]) { | ||
export function filter(callback, array) { | ||
if (isEmpty(callback) || !array) { | ||
return []; | ||
} | ||
|
||
return asArray(array).filter(callback); | ||
} | ||
|
||
export default helper(filter); | ||
export default filter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { helper } from '@ember/component/helper'; | ||
import { isEmpty } from '@ember/utils'; | ||
import asArray from '../utils/as-array'; | ||
import { get } from '@ember/object'; | ||
|
||
export function findBy([byPath, value, array]) { | ||
export function findBy(byPath, value, array) { | ||
if (isEmpty(byPath)) { | ||
return []; | ||
} | ||
|
||
return asArray(array).find((val) => get(val, byPath) === value); | ||
} | ||
|
||
export default helper(findBy); | ||
export default findBy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import { helper } from '@ember/component/helper'; | ||
import asArray from '../utils/as-array'; | ||
|
||
export function flatten(array) { | ||
return asArray(array).flat(Infinity); | ||
} | ||
|
||
export default helper(function ([array]) { | ||
return flatten(array); | ||
}); | ||
export default flatten; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
export function fromEntries([entries]) { | ||
export function fromEntries(entries) { | ||
if (!entries) { | ||
return entries; | ||
} | ||
return Object.fromEntries(entries); | ||
} | ||
|
||
export default helper(fromEntries); | ||
export default fromEntries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import { helper } from '@ember/component/helper'; | ||
import { isBlank as emberIsBlank } from '@ember/utils'; | ||
|
||
export function isBlank([value]) { | ||
return emberIsBlank(value); | ||
} | ||
export const isBlank = emberIsBlank; | ||
|
||
export default helper(isBlank); | ||
export default isBlank; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
export function isLast([checked, array]) { | ||
export function isLast(checked, array) { | ||
if (array == null || checked == null) { | ||
return false; | ||
} | ||
|
||
return array.at(-1) === checked; | ||
} | ||
|
||
export default helper(isLast); | ||
export default isLast; |
Oops, something went wrong.