Skip to content

Commit

Permalink
refactor: stops using A() with PromiseManyArray
Browse files Browse the repository at this point in the history
- as it is no longer allowed on Ember 5
  • Loading branch information
Pixelik committed Oct 7, 2023
1 parent c6a2347 commit fb3bf18
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions addon/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import ObjectProxy from '@ember/object/proxy';
import { isHTMLSafe } from '@ember/template';
import EmberObject from '@ember/object';
import { typeOf } from '@ember/utils';
import { A as emberArray, isArray } from '@ember/array';
import require from 'require';

function requireModule(module, exportName = 'default') {
Expand Down Expand Up @@ -50,7 +49,6 @@ export function isDSManyArray(o) {
return !!(
DS &&
o &&
isArray(o) &&
(o instanceof DS.PromiseManyArray || o instanceof DS.ManyArray)
);
}
Expand All @@ -75,7 +73,7 @@ export function getValidatableValue(value) {

if (isDSManyArray(value)) {
value.content = value.content.filter((v) => isValidatable(v));
return emberArray(value);
return value;
}

return isValidatable(value) ? value : undefined;
Expand Down

0 comments on commit fb3bf18

Please sign in to comment.