Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Feb 27, 2022
1 parent 62b80c9 commit 97f6e93
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/config/plugin/lib/location_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { isAbsolute } from 'path'
// - A file path starting with . or /
// - A `file:` URL
// - A Node module prefixed with `modulePrefix` (which is optional)
// eslint-disable-next-line complexity
export const getLocationType = function (originalLocation, { builtins }) {
if (originalLocation instanceof URL) {
return 'fileUrl'
Expand All @@ -37,13 +36,13 @@ export const getLocationType = function (originalLocation, { builtins }) {
return 'builtin'
}

if (isPathLocation(originalLocation)) {
return getPathLocationType(originalLocation)
}

const getPathLocationType = function (originalLocation) {
if (originalLocation.startsWith('.') || isAbsolute(originalLocation)) {
return 'path'
}

return 'module'
}

const isPathLocation = function (originalLocation) {
return originalLocation.startsWith('.') || isAbsolute(originalLocation)
}

0 comments on commit 97f6e93

Please sign in to comment.