Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TextEncoder.prototype.encoding getter, fallback to property assigment for engines without getter support such as IE8 #14

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions EncoderDecoderTogether.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions EncoderDecoderTogether.min.js-e
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';(function(t){function x(){}function y(){}var z=String.fromCharCode,w={}.toString,A=w.call(t.SharedArrayBuffer),B=w(),q=t.Uint8Array,u=q||Array,r=q?ArrayBuffer:u,C=r.isView||function(f){return f&&"length"in f},D=w.call(r.prototype);r=y.prototype;var E=t.TextEncoder,a=new (q?Uint16Array:u)(32);x.prototype.decode=function(f){if(!C(f)){var l=w.call(f);if(l!==D&&l!==A&&l!==B)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
f=q?new u(f):f||[]}for(var g=l="",b=0,c=f.length|0,v=c-32|0,e,d,h=0,p=0,m,k=0,n=-1;b<c;){for(e=b<=v?32:c-b|0;k<e;b=b+1|0,k=k+1|0){d=f[b]&255;switch(d>>4){case 15:m=f[b=b+1|0]&255;if(2!==m>>6||247<d){b=b-1|0;break}h=(d&7)<<6|m&63;p=5;d=256;case 14:m=f[b=b+1|0]&255,h<<=6,h|=(d&15)<<6|m&63,p=2===m>>6?p+4|0:24,d=d+256&768;case 13:case 12:m=f[b=b+1|0]&255,h<<=6,h|=(d&31)<<6|m&63,p=p+7|0,b<c&&2===m>>6&&h>>p&&1114112>h?(d=h,h=h-65536|0,0<=h&&(n=(h>>10)+55296|0,d=(h&1023)+56320|0,31>k?(a[k]=n,k=k+1|0,n=-1):
(m=n,n=d,d=m))):(d>>=8,b=b-d-1|0,d=65533),h=p=0,e=b<=v?32:c-b|0;default:a[k]=d;continue;case 11:case 10:case 9:case 8:}a[k]=65533}g+=z(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15],a[16],a[17],a[18],a[19],a[20],a[21],a[22],a[23],a[24],a[25],a[26],a[27],a[28],a[29],a[30],a[31]);32>k&&(g=g.slice(0,k-32|0));if(b<c){if(a[0]=n,k=~n>>>31,n=-1,g.length<l.length)continue}else-1!==n&&(g+=z(n));l+=g;g=""}return l};try{Object.defineProperty(r,"encoding",{get:function(){return"utf-8"}})}catch(f){r.encoding=
"utf-8"}r.encode=function(f){f=void 0===f?"":""+f;var l=f.length|0,g=new u((l<<1)+8|0),b,c=0,v=!q;for(b=0;b<l;b=b+1|0,c=c+1|0){var e=f.charCodeAt(b)|0;if(127>=e)g[c]=e;else{if(2047>=e)g[c]=192|e>>6;else{a:{if(55296<=e)if(56319>=e){var d=f.charCodeAt(b=b+1|0)|0;if(56320<=d&&57343>=d){e=(e<<10)+d-56613888|0;if(65535<e){g[c]=240|e>>18;g[c=c+1|0]=128|e>>12&63;g[c=c+1|0]=128|e>>6&63;g[c=c+1|0]=128|e&63;continue}break a}e=65533}else 57343>=e&&(e=65533);!v&&b<<1<c&&b<<1<(c-7|0)&&(v=!0,d=new u(3*l),d.set(g),
g=d)}g[c]=224|e>>12;g[c=c+1|0]=128|e>>6&63}g[c=c+1|0]=128|e&63}}return q?g.subarray(0,c):g.slice(0,c)};E||(t.TextDecoder=x,t.TextEncoder=y)})(""+void 0==typeof global?""+void 0==typeof self?this:self:global);//AnonyCo
//# sourceMappingURL=https://cdn.jsdelivr.net/gh/AnonyCo/FastestSmallestTextEncoderDecoder/EncoderDecoderTogether.min.js.map
Loading