exifreader 4.15.0 → 4.17.0

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": "exifreader",
3
- "version": "4.15.0",
3
+ "version": "4.17.0",
4
4
  "description": "Library that parses Exif metadata in images.",
5
5
  "author": "Mattias Wallander <mattias@wallander.eu>",
6
6
  "repository": {
@@ -51,12 +51,12 @@ function isFilePathOrURL(data) {
51
51
  }
52
52
 
53
53
  function loadFile(filename, options) {
54
- if (/^https?:\/\//.test(filename)) {
54
+ if (/^\w+:\/\//.test(filename)) {
55
55
  if (typeof fetch !== 'undefined') {
56
- return browserFetchRemoteFile(filename, options);
56
+ return fetchRemoteFile(filename, options);
57
57
  }
58
58
 
59
- return nodeFetchRemoteFile(filename, options);
59
+ return nodeGetRemoteFile(filename, options);
60
60
  }
61
61
 
62
62
  if (isDataUri(filename)) {
@@ -66,7 +66,7 @@ function loadFile(filename, options) {
66
66
  return loadLocalFile(filename, options);
67
67
  }
68
68
 
69
- function browserFetchRemoteFile(url, {length} = {}) {
69
+ function fetchRemoteFile(url, {length} = {}) {
70
70
  const options = {method: 'GET'};
71
71
  if (Number.isInteger(length) && length >= 0) {
72
72
  options.headers = {
@@ -76,7 +76,7 @@ function browserFetchRemoteFile(url, {length} = {}) {
76
76
  return fetch(url, options).then((response) => response.arrayBuffer());
77
77
  }
78
78
 
79
- function nodeFetchRemoteFile(url, {length} = {}) {
79
+ function nodeGetRemoteFile(url, {length} = {}) {
80
80
  return new Promise((resolve, reject) => {
81
81
  const options = {};
82
82
  if (Number.isInteger(length) && length >= 0) {
Binary file