diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-01-09 22:16:29 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-01-09 22:17:26 +0100 |
commit | fb7118ff1c8f0dcd61f15e51b193512283d83fa1 (patch) | |
tree | 721cee6a64b44a56b7f05f39750a65cda5fb4ef6 /config/fileUrlToDirname.js | |
parent | build: Add eslint-plugin-jest (diff) | |
download | sophie-fb7118ff1c8f0dcd61f15e51b193512283d83fa1.tar.gz sophie-fb7118ff1c8f0dcd61f15e51b193512283d83fa1.tar.zst sophie-fb7118ff1c8f0dcd61f15e51b193512283d83fa1.zip |
build: Add eslint-plugin-unicorn
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'config/fileUrlToDirname.js')
-rw-r--r-- | config/fileUrlToDirname.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/config/fileUrlToDirname.js b/config/fileUrlToDirname.js new file mode 100644 index 0000000..9b51305 --- /dev/null +++ b/config/fileUrlToDirname.js | |||
@@ -0,0 +1,10 @@ | |||
1 | import path from 'node:path'; | ||
2 | import { fileURLToPath } from 'node:url'; | ||
3 | |||
4 | /** | ||
5 | * @param {string} url | ||
6 | * @returns {string} | ||
7 | */ | ||
8 | export default function fileUrlToDirname(url) { | ||
9 | return path.dirname(fileURLToPath(url)); | ||
10 | } | ||