/
utils.ts
58 lines (57 loc) · 1.77 KB
/
utils.ts
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { arrayStartingMatch } from "./utils/arrayStartingMatch";
import { arrayUnique } from "./utils/arrayUnique";
import { asyncWaterfall } from "./utils/asyncWaterfall";
import { collapseObjectToArray } from "./utils/collapseObjectToArray";
import { ensureNoTsHeaderFiles } from "./utils/ensureNoTsHeaderFiles";
import { eventLoopDelay } from "./utils/eventLoopDelay";
import { filterObjectForLogging } from "./utils/filterObjectForLogging";
import { getExternalIPAddress } from "./utils/getExternalIPAddress";
import { hashMerge } from "./utils/hashMerge";
import { isPlainObject } from "./utils/isPlainObject";
import { parseHeadersForClientAddress } from "./utils/parseHeadersForClientAddress";
import { parseCookies } from "./utils/parseCookies";
import { parseIPv6URI } from "./utils/parseIPv6URI";
import { replaceDistWithSrc } from "./utils/replaceDistWithSrc";
import { sleep } from "./utils/sleep";
import { sortGlobalMiddleware } from "./utils/sortGlobalMiddleware";
import { sourceRelativeLinkPath } from "./utils/sourceRelativeLinkPath";
import {
dirExists,
fileExists,
createDirSafely,
createFileSafely,
createLinkfileSafely,
removeLinkfileSafely,
createSymlinkSafely,
} from "./utils/fileUtils";
/**
* Utility functions for Actionhero
*/
export const utils = {
arrayStartingMatch,
arrayUnique,
asyncWaterfall,
collapseObjectToArray,
ensureNoTsHeaderFiles,
eventLoopDelay,
filterObjectForLogging,
getExternalIPAddress,
hashMerge,
isPlainObject,
parseHeadersForClientAddress,
parseCookies,
parseIPv6URI,
replaceDistWithSrc,
sleep,
sortGlobalMiddleware,
sourceRelativeLinkPath,
fileUtils: {
dirExists,
fileExists,
createDirSafely,
createFileSafely,
createLinkfileSafely,
removeLinkfileSafely,
createSymlinkSafely,
},
};