@nuxt/utils
Advanced tools
Comparing version 2.14.4 to 2.14.5
/*! | ||
* @nuxt/utils v2.14.4 (c) 2016-2020 | ||
* @nuxt/utils v2.14.5 (c) 2016-2020 | ||
@@ -1859,21 +1859,25 @@ * - All the amazing contributors | ||
} | ||
return function (...args) { | ||
if (typeof base !== 'function') { | ||
return fn.apply(this, args) | ||
if (typeof base !== 'function') { | ||
return fn | ||
} | ||
return function (arg0, ...args) { | ||
const next = (previous = arg0) => { | ||
const fnResult = fn.call(this, previous, ...args); | ||
if (fnResult && typeof fnResult.then === 'function') { | ||
return fnResult.then(res => res || previous) | ||
} | ||
return fnResult || previous | ||
}; | ||
const baseResult = base.call(this, arg0, ...args); | ||
if (baseResult && typeof baseResult.then === 'function') { | ||
return baseResult.then(res => next(res)) | ||
} | ||
let baseResult = base.apply(this, args); | ||
// Allow function to mutate the first argument instead of returning the result | ||
if (baseResult === undefined) { | ||
[baseResult] = args; | ||
} | ||
const fnResult = fn.call( | ||
this, | ||
baseResult, | ||
...Array.prototype.slice.call(args, 1) | ||
); | ||
// Return mutated argument if no result was returned | ||
if (fnResult === undefined) { | ||
return baseResult | ||
} | ||
return fnResult | ||
return next(baseResult) | ||
} | ||
@@ -1880,0 +1884,0 @@ }; |
{ | ||
"name": "@nuxt/utils", | ||
"version": "2.14.4", | ||
"version": "2.14.5", | ||
"repository": "nuxt/nuxt.js", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"semver": "^7.3.2", | ||
"serialize-javascript": "^4.0.0", | ||
"serialize-javascript": "^5.0.0", | ||
"signal-exit": "^3.0.3", | ||
@@ -19,0 +19,0 @@ "ua-parser-js": "^0.7.21" |
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
55676
1844
+ Addedserialize-javascript@5.0.1(transitive)
- Removedserialize-javascript@4.0.0(transitive)
Updatedserialize-javascript@^5.0.0