After splitting the facades into multiple modules, enabling prod mode for code had no effect for the compiler. Also in a change between RC1 and RC2 we created the `CompilerConfig` via a provider with `useValue` and not via a `useFactory`, which reads the prod mode too early. Closes #9318 Closes #8508 Closes #9318
19 lines
577 B
TypeScript
19 lines
577 B
TypeScript
import {isDevMode} from '@angular/core';
|
|
|
|
import {BaseException} from '../src/facade/exceptions';
|
|
import {isArray, isBlank, isString} from '../src/facade/lang';
|
|
|
|
export function assertArrayOfStrings(identifier: string, value: any) {
|
|
if (!isDevMode() || isBlank(value)) {
|
|
return;
|
|
}
|
|
if (!isArray(value)) {
|
|
throw new BaseException(`Expected '${identifier}' to be an array of strings.`);
|
|
}
|
|
for (var i = 0; i < value.length; i += 1) {
|
|
if (!isString(value[i])) {
|
|
throw new BaseException(`Expected '${identifier}' to be an array of strings.`);
|
|
}
|
|
}
|
|
}
|