-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
40 lines (38 loc) · 1.03 KB
/
index.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
const o = require("./src/_o.js");
const createPromised = require("@gardenhq/willow/util/promised");
const promisedRequire = createPromised(require);
module.exports = function(cb)
{
return Promise.all(
[
"@gardenhq/willow/util/promisedYaml",
"js-yaml"
].map(
function(item)
{
return promisedRequire(item);
}
)
).then(
function(modules)
{
const createYamlableRequire = modules[0];
const yaml = modules[1];
return o(
createYamlableRequire(
createPromised,
function(path, str)
{
return yaml.load(
str,
{
filename: path,
schema: yaml.CORE_SCHEMA
}
);
}
)
)(cb);
}
);
}