-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathutils.js
41 lines (38 loc) · 1.28 KB
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { resetCache, resetLastNotification } from './audit'
export const draf = (cb) => requestAnimationFrame(() => requestAnimationFrame(cb))
export const defaultOptions = {
auto: true,
allowConsoleClears: true,
clearConsoleOnUpdate: false,
delay: 500,
element: null,
config: {
branding: {
application: 'vue-axe'
}
},
runOptions: {
reporter: 'v2',
resultTypes: ['violations']
},
style: {
head: 'padding:6px;font-size:20px;font-weight:bold;',
boldCourier: 'font-weight:bold;font-family:Courier;',
moderate: 'padding:2px 4px;border-radius:5px;background-color:#FFBA52;color:#222;font-weight:normal;',
critical: 'padding:2px 4px;border-radius:5px;background-color:#AD0000;color:#fff;font-weight:normal;',
serious: 'padding:2px 4px;border-radius:5px;background-color:#333;color:#FFCE85;font-weight:normal;',
minor: 'padding:2px 4px;border-radius:5px;background-color:#333;color:#FFCE85;font-weight:normal;',
title: 'font-color:black;font-weight:bold;',
url: 'font-color:#4D4D4D;font-weight:normal;'
},
plugins: []
}
export function clear (forceClear = false, options) {
resetCache()
if (forceClear || options.clearConsoleOnUpdate) {
resetLastNotification()
if (options.allowConsoleClears) {
console.clear()
}
}
}