Skip to content

Commit 21b6e0b

Browse files
committed
Fix formatting
1 parent 814f90f commit 21b6e0b

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

lib/input.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let PreviousMap = require('./previous-map')
1010

1111
let fromOffsetCache = Symbol('fromOffset cache')
1212

13-
let pathAvailable = Boolean(resolve && isAbsolute);
13+
let pathAvailable = Boolean(resolve && isAbsolute)
1414

1515
class Input {
1616
constructor (css, opts = {}) {
@@ -32,13 +32,17 @@ class Input {
3232
}
3333

3434
if (opts.from) {
35-
if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) {
35+
if (
36+
!pathAvailable ||
37+
/^\w+:\/\//.test(opts.from) ||
38+
isAbsolute(opts.from)
39+
) {
3640
this.file = opts.from
3741
} else {
3842
this.file = resolve(opts.from)
3943
}
4044
}
41-
45+
4246
if (pathAvailable) {
4347
let map = new PreviousMap(this.css, opts)
4448
if (map.text) {

lib/map-generator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let { dirname, resolve, relative, sep } = require('path')
44
let { pathToFileURL } = require('url')
55
let mozilla = require('source-map')
66

7-
let pathAvailable = Boolean(dirname, resolve, relative, sep);
7+
let pathAvailable = Boolean(dirname, resolve, relative, sep)
88

99
class MapGenerator {
1010
constructor (stringify, root, opts) {

test/browser.test.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
import { options, bold, red, gray, yellow } from 'colorette'
23

34
beforeEach(() => {
4-
jest.resetModules();
5+
jest.resetModules()
56
jest.doMock('fs', () => ({}))
67
jest.doMock('colorette', () => ({ options, bold, red, gray, yellow }))
7-
});
8+
})
89

910
afterEach(() => {
1011
options.enabled = true
1112
})
1213

1314
it('shows code with colors (default)', () => {
14-
let postcss = require('../lib/postcss.js');
15+
let postcss = require('../lib/postcss.js')
1516

1617
let error
1718
try {
@@ -35,7 +36,7 @@ it('shows code with colors (default)', () => {
3536
})
3637

3738
it('shows code without colors (default)', () => {
38-
let postcss = require('../lib/postcss.js');
39+
let postcss = require('../lib/postcss.js')
3940

4041
let error
4142
options.enabled = false
@@ -53,7 +54,7 @@ it('shows code without colors (default)', () => {
5354
})
5455

5556
it('shows code without colors (setting)', () => {
56-
let postcss = require('../lib/postcss.js');
57+
let postcss = require('../lib/postcss.js')
5758

5859
let error
5960
try {
@@ -69,7 +70,7 @@ it('shows code without colors (setting)', () => {
6970
})
7071

7172
it('generates source map without fs', () => {
72-
let postcss = require('../lib/postcss.js');
73+
let postcss = require('../lib/postcss.js')
7374

7475
expect(
7576
postcss([() => {}]).process('a{}', { from: 'a.css', map: true }).css
@@ -82,8 +83,8 @@ it('generates source map without fs', () => {
8283
})
8384

8485
it(`doesn't throw error without path`, () => {
85-
jest.doMock('path', () => ({}));
86-
let postcss = require('../lib/postcss.js');
86+
jest.doMock('path', () => ({}))
87+
let postcss = require('../lib/postcss.js')
8788

8889
expect(
8990
postcss([() => {}]).process('a{}', { from: 'a.css', map: true }).css

0 commit comments

Comments
 (0)