@readme/httpsnippet 7.1.0 → 7.1.1

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.
@@ -60,7 +60,7 @@ interface AvailableTarget extends TargetInfo {
60
60
  clients: ClientInfo[];
61
61
  }
62
62
  declare const availableTargets: () => AvailableTarget[];
63
- declare const extname: (targetId: TargetId) => "" | `.${string}`;
63
+ declare const extname: (targetId: TargetId) => `.${string}` | "";
64
64
 
65
65
  /** 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.
66
66
  *
@@ -60,7 +60,7 @@ interface AvailableTarget extends TargetInfo {
60
60
  clients: ClientInfo[];
61
61
  }
62
62
  declare const availableTargets: () => AvailableTarget[];
63
- declare const extname: (targetId: TargetId) => "" | `.${string}`;
63
+ declare const extname: (targetId: TargetId) => `.${string}` | "";
64
64
 
65
65
  /** 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.
66
66
  *
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'har-format';
2
2
  import './helpers/reducer.mjs';
3
- export { l as HTTPSnippet, k as HTTPSnippetOptions, H as HarRequest, j as Request, R as RequestExtras, f as addTarget, h as addTargetClient, m as availableTargets, n as extname } from './index-27be831e.js';
3
+ export { l as HTTPSnippet, k as HTTPSnippetOptions, H as HarRequest, j as Request, R as RequestExtras, f as addTarget, h as addTargetClient, m as availableTargets, n as extname } from './index-ae5e535e.js';
4
4
  import 'node:url';
5
5
  import './helpers/code-builder.mjs';
6
6
  import 'type-fest';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'har-format';
2
2
  import './helpers/reducer.js';
3
- export { l as HTTPSnippet, k as HTTPSnippetOptions, H as HarRequest, j as Request, R as RequestExtras, f as addTarget, h as addTargetClient, m as availableTargets, n as extname } from './index-e612cd58.js';
3
+ export { l as HTTPSnippet, k as HTTPSnippetOptions, H as HarRequest, j as Request, R as RequestExtras, f as addTarget, h as addTargetClient, m as availableTargets, n as extname } from './index-c415b193.js';
4
4
  import 'node:url';
5
5
  import './helpers/code-builder.js';
6
6
  import 'type-fest';
package/dist/index.js CHANGED
@@ -8,6 +8,25 @@ var stringifyObject9 = require('stringify-object');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
10
 
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var eventStream__namespace = /*#__PURE__*/_interopNamespace(eventStream);
11
30
  var FormData__default = /*#__PURE__*/_interopDefault(FormData);
12
31
  var stringifyObject9__default = /*#__PURE__*/_interopDefault(stringifyObject9);
13
32
 
@@ -3547,6 +3566,7 @@ var availableTargets = () => Object.keys(targets).map((targetId) => ({
3547
3566
  var extname = (targetId) => targets[targetId]?.info.extname || "";
3548
3567
 
3549
3568
  // src/index.ts
3569
+ var { map: eventStreamMap } = eventStream__namespace;
3550
3570
  var isHarEntry = (value) => typeof value === "object" && "log" in value && typeof value.log === "object" && "entries" in value.log && Array.isArray(value.log.entries);
3551
3571
  var HTTPSnippet = class {
3552
3572
  constructor(input, opts = {}) {
@@ -3632,7 +3652,7 @@ var HTTPSnippet = class {
3632
3652
  } else {
3633
3653
  form.pipe(
3634
3654
  // @ts-expect-error TODO
3635
- eventStream.map((data) => {
3655
+ eventStreamMap((data) => {
3636
3656
  request2.postData.text += data;
3637
3657
  })
3638
3658
  );