parent
ef674daa28
commit
8b9a212d56
@ -1,11 +1,23 @@ |
||||
|
||||
var soljson = require('./bin/soljson-latest.js'); |
||||
|
||||
compileJSON = soljson.cwrap("compileJSON", "string", ["string", "number"]); |
||||
var compileJSON = soljson.cwrap("compileJSON", "string", ["string", "number"]); |
||||
var compileJSONMulti = |
||||
'_compileJSONMulti' in soljson ? |
||||
soljson.cwrap("compileJSONMulti", "string", ["string", "number"]) : |
||||
null; |
||||
|
||||
var compile = function(input, optimise) { |
||||
var result = ''; |
||||
if (typeof(input) != typeof('') && compileJSONMulti !== null) |
||||
result = compileJSONMulti(JSON.stringify(input), optimise); |
||||
else |
||||
result = compileJSON(input, optimise); |
||||
return JSON.parse(result); |
||||
} |
||||
|
||||
|
||||
module.exports = { |
||||
compile: function(input, optimise){ |
||||
return JSON.parse( compileJSON(input, optimise) ); |
||||
}, |
||||
compile: compile, |
||||
version: soljson.cwrap("version", "string", []) |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue