Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-googlesheets

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-googlesheets - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

2

dist/parse-googlesheets.min.js

@@ -1,2 +0,2 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(function(){return(()=>{"use strict";var e={854:(e,t,r)=>{r.r(t),r.d(t,{FetchError:()=>d,Headers:()=>$,Request:()=>M,Response:()=>U,default:()=>K});const o=require("stream"),n=require("http"),s=require("url"),i=require("https"),u=require("zlib"),a=o.Readable,c=Symbol("buffer"),l=Symbol("type");class f{constructor(){this[l]="";const e=arguments[0],t=arguments[1],r=[];let o=0;if(e){const t=e,n=Number(t.length);for(let e=0;e<n;e++){const n=t[e];let s;s=n instanceof Buffer?n:ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?Buffer.from(n):n instanceof f?n[c]:Buffer.from("string"==typeof n?n:String(n)),o+=s.length,r.push(s)}}this[c]=Buffer.concat(r);let n=t&&void 0!==t.type&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[l]=n)}get size(){return this[c].length}get type(){return this[l]}text(){return Promise.resolve(this[c].toString())}arrayBuffer(){const e=this[c],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new a;return e._read=function(){},e.push(this[c]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],r=arguments[1];let o,n;o=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),n=void 0===r?e:r<0?Math.max(e+r,0):Math.min(r,e);const s=Math.max(n-o,0),i=this[c].slice(o,o+s),u=new f([],{type:arguments[2]});return u[c]=i,u}}function d(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}let p;Object.defineProperties(f.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(f.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.name="FetchError";try{p=require("encoding").convert}catch(e){}const h=Symbol("Body internals"),b=o.PassThrough;function y(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.size;let s=void 0===n?0:n;var i=r.timeout;let u=void 0===i?0:i;null==e?e=null:g(e)?e=Buffer.from(e.toString()):w(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof o||(e=Buffer.from(String(e)))),this[h]={body:e,disturbed:!1,error:null},this.size=s,this.timeout=u,e instanceof o&&e.on("error",(function(e){const r="AbortError"===e.name?e:new d(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[h].error=r}))}function m(){var e=this;if(this[h].disturbed)return y.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[h].disturbed=!0,this[h].error)return y.Promise.reject(this[h].error);let t=this.body;if(null===t)return y.Promise.resolve(Buffer.alloc(0));if(w(t)&&(t=t.stream()),Buffer.isBuffer(t))return y.Promise.resolve(t);if(!(t instanceof o))return y.Promise.resolve(Buffer.alloc(0));let r=[],n=0,s=!1;return new y.Promise((function(o,i){let u;e.timeout&&(u=setTimeout((function(){s=!0,i(new d(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(s=!0,i(t)):i(new d(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!s&&null!==t){if(e.size&&n+t.length>e.size)return s=!0,void i(new d(`content size at ${e.url} over limit: ${e.size}`,"max-size"));n+=t.length,r.push(t)}})),t.on("end",(function(){if(!s){clearTimeout(u);try{o(Buffer.concat(r,n))}catch(t){i(new d(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function g(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function w(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function v(e){let t,r,n=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof o&&"function"!=typeof n.getBoundary&&(t=new b,r=new b,n.pipe(t),n.pipe(r),e[h].body=t,n=r),n}function j(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":g(e)?"application/x-www-form-urlencoded;charset=UTF-8":w(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof o?null:"text/plain;charset=UTF-8"}function S(e){const t=e.body;return null===t?0:w(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}y.prototype={get body(){return this[h].body},get bodyUsed(){return this[h].disturbed},arrayBuffer(){return m.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return m.call(this).then((function(t){return Object.assign(new f([],{type:e.toLowerCase()}),{[c]:t})}))},json(){var e=this;return m.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return y.Promise.reject(new d(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return m.call(this).then((function(e){return e.toString()}))},buffer(){return m.call(this)},textConverted(){var e=this;return m.call(this).then((function(t){return function(e,t){if("function"!=typeof p)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let o,n,s="utf-8";return r&&(o=/charset=([^;]*)/i.exec(r)),n=e.slice(0,1024).toString(),!o&&n&&(o=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!o&&n&&(o=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),o||(o=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),o&&o.pop()),o&&(o=/charset=(.*)/i.exec(o.pop()))),!o&&n&&(o=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),o&&(s=o.pop(),"gb2312"!==s&&"gbk"!==s||(s="gb18030")),p(e,"UTF-8",s).toString()}(t,e.headers)}))}},Object.defineProperties(y.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),y.mixIn=function(e){for(const t of Object.getOwnPropertyNames(y.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(y.prototype,t);Object.defineProperty(e,t,r)}},y.Promise=global.Promise;const O=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,T=/[^\t\x20-\x7e\x80-\xff]/;function x(e){if(e=`${e}`,O.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function P(e){if(e=`${e}`,T.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function E(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const B=Symbol("map");class ${constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[B]=Object.create(null),e instanceof $){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){x(e=`${e}`);const t=E(this[B],e);return void 0===t?null:this[B][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=C(this),o=0;for(;o<r.length;){var n=r[o];const s=n[0],i=n[1];e.call(t,i,s,this),r=C(this),o++}}set(e,t){t=`${t}`,x(e=`${e}`),P(t);const r=E(this[B],e);this[B][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,x(e=`${e}`),P(t);const r=E(this[B],e);void 0!==r?this[B][r].push(t):this[B][e]=[t]}has(e){return x(e=`${e}`),void 0!==E(this[B],e)}delete(e){x(e=`${e}`);const t=E(this[B],e);void 0!==t&&delete this[B][t]}raw(){return this[B]}keys(){return A(this,"key")}values(){return A(this,"value")}[Symbol.iterator](){return A(this,"key+value")}}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(e[B]).sort();return r.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[B][t].join(", ")}:function(t){return[t.toLowerCase(),e[B][t].join(", ")]})}$.prototype.entries=$.prototype[Symbol.iterator],Object.defineProperty($.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties($.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const L=Symbol("internal");function A(e,t){const r=Object.create(k);return r[L]={target:e,kind:t,index:0},r}const k=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==k)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[L];const t=e.target,r=e.kind,o=e.index,n=C(t,r);return o>=n.length?{value:void 0,done:!0}:(this[L].index=o+1,{value:n[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function z(e){const t=Object.assign({__proto__:null},e[B]),r=E(e[B],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(k,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const R=Symbol("Response internals"),q=n.STATUS_CODES;class U{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y.call(this,e,t);const r=t.status||200,o=new $(t.headers);if(null!=e&&!o.has("Content-Type")){const t=j(e);t&&o.append("Content-Type",t)}this[R]={url:t.url,status:r,statusText:t.statusText||q[r],headers:o,counter:t.counter}}get url(){return this[R].url||""}get status(){return this[R].status}get ok(){return this[R].status>=200&&this[R].status<300}get redirected(){return this[R].counter>0}get statusText(){return this[R].statusText}get headers(){return this[R].headers}clone(){return new U(v(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}y.mixIn(U.prototype),Object.defineProperties(U.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(U.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const _=Symbol("Request internals"),H=s.parse,N=s.format,F="destroy"in o.Readable.prototype;function G(e){return"object"==typeof e&&"object"==typeof e[_]}class M{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};G(e)?t=H(e.url):(t=e&&e.href?H(e.href):H(`${e}`),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||G(e)&&null!==e.body)&&("GET"===o||"HEAD"===o))throw new TypeError("Request with GET/HEAD method cannot have body");let n=null!=r.body?r.body:G(e)&&null!==e.body?v(e):null;y.call(this,n,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const s=new $(r.headers||e.headers||{});if(null!=n&&!s.has("Content-Type")){const e=j(n);e&&s.append("Content-Type",e)}let i=G(e)?e.signal:null;if("signal"in r&&(i=r.signal),null!=i&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(i))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[_]={method:o,redirect:r.redirect||e.redirect||"follow",headers:s,parsedURL:t,signal:i},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[_].method}get url(){return N(this[_].parsedURL)}get headers(){return this[_].headers}get redirect(){return this[_].redirect}get signal(){return this[_].signal}clone(){return new M(this)}}function I(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}y.mixIn(M.prototype),Object.defineProperty(M.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(M.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),I.prototype=Object.create(Error.prototype),I.prototype.constructor=I,I.prototype.name="AbortError";const D=o.PassThrough,V=s.resolve;function Z(e,t){if(!Z.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return y.Promise=Z.Promise,new Z.Promise((function(r,s){const a=new M(e,t),c=function(e){const t=e[_].parsedURL,r=new $(e[_].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof o.Readable&&!F)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(n="0"),null!=e.body){const t=S(e);"number"==typeof t&&(n=String(t))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let s=e.agent;return"function"==typeof s&&(s=s(t)),r.has("Connection")||s||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:z(r),agent:s})}(a),l=("https:"===c.protocol?i:n).request,f=a.signal;let p=null;const h=function(){let e=new I("The user aborted a request.");s(e),a.body&&a.body instanceof o.Readable&&a.body.destroy(e),p&&p.body&&p.body.emit("error",e)};if(f&&f.aborted)return void h();const b=function(){h(),g()},y=l(c);let m;function g(){y.abort(),f&&f.removeEventListener("abort",b),clearTimeout(m)}f&&f.addEventListener("abort",b),a.timeout&&y.once("socket",(function(e){m=setTimeout((function(){s(new d(`network timeout at: ${a.url}`,"request-timeout")),g()}),a.timeout)})),y.on("error",(function(e){s(new d(`request to ${a.url} failed, reason: ${e.message}`,"system",e)),g()})),y.on("response",(function(e){clearTimeout(m);const t=function(e){const t=new $;for(const r of Object.keys(e))if(!O.test(r))if(Array.isArray(e[r]))for(const o of e[r])T.test(o)||(void 0===t[B][r]?t[B][r]=[o]:t[B][r].push(o));else T.test(e[r])||(t[B][r]=[e[r]]);return t}(e.headers);if(Z.isRedirect(e.statusCode)){const o=t.get("Location"),n=null===o?null:V(a.url,o);switch(a.redirect){case"error":return s(new d(`uri requested responds with a redirect, redirect mode is set to error: ${a.url}`,"no-redirect")),void g();case"manual":if(null!==n)try{t.set("Location",n)}catch(e){s(e)}break;case"follow":if(null===n)break;if(a.counter>=a.follow)return s(new d(`maximum redirect reached at: ${a.url}`,"max-redirect")),void g();const o={headers:new $(a.headers),follow:a.follow,counter:a.counter+1,agent:a.agent,compress:a.compress,method:a.method,body:a.body,signal:a.signal,timeout:a.timeout,size:a.size};return 303!==e.statusCode&&a.body&&null===S(a)?(s(new d("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void g()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==a.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),r(Z(new M(n,o))),void g())}}e.once("end",(function(){f&&f.removeEventListener("abort",b)}));let o=e.pipe(new D);const n={url:a.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:a.size,timeout:a.timeout,counter:a.counter},i=t.get("Content-Encoding");if(!a.compress||"HEAD"===a.method||null===i||204===e.statusCode||304===e.statusCode)return p=new U(o,n),void r(p);const c={flush:u.Z_SYNC_FLUSH,finishFlush:u.Z_SYNC_FLUSH};if("gzip"==i||"x-gzip"==i)return o=o.pipe(u.createGunzip(c)),p=new U(o,n),void r(p);if("deflate"!=i&&"x-deflate"!=i){if("br"==i&&"function"==typeof u.createBrotliDecompress)return o=o.pipe(u.createBrotliDecompress()),p=new U(o,n),void r(p);p=new U(o,n),r(p)}else e.pipe(new D).once("data",(function(e){o=8==(15&e[0])?o.pipe(u.createInflate()):o.pipe(u.createInflateRaw()),p=new U(o,n),r(p)}))})),function(e,t){const r=t.body;null===r?e.end():w(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(y,a)}))}Z.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Z.Promise=global.Promise;const K=Z},432:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.loadGoogleSheets=t.parseGoogleSheets=t.number=t.string=void 0;var o=r(602),n=function(e,t,r){return function(o){return e(o)?t(o):r(o)}},s=function(e){return null==e},i=function(e){return function(){return e}};t.string=n(s,i(void 0),(function(e){return e})),t.number=n(s,i(void 0),(function(e){return isNaN(Number(e))?void 0:Number(e)})),t.parseGoogleSheets=function(e,t){var r=t.feed.entry.reduce((function(e,t){var r=Number(t.gs$cell.row),o=Number(t.gs$cell.col);return e[r]||(e[r]=[]),e[r][o]=t.content.$t,e}),[]).filter((function(e){return e.filter((function(e){return!!e}))})),o=r[0],n=Object.entries(e),s=o.reduce((function(e,t,r){var o,s=null!==(o=n.find((function(e){return e[0],e[1].columnName.toLowerCase()===t.trim().toLowerCase()})))&&void 0!==o?o:[void 0,{type:void 0}],i=s[0],u=s[1].parse;return i&&u&&(e[i]={index:r,parse:u}),e}),Object.create(null));return r.slice(1).map((function(e){return Object.entries(s).reduce((function(t,r){var o=r[0],n=r[1],s=n.index,i=n.parse;return t[o]=i(e[s]),t}),Object.create(null))}))},t.loadGoogleSheets=function(e,r,n){return void 0===n&&(n=1),o.request("https://spreadsheets.google.com/feeds/cells/"+r+"/"+n+"/public/full?alt=json").then((function(e){return e.ok?e.json():e.text().then((function(e){return Promise.reject(e)}))})).then((function(r){return t.parseGoogleSheets(e,r)}))}},602:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.request=void 0,t.request="function"==typeof fetch?fetch.bind(window):r(854)}},t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}return r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(432)})()}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("node-fetch"));else if("function"==typeof define&&define.amd)define(["node-fetch"],t);else{var r="object"==typeof exports?t(require("node-fetch")):t(e["node-fetch"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e){return(()=>{"use strict";var t={432:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.loadGoogleSheets=t.parseGoogleSheets=t.number=t.string=void 0;var n=r(602),o=function(e,t,r){return function(n){return e(n)?t(n):r(n)}},u=function(e){return null==e},i=function(e){return function(){return e}};t.string=o(u,i(void 0),(function(e){return e})),t.number=o(u,i(void 0),(function(e){return isNaN(Number(e))?void 0:Number(e)})),t.parseGoogleSheets=function(e,t){var r=t.feed.entry.reduce((function(e,t){var r=Number(t.gs$cell.row),n=Number(t.gs$cell.col);return e[r]||(e[r]=[]),e[r][n]=t.content.$t,e}),[]).filter((function(e){return e.filter((function(e){return!!e}))})),n=r[0],o=Object.entries(e),u=n.reduce((function(e,t,r){var n,u=null!==(n=o.find((function(e){return e[0],e[1].columnName.toLowerCase()===t.trim().toLowerCase()})))&&void 0!==n?n:[void 0,{type:void 0}],i=u[0],c=u[1].parse;return i&&c&&(e[i]={index:r,parse:c}),e}),Object.create(null));return r.slice(1).map((function(e){return Object.entries(u).reduce((function(t,r){var n=r[0],o=r[1],u=o.index,i=o.parse;return t[n]=i(e[u]),t}),Object.create(null))}))},t.loadGoogleSheets=function(e,r,o){return void 0===o&&(o=1),n.request("https://spreadsheets.google.com/feeds/cells/"+r+"/"+o+"/public/full?alt=json").then((function(e){return e.ok?e.json():e.text().then((function(e){return Promise.reject(e)}))})).then((function(r){return t.parseGoogleSheets(e,r)}))}},602:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.request=void 0,t.request="function"==typeof fetch?fetch.bind(window):r(786)},786:t=>{t.exports=e}},r={};return function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{}};return t[n](o,o.exports,e),o.exports}(432)})()}));
//# sourceMappingURL=parse-googlesheets.min.js.map
{
"name": "parse-googlesheets",
"version": "2.0.3",
"version": "2.0.4",
"description": "Parse google sheets",

@@ -34,3 +34,5 @@ "main": "dist/parse-googlesheets.min.js",

"@types/jest": "^26.0.18",
"@types/node-fetch": "^2.5.7",
"jest": "^26.6.3",
"node-fetch": "^2.6.1",
"ts-jest": "^26.4.4",

@@ -42,6 +44,6 @@ "ts-loader": "^8.0.11",

},
"dependencies": {
"@types/node-fetch": "^2.5.7",
"peerDependencies": {
"node-fetch": "^2.6.1"
},
"dependencies": {},
"jest": {

@@ -48,0 +50,0 @@ "collectCoverage": true,

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc