mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(package) Util.json -> jonny
This commit is contained in:
parent
412537a7ae
commit
2add21548a
3 changed files with 7 additions and 26 deletions
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
pipe = require('pipe-io'),
|
||||
ponse = require('ponse'),
|
||||
json = require('jonny'),
|
||||
|
||||
apiURL = CloudFunc.apiURL,
|
||||
|
||||
|
|
@ -50,7 +51,7 @@
|
|||
}
|
||||
|
||||
function save(callback) {
|
||||
var data = Util.json.stringify(config);
|
||||
var data = json.stringify(config);
|
||||
|
||||
check(arguments, ['callback']);
|
||||
|
||||
|
|
@ -110,7 +111,7 @@
|
|||
}
|
||||
|
||||
function get(req, res) {
|
||||
var data = Util.json.stringify(config);
|
||||
var data = json.stringify(config);
|
||||
|
||||
ponse.send(data, {
|
||||
name : 'config.json',
|
||||
|
|
@ -130,7 +131,7 @@
|
|||
|
||||
pipe.getBody(req, function(error, body) {
|
||||
var data = '',
|
||||
json = Util.json.parse(body) || {};
|
||||
json = json.parse(body) || {};
|
||||
|
||||
if (error)
|
||||
callback(error);
|
||||
|
|
|
|||
|
|
@ -29,32 +29,12 @@
|
|||
ponse = require('ponse'),
|
||||
rendy = require('rendy'),
|
||||
copymitter = require('copymitter'),
|
||||
tryCatch = require('try-catch'),
|
||||
json = require('jonny'),
|
||||
check = require('checkup'),
|
||||
|
||||
Modules = require(DIR_JSON + 'modules'),
|
||||
|
||||
isWin32 = process.platform === 'win32',
|
||||
|
||||
json = {
|
||||
parse: function(str) {
|
||||
return this._try(str, JSON.parse);
|
||||
},
|
||||
|
||||
stringify: function(json) {
|
||||
return this._try(json, JSON.stringify);
|
||||
},
|
||||
|
||||
_try: function(data, fn) {
|
||||
var ret;
|
||||
|
||||
tryCatch(function() {
|
||||
ret = fn.call(JSON, data);
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
isWin32 = process.platform === 'win32';
|
||||
|
||||
/**
|
||||
* rest interface
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
"http-auth": "~2.2.3",
|
||||
"jag": "~1.0.0",
|
||||
"join-io": "~1.3.0",
|
||||
"jonny": "~1.0.0",
|
||||
"markdown-it": "~3.0.7",
|
||||
"mellow": "~1.0.0",
|
||||
"minify": "~1.4.0",
|
||||
|
|
@ -52,7 +53,6 @@
|
|||
"rendy": "~1.0.2",
|
||||
"restafary": "~1.1.0",
|
||||
"socket.io": "~1.3.3",
|
||||
"try-catch": "~1.0.0",
|
||||
"tryrequire": "~1.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue