Skip to content

Commit ae0373d

Browse files
committed
fix: typings entry point and failing definitions (angular-redux#36)
Also adds stricter ngc build rules to ensure correct metadata emit.
1 parent 9eb99c0 commit ae0373d

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/form/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"prepublish": "npm run build"
7070
},
7171
"main": "dist/source/index.js",
72+
"typings": "dist/source/index.d.ts",
7273
"repository": "https://github.com/angular-redux/form",
7374
"license": "MIT"
7475
}

packages/form/source/connect-array.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ export class ConnectArray extends ControlContainer implements OnInit {
111111
return controlPath(this.key, this.parent);
112112
}
113113

114-
get validator(): ValidatorFn {
114+
get validator(): ValidatorFn | null {
115115
return Validators.compose(this.rawValidators);
116116
}
117117

118-
get asyncValidator(): AsyncValidatorFn {
118+
get asyncValidator(): AsyncValidatorFn | null {
119119
return Validators.composeAsync(this.rawAsyncValidators);
120120
}
121121

packages/form/source/shims.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from '@angular/forms';
1111

1212
export function controlPath(name: string, parent: ControlContainer): string[] {
13-
return [...parent.path, name];
13+
return [...(parent.path || []), name];
1414
}
1515

1616
export function selectValueAccessor(

packages/form/tsconfig.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
"useBabel": true,
2727
"useCache": false
2828
},
29-
"angularCompilerOptions": {},
29+
"angularCompilerOptions": {
30+
"strictMetadataEmit": true,
31+
"skipTemplateCodegen": true
32+
},
3033
"exclude": [
3134
"node_modules",
3235
"dist",

0 commit comments

Comments
 (0)