Skip to content

Commit 330ae88

Browse files
Merge pull request #17 from ember-cli/nvp/widen-module-type
Widen module type
2 parents cef5100 + 6632141 commit 330ae88

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

src/index.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import EmberApplication from '@ember/application';
22
import { StrictResolver } from './strict-resolver.ts';
33

4-
type ExportableType =
5-
| undefined
6-
| null
7-
| object
8-
| number
9-
| string
10-
| boolean
11-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
12-
| Function;
13-
144
export default class EmberApp extends EmberApplication {
155
Resolver = {
166
create: ({
177
namespace,
188
}: {
199
namespace: {
20-
modules: Record<string, Record<string, unknown>>;
10+
modules: Record<string, unknown>;
2111
plurals?: Record<string, string>;
2212
};
2313
}) => {
@@ -35,9 +25,7 @@ export default class EmberApp extends EmberApplication {
3525
@public
3626
*/
3727
declare modules?: {
38-
[modulePath: string]:
39-
| ExportableType
40-
| { [exportName: string]: ExportableType };
28+
[modulePath: string]: unknown;
4129
};
4230

4331
// TODO: I don't think I really want to add this, but I also don't want to

src/strict-resolver.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { Factory, Resolver } from '@ember/owner';
22

33
export class StrictResolver implements Resolver {
4-
#modules = new Map<string, Record<string, unknown>>();
4+
#modules = new Map<string, unknown>();
55
#plurals = new Map<string, string>();
66
original: any;
77

88
constructor(
9-
modules: Record<string, Record<string, unknown>>,
9+
modules: Record<string, unknown>,
1010
plurals: Record<string, string> | undefined = undefined,
1111
) {
1212
this.addModules(modules);
@@ -18,7 +18,7 @@ export class StrictResolver implements Resolver {
1818
}
1919
}
2020

21-
addModules(modules: Record<string, Record<string, unknown>>) {
21+
addModules(modules: Record<string, unknown>) {
2222
for (const [moduleName, module] of Object.entries(modules)) {
2323
this.#modules.set(this.#normalizeModule(moduleName), module);
2424
}

0 commit comments

Comments
 (0)