fc-remote-invoke/lib/index.js

1 line
251 KiB
JavaScript
Raw Normal View History

2021-10-19 16:00:00 +08:00
module.exports=(()=>{var e={7678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(e){return r.includes(e)}const n=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...r];function isObjectTypeName(e){return n.includes(e)}const i=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(e){return i.includes(e)}function isOfType(e){return t=>typeof t===e}const{toString:s}=Object.prototype;const o=e=>{const t=s.call(e).slice(8,-1);if(/HTML\w+Element/.test(t)&&is.domElement(e)){return"HTMLElement"}if(isObjectTypeName(t)){return t}return undefined};const a=e=>t=>o(t)===e;function is(e){if(e===null){return"null"}switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(e)){return"Observable"}if(is.array(e)){return"Array"}if(is.buffer(e)){return"Buffer"}const t=o(e);if(t){return t}if(e instanceof String||e instanceof Boolean||e instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const c=isOfType("number");is.number=(e=>c(e)&&!is.nan(e));is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=(e=>e===null);is.class_=(e=>is.function_(e)&&e.toString().startsWith("class "));is.boolean=(e=>e===true||e===false);is.symbol=isOfType("symbol");is.numericString=(e=>is.string(e)&&!is.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e)));is.array=((e,t)=>{if(!Array.isArray(e)){return false}if(!is.function_(t)){return true}return e.every(t)});is.buffer=(e=>{var t,r,n,i;return(i=(n=(r=(t=e)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.isBuffer)===null||n===void 0?void 0:n.call(r,e))!==null&&i!==void 0?i:false});is.nullOrUndefined=(e=>is.null_(e)||is.undefined(e));is.object=(e=>!is.null_(e)&&(typeof e==="object"||is.function_(e)));is.iterable=(e=>{var t;return is.function_((t=e)===null||t===void 0?void 0:t[Symbol.iterator])});is.asyncIterable=(e=>{var t;return is.function_((t=e)===null||t===void 0?void 0:t[Symbol.asyncIterator])});is.generator=(e=>is.iterable(e)&&is.function_(e.next)&&is.function_(e.throw));is.asyncGenerator=(e=>is.asyncIterable(e)&&is.function_(e.next)&&is.function_(e.throw));is.nativePromise=(e=>a("Promise")(e));const u=e=>{var t,r;return is.function_((t=e)===null||t===void 0?void 0:t.then)&&is.function_((r=e)===null||r===void 0?void 0:r.catch)};is.promise=(e=>is.nativePromise(e)||u(e));is.generatorFunction=a("GeneratorFunction");is.asyncGeneratorFunction=(e=>o(e)==="AsyncGeneratorFunction");is.asyncFunction=(e=>o(e)==="AsyncFunction");is.boundFunction=(e=>is.function_(e)&&!e.hasOwnProperty("prototype"));is.regExp=a("RegExp");is.date=a("Date");is.error=a("Error");is.map=(e=>a("Map")(e));is.set=(e=>a("Set")(e));is.weakMap=(e=>a("WeakMap")(e));is.weakSet=(e=>a("WeakSet")(e));is.int8Array=a("Int8Array");is.uint8Array=a("Uint8Array");is.uint8ClampedArray=a("Uint8ClampedArray");is.int16Array=a("Int16Array");is.uint16Array=a("Uint16Array");is.int32Array=a("Int32Array");is.uint32Array=a("Uint32Array");is.float32Array=a("Float32Array");is.float64Array=a("Float64Array");is.bigInt64Array=a("BigInt64Array");is.bigUint64Array=a("BigUint64Array");is.arrayBuffer=a("ArrayBuffer");is.sharedArrayBuffer=a("SharedArrayBuffer");is.dataView=a("DataView");is.directInstanceOf=((e,t)=>Object.getPrototypeOf(e)===t.prototype);is.urlInstance=(e=>a("URL")(e));is.urlString=(e=>{if(!is.string(e)){return fa