diff options
author | 2022-02-02 18:02:06 -0800 | |
---|---|---|
committer | 2022-02-02 18:02:06 -0800 | |
commit | 68cb6130d3e4bd25a53c959db9108a68f5268298 (patch) | |
tree | d554abb9772c877a18e384ab2dd44260c8adeba9 /src/javascript/jsc/path.exports.js | |
parent | 64b74ede87b0a77a2f5ff838c3a5548fbb9f9002 (diff) | |
download | bun-68cb6130d3e4bd25a53c959db9108a68f5268298.tar.gz bun-68cb6130d3e4bd25a53c959db9108a68f5268298.tar.zst bun-68cb6130d3e4bd25a53c959db9108a68f5268298.zip |
"path" module from Node.js implementation
Diffstat (limited to 'src/javascript/jsc/path.exports.js')
-rw-r--r-- | src/javascript/jsc/path.exports.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/javascript/jsc/path.exports.js b/src/javascript/jsc/path.exports.js new file mode 100644 index 000000000..6fa7af88d --- /dev/null +++ b/src/javascript/jsc/path.exports.js @@ -0,0 +1,56 @@ +function bound(obj) { + return { + basename: obj.basename.bind(obj), + dirname: obj.dirname.bind(obj), + extname: obj.extname.bind(obj), + format: obj.format.bind(obj), + isAbsolute: obj.isAbsolute.bind(obj), + join: obj.join.bind(obj), + normalize: obj.normalize.bind(obj), + parse: obj.parse.bind(obj), + relative: obj.relative.bind(obj), + resolve: obj.resolve.bind(obj), + toNamespacedPath: obj.toNamespacedPath.bind(obj), + sep: obj.sep, + delimiter: obj.delimiter, + }; +} +var path = bound(Bun._Path()); +path.win32 = win32; +path.posix = posix; +export var posix = bound(Bun._Path(false)); +export var win32 = bound(Bun._Path(true)); + +var { + basename, + dirname, + extname, + format, + isAbsolute, + join, + normalize, + parse, + relative, + resolve, + toNamespacedPath, + sep, + delimiter, +} = path; + +export { + basename, + dirname, + extname, + format, + isAbsolute, + join, + normalize, + parse, + relative, + resolve, + toNamespacedPath, + sep, + delimiter, +}; + +export default path; |