avet-utils
Advanced tools
Comparing version 1.1.1 to 1.2.1
@@ -32,7 +32,15 @@ 'use strict'; | ||
if (!(!props && (!ctx.res || !ctx.res.finished))) { | ||
_context.next = 9; | ||
if (!(ctx.res && isResSent(ctx.res))) { | ||
_context.next = 7; | ||
break; | ||
} | ||
return _context.abrupt('return', props); | ||
case 7: | ||
if (props) { | ||
_context.next = 11; | ||
break; | ||
} | ||
compName = getDisplayName(Component); | ||
@@ -42,6 +50,6 @@ message = '"' + compName + '.getInitialProps()" should resolve to an object. But found "' + props + '" instead.'; | ||
case 9: | ||
case 11: | ||
return _context.abrupt('return', props); | ||
case 10: | ||
case 12: | ||
case 'end': | ||
@@ -65,5 +73,10 @@ return _context.stop(); | ||
function isResSent(res) { | ||
return res.finished || res.headersSent; | ||
} | ||
module.exports = { | ||
isResSent: isResSent, | ||
getDisplayName: getDisplayName, | ||
loadGetInitialProps: loadGetInitialProps | ||
}; |
{ | ||
"name": "avet-utils", | ||
"description": "Avet utils for all avet projects", | ||
"version": "1.1.1", | ||
"version": "1.2.1", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "dev": "taskr dev", |
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
17966
476