Skip to content

Commit 91b1325

Browse files
committed
revert formatting change
1 parent 0762504 commit 91b1325

File tree

1 file changed

+23
-29
lines changed

1 file changed

+23
-29
lines changed

Diff for: src/Test/Spec/Discovery.js

+23-29
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,43 @@
1-
import path from "path";
2-
import fs from "fs";
3-
import { fileURLToPath } from "url";
1+
import path from 'path'
2+
import fs from 'fs'
3+
import { fileURLToPath } from 'url'
44

5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = path.dirname(__filename);
7-
const __onWindows =
8-
process.platform === "win32" || process.platform === "win64";
5+
const __filename = fileURLToPath(import.meta.url)
6+
const __dirname = path.dirname(__filename)
7+
const __onWindows = process.platform === 'win32' || process.platform === 'win64'
98

109
if (import.meta.url === `file://${process.argv[1]}`) {
1110
throw new Error(
12-
"Sorry, purescript-spec-discovery only supports NodeJS environments!",
13-
);
11+
'Sorry, purescript-spec-discovery only supports NodeJS environments!'
12+
)
1413
}
1514

1615
export function getSpecs(pattern, mapToAff) {
1716
return (onError, onSuccess) => {
18-
const regex = new RegExp(pattern);
17+
const regex = new RegExp(pattern)
1918
const modulePromises = fs
20-
.readdirSync(path.join(__dirname, ".."))
21-
.filter((directory) => regex.test(directory))
22-
.map((name) => {
19+
.readdirSync(path.join(__dirname, '..'))
20+
.filter(directory => regex.test(directory))
21+
.map(name => {
2322
const fullPath = __onWindows
24-
? path.join("file://", __dirname, "..", name, "index.js")
25-
: path.join(__dirname, "..", name, "index.js");
26-
return import(fullPath).then((module) => {
27-
let spec =
28-
module && typeof module.spec !== "undefined" ? module.spec : null;
29-
30-
if (!spec) return spec;
23+
? path.join('file://', __dirname, '..', name, 'index.js')
24+
: path.join(__dirname, '..', name, 'index.js')
25+
return import(fullPath).then(module => {
26+
const spec = module && module.spec;
27+
if (!spec) return null;
3128

3229
if (spec.constructor.name !== "Aff") {
3330
return mapToAff(spec);
3431
}
3532

3633
return spec;
37-
});
38-
});
34+
})
35+
})
3936

4037
Promise.all(modulePromises)
41-
.then((specs) => {
42-
const s = specs.filter((x) => x);
43-
return onSuccess(s);
44-
})
45-
.catch(onError);
38+
.then(specs => onSuccess(specs.filter(x => x)))
39+
.catch(onError)
4640

47-
return () => {};
48-
};
41+
return () => {}
42+
}
4943
}

0 commit comments

Comments
 (0)