(config)
| 3014 | } |
| 3015 | |
| 3016 | function prepareConfig(config) { |
| 3017 | var input = config._i, |
| 3018 | format = config._f; |
| 3019 | |
| 3020 | config._locale = config._locale || getLocale(config._l); |
| 3021 | |
| 3022 | if (input === null || (format === undefined && input === '')) { |
| 3023 | return createInvalid({ nullInput: true }); |
| 3024 | } |
| 3025 | |
| 3026 | if (typeof input === 'string') { |
| 3027 | config._i = input = config._locale.preparse(input); |
| 3028 | } |
| 3029 | |
| 3030 | if (isMoment(input)) { |
| 3031 | return new Moment(checkOverflow(input)); |
| 3032 | } else if (isDate(input)) { |
| 3033 | config._d = input; |
| 3034 | } else if (isArray(format)) { |
| 3035 | configFromStringAndArray(config); |
| 3036 | } else if (format) { |
| 3037 | configFromStringAndFormat(config); |
| 3038 | } else { |
| 3039 | configFromInput(config); |
| 3040 | } |
| 3041 | |
| 3042 | if (!isValid(config)) { |
| 3043 | config._d = null; |
| 3044 | } |
| 3045 | |
| 3046 | return config; |
| 3047 | } |
| 3048 | |
| 3049 | function configFromInput(config) { |
| 3050 | var input = config._i; |
no test coverage detected
searching dependent graphs…