@readme/httpsnippet 8.1.0 → 8.1.2
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/dist/{chunk-XPQ7YGTP.js → chunk-NPUBNYOA.js} +1 -1
- package/dist/{chunk-XPQ7YGTP.js.map → chunk-NPUBNYOA.js.map} +1 -1
- package/dist/{index-08ee07a8.d.ts → index-b0a1cd2d.d.ts} +3 -3
- package/dist/{index-7191f23f.d.ts → index-da41d466.d.ts} +3 -3
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/targets/index.cjs.map +1 -1
- package/dist/targets/index.d.cts +1 -1
- package/dist/targets/index.d.ts +1 -1
- package/dist/targets/index.js +1 -1
- package/package.json +1 -1
|
@@ -20,8 +20,8 @@ interface Client<T extends Record<string, any> = Record<string, any>> {
|
|
|
20
20
|
convert: Converter<T>;
|
|
21
21
|
info: ClientInfo;
|
|
22
22
|
}
|
|
23
|
-
interface ClientPlugin {
|
|
24
|
-
client: Client
|
|
23
|
+
interface ClientPlugin<T extends Record<string, any> = Record<string, any>> {
|
|
24
|
+
client: Client<T>;
|
|
25
25
|
target: TargetId;
|
|
26
26
|
}
|
|
27
27
|
type Extension = `.${string}` | null;
|
|
@@ -66,7 +66,7 @@ interface AvailableTarget extends TargetInfo {
|
|
|
66
66
|
clients: ClientInfo[];
|
|
67
67
|
}
|
|
68
68
|
declare const availableTargets: () => AvailableTarget[];
|
|
69
|
-
declare const extname: (targetId: TargetId, clientId: ClientId) =>
|
|
69
|
+
declare const extname: (targetId: TargetId, clientId: ClientId) => `.${string}` | "";
|
|
70
70
|
|
|
71
71
|
/** is this wrong? yes. according to the spec (http://www.softwareishard.com/blog/har-12-spec/#postData) it's technically wrong since `params` and `text` are (by the spec) mutually exclusive. However, in practice, this is not what is often the case.
|
|
72
72
|
*
|
|
@@ -20,8 +20,8 @@ interface Client<T extends Record<string, any> = Record<string, any>> {
|
|
|
20
20
|
convert: Converter<T>;
|
|
21
21
|
info: ClientInfo;
|
|
22
22
|
}
|
|
23
|
-
interface ClientPlugin {
|
|
24
|
-
client: Client
|
|
23
|
+
interface ClientPlugin<T extends Record<string, any> = Record<string, any>> {
|
|
24
|
+
client: Client<T>;
|
|
25
25
|
target: TargetId;
|
|
26
26
|
}
|
|
27
27
|
type Extension = `.${string}` | null;
|
|
@@ -66,7 +66,7 @@ interface AvailableTarget extends TargetInfo {
|
|
|
66
66
|
clients: ClientInfo[];
|
|
67
67
|
}
|
|
68
68
|
declare const availableTargets: () => AvailableTarget[];
|
|
69
|
-
declare const extname: (targetId: TargetId, clientId: ClientId) =>
|
|
69
|
+
declare const extname: (targetId: TargetId, clientId: ClientId) => `.${string}` | "";
|
|
70
70
|
|
|
71
71
|
/** is this wrong? yes. according to the spec (http://www.softwareishard.com/blog/har-12-spec/#postData) it's technically wrong since `params` and `text` are (by the spec) mutually exclusive. However, in practice, this is not what is often the case.
|
|
72
72
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -3520,6 +3520,9 @@ var isClient = (client) => {
|
|
|
3520
3520
|
}
|
|
3521
3521
|
return true;
|
|
3522
3522
|
};
|
|
3523
|
+
var addClientPlugin = (plugin) => {
|
|
3524
|
+
addTargetClient(plugin.target, plugin.client);
|
|
3525
|
+
};
|
|
3523
3526
|
var addTargetClient = (targetId, client) => {
|
|
3524
3527
|
if (!isClient(client)) ;
|
|
3525
3528
|
if (!Object.prototype.hasOwnProperty.call(targets, targetId)) {
|
|
@@ -3746,6 +3749,7 @@ var HTTPSnippet = class {
|
|
|
3746
3749
|
};
|
|
3747
3750
|
|
|
3748
3751
|
exports.HTTPSnippet = HTTPSnippet;
|
|
3752
|
+
exports.addClientPlugin = addClientPlugin;
|
|
3749
3753
|
exports.addTarget = addTarget;
|
|
3750
3754
|
exports.addTargetClient = addTargetClient;
|
|
3751
3755
|
exports.availableTargets = availableTargets;
|