Skip to content

Commit

Permalink
Merge pull request #1 from eflexsystems/6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jakesjews committed May 3, 2024
2 parents e5e4ab2 + a503df8 commit 580a805
Show file tree
Hide file tree
Showing 93 changed files with 18,264 additions and 20,762 deletions.
6 changes: 0 additions & 6 deletions .ember-cli
@@ -1,13 +1,7 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Expand Up @@ -3,6 +3,7 @@
/vendor/

# compiled output
/declarations/
/dist/
/tmp/

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: npm
- name: Install Dependencies
run: npm ci
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: npm
- name: Install Dependencies
run: npm install --no-shrinkwrap
Expand All @@ -57,8 +57,8 @@ jobs:
fail-fast: false
matrix:
try-scenario:
- ember-lts-4.4
- ember-lts-4.8
- ember-lts-4.12
- ember-lts-5.4
- ember-release
- ember-beta
- ember-canary
Expand All @@ -70,7 +70,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18
cache: npm
- name: Install Dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,7 +2,7 @@

# compiled output
/dist/
/tmp/
/declarations/

# dependencies
/bower_components/
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Expand Up @@ -28,6 +28,8 @@
/ember-cli-build.js
/testem.js
/tests/
/tsconfig.declarations.json
/tsconfig.json
/yarn-error.log
/yarn.lock
.gitkeep
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
Expand Up @@ -13,8 +13,7 @@
# misc
/coverage/
!.*
.eslintcache
.lint-todo/
.*/

# ember-try
/.node_modules.ember-try/
Expand Down
@@ -1,4 +1,4 @@
export default function getValueArrayAndUseDeepEqualFromParams(params) {
export default function getValueArrayAndUseDeepEqualFromParams(...params) {
let currentValue = params[0];

let array;
Expand Down
8 changes: 3 additions & 5 deletions addon/helpers/append.js
@@ -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;
5 changes: 1 addition & 4 deletions addon/helpers/chunk.js
@@ -1,4 +1,3 @@
import { helper } from '@ember/component/helper';
const { max, ceil } = Math;
import asArray from '../utils/as-array';

Expand Down Expand Up @@ -28,6 +27,4 @@ export function chunk(num, array) {
}
}

export default helper(function ([num, array]) {
return chunk(num, array);
});
export default chunk;
5 changes: 2 additions & 3 deletions addon/helpers/compact.js
@@ -1,7 +1,6 @@
import { helper } from '@ember/component/helper';
import { isPresent } from '@ember/utils';

export function compact([value]) {
export function compact(value) {
let array;
if (Array.isArray(value)) {
array = value;
Expand All @@ -12,4 +11,4 @@ export function compact([value]) {
return array.filter((item) => isPresent(item));
}

export default helper(compact);
export default compact;
5 changes: 2 additions & 3 deletions addon/helpers/dec.js
@@ -1,7 +1,6 @@
import { helper } from '@ember/component/helper';
import { isEmpty } from '@ember/utils';

export function dec([step, val]) {
export function dec(step, val) {
if (isEmpty(val)) {
val = step;
step = undefined;
Expand All @@ -20,4 +19,4 @@ export function dec([step, val]) {
return val - step;
}

export default helper(dec);
export default dec;
6 changes: 2 additions & 4 deletions addon/helpers/drop.js
@@ -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;
6 changes: 2 additions & 4 deletions addon/helpers/entries.js
@@ -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;
5 changes: 2 additions & 3 deletions addon/helpers/filter-by.js
@@ -1,10 +1,9 @@
import { helper } from '@ember/component/helper';
import { isEmpty, isPresent } from '@ember/utils';
import { get } from '@ember/object';
import isEqual from '../utils/is-equal';
import asArray from '../utils/as-array';

export function filterBy([byPath, value, array]) {
export function filterBy(byPath, value, array) {
if (!Array.isArray(array) && Array.isArray(value)) {
array = value;
value = undefined;
Expand All @@ -31,4 +30,4 @@ export function filterBy([byPath, value, array]) {
return array.filter(filterFn);
}

export default helper(filterBy);
export default filterBy;
5 changes: 2 additions & 3 deletions addon/helpers/filter.js
@@ -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;
5 changes: 2 additions & 3 deletions addon/helpers/find-by.js
@@ -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;
5 changes: 1 addition & 4 deletions addon/helpers/flatten.js
@@ -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;
6 changes: 2 additions & 4 deletions addon/helpers/from-entries.js
@@ -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;
5 changes: 2 additions & 3 deletions addon/helpers/group-by.js
@@ -1,8 +1,7 @@
import { helper } from '@ember/component/helper';
import { get } from '@ember/object';
import asArray from '../utils/as-array';

export function groupBy([byPath, array]) {
export function groupBy(byPath, array) {
let groups = {};

asArray(array).forEach((item) => {
Expand All @@ -20,4 +19,4 @@ export function groupBy([byPath, array]) {
return groups;
}

export default helper(groupBy);
export default groupBy;
7 changes: 3 additions & 4 deletions addon/helpers/has-next.js
@@ -1,4 +1,3 @@
import { helper } from '@ember/component/helper';
import { isPresent } from '@ember/utils';
import { next } from './next';
import isEqual from '../utils/is-equal';
Expand All @@ -13,9 +12,9 @@ export function hasNext(currentValue, maybeArray, useDeepEqual = false) {
return isNotSameValue && isPresent(nextValue);
}

export default helper(function (params) {
export default function (...params) {
let { currentValue, array, useDeepEqual } =
getValueArrayAndUseDeepEqualFromParams(params);
getValueArrayAndUseDeepEqualFromParams(...params);

return hasNext(currentValue, array, useDeepEqual);
});
}
7 changes: 3 additions & 4 deletions addon/helpers/has-previous.js
@@ -1,4 +1,3 @@
import { helper } from '@ember/component/helper';
import { isPresent } from '@ember/utils';
import { previous } from './previous';
import isEqual from '../utils/is-equal';
Expand All @@ -13,9 +12,9 @@ export function hasPrevious(currentValue, maybeArray, useDeepEqual = false) {
return isNotSameValue && isPresent(previousValue);
}

export default helper(function (params) {
export default function (...params) {
let { currentValue, array, useDeepEqual } =
getValueArrayAndUseDeepEqualFromParams(params);
getValueArrayAndUseDeepEqualFromParams(...params);

return hasPrevious(currentValue, array, useDeepEqual);
});
}
5 changes: 2 additions & 3 deletions addon/helpers/inc.js
@@ -1,7 +1,6 @@
import { helper } from '@ember/component/helper';
import { isEmpty } from '@ember/utils';

export function inc([step, val]) {
export function inc(step, val) {
if (isEmpty(val)) {
val = step;
step = undefined;
Expand All @@ -20,4 +19,4 @@ export function inc([step, val]) {
return val + step;
}

export default helper(inc);
export default inc;
5 changes: 1 addition & 4 deletions addon/helpers/includes.js
@@ -1,4 +1,3 @@
import { helper } from '@ember/component/helper';
import asArray from '../utils/as-array';

export function includes(needleOrNeedles, haystack) {
Expand All @@ -17,6 +16,4 @@ export function includes(needleOrNeedles, haystack) {
});
}

export default helper(function ([needle, haystack]) {
return includes(needle, haystack);
});
export default includes;
5 changes: 2 additions & 3 deletions addon/helpers/intersect.js
@@ -1,7 +1,6 @@
import { helper } from '@ember/component/helper';
import asArray from '../utils/as-array';

export function intersect([...arrays]) {
export function intersect(...arrays) {
const confirmedArrays = asArray(arrays).map((array) => {
return Array.isArray(array) ? array : [];
});
Expand All @@ -17,4 +16,4 @@ export function intersect([...arrays]) {
});
}

export default helper(intersect);
export default intersect;
11 changes: 3 additions & 8 deletions addon/helpers/invoke.js
@@ -1,16 +1,11 @@
import { helper } from '@ember/component/helper';
import RSVP from 'rsvp';

const { all } = RSVP;

export function invoke([methodName, ...args]) {
export function invoke(methodName, ...args) {
let obj = args.pop();

if (Array.isArray(obj)) {
return function () {
let promises = obj.map((item) => item[methodName]?.(...args));

return all(promises);
return Promise.all(promises);
};
}

Expand All @@ -19,4 +14,4 @@ export function invoke([methodName, ...args]) {
};
}

export default helper(invoke);
export default invoke;
7 changes: 2 additions & 5 deletions addon/helpers/is-blank.js
@@ -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;
6 changes: 2 additions & 4 deletions addon/helpers/is-last.js
@@ -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;

0 comments on commit 580a805

Please sign in to comment.