routing-controllers
Advanced tools
Comparing version 0.6.0-alpha.4 to 0.6.0-alpha.5
@@ -11,3 +11,3 @@ "use strict"; | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -30,3 +30,3 @@ index: index, | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -54,3 +54,3 @@ index: index, | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -79,3 +79,3 @@ index: index, | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -105,3 +105,3 @@ index: index, | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -131,3 +131,3 @@ index: index, | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -157,3 +157,3 @@ index: index, | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -183,3 +183,3 @@ index: index, | ||
var metadata = { | ||
object: object, | ||
target: object.constructor, | ||
method: methodName, | ||
@@ -186,0 +186,0 @@ index: index, |
@@ -59,3 +59,2 @@ "use strict"; | ||
// finally register action | ||
console.log("params: ", expressParams); | ||
(_a = this.express)[expressAction].apply(_a, expressParams); | ||
@@ -127,10 +126,15 @@ var _a; | ||
} | ||
else if (result !== null && result !== undefined) { | ||
if (action.isJsonTyped) { | ||
response.json(result); | ||
else if (result !== undefined) { | ||
if (result === null) { | ||
response.send(); | ||
} | ||
else { | ||
response.send(result); | ||
if (action.isJsonTyped) { | ||
response.json(result); | ||
} | ||
else { | ||
response.send(result); | ||
} | ||
options.next(); | ||
} | ||
options.next(); | ||
} | ||
@@ -137,0 +141,0 @@ else { |
@@ -122,5 +122,15 @@ "use strict"; | ||
} | ||
else if (result !== null && result !== undefined) { | ||
response.body = result; | ||
options.next(); | ||
else if (result !== undefined) { | ||
if (result === null) { | ||
response.send(); | ||
} | ||
else { | ||
if (action.isJsonTyped) { | ||
response.json(result); | ||
} | ||
else { | ||
response.send(result); | ||
} | ||
options.next(); | ||
} | ||
} | ||
@@ -127,0 +137,0 @@ else { |
@@ -49,3 +49,2 @@ "use strict"; | ||
controller.uses = _this.createControllerUses(controller); | ||
console.log("controller.uses: ", controller.uses); | ||
return controller; | ||
@@ -82,4 +81,2 @@ }); | ||
MetadataBuilder.prototype.createControllerUses = function (controller) { | ||
console.log("target: ", controller.target); | ||
console.log(index_1.defaultMetadataArgsStorage().uses.filter(function (use) { return use.target === controller.target; })); | ||
return index_1.defaultMetadataArgsStorage() | ||
@@ -86,0 +83,0 @@ .findUsesWithTargetAndMethod(controller.target, undefined) |
@@ -7,5 +7,5 @@ import { ParamTypes } from "../types/ParamTypes"; | ||
/** | ||
* Object on which's method's parameter this parameter is attached. | ||
* Parameter target. | ||
*/ | ||
object: any; | ||
target: any; | ||
/** | ||
@@ -32,6 +32,2 @@ * Method on which's parameter is attached. | ||
/** | ||
* Parameter target. | ||
*/ | ||
target?: any; | ||
/** | ||
* Specifies if parameter should be parsed as json or not. | ||
@@ -38,0 +34,0 @@ */ |
@@ -8,8 +8,4 @@ "use strict"; | ||
this.actionMetadata = actionMetadata; | ||
if (args.object) | ||
this.object = args.object; | ||
if (args.target) | ||
this.target = args.target; | ||
if (args.method) | ||
this.method = args.method; | ||
this.target = args.target; | ||
this.method = args.method; | ||
if (args.index !== undefined) | ||
@@ -16,0 +12,0 @@ this.index = args.index; |
{ | ||
"name": "routing-controllers", | ||
"private": false, | ||
"version": "0.6.0-alpha.4", | ||
"version": "0.6.0-alpha.5", | ||
"description": "Allows to use class-based controllers with express.js in Typescript", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
@@ -91,3 +91,3 @@ "use strict"; | ||
var result = action.executeAction(params); | ||
if (result) | ||
if (result !== undefined) | ||
_this.handleResult(result, action, options); | ||
@@ -94,0 +94,0 @@ }).catch(function (error) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3508
220363