Skip to content
Permalink
Browse files
Get rid of typeof for checking undefined
  • Loading branch information
Connormiha committed Aug 16, 2018
1 parent a02bf99 commit efa69cd6280deb6d599528c1db1128387430c9e1
Showing 1 changed file with 6 additions and 6 deletions.
@@ -60,13 +60,13 @@ class ContextReplacementPlugin {
cmf.hooks.beforeResolve.tap("ContextReplacementPlugin", result => {
if (!result) return;
if (resourceRegExp.test(result.request)) {
if (typeof newContentResource !== "undefined") {
if (newContentResource !== undefined) {
result.request = newContentResource;
}
if (typeof newContentRecursive !== "undefined") {
if (newContentRecursive !== undefined) {
result.recursive = newContentRecursive;
}
if (typeof newContentRegExp !== "undefined") {
if (newContentRegExp !== undefined) {
result.regExp = newContentRegExp;
}
if (typeof newContentCallback === "function") {
@@ -82,13 +82,13 @@ class ContextReplacementPlugin {
cmf.hooks.afterResolve.tap("ContextReplacementPlugin", result => {
if (!result) return;
if (resourceRegExp.test(result.resource)) {
if (typeof newContentResource !== "undefined") {
if (newContentResource !== undefined) {
result.resource = path.resolve(result.resource, newContentResource);
}
if (typeof newContentRecursive !== "undefined") {
if (newContentRecursive !== undefined) {
result.recursive = newContentRecursive;
}
if (typeof newContentRegExp !== "undefined") {
if (newContentRegExp !== undefined) {
result.regExp = newContentRegExp;
}
if (typeof newContentCreateContextMap === "function") {

0 comments on commit efa69cd

Please sign in to comment.