-
Notifications
You must be signed in to change notification settings - Fork 4
/
example.js
34 lines (31 loc) · 929 Bytes
/
example.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
import {
getEdgeBetaPath,
getEdgeCanaryPath,
getEdgeDevPath,
getEdgePath,
getAnyEdgeStable,
getAnyEdgeLatest,
} from "./dist/index.js"
// don't forget to replace above with following line
// let { getEdgeBetaPath, getEdgeCanaryPath, getEdgeDevPath, getEdgePath } from 'edge-paths'
// Here is one naive example. Uncomment following line to test
// console.log(getEdgeBetaPath())
// console.log(getEdgeCanaryPath())
// console.log(getEdgeDevPath())
// console.log(getEdgePath())
// Here is another example with try catch
// This find edge function just ignore the error
function findEdge(func) {
try {
let path = func()
console.log("Found path", path)
} catch (e) {
console.log("Error on finding path", e)
}
}
findEdge(() => getEdgeBetaPath())
findEdge(() => getEdgeCanaryPath())
findEdge(() => getEdgeDevPath())
findEdge(() => getEdgePath())
findEdge(() => getAnyEdgeStable())
findEdge(() => getAnyEdgeLatest())