| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,23 +67,15 @@ function createLookupPromise(family, hostname, all, hints, verbatim) { | |||
| 67 | 67 | return new Promise((resolve, reject) => { | |
| 68 | 68 | if (!hostname) { | |
| 69 | 69 | emitInvalidHostnameWarning(hostname); | |
| 70 | - if (all) | ||
| 71 | - resolve([]); | ||
| 72 | - else | ||
| 73 | - resolve({ address: null, family: family === 6 ? 6 : 4 }); | ||
| 74 | - | ||
| 70 | + resolve(all ? [] : { address: null, family: family === 6 ? 6 : 4 }); | ||
| 75 | 71 | return; | |
| 76 | 72 | } | |
| 77 | 73 | ||
| 78 | 74 | const matchedFamily = isIP(hostname); | |
| 79 | 75 | ||
| 80 | 76 | if (matchedFamily !== 0) { | |
| 81 | 77 | const result = { address: hostname, family: matchedFamily }; | |
| 82 | - if (all) | ||
| 83 | - resolve([result]); | ||
| 84 | - else | ||
| 85 | - resolve(result); | ||
| 86 | - | ||
| 78 | + resolve(all ? [result] : result); | ||
| 87 | 79 | return; | |
| 88 | 80 | } | |
| 89 | 81 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments