Skip to content

Commit

Permalink
Get rid of typeof for checking undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha committed Aug 16, 2018
1 parent a02bf99 commit efa69cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/ContextReplacementPlugin.js
Expand Up @@ -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") {
Expand All @@ -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") {
Expand Down

0 comments on commit efa69cd

Please sign in to comment.