@jsenv/filesystem 4.2.0 → 4.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/filesystem",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@jsenv/urls": "1.2.8",
33
- "@jsenv/url-meta": "7.1.0",
33
+ "@jsenv/url-meta": "8.0.0",
34
34
  "@jsenv/abort": "4.2.4"
35
35
  }
36
36
  }
@@ -43,10 +43,13 @@ export const validateDirectoryUrl = (value) => {
43
43
  }
44
44
  }
45
45
 
46
- export const assertAndNormalizeDirectoryUrl = (directoryUrl) => {
46
+ export const assertAndNormalizeDirectoryUrl = (
47
+ directoryUrl,
48
+ name = "directoryUrl",
49
+ ) => {
47
50
  const { valid, message, value } = validateDirectoryUrl(directoryUrl)
48
51
  if (!valid) {
49
- throw new TypeError(`directoryUrl ${message}, got ${value}`)
52
+ throw new TypeError(`${name} ${message}, got ${value}`)
50
53
  }
51
54
  return value
52
55
  }
@@ -41,10 +41,14 @@ export const validateFileUrl = (value, baseUrl) => {
41
41
  }
42
42
  }
43
43
 
44
- export const assertAndNormalizeFileUrl = (fileUrl, baseUrl) => {
44
+ export const assertAndNormalizeFileUrl = (
45
+ fileUrl,
46
+ baseUrl,
47
+ name = "fileUrl",
48
+ ) => {
45
49
  const { valid, message, value } = validateFileUrl(fileUrl, baseUrl)
46
50
  if (!valid) {
47
- throw new TypeError(`fileUrl ${message}, got ${fileUrl}`)
51
+ throw new TypeError(`${name} ${message}, got ${fileUrl}`)
48
52
  }
49
53
  return value
50
54
  }