add ability to call self-signed or invalid certificate clients

This commit is contained in:
Joel Male
2021-02-26 13:58:33 +10:00
parent 528d756289
commit 9380ee26ff
3852 changed files with 253796 additions and 137756 deletions
+3 -1
View File
@@ -21,8 +21,10 @@ importFresh('./foo')();
importFresh('./foo')();
//=> 1
const foo = importFresh<typeof import('./foo')>('./foo');
```
*/
declare function importFresh(moduleId: string): unknown;
declare function importFresh<T>(moduleId: string): T;
export = importFresh;
+2 -1
View File
@@ -10,7 +10,8 @@ module.exports = moduleId => {
const parentPath = parentModule(__filename);
const filePath = resolveFrom(path.dirname(parentPath), moduleId);
const cwd = parentPath ? path.dirname(parentPath) : __dirname;
const filePath = resolveFrom(cwd, moduleId);
const oldModule = require.cache[filePath];
// Delete itself from module parent
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+3 -2
View File
@@ -1,13 +1,14 @@
{
"name": "import-fresh",
"version": "3.2.1",
"version": "3.3.0",
"description": "Import a module while bypassing the cache",
"license": "MIT",
"repository": "sindresorhus/import-fresh",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=6"
+1 -5
View File
@@ -1,17 +1,15 @@
# import-fresh [![Build Status](https://travis-ci.org/sindresorhus/import-fresh.svg?branch=master)](https://travis-ci.org/sindresorhus/import-fresh)
# import-fresh
> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching)
Useful for testing purposes when you need to freshly import a module.
## Install
```
$ npm install import-fresh
```
## Usage
```js
@@ -36,14 +34,12 @@ importFresh('./foo')();
//=> 1
```
## import-fresh for enterprise
Available as part of the Tidelift Subscription.
The maintainers of import-fresh and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-import-fresh?utm_source=npm-import-fresh&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related
- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache