fixed typeOf check and string literal require in dynamicImport
This commit is contained in:
parent
fee422223a
commit
2b2dedcdc2
5 changed files with 6 additions and 6 deletions
|
@ -14,9 +14,9 @@ export const dynamicImport = (filePath) => {
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
throw new Error('no file path provided to dynamicImport()');
|
throw new Error('no file path provided to dynamicImport()');
|
||||||
}
|
}
|
||||||
if (filePath.typeof !== 'string') {
|
if (typeof filePath !== 'string') {
|
||||||
console.log('dynamicImport > filePath:', filePath);
|
console.log('dynamicImport > filePath:', filePath);
|
||||||
console.log('dynamicImport > filePath type:', filePath.typeof);
|
console.log('dynamicImport > filePath type:', typeof filePath);
|
||||||
throw new Error('file path provided to dynamicImport() must be a string');
|
throw new Error('file path provided to dynamicImport() must be a string');
|
||||||
}
|
}
|
||||||
// split out the file folders // filter out any empty or white-space-only strings
|
// split out the file folders // filter out any empty or white-space-only strings
|
||||||
|
|
2
index.js
2
index.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue