Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
  • Loading branch information
barak007 and ai committed Apr 11, 2021
1 parent ff2fd57 commit 8c58434
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Input {

result.input = { line, column, source: this.css }
if (this.file) {
if(pathToFileURL) {
if (pathToFileURL) {
result.input.url = pathToFileURL(this.file).toString()
}
result.input.file = this.file
Expand Down Expand Up @@ -164,10 +164,10 @@ class Input {
}

if (fromUrl.protocol === 'file:') {
if(fileURLToPath){
if (fileURLToPath) {
result.file = fileURLToPath(fromUrl)
} else {
throw new Error(`file: protocol is not available in this postcss build`);
throw new Error(`file: protocol is not available in this PostCSS build`);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/map-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ class MapGenerator {
if (this.mapOpts.from) {
return this.toUrl(this.mapOpts.from)
} else if (this.mapOpts.absolute) {
if(pathToFileURL) {
if (pathToFileURL) {
return pathToFileURL(node.source.input.from).toString()
} else {
throw new Error('map option "absolute" is not available in this postcss build')
throw new Error('`map.absolute` option is not available in this PostCSS build')
}
} else {
return this.toUrl(this.path(node.source.input.from))
Expand Down

0 comments on commit 8c58434

Please sign in to comment.