create-app
Advanced tools
Comparing version 2.0.7 to 2.0.8
@@ -113,3 +113,3 @@ "use strict"; | ||
var iController = loader(controller, finalLocation, context); | ||
if (Promise.resolve(iController) == iController) { | ||
if (util_1.isPromise(iController)) { | ||
return iController.then(initController); | ||
@@ -196,3 +196,3 @@ } | ||
} | ||
if (Promise.resolve(element) == element) { | ||
if (util_1.isPromise(element)) { | ||
return element.then(function (result) { | ||
@@ -260,3 +260,3 @@ if (currentLocation !== location || result == null) { | ||
var result = render(location); | ||
if (Promise.resolve(result) == result) { | ||
if (util_1.isPromise(result)) { | ||
result.then(function () { | ||
@@ -263,0 +263,0 @@ publish(location); |
@@ -70,3 +70,3 @@ "use strict"; | ||
var controller = fetchController(requestPath, injectContext); | ||
if (Promise.resolve(controller) == controller) { | ||
if (util_1.isPromise(controller)) { | ||
result = controller.then(initController); | ||
@@ -82,3 +82,3 @@ } | ||
} | ||
if (Promise.resolve(result) == result) { | ||
if (util_1.isPromise(result)) { | ||
if (callback) { | ||
@@ -98,3 +98,3 @@ var cb_1 = callback; | ||
} | ||
if (Promise.resolve(component) == component) { | ||
if (util_1.isPromise(component)) { | ||
return component.then(function (component) { | ||
@@ -131,3 +131,3 @@ if (component == null) { | ||
var iController = loader(controller, finalLocation, finalContext); | ||
if (Promise.resolve(iController) == iController) { | ||
if (util_1.isPromise(iController)) { | ||
return iController.then(function (iController) { | ||
@@ -134,0 +134,0 @@ var Wrapper = wrapController(iController); |
@@ -8,1 +8,2 @@ import { Cache, AppMap } from './type'; | ||
export declare function createMap<K, V>(): AppMap<K, V>; | ||
export declare function isPromise(value: any): value is Promise<unknown>; |
@@ -86,1 +86,5 @@ "use strict"; | ||
exports.createMap = createMap; | ||
function isPromise(value) { | ||
return !!value && typeof value.then === 'function'; | ||
} | ||
exports.isPromise = isPromise; |
{ | ||
"name": "create-app", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "configuring once, rendering both client and server.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
40944
74
1062