-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
30 lines (23 loc) · 907 Bytes
/
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
'use strict';
var CSON = require('season');
module.exports = function(lasso, config) {
lasso.dependencies.registerRequireExtension('cson', {
object: true,
read: function(path, lassoContext, callback) {
return new Promise((resolve, reject) => {
callback = callback || function (err, res) {
return err ? reject(err) : resolve(res);
};
CSON.readFile(path, function(err, o) {
if (err) {
return callback(err);
}
callback(null, JSON.stringify(o));
});
})
},
getLastModified: function(path, lassoContext, callback) {
return lassoContext.getFileLastModified(path, callback);
}
});
};