Skip to content

Commit

Permalink
fix bug in /handler/json
Browse files Browse the repository at this point in the history
  • Loading branch information
dlueth committed Apr 20, 2020
1 parent f06a3cb commit d01948f
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 30 deletions.
12 changes: 3 additions & 9 deletions addon/handler/json.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
'use strict';

function definition(path, abstractHandler, Task, Failure, isObject, merge) {
function definition(path, abstractHandler, Task, Pledge, Failure, isObject, merge) {
var regexMatchType = /^application\/json/,
settings = { suffix: '.json' },
parseJson = new Task(function(resolve, reject, source) {
Expand Down Expand Up @@ -37,18 +37,12 @@
}
},
process: function(dependency) {
parseJson(dependency.source)
.then(function(data) {
provide(function() { return data; });
})
.catch(function() {
dependency.dfd.reject(new Failure('error parsing', dependency.path));
});
provide(parseJson(dependency.source));
}
};

return new (HandlerJson.extends(abstractHandler));
}

provide([ 'path', '/demand/abstract/handler', '/demand/task', '/demand/failure', '/demand/validator/isObject', '/demand/function/merge' ], definition);
provide([ 'path', '/demand/abstract/handler', '/demand/task', '/demand/pledge', '/demand/failure', '/demand/validator/isObject', '/demand/function/merge' ], definition);
}());
2 changes: 1 addition & 1 deletion dist/cache/dispose.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cache/states.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/demand.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/demand.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/handler/css.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/html.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/handler/json.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/json.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/legacy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/text.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/cookie.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d01948f

Please sign in to comment.