refactor(forms): replace instanceof Array (#33078)

PR Close #33078
This commit is contained in:
Nikita Potapenko 2019-10-10 12:06:42 +03:00 committed by Miško Hevery
parent b0834fe962
commit f54adf10b5
1 changed files with 2 additions and 2 deletions

View File

@ -47,10 +47,10 @@ export const DISABLED = 'DISABLED';
function _find(control: AbstractControl, path: Array<string|number>| string, delimiter: string) { function _find(control: AbstractControl, path: Array<string|number>| string, delimiter: string) {
if (path == null) return null; if (path == null) return null;
if (!(path instanceof Array)) { if (!Array.isArray(path)) {
path = path.split(delimiter); path = path.split(delimiter);
} }
if (path instanceof Array && path.length === 0) return null; if (Array.isArray(path) && path.length === 0) return null;
return path.reduce((v: AbstractControl | null, name) => { return path.reduce((v: AbstractControl | null, name) => {
if (v instanceof FormGroup) { if (v instanceof FormGroup) {