@cj-tech-master/excelts 1.4.5-canary.20251212053535.13d32d8 → 1.4.5-canary.20251212064440.3eb099f
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v1.4.5-canary.
|
|
2
|
+
* @cj-tech-master/excelts v1.4.5-canary.20251212064440.3eb099f
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2025 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -22,7 +22,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}var a=Ve().Buffer,o=global.crypto|
|
|
|
22
22
|
`)}})),Ti=c((e=>{var t=e;t.der=Ci(),t.pem=wi()})),Ei=c((e=>{var t=e;t.bignum=Dr(),t.define=pi().define,t.base=_i(),t.constants=yi(),t.decoders=Si(),t.encoders=Ti()})),Di=c(((e,t)=>{var n=Ei(),r=n.define(`Time`,function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),i=n.define(`AttributeTypeValue`,function(){this.seq().obj(this.key(`type`).objid(),this.key(`value`).any())}),a=n.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`parameters`).optional(),this.key(`curve`).objid().optional())}),o=n.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(a),this.key(`subjectPublicKey`).bitstr())}),s=n.define(`RelativeDistinguishedName`,function(){this.setof(i)}),c=n.define(`RDNSequence`,function(){this.seqof(s)}),l=n.define(`Name`,function(){this.choice({rdnSequence:this.use(c)})}),u=n.define(`Validity`,function(){this.seq().obj(this.key(`notBefore`).use(r),this.key(`notAfter`).use(r))}),d=n.define(`Extension`,function(){this.seq().obj(this.key(`extnID`).objid(),this.key(`critical`).bool().def(!1),this.key(`extnValue`).octstr())}),f=n.define(`TBSCertificate`,function(){this.seq().obj(this.key(`version`).explicit(0).int().optional(),this.key(`serialNumber`).int(),this.key(`signature`).use(a),this.key(`issuer`).use(l),this.key(`validity`).use(u),this.key(`subject`).use(l),this.key(`subjectPublicKeyInfo`).use(o),this.key(`issuerUniqueID`).implicit(1).bitstr().optional(),this.key(`subjectUniqueID`).implicit(2).bitstr().optional(),this.key(`extensions`).explicit(3).seqof(d).optional())});t.exports=n.define(`X509Certificate`,function(){this.seq().obj(this.key(`tbsCertificate`).use(f),this.key(`signatureAlgorithm`).use(a),this.key(`signatureValue`).bitstr())})})),Oi=c((e=>{var t=Ei();e.certificate=Di(),e.RSAPrivateKey=t.define(`RSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`modulus`).int(),this.key(`publicExponent`).int(),this.key(`privateExponent`).int(),this.key(`prime1`).int(),this.key(`prime2`).int(),this.key(`exponent1`).int(),this.key(`exponent2`).int(),this.key(`coefficient`).int())}),e.RSAPublicKey=t.define(`RSAPublicKey`,function(){this.seq().obj(this.key(`modulus`).int(),this.key(`publicExponent`).int())});var n=t.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`none`).null_().optional(),this.key(`curve`).objid().optional(),this.key(`params`).seq().obj(this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int()).optional())});e.PublicKey=t.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(n),this.key(`subjectPublicKey`).bitstr())}),e.PrivateKey=t.define(`PrivateKeyInfo`,function(){this.seq().obj(this.key(`version`).int(),this.key(`algorithm`).use(n),this.key(`subjectPrivateKey`).octstr())}),e.EncryptedPrivateKey=t.define(`EncryptedPrivateKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).seq().obj(this.key(`id`).objid(),this.key(`decrypt`).seq().obj(this.key(`kde`).seq().obj(this.key(`id`).objid(),this.key(`kdeparams`).seq().obj(this.key(`salt`).octstr(),this.key(`iters`).int())),this.key(`cipher`).seq().obj(this.key(`algo`).objid(),this.key(`iv`).octstr()))),this.key(`subjectPrivateKey`).octstr())}),e.DSAPrivateKey=t.define(`DSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int(),this.key(`pub_key`).int(),this.key(`priv_key`).int())}),e.DSAparam=t.define(`DSAparam`,function(){this.int()});var r=t.define(`ECParameters`,function(){this.choice({namedCurve:this.objid()})});e.ECPrivateKey=t.define(`ECPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`privateKey`).octstr(),this.key(`parameters`).optional().explicit(0).use(r),this.key(`publicKey`).optional().explicit(1).bitstr())}),e.signature=t.define(`signature`,function(){this.seq().obj(this.key(`r`).int(),this.key(`s`).int())})})),ki=c(((e,t)=>{t.exports={"2.16.840.1.101.3.4.1.1":`aes-128-ecb`,"2.16.840.1.101.3.4.1.2":`aes-128-cbc`,"2.16.840.1.101.3.4.1.3":`aes-128-ofb`,"2.16.840.1.101.3.4.1.4":`aes-128-cfb`,"2.16.840.1.101.3.4.1.21":`aes-192-ecb`,"2.16.840.1.101.3.4.1.22":`aes-192-cbc`,"2.16.840.1.101.3.4.1.23":`aes-192-ofb`,"2.16.840.1.101.3.4.1.24":`aes-192-cfb`,"2.16.840.1.101.3.4.1.41":`aes-256-ecb`,"2.16.840.1.101.3.4.1.42":`aes-256-cbc`,"2.16.840.1.101.3.4.1.43":`aes-256-ofb`,"2.16.840.1.101.3.4.1.44":`aes-256-cfb`}})),Ai=c(((e,t)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=xr(),o=wr(),s=Ve().Buffer;t.exports=function(e,t){var c=e.toString(),l=c.match(n),u;if(l){var d=`aes`+l[1],f=s.from(l[2],`hex`),p=s.from(l[3].replace(/[\r\n]/g,``),`base64`),m=a(t,f.slice(0,8),parseInt(l[1],10)).key,h=[],g=o.createDecipheriv(d,m,f);h.push(g.update(p)),h.push(g.final()),u=s.concat(h)}else{var _=c.match(i);u=s.from(_[2].replace(/[\r\n]/g,``),`base64`)}return{tag:c.match(r)[1],data:u}}})),ji=c(((e,t)=>{var n=Oi(),r=ki(),i=Ai(),a=wr(),o=Zn().pbkdf2Sync,s=Ve().Buffer;function c(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=r[e.algorithm.decrypt.cipher.algo.join(`.`)],l=e.algorithm.decrypt.cipher.iv,u=e.subjectPrivateKey,d=o(t,n,i,parseInt(c.split(`-`)[1],10)/8,`sha1`),f=a.createDecipheriv(c,d,l),p=[];return p.push(f.update(u)),p.push(f.final()),s.concat(p)}function l(e){var t;typeof e==`object`&&!s.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e==`string`&&(e=s.from(e));var r=i(e,t),a=r.tag,o=r.data,l,u;switch(a){case`CERTIFICATE`:u=n.certificate.decode(o,`der`).tbsCertificate.subjectPublicKeyInfo;case`PUBLIC KEY`:switch(u||=n.PublicKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPublicKey.decode(u.subjectPublicKey.data,`der`);case`1.2.840.10045.2.1`:return u.subjectPrivateKey=u.subjectPublicKey,{type:`ec`,data:u};case`1.2.840.10040.4.1`:return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,`der`),{type:`dsa`,data:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`ENCRYPTED PRIVATE KEY`:o=n.EncryptedPrivateKey.decode(o,`der`),o=c(o,t);case`PRIVATE KEY`:switch(u=n.PrivateKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPrivateKey.decode(u.subjectPrivateKey,`der`);case`1.2.840.10045.2.1`:return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,`der`).privateKey};case`1.2.840.10040.4.1`:return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,`der`),{type:`dsa`,params:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`RSA PUBLIC KEY`:return n.RSAPublicKey.decode(o,`der`);case`RSA PRIVATE KEY`:return n.RSAPrivateKey.decode(o,`der`);case`DSA PRIVATE KEY`:return{type:`dsa`,params:n.DSAPrivateKey.decode(o,`der`)};case`EC PRIVATE KEY`:return o=n.ECPrivateKey.decode(o,`der`),{curve:o.parameters.value,privateKey:o.privateKey};default:throw Error(`unknown key type `+a)}}l.signature=n.signature,t.exports=l})),Mi=c(((e,t)=>{t.exports={"1.3.132.0.10":`secp256k1`,"1.3.132.0.33":`p224`,"1.2.840.10045.3.1.1":`p192`,"1.2.840.10045.3.1.7":`p256`,"1.3.132.0.34":`p384`,"1.3.132.0.35":`p521`}})),Ni=c(((e,t)=>{var n=Ve().Buffer,r=Un(),i=Fr(),a=di().ec,o=Pr(),s=ji(),c=Mi(),l=1;function u(e,t,r,a,o){var c=s(t);if(c.curve){if(a!==`ecdsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);return d(e,c)}else if(c.type===`dsa`){if(a!==`dsa`)throw Error(`wrong private key type`);return f(e,c,r)}if(a!==`rsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);if(t.padding!==void 0&&t.padding!==l)throw Error(`illegal or unsupported padding mode`);e=n.concat([o,e]);for(var u=c.modulus.byteLength(),p=[0,1];e.length+p.length+1<u;)p.push(255);p.push(0);for(var m=-1;++m<e.length;)p.push(e[m]);return i(p,c)}function d(e,t){var r=c[t.curve.join(`.`)];if(!r)throw Error(`unknown curve `+t.curve.join(`.`));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}function f(e,t,n){for(var r=t.params.priv_key,i=t.params.p,a=t.params.q,s=t.params.g,c=new o(0),l,u=h(e,a).mod(a),d=!1,f=m(r,a,e,n);d===!1;)l=_(a,f,n),c=v(s,l,i,a),d=l.invm(a).imul(u.add(r.mul(c))).mod(a),d.cmpn(0)===0&&(d=!1,c=new o(0));return p(c,d)}function p(e,t){e=e.toArray(),t=t.toArray(),e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}function m(e,t,i,a){if(e=n.from(e.toArray()),e.length<t.byteLength()){var o=n.alloc(t.byteLength()-e.length);e=n.concat([o,e])}var s=i.length,c=g(i,t),l=n.alloc(s);l.fill(1);var u=n.alloc(s);return u=r(a,u).update(l).update(n.from([0])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),u=r(a,u).update(l).update(n.from([1])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),{k:u,v:l}}function h(e,t){var n=new o(e),r=(e.length<<3)-t.bitLength();return r>0&&n.ishrn(r),n}function g(e,t){e=h(e,t),e=e.mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}function _(e,t,i){var a,o;do{for(a=n.alloc(0);a.length*8<e.bitLength();)t.v=r(i,t.k).update(t.v).digest(),a=n.concat([a,t.v]);o=h(a,e),t.k=r(i,t.k).update(t.v).update(n.from([0])).digest(),t.v=r(i,t.k).update(t.v).digest()}while(o.cmp(e)!==-1);return o}function v(e,t,n,r){return e.toRed(o.mont(n)).redPow(t).fromRed().mod(r)}t.exports=u,t.exports.getKey=m,t.exports.makeKey=_})),Pi=c(((e,t)=>{var n=Ve().Buffer,r=Pr(),i=di().ec,a=ji(),o=Mi();function s(e,t,i,o,s){var u=a(i);if(u.type===`ec`){if(o!==`ecdsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);return c(e,t,u)}else if(u.type===`dsa`){if(o!==`dsa`)throw Error(`wrong public key type`);return l(e,t,u)}if(o!==`rsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);t=n.concat([s,t]);for(var d=u.modulus.byteLength(),f=[1],p=0;t.length+f.length+2<d;)f.push(255),p+=1;f.push(0);for(var m=-1;++m<t.length;)f.push(t[m]);f=n.from(f);var h=r.mont(u.modulus);e=new r(e).toRed(h),e=e.redPow(new r(u.publicExponent)),e=n.from(e.fromRed().toArray());var g=p<8?1:0;for(d=Math.min(e.length,f.length),e.length!==f.length&&(g=1),m=-1;++m<d;)g|=e[m]^f[m];return g===0}function c(e,t,n){var r=o[n.data.algorithm.curve.join(`.`)];if(!r)throw Error(`unknown curve `+n.data.algorithm.curve.join(`.`));var a=new i(r),s=n.data.subjectPrivateKey.data;return a.verify(t,e,s)}function l(e,t,n){var i=n.data.p,o=n.data.q,s=n.data.g,c=n.data.pub_key,l=a.signature.decode(e,`der`),d=l.s,f=l.r;u(d,o),u(f,o);var p=r.mont(i),m=d.invm(o);return s.toRed(p).redPow(new r(t).mul(m).mod(o)).fromRed().mul(c.toRed(p).redPow(f.mul(m).mod(o)).fromRed()).mod(i).mod(o).cmp(f)===0}function u(e,t){if(e.cmpn(0)<=0||e.cmp(t)>=0)throw Error(`invalid sig`)}t.exports=s})),Fi=c(((e,t)=>{var n=Ve().Buffer,r=Bn(),i=On(),a=Ue(),o=Ni(),s=Pi(),c=Wn();Object.keys(c).forEach(function(e){c[e].id=n.from(c[e].id,`hex`),c[e.toLowerCase()]=c[e]});function l(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(l,i.Writable),l.prototype._write=function(e,t,n){this._hash.update(e),n()},l.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},l.prototype.sign=function(e,t){this.end();var n=o(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?n.toString(t):n};function u(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(u,i.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},u.prototype.verify=function(e,t,r){var i=typeof t==`string`?n.from(t,r):t;return this.end(),s(i,this._hash.digest(),e,this._signType,this._tag)};function d(e){return new l(e)}function f(e){return new u(e)}t.exports={Sign:d,Verify:f,createSign:d,createVerify:f}})),Ii=c(((e,t)=>{var n=K(),r=di(),i=Dr();t.exports=function(e){return new o(e)};var a={secp256k1:{name:`secp256k1`,byteLength:32},secp224r1:{name:`p224`,byteLength:28},prime256v1:{name:`p256`,byteLength:32},prime192v1:{name:`p192`,byteLength:24},ed25519:{name:`ed25519`,byteLength:32},secp384r1:{name:`p384`,byteLength:48},secp521r1:{name:`p521`,byteLength:66}};a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1;function o(e){this.curveType=a[e],this.curveType||={name:e},this.curve=new r.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,r){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var n=this.keys.getPublic(t===`compressed`,!0);return t===`hybrid`&&(n[n.length-1]%2?n[0]=7:n[0]=6),s(n,e)},o.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t));var r=new i(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this};function s(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n.Buffer(e);if(r&&i.length<r){var a=new n.Buffer(r-i.length);a.fill(0),i=n.Buffer.concat([a,i])}return t?i.toString(t):i}})),Li=c(((e,t)=>{var n=Bn(),r=Ve().Buffer;t.exports=function(e,t){for(var a=r.alloc(0),o=0,s;a.length<t;)s=i(o++),a=r.concat([a,n(`sha1`).update(e).update(s).digest()]);return a.slice(0,t)};function i(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}})),Ri=c(((e,t)=>{t.exports=function(e,t){for(var n=e.length,r=-1;++r<n;)e[r]^=t[r];return e}})),zi=c(((e,t)=>{var n=Dr(),r=Ve().Buffer;function i(e,t){return r.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}t.exports=i})),Bi=c(((e,t)=>{var n=ji(),r=He(),i=Bn(),a=Li(),o=Ri(),s=Dr(),c=zi(),l=Fr(),u=Ve().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,a=n(e),o;if(i===4)o=d(a,t);else if(i===1)o=f(a,t,r);else if(i===3){if(o=new s(t),o.cmp(a.modulus)>=0)throw Error(`data too long for modulus`)}else throw Error(`unknown padding`);return r?l(o,a):c(o,a)};function d(e,t){var n=e.modulus.byteLength(),c=t.length,l=i(`sha1`).update(u.alloc(0)).digest(),d=l.length,f=2*d;if(c>n-f-2)throw Error(`message too long`);var p=u.alloc(n-c-f-2),m=n-d-1,h=r(d),g=o(u.concat([l,p,u.alloc(1,1),t],m),a(h,m)),_=o(h,a(g,d));return new s(u.concat([u.alloc(1),_,g],n))}function f(e,t,n){var r=t.length,i=e.modulus.byteLength();if(r>i-11)throw Error(`message too long`);var a=n?u.alloc(i-r-3,255):p(i-r-3);return new s(u.concat([u.from([0,n?1:2]),a,u.alloc(1),t],i))}function p(e){for(var t=u.allocUnsafe(e),n=0,i=r(e*2),a=0,o;n<e;)a===i.length&&(i=r(e*2),a=0),o=i[a++],o&&(t[n++]=o);return t}})),Vi=c(((e,t)=>{var n=ji(),r=Li(),i=Ri(),a=Dr(),o=Fr(),s=Bn(),c=zi(),l=Ve().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,s=n(e),f=s.modulus.byteLength();if(t.length>f||new a(t).cmp(s.modulus)>=0)throw Error(`decryption error`);var p=r?c(new a(t),s):o(t,s),m=l.alloc(f-p.length);if(p=l.concat([m,p],f),i===4)return u(s,p);if(i===1)return d(s,p,r);if(i===3)return p;throw Error(`unknown padding`)};function u(e,t){var n=e.modulus.byteLength(),a=s(`sha1`).update(l.alloc(0)).digest(),o=a.length;if(t[0]!==0)throw Error(`decryption error`);var c=t.slice(1,o+1),u=t.slice(o+1),d=i(u,r(i(c,r(u,o)),n-o-1));if(f(a,d.slice(0,o)))throw Error(`decryption error`);for(var p=o;d[p]===0;)p++;if(d[p++]!==1)throw Error(`decryption error`);return d.slice(p)}function d(e,t,n){for(var r=t.slice(0,2),i=2,a=0;t[i++]!==0;)if(i>=t.length){a++;break}var o=t.slice(2,i-1);if((r.toString(`hex`)!==`0002`&&!n||r.toString(`hex`)!==`0001`&&n)&&a++,o.length<8&&a++,a)throw Error(`decryption error`);return t.slice(i)}function f(e,t){e=l.from(e),t=l.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));for(var i=-1;++i<r;)n+=e[i]^t[i];return n}})),Hi=c((e=>{e.publicEncrypt=Bi(),e.privateDecrypt=Vi(),e.privateEncrypt=function(t,n){return e.publicEncrypt(t,n,!0)},e.publicDecrypt=function(t,n){return e.privateDecrypt(t,n,!0)}})),Ui=c((e=>{Be();function t(){throw Error(`secure random number generation not supported by this browser
|
|
23
23
|
use chrome, FireFox or Internet Explorer 11`)}var n=Ve(),r=He(),i=n.Buffer,a=n.kMaxLength,o=global.crypto||global.msCrypto,s=2**32-1;function c(e,t){if(typeof e!=`number`||e!==e)throw TypeError(`offset must be a number`);if(e>s||e<0)throw TypeError(`offset must be a uint32`);if(e>a||e>t)throw RangeError(`offset out of range`)}function l(e,t,n){if(typeof e!=`number`||e!==e)throw TypeError(`size must be a number`);if(e>s||e<0)throw TypeError(`size must be a uint32`);if(e+t>n||e>a)throw RangeError(`buffer too small`)}o&&o.getRandomValues||!Q.browser?(e.randomFill=u,e.randomFillSync=f):(e.randomFill=t,e.randomFillSync=t);function u(e,t,n,r){if(!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);if(typeof t==`function`)r=t,t=0,n=e.length;else if(typeof n==`function`)r=n,n=e.length-t;else if(typeof r!=`function`)throw TypeError(`"cb" argument must be a function`);return c(t,e.length),l(n,t,e.length),d(e,t,n,r)}function d(e,t,n,i){if(Q.browser){var a=e.buffer,s=new Uint8Array(a,t,n);if(o.getRandomValues(s),i){Q.nextTick(function(){i(null,e)});return}return e}if(i){r(n,function(n,r){if(n)return i(n);r.copy(e,t),i(null,e)});return}return r(n).copy(e,t),e}function f(e,t,n){if(t===void 0&&(t=0),!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);return c(t,e.length),n===void 0&&(n=e.length-t),l(n,t,e.length),d(e,t,n)}})),Wi=c((e=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=He(),e.createHash=e.Hash=Bn(),e.createHmac=e.Hmac=Un();var t=Gn(),n=Object.keys(t),r=[`sha1`,`sha224`,`sha256`,`sha384`,`sha512`,`md5`,`rmd160`].concat(n);e.getHashes=function(){return r};var i=Zn();e.pbkdf2=i.pbkdf2,e.pbkdf2Sync=i.pbkdf2Sync;var a=Er();e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var o=Nr();e.DiffieHellmanGroup=o.DiffieHellmanGroup,e.createDiffieHellmanGroup=o.createDiffieHellmanGroup,e.getDiffieHellman=o.getDiffieHellman,e.createDiffieHellman=o.createDiffieHellman,e.DiffieHellman=o.DiffieHellman;var s=Fi();e.createSign=s.createSign,e.Sign=s.Sign,e.createVerify=s.createVerify,e.Verify=s.Verify,e.createECDH=Ii();var c=Hi();e.publicEncrypt=c.publicEncrypt,e.privateEncrypt=c.privateEncrypt,e.publicDecrypt=c.publicDecrypt,e.privateDecrypt=c.privateDecrypt;var l=Ui();e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
24
24
|
we accept pull requests
|
|
25
|
-
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Gi=K(),Ki=d(Wi(),1);let qi={hash(e,...t){let n=Ki.createHash(e);return n.update(Gi.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Ki.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Gi.Buffer.from(e,`utf16le`),a=this.hash(t,Gi.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Gi.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Ki.randomBytes(e)}};var Ji=l({default:()=>Yi}),Yi,Xi=s((()=>{Yi=null}));Xi();function Zi(){}let Qi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function $i(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function ea(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let ta=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function na(e){let t=ta.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`"`;break;case 38:r=`&`;break;case 39:r=`'`;break;case 60:r=`<`;break;case 62:r=`>`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ra(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}})}function ia(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function aa(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function oa(e){return new Promise(t=>{Yi.access(e,Yi.constants.F_OK,e=>{t(!e)})})}function sa(e){return e===!0||e===`true`||e===1||e===`1`}function*ca(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function la(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}function ua(e,t=null){return e.reduce((e,n)=>(e[n]=t,e),{})}let da=new TextDecoder(`utf-8`);function fa(e){return typeof e==`string`?e:da.decode(e)}function pa(e,t){ma(e,t);let{sourceSheet:n}=t,{rows:r,columns:i,values:a}=t,o=ha(n,[...r,...i]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{});return{sourceSheet:n,rows:r.map(e=>s[e]),columns:i.map(e=>s[e]),values:a.map(e=>s[e]),metric:`sum`,cacheFields:o,cacheId:`10`}}function ma(e,t){if(e.workbook.pivotTables.length===1)throw Error(`A pivot table was already added. At this time, ExcelTS supports at most one pivot table per file.`);if(t.metric&&t.metric!==`sum`)throw Error(`Only the "sum" metric is supported at this time.`);let n=ua(t.sourceSheet.getRow(1).values.slice(1),!0);for(let e of[...t.rows,...t.columns,...t.values])if(!n[e])throw Error(`The header name "${e}" was not found in ${t.sourceSheet.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(!t.columns.length)throw Error(`No pivot table columns specified.`);if(t.values.length!==1)throw Error(`Exactly 1 value needs to be specified at this time.`)}function ha(e,t){let n=e.getRow(1).values,r=ua(t,!0),i=t=>{let n=e.getColumn(t).values.splice(2);return la(new Set(n))},a=[];for(let e of ca(1,n.length)){let t=n[e],o=r[t]?i(e):null;a.push({name:t,sharedItems:o})}return a}let ga=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),_a=(e,t,n,r=[])=>{e[n]&&(t[n]=ga(e[n],r))},va=e=>Object.keys(e).length===0,ya=e=>{if(!e)return e;if(va(e))return{};let t={...e};return _a(e,t,`font`,[`color`]),_a(e,t,`alignment`),_a(e,t,`protection`),e.border&&(_a(e,t,`border`),_a(e.border,t.border,`top`,[`color`]),_a(e.border,t.border,`left`,[`color`]),_a(e.border,t.border,`bottom`,[`color`]),_a(e.border,t.border,`right`,[`color`]),_a(e.border,t.border,`diagonal`,[`color`])),e.fill&&(_a(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>ga(e,[`color`])))),t};var ba=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this.name=e.name||`sheet${this.id}`,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!(e.pageSetup&&(e.pageSetup.fitToWidth||e.pageSetup.fitToHeight)&&!e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new de,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);if(e&&e.length>31&&(e=e.substring(0,31)),this._workbook.worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=Array.isArray(t.header)?t.header.length:t.header?1:0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new se(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new se(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=n.map(e=>e[i]||null);this.getRow(i+1).splice(e,t,...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=void 0;this.workbook.definedNames.spliceColumns(this.name,e,t,n.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow(t=>{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||=this._rows[e-1]=new oe(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=ya(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=ya(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t.type===S.ValueType.Merge){let e=this.getRow(t.row+i).getCell(n),r=t.master,a=this.getRow(r.row+i).getCell(r.col);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){let n,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._rows.length;for(let t=1;t<=e;t++)r(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&r(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)if(f){let a=this.getCell(n,i);a.value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1}else this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new U(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new U(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{this.sheetProtection={sheet:!0},t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName=`SHA-512`,this.sheetProtection.saltValue=qi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=qi.convertPasswordToHash(e,`SHA512`,this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&`spinCount`in t&&delete this.sheetProtection.spinCount),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new ue(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){console.warn(`Warning: Pivot Table support is experimental.
|
|
25
|
+
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Gi=K(),Ki=d(Wi(),1);let qi={hash(e,...t){let n=Ki.createHash(e);return n.update(Gi.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Ki.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Gi.Buffer.from(e,`utf16le`),a=this.hash(t,Gi.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Gi.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Ki.randomBytes(e)}};var Ji=l({default:()=>Yi}),Yi,Xi=s((()=>{Yi=null}));Xi();function Zi(){}let Qi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function $i(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function ea(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let ta=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function na(e){let t=ta.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`"`;break;case 38:r=`&`;break;case 39:r=`'`;break;case 60:r=`<`;break;case 62:r=`>`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ra(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}})}function ia(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function aa(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function oa(e){return new Promise(t=>{Yi.access(e,Yi.constants.F_OK,e=>{t(!e)})})}function sa(e){return e===!0||e===`true`||e===1||e===`1`}function*ca(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function la(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}function ua(e,t=null){return e.reduce((e,n)=>(e[n]=t,e),{})}let da=new TextDecoder(`utf-8`);function fa(e){return typeof e==`string`?e:da.decode(e)}function pa(e,t){ma(e,t);let{sourceSheet:n}=t,{rows:r,columns:i,values:a}=t,o=ha(n,[...r,...i]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{});return{sourceSheet:n,rows:r.map(e=>s[e]),columns:i.map(e=>s[e]),values:a.map(e=>s[e]),metric:`sum`,cacheFields:o,cacheId:`10`}}function ma(e,t){if(e.workbook.pivotTables.length===1)throw Error(`A pivot table was already added. At this time, ExcelTS supports at most one pivot table per file.`);if(t.metric&&t.metric!==`sum`)throw Error(`Only the "sum" metric is supported at this time.`);let n=ua(t.sourceSheet.getRow(1).values.slice(1),!0);for(let e of[...t.rows,...t.columns,...t.values])if(!n[e])throw Error(`The header name "${e}" was not found in ${t.sourceSheet.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(!t.columns.length)throw Error(`No pivot table columns specified.`);if(t.values.length!==1)throw Error(`Exactly 1 value needs to be specified at this time.`)}function ha(e,t){let n=e.getRow(1).values,r=ua(t,!0),i=t=>{let n=e.getColumn(t).values.splice(2);return la(new Set(n))},a=[];for(let e of ca(1,n.length)){let t=n[e],o=r[t]?i(e):null;a.push({name:t,sharedItems:o})}return a}let ga=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),_a=(e,t,n,r=[])=>{e[n]&&(t[n]=ga(e[n],r))},va=e=>Object.keys(e).length===0,ya=e=>{if(!e)return e;if(va(e))return{};let t={...e};return _a(e,t,`font`,[`color`]),_a(e,t,`alignment`),_a(e,t,`protection`),e.border&&(_a(e,t,`border`),_a(e.border,t.border,`top`,[`color`]),_a(e.border,t.border,`left`,[`color`]),_a(e.border,t.border,`bottom`,[`color`]),_a(e.border,t.border,`right`,[`color`]),_a(e.border,t.border,`diagonal`,[`color`])),e.fill&&(_a(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>ga(e,[`color`])))),t};var ba=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this.name=e.name||`sheet${this.id}`,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!(e.pageSetup&&(e.pageSetup.fitToWidth||e.pageSetup.fitToHeight)&&!e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new de,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);if(e&&e.length>31&&(e=e.substring(0,31)),this._workbook.worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=Array.isArray(t.header)?t.header.length:t.header?1:0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new se(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new se(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=n.map(e=>e[i]||null);this.getRow(i+1).splice(e,t,...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=void 0;this.workbook.definedNames.spliceColumns(this.name,e,t,n.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow(t=>{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||=this._rows[e-1]=new oe(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=ya(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=ya(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t.type===S.ValueType.Merge){let e=this.getRow(t.row+i).getCell(n),r=t.master,a=this.getRow(r.row+i).getCell(r.col);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){if(t||(t=e,e=void 0),e&&e.includeEmpty){let e=this._rows.length;for(let n=1;n<=e;n++)t(this.getRow(n),n)}else this._rows.forEach(e=>{e&&e.hasValues&&t(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)if(f){let a=this.getCell(n,i);a.value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1}else this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new U(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new U(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{this.sheetProtection={sheet:!0},t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName=`SHA-512`,this.sheetProtection.saltValue=qi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=qi.convertPasswordToHash(e,`SHA512`,this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&`spinCount`in t&&delete this.sheetProtection.spinCount),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new ue(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){console.warn(`Warning: Pivot Table support is experimental.
|
|
26
26
|
Please leave feedback at https://github.com/excelts/excelts/discussions/2575`);let t=pa(this,e);return this.pivotTables.push(t),this.workbook.pivotTables.push(t),t}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormattings.splice(e,1):e instanceof Function?this.conditionalFormattings=this.conditionalFormattings.filter(e):this.conditionalFormattings=[]}get model(){let e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(e=>e.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(e=>e.model),pivotTables:this.pivotTables,conditionalFormattings:this.conditionalFormattings};e.cols=se.toModel(this.columns||[]);let t=e.rows=[],n=e.dimensions=new h;return this._rows.forEach(e=>{let r=e&&e.model;r&&(n.expand(r.number,r.min,r.number,r.max),t.push(r))}),e.merges=[],Object.values(this._merges).forEach(t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows&&e.rows.forEach(e=>{let t=new oe(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){e.mergeCells&&e.mergeCells.forEach(e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=se.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new de(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new U(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new ue(this,t);return n.model=t,e[t.name]=n,e},{}),this.pivotTables=e.pivotTables,this.conditionalFormattings=e.conditionalFormattings}};function xa(e){return typeof e==`number`?!0:e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function Sa(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Sa(e));let t={};for(let n of Object.keys(e))xa(n)&&(t[n]=Sa(e[n]));return t}var Ca=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(m.decodeEx(e))}getCell(e){return this.findCellEx(m.decodeEx(e),!0)}findCell(e){return this.findCellEx(m.decodeEx(e),!1)}findCellAt(e,t,n){let r=this.sheets[e],i=r&&r[t];return i&&i[n]}addCellEx(e){if(e.top!==void 0)for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++)this.getCellAt(e.sheetName,t,n);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){let n=this.findSheet(e,t),r=this.findSheetRow(n,e,t);return this.findRowCell(r,e,t)}getCellAt(e,t,n){if(!xa(e))throw Error(`Invalid sheet name: ${e}`);let r=this.sheets[e]||(this.sheets[e]=[]),i=r[t]||(r[t]=[]);return i[n]||(i[n]={sheetName:e,address:m.n2l(n)+t,row:t,col:n})}removeCellEx(e){let t=this.findSheet(e,!1);if(!t)return;let n=this.findSheetRow(t,e,!1);n&&delete n[e.col]}forEachInSheet(e,t){let n=this.sheets[e];n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){Object.keys(this.sheets).forEach(t=>{this.forEachInSheet(t,e)})}map(e){let t=[];return this.forEach(n=>{t.push(e(n))}),t}findSheet(e,t){let n=e.sheetName;if(!xa(n))throw Error(`Invalid sheet name: ${n}`);if(Object.prototype.hasOwnProperty.call(this.sheets,n))return this.sheets[n];if(t)return this.sheets[n]=[]}findSheetRow(e,t,n){let{row:r}=t;if(!xa(r))throw Error(`Invalid row: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=[]}findRowCell(e,t,n){let{col:r}=t;if(!xa(r))throw Error(`Invalid column: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=this.template?{...t,...Sa(this.template)}:t}spliceRows(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push([]);i.splice(t,n,...e)}}spliceColumns(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push(null);Object.values(i).forEach(r=>{r.splice(t,n,...e)})}}};let wa=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;var Ta=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new Ca)}add(e,t){let n=m.decodeEx(e);`error`in n||this.addEx(n,t)}addEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++){let i={sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t};n.addCellEx(i)}else n.addCellEx(e)}remove(e,t){let n=m.decodeEx(e);`error`in n||this.removeEx(n,t)}removeEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++)n.removeCellEx({sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t});else n.removeCellEx(e)}removeAllNames(e){Object.values(this.matrixMap).forEach(t=>{if(`top`in e)for(let n=e.left;n<=e.right;n++)for(let r=e.top;r<=e.bottom;r++)t.removeCellEx({sheetName:e.sheetName,address:m.n2l(n)+r,row:r,col:n});else t.removeCellEx(e)})}forEach(e){Object.entries(this.matrixMap).forEach(([t,n])=>{n.forEach(n=>{e(t,n)})})}getNames(e){let t=m.decodeEx(e);return`error`in t||`top`in t?[]:this.getNamesEx(t)}getNamesEx(e){return Object.entries(this.matrixMap).map(([t,n])=>n.findCellEx(e,!1)&&t).filter(e=>!!e)}_explore(e,t){t.mark=!1;let{sheetName:n}=t,r=new h(t.row,t.col,t.row,t.col,n),i,a,o=(t,r)=>e.findCellAt(n,t,r);function s(e,n){let i=o(e,t.col);return!i||!i.mark?!1:(r[n]=e,i.mark=!1,!0)}for(a=t.row-1;s(a,`top`);a--);for(a=t.row+1;s(a,`bottom`);a++);function c(e,t){let n=[];for(a=r.top;a<=r.bottom;a++){let t=o(a,e);if(t&&t.mark)n.push(t);else return!1}r[t]=e;for(let e=0;e<n.length;e++)n[e].mark=!1;return!0}for(i=t.col-1;c(i,`left`);i--);for(i=t.col+1;c(i,`right`);i++);return r}getRanges(e,t){return t||=this.matrixMap[e],t?(t.forEach(e=>{e.mark=!0}),{name:e,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(Boolean).map(e=>e.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,(e,t,n)=>{e&&(e.row!==t||e.col!==n)&&(e.row=t,e.col=n,e.address=m.n2l(n)+t)})}spliceRows(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceRows(e,t,n,r),this.normaliseMatrix(i,e)})}spliceColumns(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceColumns(e,t,n,r),this.normaliseMatrix(i,e)})}get model(){return Object.entries(this.matrixMap).map(([e,t])=>this.getRanges(e,t)).filter(e=>e.ranges.length)}set model(e){let t=this.matrixMap={};e.forEach(e=>{let n=t[e.name]=new Ca;e.ranges.forEach(e=>{wa.test(e.split(`!`).pop()||``)&&n.addCell(e)})})}},Ea=Uint8Array,Da=Uint16Array,Oa=Int32Array,ka=new Ea([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Aa=new Ea([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ja=new Ea([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ma=function(e,t){for(var n=new Da(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Oa(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},Na=Ma(ka,2),Pa=Na.b,Fa=Na.r;Pa[28]=258,Fa[258]=28;var Ia=Ma(Aa,0),La=Ia.b;Ia.r;for(var Ra=new Da(32768),za=0;za<32768;++za){var Ba=(za&43690)>>1|(za&21845)<<1;Ba=(Ba&52428)>>2|(Ba&13107)<<2,Ba=(Ba&61680)>>4|(Ba&3855)<<4,Ra[za]=((Ba&65280)>>8|(Ba&255)<<8)>>1}for(var Va=(function(e,t,n){for(var r=e.length,i=0,a=new Da(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new Da(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new Da(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[Ra[d]>>c]=l}else for(s=new Da(r),i=0;i<r;++i)e[i]&&(s[i]=Ra[o[e[i]-1]++]>>15-e[i]);return s}),Ha=new Ea(288),za=0;za<144;++za)Ha[za]=8;for(var za=144;za<256;++za)Ha[za]=9;for(var za=256;za<280;++za)Ha[za]=7;for(var za=280;za<288;++za)Ha[za]=8;for(var Ua=new Ea(32),za=0;za<32;++za)Ua[za]=5;var Wa=Va(Ha,9,1),Ga=Va(Ua,5,1),Ka=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},qa=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Ja=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Ya=function(e){return(e+7)/8|0},Xa=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Ea(e.subarray(t,n))},Za=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],Qa=function(e,t,n){var r=Error(t||Za[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Qa),!n)throw r;return r},$a=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new Ea(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new Ea(i*3));var l=function(e){var t=n.length;if(e>t){var r=new Ea(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=qa(e,d,1);var v=qa(e,d+1,3);if(d+=3,v)if(v==1)p=Wa,m=Ga,h=9,g=5;else if(v==2){var y=qa(e,d,31)+257,b=qa(e,d+10,15)+4,x=y+qa(e,d+5,31)+1;d+=14;for(var S=new Ea(x),C=new Ea(19),w=0;w<b;++w)C[ja[w]]=qa(e,d+w*3,7);d+=b*3;for(var T=Ka(C),E=(1<<T)-1,D=Va(C,T,1),w=0;w<x;){var O=D[qa(e,d,E)];d+=O&15;var k=O>>4;if(k<16)S[w++]=k;else{var A=0,ee=0;for(k==16?(ee=3+qa(e,d,3),d+=2,A=S[w-1]):k==17?(ee=3+qa(e,d,7),d+=3):k==18&&(ee=11+qa(e,d,127),d+=7);ee--;)S[w++]=A}}var j=S.subarray(0,y),M=S.subarray(y);h=Ka(j),g=Ka(M),p=Va(j,h,1),m=Va(M,g,1)}else Qa(1);else{var k=Ya(d)+4,N=e[k-4]|e[k-3]<<8,P=k+N;if(P>i){c&&Qa(0);break}s&&l(f+N),n.set(e.subarray(k,P),f),t.b=f+=N,t.p=d=P*8,t.f=u;continue}if(d>_){c&&Qa(0);break}}s&&l(f+131072);for(var F=(1<<h)-1,te=(1<<g)-1,I=d;;I=d){var A=p[Ja(e,d)&F],L=A>>4;if(d+=A&15,d>_){c&&Qa(0);break}if(A||Qa(2),L<256)n[f++]=L;else if(L==256){I=d,p=null;break}else{var ne=L-254;if(L>264){var w=L-257,R=ka[w];ne=qa(e,d,(1<<R)-1)+Pa[w],d+=R}var z=m[Ja(e,d)&te],re=z>>4;z||Qa(3),d+=z&15;var M=La[re];if(re>3){var R=Aa[re];M+=Ja(e,d)&(1<<R)-1,d+=R}if(d>_){c&&Qa(0);break}s&&l(f+131072);var B=f+ne;if(f<M){var V=a-M,ie=Math.min(M,B);for(V+f<0&&Qa(3);f<ie;++f)n[f]=r[V+f]}for(;f<B;++f)n[f]=n[f-M]}}t.l=p,t.p=I,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?Xa(n,0,f):n.subarray(0,f)},eo=new Ea(0),to=function(e,t){return e[t]|e[t+1]<<8},no=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ro=function(e,t){return no(e,t)+no(e,t+4)*4294967296},io=function(){function e(e,t){typeof e==`function`&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Ea(32768),this.p=new Ea(0),n&&this.o.set(n)}return e.prototype.e=function(e){if(this.ondata||Qa(5),this.d&&Qa(4),!this.p.length)this.p=e;else if(e.length){var t=new Ea(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=$a(this.p,this.s,this.o);this.ondata(Xa(n,t,this.s.b),this.d),this.o=Xa(n,this.s.b-32768),this.s.b=this.o.length,this.p=Xa(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),ao=typeof TextDecoder<`u`&&new TextDecoder;try{ao.decode(eo,{stream:!0})}catch{}var oo=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Xa(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function so(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else if(ao)return ao.decode(e);else{var i=oo(e),a=i.s,n=i.r;return n.length&&Qa(8),a}}var co=function(e,t){for(;to(e,t)!=1;t+=4+to(e,t+2));return[ro(e,t+12),ro(e,t+4),ro(e,t+20)]},lo=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),uo=function(){function e(){var e=this;this.i=new io(function(t,n){e.ondata(null,t,n)})}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),fo=function(){function e(e){this.onfile=e,this.k=[],this.o={0:lo},this.p=eo}return e.prototype.push=function(e,t){var n=this;if(this.onfile||Qa(5),this.p||Qa(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),e=e.subarray(r),e.length)return this.push(e,t)}else{var a=0,o=0,s=void 0,c=void 0;this.p.length?e.length?(c=new Ea(this.p.length+e.length),c.set(this.p),c.set(e,this.p.length)):c=this.p:c=e;for(var l=c.length,u=this.c,d=u&&this.d,f=function(){var e,t=no(c,o);if(t==67324752){a=1,s=o,p.d=null,p.c=0;var r=to(c,o+6),i=to(c,o+8),d=r&2048,f=r&8,m=to(c,o+26),h=to(c,o+28);if(l>o+30+m+h){var g=[];p.k.unshift(g),a=2;var _=no(c,o+18),v=no(c,o+22),y=so(c.subarray(o+30,o+=30+m),!d);_==4294967295?(e=f?[-2]:co(c,o),_=e[0],v=e[1]):f&&(_=-1),o+=h,p.c=_;var b,x={name:y,compression:i,start:function(){if(x.ondata||Qa(5),!_)x.ondata(null,eo,!0);else{var e=n.o[i];e||x.ondata(Qa(14,`unknown compression type `+i,1),null,!1),b=_<0?new e(y):new e(y,_,v),b.ondata=function(e,t,n){x.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var a=r[t];b.push(a,!1)}n.k[0]==g&&n.c?n.d=b:b.push(eo,!0)}},terminate:function(){b&&b.terminate&&b.terminate()}};_>=0&&(x.size=_,x.originalSize=v),p.onfile(x)}return`break`}else if(u){if(t==134695760)return s=o+=12+(u==-2&&8),a=3,p.c=0,`break`;if(t==33639248)return s=o-=4,a=3,p.c=0,`break`}},p=this;o<l-4&&f()!==`break`;++o);if(this.p=eo,u<0){var m=a?c.subarray(0,s-12-(u==-2&&8)-(no(c,s-16)==134695760&&4)):c.subarray(0,o);d?d.push(m,!!a):this.k[+(a==2)].push(m)}if(a&2)return this.push(c.subarray(o),t);this.p=c.subarray(o)}t&&(this.c&&Qa(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),po=c(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=p();return function(){var n=m(e),r;if(t){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&(n(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return f(e)}function f(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function p(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var h={},g,_;function v(e,t,n){n||=Error;function r(e,n,r){return typeof t==`string`?t:t(e,n,r)}h[e]=function(t){c(a,t);var n=u(a);function a(t,i,o){var c;return s(this,a),c=n.call(this,r(t,i,o)),c.code=e,c}return i(a)}(n)}function y(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function b(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function x(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function S(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}v(`ERR_AMBIGUOUS_ARGUMENT`,`The "%s" argument is ambiguous. %s`,TypeError),v(`ERR_INVALID_ARG_TYPE`,function(e,t,r){g===void 0&&(g=jo()),g(typeof e==`string`,`'name' must be a string`);var i;typeof t==`string`&&b(t,`not `)?(i=`must not be`,t=t.replace(/^not /,``)):i=`must be`;var a=x(e,` argument`)?`The ${e} ${i} ${y(t,`type`)}`:`The "${e}" ${S(e,`.`)?`property`:`argument`} ${i} ${y(t,`type`)}`;return a+=`. Received type ${n(r)}`,a},TypeError),v(`ERR_INVALID_ARG_VALUE`,function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`is invalid`;_===void 0&&(_=Kt());var r=_.inspect(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The argument '${e}' ${n}. Received ${r}`},TypeError,RangeError),v(`ERR_INVALID_RETURN_VALUE`,function(e,t,r){return`Expected ${e} to be returned from the "${t}" function but got ${r&&r.constructor&&r.constructor.name?`instance of ${r.constructor.name}`:`type ${n(r)}`}.`},TypeError),v(`ERR_MISSING_ARGS`,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g===void 0&&(g=jo()),g(t.length>0,`At least one arg needs to be specified`);var r=`The `,i=t.length;switch(t=t.map(function(e){return`"${e}"`}),i){case 1:r+=`${t[0]} argument`;break;case 2:r+=`${t[0]} and ${t[1]} arguments`;break;default:r+=t.slice(0,i-1).join(`, `),r+=`, and ${t[i-1]} arguments`;break}return`${r} must be specified`},TypeError),t.exports.codes=h})),mo=c(((e,t)=>{Be();function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t=c(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function c(e){var t=l(e,`string`);return b(t)===`symbol`?t:String(t)}function l(e,t){if(b(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(b(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&v(e,t)}function d(e){var t=g();return function(){var n=y(e),r;if(t){var i=y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){if(t&&(b(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return p(e)}function p(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function m(e){var t=typeof Map==`function`?new Map:void 0;return m=function(e){if(e===null||!_(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},m(e)}function h(e,t,n){return h=g()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},h.apply(null,arguments)}function g(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e){"@babel/helpers - typeof";return b=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},b(e)}var x=Kt().inspect,S=po().codes.ERR_INVALID_ARG_TYPE;function C(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function w(e,t){if(t=Math.floor(t),e.length==0||t==0)return``;var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,n-e.length),e}var T=``,E=``,D=``,O=``,k={deepStrictEqual:`Expected values to be strictly deep-equal:`,strictEqual:`Expected values to be strictly equal:`,strictEqualObject:`Expected "actual" to be reference-equal to "expected":`,deepEqual:`Expected values to be loosely deep-equal:`,equal:`Expected values to be loosely equal:`,notDeepStrictEqual:`Expected "actual" not to be strictly deep-equal to:`,notStrictEqual:`Expected "actual" to be strictly unequal to:`,notStrictEqualObject:`Expected "actual" not to be reference-equal to "expected":`,notDeepEqual:`Expected "actual" not to be loosely deep-equal to:`,notEqual:`Expected "actual" to be loosely unequal to:`,notIdentical:`Values identical but not reference-equal:`},A=10;function ee(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,`message`,{value:e.message}),n}function j(e){return x(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(e,t,n){var r=``,i=``,a=0,o=``,s=!1,c=j(e),l=c.split(`
|
|
27
27
|
`),u=j(t).split(`
|
|
28
28
|
`),d=0,f=``;if(n===`strictEqual`&&b(e)===`object`&&b(t)===`object`&&e!==null&&t!==null&&(n=`strictEqualObject`),l.length===1&&u.length===1&&l[0]!==u[0]){var p=l[0].length+u[0].length;if(p<=A){if((b(e)!==`object`||e===null)&&(b(t)!==`object`||t===null)&&(e!==0||t!==0))return`${k[n]}
|
|
@@ -470,15 +470,10 @@ class Worksheet {
|
|
|
470
470
|
// account for defined names
|
|
471
471
|
this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
|
|
472
472
|
}
|
|
473
|
-
eachRow(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
iteratee = optionsOrIteratee;
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
options = optionsOrIteratee;
|
|
481
|
-
iteratee = maybeIteratee;
|
|
473
|
+
eachRow(options, iteratee) {
|
|
474
|
+
if (!iteratee) {
|
|
475
|
+
iteratee = options;
|
|
476
|
+
options = undefined;
|
|
482
477
|
}
|
|
483
478
|
if (options && options.includeEmpty) {
|
|
484
479
|
const n = this._rows.length;
|
|
@@ -467,15 +467,10 @@ class Worksheet {
|
|
|
467
467
|
// account for defined names
|
|
468
468
|
this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
|
|
469
469
|
}
|
|
470
|
-
eachRow(
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
iteratee = optionsOrIteratee;
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
options = optionsOrIteratee;
|
|
478
|
-
iteratee = maybeIteratee;
|
|
470
|
+
eachRow(options, iteratee) {
|
|
471
|
+
if (!iteratee) {
|
|
472
|
+
iteratee = options;
|
|
473
|
+
options = undefined;
|
|
479
474
|
}
|
|
480
475
|
if (options && options.includeEmpty) {
|
|
481
476
|
const n = this._rows.length;
|
|
@@ -143,7 +143,7 @@ declare class Worksheet {
|
|
|
143
143
|
get workbook(): Workbook;
|
|
144
144
|
destroy(): void;
|
|
145
145
|
get dimensions(): Range;
|
|
146
|
-
get columns(): Column[]
|
|
146
|
+
get columns(): Column[];
|
|
147
147
|
set columns(value: ColumnDefn[]);
|
|
148
148
|
getColumnKey(key: string): Column | undefined;
|
|
149
149
|
setColumnKey(key: string, value: Column): void;
|
|
@@ -162,18 +162,18 @@ declare class Worksheet {
|
|
|
162
162
|
findRows(start: number, length: number): (Row | undefined)[];
|
|
163
163
|
get rowCount(): number;
|
|
164
164
|
get actualRowCount(): number;
|
|
165
|
-
getRow(r: number):
|
|
166
|
-
getRows(start: number, length: number):
|
|
167
|
-
addRow(value:
|
|
168
|
-
addRows(value:
|
|
169
|
-
insertRow(pos: number, value:
|
|
170
|
-
insertRows(pos: number, values:
|
|
165
|
+
getRow(r: number): any;
|
|
166
|
+
getRows(start: number, length: number): any[] | undefined;
|
|
167
|
+
addRow(value: any, style?: string): any;
|
|
168
|
+
addRows(value: any[], style?: string): any[];
|
|
169
|
+
insertRow(pos: number, value: any, style?: string): any;
|
|
170
|
+
insertRows(pos: number, values: any[], style?: string): Row[] | undefined;
|
|
171
171
|
_setStyleOption(pos: number, style?: string): void;
|
|
172
172
|
_copyStyle(src: number, dest: number, styleEmpty?: boolean): void;
|
|
173
173
|
duplicateRow(rowNum: number, count: number, insert?: boolean): void;
|
|
174
174
|
spliceRows(start: number, count: number, ...inserts: RowValues[]): void;
|
|
175
|
-
eachRow(iteratee: (row:
|
|
176
|
-
eachRow(options: EachRowOptions, iteratee: (row:
|
|
175
|
+
eachRow(iteratee: (row: any, rowNumber: number) => void): void;
|
|
176
|
+
eachRow(options: EachRowOptions, iteratee: (row: any, rowNumber: number) => void): void;
|
|
177
177
|
getSheetValues(): CellValue[][];
|
|
178
178
|
findCell(r: number | string, c?: number): Cell | undefined;
|
|
179
179
|
getCell(r: number | string, c?: number): Cell;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cj-tech-master/excelts",
|
|
3
|
-
"version": "1.4.5-canary.
|
|
3
|
+
"version": "1.4.5-canary.20251212064440.3eb099f",
|
|
4
4
|
"description": "TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|