feat: add components
This commit is contained in:
13
components/component-json-ex.js
Normal file
13
components/component-json-ex.js
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
var FastJSON = Packages.com.alibaba.fastjson.JSON;
|
||||
var FastJSONSerializerFeature = Packages.com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
|
||||
exports.prettyJSON = (obj) => {
|
||||
return FastJSON.toJSONString(FastJSON.parse(JSON.stringify(obj)), FastJSONSerializerFeature.PrettyFormat);
|
||||
};
|
||||
|
||||
exports.prettyJavaJSON = (obj) => {
|
||||
return FastJSON.toJSONString(obj, FastJSONSerializerFeature.PrettyFormat);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user