diff options
Diffstat (limited to 'src/bun.js/bindings/BunString.cpp')
-rw-r--r-- | src/bun.js/bindings/BunString.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bun.js/bindings/BunString.cpp b/src/bun.js/bindings/BunString.cpp index e044730c4..5eb5f9f9b 100644 --- a/src/bun.js/bindings/BunString.cpp +++ b/src/bun.js/bindings/BunString.cpp @@ -315,6 +315,11 @@ extern "C" void BunString__toWTFString(BunString* bunString) } } +extern "C" BunString URL__getFileURLString(BunString* filePath) +{ + return Bun::toStringRef(WTF::URL::fileURLWithFileSystemPath(Bun::toWTFString(*filePath)).stringWithoutFragmentIdentifier()); +} + extern "C" WTF::URL* URL__fromJS(EncodedJSValue encodedValue, JSC::JSGlobalObject* globalObject) { auto throwScope = DECLARE_THROW_SCOPE(globalObject->vm()); |