mirror of
https://github.com/swc-project/swc.git
synced 2025-01-01 10:02:51 +03:00
12 lines
28 KiB
TypeScript
12 lines
28 KiB
TypeScript
|
// Loaded from https://cdn.esm.sh/v45/node_buffer.js
|
||
|
|
||
|
|
||
|
/* esm.sh - esbuild bundle(buffer@6.0.3) es2020 production */
|
||
|
var ar=Object.create,N=Object.defineProperty,yr=Object.getPrototypeOf,wr=Object.prototype.hasOwnProperty,xr=Object.getOwnPropertyNames,Br=Object.getOwnPropertyDescriptor;var Er=i=>N(i,"__esModule",{value:!0});var k=(i,r)=>()=>(r||i((r={exports:{}}).exports,r),r.exports);var dr=(i,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of xr(r))!wr.call(i,n)&&n!=="default"&&N(i,n,{get:()=>r[n],enumerable:!(t=Br(r,n))||t.enumerable});return i},H=i=>dr(Er(N(i!=null?ar(yr(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var z=k(_=>{"use strict";_.byteLength=gr;_.toByteArray=mr;_.fromByteArray=Ir;var B=[],w=[],Fr=typeof Uint8Array!="undefined"?Uint8Array:Array,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var F=0,Ar=b.length;F<Ar;++F)B[F]=b[F],w[b.charCodeAt(F)]=F;w["-".charCodeAt(0)]=62;w["_".charCodeAt(0)]=63;function V(i){var r=i.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=r);var n=t===r?0:4-t%4;return[t,n]}function gr(i){var r=V(i),t=r[0],n=r[1];return(t+n)*3/4-n}function Ur(i,r,t){return(r+t)*3/4-t}function mr(i){var r,t=V(i),n=t[0],e=t[1],o=new Fr(Ur(i,n,e)),u=0,f=e>0?n-4:n,c;for(c=0;c<f;c+=4)r=w[i.charCodeAt(c)]<<18|w[i.charCodeAt(c+1)]<<12|w[i.charCodeAt(c+2)]<<6|w[i.charCodeAt(c+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return e===2&&(r=w[i.charCodeAt(c)]<<2|w[i.charCodeAt(c+1)]>>4,o[u++]=r&255),e===1&&(r=w[i.charCodeAt(c)]<<10|w[i.charCodeAt(c+1)]<<4|w[i.charCodeAt(c+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Tr(i){return B[i>>18&63]+B[i>>12&63]+B[i>>6&63]+B[i&63]}function Rr(i,r,t){for(var n,e=[],o=r;o<t;o+=3)n=(i[o]<<16&16711680)+(i[o+1]<<8&65280)+(i[o+2]&255),e.push(Tr(n));return e.join("")}function Ir(i){for(var r,t=i.length,n=t%3,e=[],o=16383,u=0,f=t-n;u<f;u+=o)e.push(Rr(i,u,u+o>f?f:u+o));return n===1?(r=i[t-1],e.push(B[r>>2]+B[r<<4&63]+"==")):n===2&&(r=(i[t-2]<<8)+i[t-1],e.push(B[r>>10]+B[r>>4&63]+B[r<<2&63]+"=")),e.join("")}});var J=k(D=>{D.read=function(i,r,t,n,e){var o,u,f=e*8-n-1,c=(1<<f)-1,l=c>>1,s=-7,p=t?e-1:0,I=t?-1:1,x=i[r+p];for(p+=I,o=x&(1<<-s)-1,x>>=-s,s+=f;s>0;o=o*256+i[r+p],p+=I,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=n;s>0;u=u*256+i[r+p],p+=I,s-=8);if(o===0)o=1-l;else{if(o===c)return u?NaN:(x?-1:1)*Infinity;u=u+Math.pow(2,n),o=o-l}return(x?-1:1)*u*Math.pow(2,o-n)};D.write=function(i,r,t,n,e,o){var u,f,c,l=o*8-e-1,s=(1<<l)-1,p=s>>1,I=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,M=n?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===Infinity?(f=isNaN(r)?1:0,u=s):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+p>=1?r+=I/c:r+=I*Math.pow(2,1-p),r*c>=2&&(u++,c/=2),u+p>=s?(f=0,u=s):u+p>=1?(f=(r*c-1)*Math.pow(2,e),u=u+p):(f=r*Math.pow(2,p-1)*Math.pow(2,e),u=0));e>=8;i[t+x]=f&255,x+=M,f/=256,e-=8);for(u=u<<e|f,l+=e;l>0;i[t+x]=u&255,x+=M,u/=256,l-=8);i[t+x-M]|=lr*128}});var X=k(A=>{"use strict";var $=z(),U=J(),K=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;A.Buffer=h;A.SlowBuffer=Cr;A.INSPECT_MAX_BYTES=50;var S=2147483647;A.kMaxLength=S;h.TYPED_ARRAY_SUPPORT=_r();!h.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function _r(){try{let i=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(i,r),i.foo()===42}catch(i){return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(!!h.isBuffer(this))return this.buffer}});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(!!h.isBuffer(this))return this.byteOffset}});function d(i){if(i>S)throw new RangeError('The value "'+i+'" is invalid for option "size"');let r=new Uint8Array(i);return Object.setPrototypeOf(r,h.prototype),r}function h(i,r,t){if(typeof i=="number"){if(typeof r=="strin
|
||
|
/*!
|
||
|
* The buffer module from node.js, for the browser.
|
||
|
*
|
||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||
|
* @license MIT
|
||
|
*/
|
||
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|