mirror of
https://github.com/thangisme/notes.git
synced 2025-09-24 00:04:23 -04:00
Initial commit
This commit is contained in:
18
node_modules/stylelint/lib/utils/getModulePath.js
generated
vendored
Normal file
18
node_modules/stylelint/lib/utils/getModulePath.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/* @flow */
|
||||
"use strict"
|
||||
|
||||
const configurationError = require("./configurationError")
|
||||
const resolveFrom = require("resolve-from")
|
||||
|
||||
module.exports = function (basedir/*: string*/, lookup/*: string*/)/*: string*/ {
|
||||
// First try to resolve from the provided directory,
|
||||
// then try to resolve from process.cwd.
|
||||
let path = resolveFrom(basedir, lookup)
|
||||
if (!path) {
|
||||
path = resolveFrom(process.cwd(), lookup)
|
||||
}
|
||||
if (!path) {
|
||||
throw configurationError(`Could not find "${lookup}". Do you need a \`configBasedir\`?`)
|
||||
}
|
||||
return path
|
||||
}
|
Reference in New Issue
Block a user