forked from perry-mitchell/webdav-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use hot-patcher to patch request rather than using a singleton and se…
…tter
- Loading branch information
1 parent
213b3c8
commit 7a3cba6
Showing
8 changed files
with
61 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
const { axios, setRequestMethod } = require("./request.js"); | ||
const { axios } = require("./request.js"); | ||
const { createClient } = require("./factory.js"); | ||
const { getPatcher } = require("./patcher.js"); | ||
|
||
/** | ||
* @module WebDAV | ||
*/ | ||
module.exports = { | ||
/** | ||
* Axios request library | ||
* @type {Function} | ||
* @memberof module:WebDAV | ||
*/ | ||
axios, | ||
createClient, | ||
setRequestMethod | ||
getPatcher | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const HotPatcher = require("hot-patcher"); | ||
|
||
let __patcher = null; | ||
|
||
/** | ||
* Get the HotPatcher instance for patching internal methods | ||
* @returns {HotPatcher} The internal HotPatcher instance | ||
*/ | ||
function getPatcher() { | ||
if (!__patcher) { | ||
__patcher = new HotPatcher(); | ||
} | ||
return __patcher; | ||
} | ||
|
||
module.exports = { | ||
getPatcher | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters