Total Complexity | 5 |
Complexity/F | 1.67 |
Lines of Code | 35 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | import * as feathersUtil from 'feathers-commons/lib/utils' |
||
2 | |||
3 | export const each = feathersUtil.each |
||
4 | export const some = feathersUtil._.some |
||
5 | |||
6 | /** |
||
7 | * Empty function |
||
8 | */ |
||
9 | export function noop() { |
||
10 | } |
||
11 | |||
12 | /** |
||
13 | * Log debug in user's console |
||
14 | * |
||
15 | * @param args |
||
16 | */ |
||
17 | export function warn(...args) { |
||
18 | /* istanbul ignore next */ |
||
19 | if (console || window.console) { |
||
20 | console.warn('[vue-syncers-feathers]', ...args) |
||
21 | } |
||
22 | } |
||
23 | |||
24 | const numberRegex = /^\d+$/ |
||
25 | |||
26 | /** |
||
27 | * Test if a value seems like a number |
||
28 | * |
||
29 | * @param value |
||
30 | * @returns {boolean} |
||
31 | */ |
||
32 | |||
33 | export function isNumericIDLike(value) { |
||
34 | return (typeof value !== 'number' && numberRegex.test(value)) |
||
35 | } |
||
36 |