From 10f3703e0abdbf2c90b1326ca3e44412cb61ed1a Mon Sep 17 00:00:00 2001 From: Dale 'Ducky' Lotts Date: Mon, 4 Nov 2019 11:15:56 -0500 Subject: [PATCH] fix: fix maximum call stack size exceeded with `ng build --prod` Fix #440 --- .travis.yml | 5 ++--- .../dl-date-time-input/dl-date-time-input.directive.ts | 9 ++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8d22ab8..36a068a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,8 @@ notifications: email: false node_js: - '10' -before_install: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start +services: + - xvfb before_script: - npm prune script: diff --git a/src/lib/dl-date-time-input/dl-date-time-input.directive.ts b/src/lib/dl-date-time-input/dl-date-time-input.directive.ts index a276c0b1..ee1c0e93 100644 --- a/src/lib/dl-date-time-input/dl-date-time-input.directive.ts +++ b/src/lib/dl-date-time-input/dl-date-time-input.directive.ts @@ -18,11 +18,6 @@ import {DlDateTimeInputChange} from './dl-date-time-input-change'; */ const moment = _moment; -/** - * @internal - */ -const alwaysTrueInputFilter: (value: any) => boolean = () => true; - /** * This directive allows the user to enter dates, using the keyboard, into an input box and * angular will then store a date value in the model. @@ -40,10 +35,10 @@ export class DlDateTimeInputDirective implements ControlValueAccessor, Valida /* tslint:disable:member-ordering */ private _filterValidator: ValidatorFn = (control: AbstractControl): ValidationErrors | null => { - return (this._inputFilter || alwaysTrueInputFilter)(this._value) ? + return (this._inputFilter || (() => true))(this._value) ? null : {'dlDateTimeInputFilter': {'value': control.value}}; } - private _inputFilter: (value: (D | null)) => boolean = alwaysTrueInputFilter; + private _inputFilter: (value: (D | null)) => boolean = () => true; private _isValid = true; private _parseValidator: ValidatorFn = (): ValidationErrors | null => { return this._isValid ?