| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7ee3cdf commit 77cb604
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const { | |
| 3 | - ERR_INVALID_ARG_TYPE, | ||
| 4 | 3 | ERR_SYNTHETIC | |
| 5 | 4 | } = require('internal/errors').codes; | |
| 6 | 5 | const { | |
@@ -18,9 +17,11 @@ const report = { | |||
| 18 | 17 | if (typeof file === 'object' && file !== null) { | |
| 19 | 18 | err = file; | |
| 20 | 19 | file = undefined; | |
| 21 | - } else if (file !== undefined && typeof file !== 'string') { | ||
| 22 | - throw new ERR_INVALID_ARG_TYPE('file', 'String', file); | ||
| 23 | - } else if (err === undefined) { | ||
| 20 | + } else if (file !== undefined) { | ||
| 21 | + validateString(file, 'file'); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + if (err === undefined) { | ||
| 24 | 25 | err = new ERR_SYNTHETIC(); | |
| 25 | 26 | } else { | |
| 26 | 27 | validateObject(err, 'err'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments