forked from sheepzh/time-tracker-4-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremain-host.ts
More file actions
36 lines (31 loc) · 844 Bytes
/
remain-host.ts
File metadata and controls
36 lines (31 loc) · 844 Bytes
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
/**
* Copyright (c) 2022 Hengyang Zhang
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
/**
* @since 0.7.0
*/
export const PDF_HOST = "__local_pdf__"
export const JSON_HOST = "__local_json__"
export const TXT_HOST = "__local_txt__"
export const PIC_HOST = "__local_picture__"
export const LOCAL_HOST_PATTERN = "__local_*__"
export const ALL_HOSTS = [PDF_HOST, JSON_HOST, TXT_HOST, PIC_HOST]
export const MERGED_HOST = "__local_files__"
export const SUFFIX_HOST_MAP: Record<string, string> = {
txt: TXT_HOST,
pdf: PDF_HOST,
json: JSON_HOST,
// Pictures
jpg: PIC_HOST,
img: PIC_HOST,
png: PIC_HOST,
jpeg: PIC_HOST,
}
const reg = /^__local_(.+)__$/
export function isRemainHost(host: string) {
return reg.test(host)
}
export const EXCLUDING_PREFIX = '+'