react-fetch-hook
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -44,2 +44,6 @@ "use strict"; | ||
if (input instanceof URL) { | ||
return [].concat(_toConsumableArray(accumulator), _toConsumableArray(flattenInput(input.hash, input.host, input.hostname, input.href, input.origin, input.password, input.pathname, input.port, input.protocol, input.search, input.username))); | ||
} | ||
return [].concat(_toConsumableArray(accumulator), [input]); | ||
@@ -46,0 +50,0 @@ }, []); |
{ | ||
"name": "react-fetch-hook", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "React fetch hook", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -23,2 +23,23 @@ import { flattenInput } from "../usePromise"; | ||
}); | ||
it("with URL instance", () => { | ||
const url = new URL("https://google.com"); | ||
url.search = new URLSearchParams({ a: "aaa", b: "bbb" }).toString(); | ||
const result = flattenInput(url, { x: 1 }); | ||
expect(result).toMatchObject([ | ||
"", | ||
"google.com", | ||
"google.com", | ||
"https://google.com/?a=aaa&b=bbb", | ||
"https://google.com", | ||
"", | ||
"/", | ||
"", | ||
"https:", | ||
"?a=aaa&b=bbb", | ||
"", | ||
"x", | ||
1 | ||
]); | ||
}); | ||
}); |
@@ -19,2 +19,20 @@ // @flow | ||
} | ||
if (input instanceof URL) { | ||
return [ | ||
...accumulator, | ||
...flattenInput( | ||
input.hash, | ||
input.host, | ||
input.hostname, | ||
input.href, | ||
input.origin, | ||
input.password, | ||
input.pathname, | ||
input.port, | ||
input.protocol, | ||
input.search, | ||
input.username | ||
) | ||
]; | ||
} | ||
return [...accumulator, input]; | ||
@@ -21,0 +39,0 @@ }, []); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18589
355