Skip to content

Commit

Permalink
Remove some unnecessary uses of Ember.A
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Nov 7, 2022
1 parent cfaf5d5 commit 3a1c614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/@ember/debug/container-debug-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export default class ContainerDebugAdapter extends EmberObject {
@return {Array} An array of strings.
@public
*/
catalogEntriesByType(type: string): NativeArray<string> {
let namespaces = emberA(Namespace.NAMESPACES);
let types = emberA<string>();
catalogEntriesByType(type: string): string[] {
let namespaces = Namespace.NAMESPACES;
let types: string[] = [];
let typeSuffixRegex = new RegExp(`${classify(type)}$`);

namespaces.forEach((namespace) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/@ember/debug/data-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,14 @@ export default class DataAdapter<T> extends EmberObject {
: this._getObjectsOnNamespaces();

// New adapters return strings instead of classes.
let klassTypes = emberA(stringTypes).map((name) => {
let klassTypes = stringTypes.map((name) => {
return {
klass: this._nameToClass(name),
name,
};
});

return emberA(klassTypes).filter((type) => this.detect(type.klass));
return klassTypes.filter((type) => this.detect(type.klass));
}

/**
Expand All @@ -571,8 +571,8 @@ export default class DataAdapter<T> extends EmberObject {
@return {Array} Array of model type strings.
*/
_getObjectsOnNamespaces() {
let namespaces = emberA(Namespace.NAMESPACES);
let types = emberA<string>();
let namespaces = Namespace.NAMESPACES;
let types: string[] = [];

namespaces.forEach((namespace) => {
for (let key in namespace) {
Expand Down

0 comments on commit 3a1c614

Please sign in to comment.