UNPKG

939 BJavaScriptView Raw
1let {
2 getEdgeBetaPath,
3 getEdgeCanaryPath,
4 getEdgeDevPath,
5 getEdgePath,
6 getAnyEdgeStable,
7 getAnyEdgeLatest,
8} = require(".")
9// don't forget to replace above with following line
10// let { getEdgeBetaPath, getEdgeCanaryPath, getEdgeDevPath, getEdgePath } = require("edge-paths")
11
12// Here is one naive example. Uncomment following line to test
13// console.log(getEdgeBetaPath())
14// console.log(getEdgeCanaryPath())
15// console.log(getEdgeDevPath())
16// console.log(getEdgePath())
17
18// Here is another example with try catch
19// This find edge function just ignore the error
20function findEdge(func) {
21 try {
22 let path = func()
23 console.log("Found path", path)
24 } catch (e) {
25 console.log("Error on finding path", e)
26 }
27}
28
29findEdge(() => getEdgeBetaPath())
30findEdge(() => getEdgeCanaryPath())
31findEdge(() => getEdgeDevPath())
32findEdge(() => getEdgePath())
33findEdge(() => getAnyEdgeStable())
34findEdge(() => getAnyEdgeLatest())