bare-module 4.8.5 → 4.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,3 @@
1
- /* global Bare */
2
1
  const path = require('bare-path')
3
2
  const resolve = require('bare-module-resolve')
4
3
  const lex = require('bare-module-lexer')
@@ -979,7 +978,9 @@ Module._protocol = new Protocol({
979
978
  postresolve(url) {
980
979
  switch (url.protocol) {
981
980
  case 'file:':
982
- return pathToFileURL(binding.realpath(fileURLToPath(url)))
981
+ return pathToFileURL(
982
+ binding.realpath(path.toNamespacedPath(fileURLToPath(url)))
983
+ )
983
984
  default:
984
985
  return url
985
986
  }
@@ -989,7 +990,7 @@ Module._protocol = new Protocol({
989
990
  switch (url.protocol) {
990
991
  case 'file:':
991
992
  return binding.exists(
992
- fileURLToPath(url),
993
+ path.toNamespacedPath(fileURLToPath(url)),
993
994
  type === constants.types.ASSET
994
995
  ? binding.FILE | binding.DIR
995
996
  : binding.FILE
@@ -1002,7 +1003,9 @@ Module._protocol = new Protocol({
1002
1003
  read(url) {
1003
1004
  switch (url.protocol) {
1004
1005
  case 'file:':
1005
- return Buffer.from(binding.read(fileURLToPath(url)))
1006
+ return Buffer.from(
1007
+ binding.read(path.toNamespacedPath(fileURLToPath(url)))
1008
+ )
1006
1009
  default:
1007
1010
  throw errors.UNKNOWN_PROTOCOL(`Cannot load module '${url.href}'`)
1008
1011
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module",
3
- "version": "4.8.5",
3
+ "version": "4.8.6",
4
4
  "description": "Module support for JavaScript",
5
5
  "exports": {
6
6
  ".": {