@bunt/app
Advanced tools
Comparing version 0.19.12 to 0.19.16
@@ -41,7 +41,7 @@ "use strict"; | ||
static async factory(context, routes = []) { | ||
return new this(await unit_1.unit(context), routes); | ||
return new this(await (0, unit_1.unit)(context), routes); | ||
} | ||
add(route) { | ||
this.logger.debug("add", route); | ||
util_1.assert(!__classPrivateFieldGet(this, _Application_unit, "f").has(route.action), `This route was already added`); | ||
(0, util_1.assert)(!__classPrivateFieldGet(this, _Application_unit, "f").has(route.action), `This route was already added`); | ||
__classPrivateFieldGet(this, _Application_unit, "f").add(route.action); | ||
@@ -62,3 +62,3 @@ __classPrivateFieldGet(this, _Application_routes, "f").push(route); | ||
const route = __classPrivateFieldGet(this, _Application_routes, "f").find((route) => route.test(request.route)); | ||
util_1.assert(route, () => new Route_1.RouteNotFound(request.route)); | ||
(0, util_1.assert)(route, () => new Route_1.RouteNotFound(request.route)); | ||
this.logger.debug("match", route); | ||
@@ -73,3 +73,3 @@ const unit = __classPrivateFieldGet(this, _Application_unit, "f"); | ||
}; | ||
if (util_1.isDefined(route.payload)) { | ||
if ((0, util_1.isDefined)(route.payload)) { | ||
const { payload } = route; | ||
@@ -76,0 +76,0 @@ Object.assign(state, await payload.validate(routeContext)); |
@@ -11,3 +11,3 @@ "use strict"; | ||
async validate(context) { | ||
return input_1.validate(this.type, await this.resolver.resolve(context)); | ||
return (0, input_1.validate)(this.type, await this.resolver.resolve(context)); | ||
} | ||
@@ -14,0 +14,0 @@ } |
@@ -12,8 +12,8 @@ "use strict"; | ||
const { resolvers } = this; | ||
if (util_1.isFunction(resolvers)) { | ||
if ((0, util_1.isFunction)(resolvers)) { | ||
Object.assign(state, await resolvers(context)); | ||
} | ||
else if (util_1.isObject(resolvers)) { | ||
else if ((0, util_1.isObject)(resolvers)) { | ||
for (const [name, resolver] of Object.entries(resolvers)) { | ||
if (util_1.isFunction(resolver)) { | ||
if ((0, util_1.isFunction)(resolver)) { | ||
Reflect.set(state, name, await resolver(context)); | ||
@@ -20,0 +20,0 @@ } |
@@ -10,8 +10,8 @@ "use strict"; | ||
if (Array.isArray(expected)) { | ||
util_1.assert(expected.some((e) => clientValue.includes(e)), `Wrong header "${header}" value, allowed: ${expected.join(", ")}`); | ||
(0, util_1.assert)(expected.some((e) => clientValue.includes(e)), `Wrong header "${header}" value, allowed: ${expected.join(", ")}`); | ||
} | ||
if (util_1.isFunction(expected)) { | ||
if ((0, util_1.isFunction)(expected)) { | ||
const result = expected(clientValue); | ||
if (util_1.isBoolean(result)) { | ||
util_1.assert(result, `Wrong ${header}`); | ||
if ((0, util_1.isBoolean)(result)) { | ||
(0, util_1.assert)(result, `Wrong ${header}`); | ||
} | ||
@@ -18,0 +18,0 @@ } |
@@ -24,3 +24,3 @@ "use strict"; | ||
transform(transformer) { | ||
if (util_1.isFunction(transformer)) { | ||
if ((0, util_1.isFunction)(transformer)) { | ||
return transformer(this); | ||
@@ -27,0 +27,0 @@ } |
@@ -8,4 +8,4 @@ "use strict"; | ||
this.route = route; | ||
this.tester = path_to_regexp_1.pathToRegexp(route); | ||
this.matcher = path_to_regexp_1.match(route); | ||
this.tester = (0, path_to_regexp_1.pathToRegexp)(route); | ||
this.matcher = (0, path_to_regexp_1.match)(route); | ||
} | ||
@@ -12,0 +12,0 @@ match(route) { |
@@ -24,3 +24,3 @@ "use strict"; | ||
this.payload = payload; | ||
__classPrivateFieldSet(this, _Route_matcher, util_1.isFunction(matcher) ? matcher(this.route) : matcher, "f"); | ||
__classPrivateFieldSet(this, _Route_matcher, (0, util_1.isFunction)(matcher) ? matcher(this.route) : matcher, "f"); | ||
} | ||
@@ -40,3 +40,3 @@ static create(matcher) { | ||
getRuleArgs(rule) { | ||
if (util_1.isString(rule)) { | ||
if ((0, util_1.isString)(rule)) { | ||
return { route: rule, payload: undefined }; | ||
@@ -43,0 +43,0 @@ } |
@@ -8,5 +8,5 @@ "use strict"; | ||
const buffer = await request.getBuffer(); | ||
return querystring_1.parse(buffer.toString("utf-8")); | ||
return (0, querystring_1.parse)(buffer.toString("utf-8")); | ||
}; | ||
exports.URLEncodedFormTransform = URLEncodedFormTransform; | ||
//# sourceMappingURL=URLEncodedFormTransform.js.map |
{ | ||
"name": "@bunt/app", | ||
"version": "0.19.12", | ||
"version": "0.19.16", | ||
"keywords": [ | ||
@@ -29,9 +29,9 @@ "typescript" | ||
"dependencies": { | ||
"@bunt/input": "^0.19.12", | ||
"@bunt/unit": "^0.19.12", | ||
"@bunt/util": "^0.19.12", | ||
"@bunt/input": "^0.19.16", | ||
"@bunt/unit": "^0.19.16", | ||
"@bunt/util": "^0.19.16", | ||
"path-to-regexp": "^6.2.0" | ||
}, | ||
"license": "MIT", | ||
"gitHead": "af2ad3c8c543ddc526a1333910f5487d80c84d78" | ||
"gitHead": "4d9fc4fc6414228f9cfb275f9cead9a53bca76c0" | ||
} |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
48374
Updated@bunt/input@^0.19.16
Updated@bunt/unit@^0.19.16
Updated@bunt/util@^0.19.16