Skip to content

Commit

Permalink
update 0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
YuChenLi923 committed Aug 16, 2019
1 parent c32b651 commit 3c7b58b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/condition-json.js
Expand Up @@ -207,7 +207,7 @@ var handleValue = function () {
}

_context.next = 20;
return convert(value, scope);
return convert(value, scope, listener);

case 20:
value = _context.sent;
Expand Down Expand Up @@ -299,7 +299,7 @@ var convert = function () {

case 17:
_context2.next = 19;
return convert(value, scope);
return convert(value, scope, listener);

case 19:
childJSON = _context2.sent;
Expand Down
2 changes: 1 addition & 1 deletion dist/condition-json.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "condition-json",
"version": "0.0.6",
"version": "0.0.7",
"description": "",
"main": "dist/condition-json.min.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -23,7 +23,7 @@ async function handleValue(value, scope, newJson, key, listener) {
}
}
} else if (isObject(value)) {
value = await convert(value, scope);
value = await convert(value, scope, listener);
}
if (listener && typeof listener.convert === 'function') {
value = listener.convert(value, key);
Expand Down Expand Up @@ -71,7 +71,7 @@ async function convert(json, scope, listener) {
if (!result || !isObject(value)) {
return;
}
let childJSON = await convert(value, scope);
let childJSON = await convert(value, scope, listener);
assign(newJson, childJSON, true);
}));
return newJson;
Expand Down
10 changes: 6 additions & 4 deletions test/index.js
Expand Up @@ -137,13 +137,15 @@ describe('test assign', () => {
describe('test function error', () => {
it('error', () => {
const json = {
name: async function() {
return a;
name: {
body: async function() {
return a;
}
}
};
cjson(json, {}, {
error: function (e) {
console.log(e.message, 1111);
error: (e) => {
console.log(e.message, 3213213213);
}
});
});
Expand Down

0 comments on commit 3c7b58b

Please sign in to comment.