@agnostack/verifyd 1.0.14-beta.1 → 1.0.14-beta.3

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/lib/utils/rawbody.d.ts.map +1 -1
  3. package/dist/lib/utils/rawbody.js +6 -5
  4. package/dist/lib/utils/rawbody.js.map +1 -1
  5. package/dist/umd/lib/index.js +6 -368
  6. package/dist/umd/lib/index.js.map +1 -1
  7. package/dist/umd/lib/lib/utils/rawbody.d.ts.map +1 -1
  8. package/package.json +4 -5
  9. package/node_modules/bytes/History.md +0 -97
  10. package/node_modules/bytes/LICENSE +0 -23
  11. package/node_modules/bytes/Readme.md +0 -152
  12. package/node_modules/bytes/index.js +0 -170
  13. package/node_modules/bytes/package.json +0 -42
  14. package/node_modules/depd/History.md +0 -103
  15. package/node_modules/depd/LICENSE +0 -22
  16. package/node_modules/depd/Readme.md +0 -280
  17. package/node_modules/depd/index.js +0 -538
  18. package/node_modules/depd/lib/browser/index.js +0 -77
  19. package/node_modules/depd/package.json +0 -45
  20. package/node_modules/http-errors/HISTORY.md +0 -180
  21. package/node_modules/http-errors/LICENSE +0 -23
  22. package/node_modules/http-errors/README.md +0 -169
  23. package/node_modules/http-errors/index.js +0 -289
  24. package/node_modules/http-errors/package.json +0 -50
  25. package/node_modules/iconv-lite/Changelog.md +0 -162
  26. package/node_modules/iconv-lite/LICENSE +0 -21
  27. package/node_modules/iconv-lite/README.md +0 -156
  28. package/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
  29. package/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
  30. package/node_modules/iconv-lite/encodings/index.js +0 -22
  31. package/node_modules/iconv-lite/encodings/internal.js +0 -188
  32. package/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  33. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  34. package/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
  35. package/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  36. package/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  37. package/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  38. package/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  39. package/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  40. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  41. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
  42. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  43. package/node_modules/iconv-lite/encodings/utf16.js +0 -177
  44. package/node_modules/iconv-lite/encodings/utf7.js +0 -290
  45. package/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  46. package/node_modules/iconv-lite/lib/extend-node.js +0 -217
  47. package/node_modules/iconv-lite/lib/index.d.ts +0 -24
  48. package/node_modules/iconv-lite/lib/index.js +0 -153
  49. package/node_modules/iconv-lite/lib/streams.js +0 -121
  50. package/node_modules/iconv-lite/package.json +0 -46
  51. package/node_modules/inherits/LICENSE +0 -16
  52. package/node_modules/inherits/README.md +0 -42
  53. package/node_modules/inherits/inherits.js +0 -9
  54. package/node_modules/inherits/inherits_browser.js +0 -27
  55. package/node_modules/inherits/package.json +0 -29
  56. package/node_modules/raw-body/HISTORY.md +0 -308
  57. package/node_modules/raw-body/LICENSE +0 -22
  58. package/node_modules/raw-body/README.md +0 -223
  59. package/node_modules/raw-body/SECURITY.md +0 -24
  60. package/node_modules/raw-body/index.d.ts +0 -87
  61. package/node_modules/raw-body/index.js +0 -336
  62. package/node_modules/raw-body/package.json +0 -49
  63. package/node_modules/safer-buffer/LICENSE +0 -21
  64. package/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  65. package/node_modules/safer-buffer/Readme.md +0 -156
  66. package/node_modules/safer-buffer/dangerous.js +0 -58
  67. package/node_modules/safer-buffer/package.json +0 -34
  68. package/node_modules/safer-buffer/safer.js +0 -77
  69. package/node_modules/safer-buffer/tests.js +0 -406
  70. package/node_modules/setprototypeof/LICENSE +0 -13
  71. package/node_modules/setprototypeof/README.md +0 -31
  72. package/node_modules/setprototypeof/index.d.ts +0 -2
  73. package/node_modules/setprototypeof/index.js +0 -17
  74. package/node_modules/setprototypeof/package.json +0 -38
  75. package/node_modules/setprototypeof/test/index.js +0 -24
  76. package/node_modules/statuses/HISTORY.md +0 -82
  77. package/node_modules/statuses/LICENSE +0 -23
  78. package/node_modules/statuses/README.md +0 -136
  79. package/node_modules/statuses/codes.json +0 -65
  80. package/node_modules/statuses/index.js +0 -146
  81. package/node_modules/statuses/package.json +0 -49
  82. package/node_modules/toidentifier/HISTORY.md +0 -9
  83. package/node_modules/toidentifier/LICENSE +0 -21
  84. package/node_modules/toidentifier/README.md +0 -61
  85. package/node_modules/toidentifier/index.js +0 -32
  86. package/node_modules/toidentifier/package.json +0 -38
  87. package/node_modules/unpipe/HISTORY.md +0 -4
  88. package/node_modules/unpipe/LICENSE +0 -22
  89. package/node_modules/unpipe/README.md +0 -43
  90. package/node_modules/unpipe/index.js +0 -69
  91. package/node_modules/unpipe/package.json +0 -27
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.0.14-beta.3](https://github.com/agnostack/verifyd/compare/v1.0.14-beta.2...v1.0.14-beta.3) (2023-12-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * wip ([2b84556](https://github.com/agnostack/verifyd/commit/2b845565a8fc1a45a877a05c10eda503dcd26081))
7
+
8
+ ## [1.0.14-beta.2](https://github.com/agnostack/verifyd/compare/v1.0.14-beta.1...v1.0.14-beta.2) (2023-12-11)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * wip ([3e866f9](https://github.com/agnostack/verifyd/commit/3e866f9c833149e54d9ed0f6440e42520b3bdeb5))
14
+
1
15
  ## [1.0.14-beta.1](https://github.com/agnostack/verifyd/compare/v1.0.13...v1.0.14-beta.1) (2023-12-11)
2
16
 
3
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"rawbody.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/rawbody.js"],"names":[],"mappings":"AAgBO,sDAON"}
1
+ {"version":3,"file":"rawbody.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/rawbody.js"],"names":[],"mappings":"AAiBO,sDAON"}
@@ -33,14 +33,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.ensureRawBody = void 0;
36
- const getChunkedRawBody = (readable) => __awaiter(void 0, void 0, void 0, function* () {
37
- if (readable === null || readable === void 0 ? void 0 : readable.rawBody) {
38
- return readable.rawBody;
36
+ const getChunkedRawBody = (req) => __awaiter(void 0, void 0, void 0, function* () {
37
+ console.log(`>>> > getChunkedRawBody > req?.rawBody:`, { rawBody: req === null || req === void 0 ? void 0 : req.rawBody });
38
+ if (req === null || req === void 0 ? void 0 : req.rawBody) {
39
+ return req.rawBody;
39
40
  }
40
41
  // TODO: move to req.text() after next 13.5: https://github.com/vercel/next.js/discussions/13405
41
42
  try {
42
- const getRawBody = (yield Promise.resolve().then(() => __importStar(require('raw-body')))).default;
43
- return getRawBody(readable);
43
+ const _getRawBody = (yield Promise.resolve().then(() => __importStar(require('raw-body')))).default;
44
+ return _getRawBody(req);
44
45
  }
45
46
  catch (error) {
46
47
  console.error(`Failed to import 'raw-body', please ensure the dependency is installed`);
@@ -1 +1 @@
1
- {"version":3,"file":"rawbody.js","sourceRoot":"","sources":["../../../src/lib/utils/rawbody.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,CAAO,QAAQ,EAAE,EAAE;IAC3C,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,EAAE;QACrB,OAAO,QAAQ,CAAC,OAAO,CAAA;KACxB;IAED,gGAAgG;IAChG,IAAI;QACF,MAAM,UAAU,GAAG,CAAC,wDAAa,UAAU,GAAC,CAAC,CAAC,OAAO,CAAA;QACrD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;KAC5B;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAA;QACvF,MAAM,KAAK,CAAA;KACZ;AACH,CAAC,CAAA,CAAA;AAED,yEAAyE;AAClE,MAAM,aAAa,GAAG,CAAO,GAAG,EAAE,EAAE;IAAC,OAAA,CAC1C,iBAAiB,CAAC,GAAG,CAAC;SACnB,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;SACvC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;QAChE,MAAM,KAAK,CAAA;IACf,CAAC,CAAC,CACH,CAAA;EAAA,CAAA;AAPY,QAAA,aAAa,iBAOzB"}
1
+ {"version":3,"file":"rawbody.js","sourceRoot":"","sources":["../../../src/lib/utils/rawbody.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,CAAO,GAAG,EAAE,EAAE;IACtC,OAAO,CAAC,GAAG,CAAC,yCAAyC,EAAE,EAAE,OAAO,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,EAAE,CAAC,CAAA;IACjF,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,EAAE;QAChB,OAAO,GAAG,CAAC,OAAO,CAAA;KACnB;IAED,gGAAgG;IAChG,IAAI;QACF,MAAM,WAAW,GAAG,CAAC,wDAAa,UAAU,GAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAA;KACxB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAA;QACvF,MAAM,KAAK,CAAA;KACZ;AACH,CAAC,CAAA,CAAA;AAED,yEAAyE;AAClE,MAAM,aAAa,GAAG,CAAO,GAAG,EAAE,EAAE;IAAC,OAAA,CAC1C,iBAAiB,CAAC,GAAG,CAAC;SACnB,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;SACvC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;QAChE,MAAM,KAAK,CAAA;IACf,CAAC,CAAC,CACH,CAAA;EAAA,CAAA;AAPY,QAAA,aAAa,iBAOzB"}
@@ -1,27 +1,3 @@
1
- /**
2
- * MIT License
3
- *
4
- * Copyright (c) 2021-present agnoStack, Inc. and Adam Grohs
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
1
  (function (global, factory) {
26
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
27
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -697,15 +673,16 @@
697
673
  }
698
674
  }
699
675
 
700
- const getChunkedRawBody = async (readable) => {
701
- if (readable?.rawBody) {
702
- return readable.rawBody
676
+ const getChunkedRawBody = async (req) => {
677
+ console.log(`>>> > getChunkedRawBody > req?.rawBody:`, { rawBody: req?.rawBody });
678
+ if (req?.rawBody) {
679
+ return req.rawBody
703
680
  }
704
681
 
705
682
  // TODO: move to req.text() after next 13.5: https://github.com/vercel/next.js/discussions/13405
706
683
  try {
707
- const getRawBody = (await Promise.resolve().then(function () { return index; })).default;
708
- return getRawBody(readable)
684
+ const _getRawBody = (await import('raw-body')).default;
685
+ return _getRawBody(req)
709
686
  } catch (error) {
710
687
  console.error(`Failed to import 'raw-body', please ensure the dependency is installed`);
711
688
  throw error
@@ -827,345 +804,6 @@
827
804
  }
828
805
  };
829
806
 
830
- /*!
831
- * raw-body
832
- * Copyright(c) 2013-2014 Jonathan Ong
833
- * Copyright(c) 2014-2022 Douglas Christopher Wilson
834
- * MIT Licensed
835
- */
836
-
837
- /**
838
- * Module dependencies.
839
- * @private
840
- */
841
-
842
- var asyncHooks = tryRequireAsyncHooks();
843
- var bytes = require('bytes');
844
- var createError = require('http-errors');
845
- var iconv = require('iconv-lite');
846
- var unpipe = require('unpipe');
847
-
848
- /**
849
- * Module exports.
850
- * @public
851
- */
852
-
853
- module.exports = getRawBody;
854
-
855
- /**
856
- * Module variables.
857
- * @private
858
- */
859
-
860
- var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /;
861
-
862
- /**
863
- * Get the decoder for a given encoding.
864
- *
865
- * @param {string} encoding
866
- * @private
867
- */
868
-
869
- function getDecoder (encoding) {
870
- if (!encoding) return null
871
-
872
- try {
873
- return iconv.getDecoder(encoding)
874
- } catch (e) {
875
- // error getting decoder
876
- if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e
877
-
878
- // the encoding was not found
879
- throw createError(415, 'specified encoding unsupported', {
880
- encoding: encoding,
881
- type: 'encoding.unsupported'
882
- })
883
- }
884
- }
885
-
886
- /**
887
- * Get the raw body of a stream (typically HTTP).
888
- *
889
- * @param {object} stream
890
- * @param {object|string|function} [options]
891
- * @param {function} [callback]
892
- * @public
893
- */
894
-
895
- function getRawBody (stream, options, callback) {
896
- var done = callback;
897
- var opts = options || {};
898
-
899
- // light validation
900
- if (stream === undefined) {
901
- throw new TypeError('argument stream is required')
902
- } else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') {
903
- throw new TypeError('argument stream must be a stream')
904
- }
905
-
906
- if (options === true || typeof options === 'string') {
907
- // short cut for encoding
908
- opts = {
909
- encoding: options
910
- };
911
- }
912
-
913
- if (typeof options === 'function') {
914
- done = options;
915
- opts = {};
916
- }
917
-
918
- // validate callback is a function, if provided
919
- if (done !== undefined && typeof done !== 'function') {
920
- throw new TypeError('argument callback must be a function')
921
- }
922
-
923
- // require the callback without promises
924
- if (!done && !global.Promise) {
925
- throw new TypeError('argument callback is required')
926
- }
927
-
928
- // get encoding
929
- var encoding = opts.encoding !== true
930
- ? opts.encoding
931
- : 'utf-8';
932
-
933
- // convert the limit to an integer
934
- var limit = bytes.parse(opts.limit);
935
-
936
- // convert the expected length to an integer
937
- var length = opts.length != null && !isNaN(opts.length)
938
- ? parseInt(opts.length, 10)
939
- : null;
940
-
941
- if (done) {
942
- // classic callback style
943
- return readStream(stream, encoding, length, limit, wrap(done))
944
- }
945
-
946
- return new Promise(function executor (resolve, reject) {
947
- readStream(stream, encoding, length, limit, function onRead (err, buf) {
948
- if (err) return reject(err)
949
- resolve(buf);
950
- });
951
- })
952
- }
953
-
954
- /**
955
- * Halt a stream.
956
- *
957
- * @param {Object} stream
958
- * @private
959
- */
960
-
961
- function halt (stream) {
962
- // unpipe everything from the stream
963
- unpipe(stream);
964
-
965
- // pause stream
966
- if (typeof stream.pause === 'function') {
967
- stream.pause();
968
- }
969
- }
970
-
971
- /**
972
- * Read the data from the stream.
973
- *
974
- * @param {object} stream
975
- * @param {string} encoding
976
- * @param {number} length
977
- * @param {number} limit
978
- * @param {function} callback
979
- * @public
980
- */
981
-
982
- function readStream (stream, encoding, length, limit, callback) {
983
- var complete = false;
984
- var sync = true;
985
-
986
- // check the length and limit options.
987
- // note: we intentionally leave the stream paused,
988
- // so users should handle the stream themselves.
989
- if (limit !== null && length !== null && length > limit) {
990
- return done(createError(413, 'request entity too large', {
991
- expected: length,
992
- length: length,
993
- limit: limit,
994
- type: 'entity.too.large'
995
- }))
996
- }
997
-
998
- // streams1: assert request encoding is buffer.
999
- // streams2+: assert the stream encoding is buffer.
1000
- // stream._decoder: streams1
1001
- // state.encoding: streams2
1002
- // state.decoder: streams2, specifically < 0.10.6
1003
- var state = stream._readableState;
1004
- if (stream._decoder || (state && (state.encoding || state.decoder))) {
1005
- // developer error
1006
- return done(createError(500, 'stream encoding should not be set', {
1007
- type: 'stream.encoding.set'
1008
- }))
1009
- }
1010
-
1011
- if (typeof stream.readable !== 'undefined' && !stream.readable) {
1012
- return done(createError(500, 'stream is not readable', {
1013
- type: 'stream.not.readable'
1014
- }))
1015
- }
1016
-
1017
- var received = 0;
1018
- var decoder;
1019
-
1020
- try {
1021
- decoder = getDecoder(encoding);
1022
- } catch (err) {
1023
- return done(err)
1024
- }
1025
-
1026
- var buffer = decoder
1027
- ? ''
1028
- : [];
1029
-
1030
- // attach listeners
1031
- stream.on('aborted', onAborted);
1032
- stream.on('close', cleanup);
1033
- stream.on('data', onData);
1034
- stream.on('end', onEnd);
1035
- stream.on('error', onEnd);
1036
-
1037
- // mark sync section complete
1038
- sync = false;
1039
-
1040
- function done () {
1041
- var args = new Array(arguments.length);
1042
-
1043
- // copy arguments
1044
- for (var i = 0; i < args.length; i++) {
1045
- args[i] = arguments[i];
1046
- }
1047
-
1048
- // mark complete
1049
- complete = true;
1050
-
1051
- if (sync) {
1052
- process.nextTick(invokeCallback);
1053
- } else {
1054
- invokeCallback();
1055
- }
1056
-
1057
- function invokeCallback () {
1058
- cleanup();
1059
-
1060
- if (args[0]) {
1061
- // halt the stream on error
1062
- halt(stream);
1063
- }
1064
-
1065
- callback.apply(null, args);
1066
- }
1067
- }
1068
-
1069
- function onAborted () {
1070
- if (complete) return
1071
-
1072
- done(createError(400, 'request aborted', {
1073
- code: 'ECONNABORTED',
1074
- expected: length,
1075
- length: length,
1076
- received: received,
1077
- type: 'request.aborted'
1078
- }));
1079
- }
1080
-
1081
- function onData (chunk) {
1082
- if (complete) return
1083
-
1084
- received += chunk.length;
1085
-
1086
- if (limit !== null && received > limit) {
1087
- done(createError(413, 'request entity too large', {
1088
- limit: limit,
1089
- received: received,
1090
- type: 'entity.too.large'
1091
- }));
1092
- } else if (decoder) {
1093
- buffer += decoder.write(chunk);
1094
- } else {
1095
- buffer.push(chunk);
1096
- }
1097
- }
1098
-
1099
- function onEnd (err) {
1100
- if (complete) return
1101
- if (err) return done(err)
1102
-
1103
- if (length !== null && received !== length) {
1104
- done(createError(400, 'request size did not match content length', {
1105
- expected: length,
1106
- length: length,
1107
- received: received,
1108
- type: 'request.size.invalid'
1109
- }));
1110
- } else {
1111
- var string = decoder
1112
- ? buffer + (decoder.end() || '')
1113
- : Buffer.concat(buffer);
1114
- done(null, string);
1115
- }
1116
- }
1117
-
1118
- function cleanup () {
1119
- buffer = null;
1120
-
1121
- stream.removeListener('aborted', onAborted);
1122
- stream.removeListener('data', onData);
1123
- stream.removeListener('end', onEnd);
1124
- stream.removeListener('error', onEnd);
1125
- stream.removeListener('close', cleanup);
1126
- }
1127
- }
1128
-
1129
- /**
1130
- * Try to require async_hooks
1131
- * @private
1132
- */
1133
-
1134
- function tryRequireAsyncHooks () {
1135
- try {
1136
- return require('async_hooks')
1137
- } catch (e) {
1138
- return {}
1139
- }
1140
- }
1141
-
1142
- /**
1143
- * Wrap function with async resource, if possible.
1144
- * AsyncResource.bind static method backported.
1145
- * @private
1146
- */
1147
-
1148
- function wrap (fn) {
1149
- var res;
1150
-
1151
- // create anonymous resource
1152
- if (asyncHooks.AsyncResource) {
1153
- res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn');
1154
- }
1155
-
1156
- // incompatible node.js
1157
- if (!res || !res.runInAsyncScope) {
1158
- return fn
1159
- }
1160
-
1161
- // return bound function
1162
- return res.runInAsyncScope.bind(res, fn, null)
1163
- }
1164
-
1165
- var index = /*#__PURE__*/Object.freeze({
1166
- __proto__: null
1167
- });
1168
-
1169
807
  exports.CONTENT_TYPES = CONTENT_TYPES;
1170
808
  exports.HEADER_CONTENT_TYPE = HEADER_CONTENT_TYPE;
1171
809
  exports.VerificationError = VerificationError;