Total Complexity | 4 |
Complexity/F | 1.33 |
Lines of Code | 24 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | 'use strict' |
||
2 | |||
3 | import moment from 'moment' |
||
4 | export { genToken } from './tokenizer' |
||
|
|||
5 | export { isFunction, isObject } from 'lodash' |
||
6 | |||
7 | export const addDays = (offset, date) => { |
||
8 | date = date || new Date() |
||
9 | const momentAt = moment(date).add(offset, 'days') |
||
10 | return momentAt.toDate() |
||
11 | } |
||
12 | |||
13 | export const isAfter = (first, second) => { |
||
14 | const firstMoment = moment(first) |
||
15 | const secondMoment = moment(second) |
||
16 | return secondMoment.isAfter(firstMoment) |
||
17 | } |
||
18 | |||
19 | export const parseError = (error) => { |
||
20 | if (error.expected === 'object') { |
||
21 | const e = error.message |
||
22 | error.message = e.slice(0, e.indexOf('(object)')).trim() |
||
23 | } |
||
24 | } |
||
25 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.