mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Add path joining utility.
This commit is contained in:
4
src/utils/path-join.js
Normal file
4
src/utils/path-join.js
Normal file
@@ -0,0 +1,4 @@
|
||||
const s = process?.platform === 'win32' ? '\\' : '/'
|
||||
const reg = new RegExp(`((?<=\\${s})\\${s}+)|(^\\.\\${s})|((?<=\\${s})\\.\\${s})`, 'g')
|
||||
|
||||
export default (...paths) => paths.join(s).replace(reg, '')
|
||||
Reference in New Issue
Block a user