human/dist/human.node.js

207 lines
2.0 MiB
JavaScript
Raw Normal View History

2020-11-17 16:18:15 +01:00
var __create=Object.create;var __defProp=Object.defineProperty;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __markAsModule=target=>__defProp(target,"__esModule",{value:true});var __commonJS=(callback,module2)=>()=>{if(!module2){module2={exports:{}};callback(module2.exports,module2)}return module2.exports};var __export=(target,all)=>{__markAsModule(target);for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __exportStar=(target,module2,desc)=>{__markAsModule(target);if(typeof module2==="object"||typeof module2==="function"){for(let key of __getOwnPropNames(module2))if(!__hasOwnProp.call(target,key)&&key!=="default")__defProp(target,key,{get:()=>module2[key],enumerable:!(desc=__getOwnPropDesc(module2,key))||desc.enumerable})}return target};var __toModule=module2=>{if(module2&&module2.__esModule)return module2;return __exportStar(__defProp(__create(__getProtoOf(module2)),"default",{value:module2,enumerable:true}),module2)};var require_lib=__commonJS(exports2=>{__export(exports2,{FetchError:()=>FetchError,Headers:()=>Headers,Request:()=>Request,Response:()=>Response,default:()=>lib_default});const stream=__toModule(require("stream"));const http2=__toModule(require("http"));const url=__toModule(require("url"));const https2=__toModule(require("https"));const zlib2=__toModule(require("zlib"));const Readable=stream.default.Readable;const BUFFER=Symbol("buffer");const TYPE=Symbol("type");class Blob2{constructor(){this[TYPE]="";const blobParts=arguments[0];const options=arguments[1];const buffers=[];let size=0;if(blobParts){const a=blobParts;const length=Number(a.length);for(let i=0;i<length;i++){const element=a[i];let buffer2;if(element instanceof Buffer){buffer2=element}else if(ArrayBuffer.isView(element)){buffer2=Buffer.from(element.buffer,element.byteOffset,element.byteLength)}else if(element instanceof ArrayBuffer){buffer2=Buffer.from(element)}else if(element instanceof Blob2){buffer2=element[BUFFER]}else{buffer2=Buffer.from(typeof element==="string"?element:String(element))}size+=buffer2.length;buffers.push(buffer2)}}this[BUFFER]=Buffer.concat(buffers);let type=options&&options.type!==void 0&&String(options.type).toLowerCase();if(type&&!/[^\u0020-\u007E]/.test(type)){this[TYPE]=type}}get size(){return this[BUFFER].length}get type(){return this[TYPE]}text(){return Promise.resolve(this[BUFFER].toString())}arrayBuffer(){const buf=this[BUFFER];const ab=buf.buffer.slice(buf.byteOffset,buf.byteOffset+buf.byteLength);return Promise.resolve(ab)}stream(){const readable=new Readable;readable._read=function(){};readable.push(this[BUFFER]);readable.push(null);return readable}toString(){return"[object Blob]"}slice(){const size=this.size;const start=arguments[0];const end=arguments[1];let relativeStart,relativeEnd;if(start===void 0){relativeStart=0}else if(start<0){relativeStart=Math.max(size+start,0)}else{relativeStart=Math.min(start,size)}if(end===void 0){relativeEnd=size}else if(end<0){relativeEnd=Math.max(size+end,0)}else{relativeEnd=Math.min(end,size)}const span=Math.max(relativeEnd-relativeStart,0);const buffer2=this[BUFFER];const slicedBuffer=buffer2.slice(relativeStart,relativeStart+span);const blob=new Blob2([],{type:arguments[2]});blob[BUFFER]=slicedBuffer;return blob}}Object.defineProperties(Blob2.prototype,{size:{enumerable:true},type:{enumerable:true},slice:{enumerable:true}});Object.defineProperty(Blob2.prototype,Symbol.toStringTag,{value:"Blob",writable:false,enumerable:false,configurable:true});function FetchError(message,type,systemError){Error.call(this,message);this.message=message;this.type=type;if(systemError){this.code=this.errno=systemError.code}Error.captureStackTrace(this,this.constructor)}FetchError.prototype=Object.create(Error.prototype);FetchError.prototype.constructor=FetchError;FetchError.prototype.name="FetchError";let convert;try{convert=require("encoding").convert}catch(e){}const INTERNALS=Symbol("Body internals");const PassThroug
2020-11-16 21:51:46 +01:00
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
2020-11-03 15:34:36 +01:00
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2017 Google LLC. All Rights Reserved.
2020-11-03 15:34:36 +01:00
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2018 Google LLC
2020-11-10 02:13:38 +01:00
*
2020-11-16 21:51:46 +01:00
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
2020-11-03 15:34:36 +01:00
* =============================================================================
*/
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2018 Google LLC. All Rights Reserved.
2020-11-03 15:34:36 +01:00
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
2020-11-16 21:51:46 +01:00
*
2020-11-03 15:34:36 +01:00
* =============================================================================
*/
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2018 Google LLC. All Rights Reserved.
2020-11-03 15:34:36 +01:00
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2019 Google LLC
2020-11-10 02:13:38 +01:00
*
2020-11-16 21:51:46 +01:00
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
2020-11-03 15:34:36 +01:00
* =============================================================================
*/
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2019 Google LLC. All Rights Reserved.
2020-11-03 15:34:36 +01:00
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2020 Google Inc. All Rights Reserved.
2020-11-03 15:34:36 +01:00
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
2020-11-16 21:51:46 +01:00
* Copyright 2020 Google LLC
2020-11-10 02:13:38 +01:00
*
2020-11-16 21:51:46 +01:00
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
2020-11-03 15:34:36 +01:00
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
2020-11-04 07:11:24 +01:00
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
2020-11-03 15:34:36 +01:00
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
2020-11-16 21:51:46 +01:00
* Licensed under the Apache License, Version 2.0 (the License);
2020-11-03 15:34:36 +01:00
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
2020-11-16 21:51:46 +01:00
* http://www.apache.org/licenses/LICENSE-2.0
2020-11-03 15:34:36 +01:00
*
* Unless required by applicable law or agreed to in writing, software
2020-11-16 21:51:46 +01:00
* distributed under the License is distributed on an AS IS BASIS,
2020-11-03 15:34:36 +01:00
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
2020-11-16 21:51:46 +01:00
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/** @license See the LICENSE file. */
2020-10-27 17:49:52 +01:00
//# sourceMappingURL=human.node.js.map