finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
450 bytes
|
| Line | |
|---|
| 1 | const url = require('url')
|
|---|
| 2 |
|
|---|
| 3 | const node = require('../node.js')
|
|---|
| 4 | const polyfill = require('./polyfill.js')
|
|---|
| 5 |
|
|---|
| 6 | const useNative = node.satisfies('>=10.12.0')
|
|---|
| 7 |
|
|---|
| 8 | const fileURLToPath = (path) => {
|
|---|
| 9 | // the polyfill is tested separately from this module, no need to hack
|
|---|
| 10 | // process.version to try to trigger it just for coverage
|
|---|
| 11 | // istanbul ignore next
|
|---|
| 12 | return useNative
|
|---|
| 13 | ? url.fileURLToPath(path)
|
|---|
| 14 | : polyfill(path)
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | module.exports = fileURLToPath
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.