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

@flatfile/hooks

Package Overview
Dependencies
Maintainers
15
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flatfile/hooks - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

3

__sandbox__/index.ts

@@ -25,3 +25,4 @@ import { FlatfileRecords, FlatfileSession } from '../src/index';

uploads: ['1'],
rows
rows,
envSignature: ''
}

@@ -28,0 +29,0 @@

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

!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var n=r();for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,(function(){return(()=>{"use strict";var e,r,n={697:(e,r,n)=>{n.r(r),n.d(r,{FlatfileRecords:()=>i,FlatfileSession:()=>t});class t{constructor(e){this.payload=e}get workspaceId(){return this.payload.workspaceId}get workbookId(){return this.payload.workbookId}get schemaId(){return this.payload.schemaId}get uploads(){return this.payload.uploads}get endUser(){return this.payload.endUser}get rows(){return this.payload.rows}}class o{_info=[];constructor(e){this.mutated=this.data=Object.assign({},e.rawData),this._rowId=e.rowId}get rowId(){return this._rowId}get originalValue(){return this.data}get value(){return this.mutated}verifyField(e){return!!this.data.hasOwnProperty(e)||(console.error(`Record does not have field "${e}".`),!1)}set(e,r){return this.verifyField(e)?(Object.defineProperty(this.mutated,e,{value:r}),this):this}addComment(e,r){return this.pushInfoMessage(e,r,"info"),this}addError(e,r){return this.pushInfoMessage(e,r,"error"),this}addWarning(e,r){return this.pushInfoMessage(e,r,"warning"),this}pushInfoMessage(e,r,n){(e=Array.isArray(e)?e:[e]).forEach((e=>{this.verifyField(e)&&this._info.push({field:e,message:r,level:n})}))}toJSON(){return{row:{rawData:this.mutated,rowId:this.rowId},info:this._info}}}class i{constructor(e){this._records=e.map((e=>new o(e)))}get records(){return this._records}async mapRecords(e){this.$promise=Promise.all(this.records.map((r=>e(r)))).then((()=>{})).finally((()=>{this.$promise=void 0})),await this.$promise}async waitUntilResolved(){this.$promise&&await this.$promise}toJSON(){return this.records.map((e=>e.toJSON()))}}}},t={};function o(e){var r=t[e];if(void 0!==r){if(void 0!==r.error)throw r.error;return r.exports}var i=t[e]={exports:{}};try{var d={id:e,module:i,factory:n[e],require:o};o.i.forEach((function(e){e(d)})),i=d.module,d.factory.call(i.exports,i,i.exports,d.require)}catch(e){throw i.error=e,e}return i.exports}return o.m=n,o.c=t,o.i=[],o.d=(e,r)=>{for(var n in r)o.o(r,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o.hu=e=>e+"."+o.h()+".hot-update.js",o.hmrF=()=>"main."+o.h()+".hot-update.json",o.h=()=>"54fec366d569c379f7ff",o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@flatfile/hooks:",o.l=(n,t,i,d)=>{if(e[n])e[n].push(t);else{var a,c;if(void 0!==i)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var l=s[u];if(l.getAttribute("src")==n||l.getAttribute("data-webpack")==r+i){a=l;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",r+i),a.src=n),e[n]=[t];var f=(r,t)=>{a.onerror=a.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(t))),r)return r(t)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e,r,n,t,i={},d=o.c,a=[],c=[],s="idle";function u(e){s=e;for(var r=[],n=0;n<c.length;n++)r[n]=c[n].call(null,e);return Promise.all(r)}function l(e){if(0===r.length)return e();var n=r;return r=[],Promise.all(n).then((function(){return l(e)}))}function f(e){if("idle"!==s)throw new Error("check() is only allowed in idle status");return u("check").then(o.hmrM).then((function(t){return t?u("prepare").then((function(){var i=[];return r=[],n=[],Promise.all(Object.keys(o.hmrC).reduce((function(e,r){return o.hmrC[r](t.c,t.r,t.m,e,n,i),e}),[])).then((function(){return l((function(){return e?h(e):u("ready").then((function(){return i}))}))}))})):u(m()?"ready":"idle").then((function(){return null}))}))}function p(e){return"ready"!==s?Promise.resolve().then((function(){throw new Error("apply() is only allowed in ready status")})):h(e)}function h(e){e=e||{},m();var r=n.map((function(r){return r(e)}));n=void 0;var o=r.map((function(e){return e.error})).filter(Boolean);if(o.length>0)return u("abort").then((function(){throw o[0]}));var i=u("dispose");r.forEach((function(e){e.dispose&&e.dispose()}));var d,a=u("apply"),c=function(e){d||(d=e)},s=[];return r.forEach((function(e){if(e.apply){var r=e.apply(c);if(r)for(var n=0;n<r.length;n++)s.push(r[n])}})),Promise.all([i,a]).then((function(){return d?u("fail").then((function(){throw d})):t?h(e).then((function(e){return s.forEach((function(r){e.indexOf(r)<0&&e.push(r)})),e})):u("idle").then((function(){return s}))}))}function m(){if(t)return n||(n=[]),Object.keys(o.hmrI).forEach((function(e){t.forEach((function(r){o.hmrI[e](r,n)}))})),t=void 0,!0}o.hmrD=i,o.i.push((function(h){var m,v,y,g,w=h.module,b=function(n,t){var o=d[t];if(!o)return n;var i=function(r){if(o.hot.active){if(d[r]){var i=d[r].parents;-1===i.indexOf(t)&&i.push(t)}else a=[t],e=r;-1===o.children.indexOf(r)&&o.children.push(r)}else console.warn("[HMR] unexpected require("+r+") from disposed module "+t),a=[];return n(r)},c=function(e){return{configurable:!0,enumerable:!0,get:function(){return n[e]},set:function(r){n[e]=r}}};for(var f in n)Object.prototype.hasOwnProperty.call(n,f)&&"e"!==f&&Object.defineProperty(i,f,c(f));return i.e=function(e){return function(e){switch(s){case"ready":return u("prepare"),r.push(e),l((function(){return u("ready")})),e;case"prepare":return r.push(e),e;default:return e}}(n.e(e))},i}(h.require,h.id);w.hot=(m=h.id,v=w,g={_acceptedDependencies:{},_acceptedErrorHandlers:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:y=e!==m,_requireSelf:function(){a=v.parents.slice(),e=y?void 0:m,o(m)},active:!0,accept:function(e,r,n){if(void 0===e)g._selfAccepted=!0;else if("function"==typeof e)g._selfAccepted=e;else if("object"==typeof e&&null!==e)for(var t=0;t<e.length;t++)g._acceptedDependencies[e[t]]=r||function(){},g._acceptedErrorHandlers[e[t]]=n;else g._acceptedDependencies[e]=r||function(){},g._acceptedErrorHandlers[e]=n},decline:function(e){if(void 0===e)g._selfDeclined=!0;else if("object"==typeof e&&null!==e)for(var r=0;r<e.length;r++)g._declinedDependencies[e[r]]=!0;else g._declinedDependencies[e]=!0},dispose:function(e){g._disposeHandlers.push(e)},addDisposeHandler:function(e){g._disposeHandlers.push(e)},removeDisposeHandler:function(e){var r=g._disposeHandlers.indexOf(e);r>=0&&g._disposeHandlers.splice(r,1)},invalidate:function(){switch(this._selfInvalidated=!0,s){case"idle":n=[],Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](m,n)})),u("ready");break;case"ready":Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](m,n)}));break;case"prepare":case"check":case"dispose":case"apply":(t=t||[]).push(m)}},check:f,apply:p,status:function(e){if(!e)return s;c.push(e)},addStatusHandler:function(e){c.push(e)},removeStatusHandler:function(e){var r=c.indexOf(e);r>=0&&c.splice(r,1)},data:i[m]},e=void 0,g),w.parents=a,w.children=[],a=[],h.require=b})),o.hmrC={},o.hmrI={}})(),o.p="/",(()=>{var e,r,n,t,i=o.hmrS_jsonp=o.hmrS_jsonp||{179:0},d={};function a(e){return new Promise(((r,n)=>{d[e]=r;var t=o.p+o.hu(e),i=new Error;o.l(t,(r=>{if(d[e]){d[e]=void 0;var t=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;i.message="Loading hot update chunk "+e+" failed.\n("+t+": "+o+")",i.name="ChunkLoadError",i.type=t,i.request=o,n(i)}}))}))}function c(d){function a(e){for(var r=[e],n={},t=r.map((function(e){return{chain:[e],id:e}}));t.length>0;){var i=t.pop(),d=i.id,a=i.chain,s=o.c[d];if(s&&(!s.hot._selfAccepted||s.hot._selfInvalidated)){if(s.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:d};if(s.hot._main)return{type:"unaccepted",chain:a,moduleId:d};for(var u=0;u<s.parents.length;u++){var l=s.parents[u],f=o.c[l];if(f){if(f.hot._declinedDependencies[d])return{type:"declined",chain:a.concat([l]),moduleId:d,parentId:l};-1===r.indexOf(l)&&(f.hot._acceptedDependencies[d]?(n[l]||(n[l]=[]),c(n[l],[d])):(delete n[l],r.push(l),t.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:r,outdatedDependencies:n}}function c(e,r){for(var n=0;n<r.length;n++){var t=r[n];-1===e.indexOf(t)&&e.push(t)}}o.f&&delete o.f.jsonpHmr,e=void 0;var s={},u=[],l={},f=function(e){console.warn("[HMR] unexpected require("+e.id+") to disposed module")};for(var p in r)if(o.o(r,p)){var h,m=r[p],v=!1,y=!1,g=!1,w="";switch((h=m?a(p):{type:"disposed",moduleId:p}).chain&&(w="\nUpdate propagation: "+h.chain.join(" -> ")),h.type){case"self-declined":d.onDeclined&&d.onDeclined(h),d.ignoreDeclined||(v=new Error("Aborted because of self decline: "+h.moduleId+w));break;case"declined":d.onDeclined&&d.onDeclined(h),d.ignoreDeclined||(v=new Error("Aborted because of declined dependency: "+h.moduleId+" in "+h.parentId+w));break;case"unaccepted":d.onUnaccepted&&d.onUnaccepted(h),d.ignoreUnaccepted||(v=new Error("Aborted because "+p+" is not accepted"+w));break;case"accepted":d.onAccepted&&d.onAccepted(h),y=!0;break;case"disposed":d.onDisposed&&d.onDisposed(h),g=!0;break;default:throw new Error("Unexception type "+h.type)}if(v)return{error:v};if(y)for(p in l[p]=m,c(u,h.outdatedModules),h.outdatedDependencies)o.o(h.outdatedDependencies,p)&&(s[p]||(s[p]=[]),c(s[p],h.outdatedDependencies[p]));g&&(c(u,[h.moduleId]),l[p]=f)}r=void 0;for(var b,_=[],I=0;I<u.length;I++){var E=u[I],k=o.c[E];k&&(k.hot._selfAccepted||k.hot._main)&&l[E]!==f&&!k.hot._selfInvalidated&&_.push({module:E,require:k.hot._requireSelf,errorHandler:k.hot._selfAccepted})}return{dispose:function(){var e;n.forEach((function(e){delete i[e]})),n=void 0;for(var r,t=u.slice();t.length>0;){var d=t.pop(),a=o.c[d];if(a){var c={},l=a.hot._disposeHandlers;for(I=0;I<l.length;I++)l[I].call(null,c);for(o.hmrD[d]=c,a.hot.active=!1,delete o.c[d],delete s[d],I=0;I<a.children.length;I++){var f=o.c[a.children[I]];f&&(e=f.parents.indexOf(d))>=0&&f.parents.splice(e,1)}}}for(var p in s)if(o.o(s,p)&&(a=o.c[p]))for(b=s[p],I=0;I<b.length;I++)r=b[I],(e=a.children.indexOf(r))>=0&&a.children.splice(e,1)},apply:function(e){for(var r in l)o.o(l,r)&&(o.m[r]=l[r]);for(var n=0;n<t.length;n++)t[n](o);for(var i in s)if(o.o(s,i)){var a=o.c[i];if(a){b=s[i];for(var c=[],f=[],p=[],h=0;h<b.length;h++){var m=b[h],v=a.hot._acceptedDependencies[m],y=a.hot._acceptedErrorHandlers[m];if(v){if(-1!==c.indexOf(v))continue;c.push(v),f.push(y),p.push(m)}}for(var g=0;g<c.length;g++)try{c[g].call(null,b)}catch(r){if("function"==typeof f[g])try{f[g](r,{moduleId:i,dependencyId:p[g]})}catch(n){d.onErrored&&d.onErrored({type:"accept-error-handler-errored",moduleId:i,dependencyId:p[g],error:n,originalError:r}),d.ignoreErrored||(e(n),e(r))}else d.onErrored&&d.onErrored({type:"accept-errored",moduleId:i,dependencyId:p[g],error:r}),d.ignoreErrored||e(r)}}}for(var w=0;w<_.length;w++){var I=_[w],E=I.module;try{I.require(E)}catch(r){if("function"==typeof I.errorHandler)try{I.errorHandler(r,{moduleId:E,module:o.c[E]})}catch(n){d.onErrored&&d.onErrored({type:"self-accept-error-handler-errored",moduleId:E,error:n,originalError:r}),d.ignoreErrored||(e(n),e(r))}else d.onErrored&&d.onErrored({type:"self-accept-errored",moduleId:E,error:r}),d.ignoreErrored||e(r)}}return u}}}this.webpackHotUpdate_flatfile_hooks=(e,n,i)=>{for(var a in n)o.o(n,a)&&(r[a]=n[a]);i&&t.push(i),d[e]&&(d[e](),d[e]=void 0)},o.hmrI.jsonp=function(e,i){r||(r={},t=[],n=[],i.push(c)),o.o(r,e)||(r[e]=o.m[e])},o.hmrC.jsonp=function(d,s,u,l,f,p){f.push(c),e={},n=s,r=u.reduce((function(e,r){return e[r]=!1,e}),{}),t=[],d.forEach((function(r){o.o(i,r)&&void 0!==i[r]&&(l.push(a(r)),e[r]=!0)})),o.f&&(o.f.jsonpHmr=function(r,n){e&&!o.o(e,r)&&o.o(i,r)&&void 0!==i[r]&&(n.push(a(r)),e[r]=!0)})},o.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(o.p+o.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})(),o(697)})()}));
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var n=r();for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,(function(){return(()=>{"use strict";var e,r,n={697:(e,r,n)=>{n.r(r),n.d(r,{FlatfileRecords:()=>i,FlatfileSession:()=>t});class t{constructor(e){this.payload=e}get workspaceId(){return this.payload.workspaceId}get workbookId(){return this.payload.workbookId}get schemaId(){return this.payload.schemaId}get uploads(){return this.payload.uploads}get endUser(){return this.payload.endUser}get rows(){return this.payload.rows}get env(){return this.payload.env}get envSignature(){return this.payload.envSignature}}class o{_info=[];constructor(e){this.mutated=this.data=Object.assign({},e.rawData),this._rowId=e.rowId}get rowId(){return this._rowId}get originalValue(){return this.data}get value(){return this.mutated}verifyField(e){return!!this.data.hasOwnProperty(e)||(console.error(`Record does not have field "${e}".`),!1)}set(e,r){return this.verifyField(e)?(Object.defineProperty(this.mutated,e,{value:r}),this):this}addComment(e,r){return this.pushInfoMessage(e,r,"info"),this}addError(e,r){return this.pushInfoMessage(e,r,"error"),this}addWarning(e,r){return this.pushInfoMessage(e,r,"warning"),this}pushInfoMessage(e,r,n){(e=Array.isArray(e)?e:[e]).forEach((e=>{this.verifyField(e)&&this._info.push({field:e,message:r,level:n})}))}toJSON(){return{row:{rawData:this.mutated,rowId:this.rowId},info:this._info}}}class i{constructor(e){this._records=e.map((e=>new o(e)))}get records(){return this._records}async mapRecords(e){this.$promise=Promise.all(this.records.map((r=>e(r)))).then((()=>{})).finally((()=>{this.$promise=void 0})),await this.$promise}async waitUntilResolved(){this.$promise&&await this.$promise}toJSON(){return this.records.map((e=>e.toJSON()))}}}},t={};function o(e){var r=t[e];if(void 0!==r){if(void 0!==r.error)throw r.error;return r.exports}var i=t[e]={exports:{}};try{var d={id:e,module:i,factory:n[e],require:o};o.i.forEach((function(e){e(d)})),i=d.module,d.factory.call(i.exports,i,i.exports,d.require)}catch(e){throw i.error=e,e}return i.exports}return o.m=n,o.c=t,o.i=[],o.d=(e,r)=>{for(var n in r)o.o(r,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o.hu=e=>e+"."+o.h()+".hot-update.js",o.hmrF=()=>"main."+o.h()+".hot-update.json",o.h=()=>"8d83c49726cad2e29b25",o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@flatfile/hooks:",o.l=(n,t,i,d)=>{if(e[n])e[n].push(t);else{var a,c;if(void 0!==i)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var l=s[u];if(l.getAttribute("src")==n||l.getAttribute("data-webpack")==r+i){a=l;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",r+i),a.src=n),e[n]=[t];var f=(r,t)=>{a.onerror=a.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(t))),r)return r(t)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e,r,n,t,i={},d=o.c,a=[],c=[],s="idle";function u(e){s=e;for(var r=[],n=0;n<c.length;n++)r[n]=c[n].call(null,e);return Promise.all(r)}function l(e){if(0===r.length)return e();var n=r;return r=[],Promise.all(n).then((function(){return l(e)}))}function f(e){if("idle"!==s)throw new Error("check() is only allowed in idle status");return u("check").then(o.hmrM).then((function(t){return t?u("prepare").then((function(){var i=[];return r=[],n=[],Promise.all(Object.keys(o.hmrC).reduce((function(e,r){return o.hmrC[r](t.c,t.r,t.m,e,n,i),e}),[])).then((function(){return l((function(){return e?h(e):u("ready").then((function(){return i}))}))}))})):u(m()?"ready":"idle").then((function(){return null}))}))}function p(e){return"ready"!==s?Promise.resolve().then((function(){throw new Error("apply() is only allowed in ready status")})):h(e)}function h(e){e=e||{},m();var r=n.map((function(r){return r(e)}));n=void 0;var o=r.map((function(e){return e.error})).filter(Boolean);if(o.length>0)return u("abort").then((function(){throw o[0]}));var i=u("dispose");r.forEach((function(e){e.dispose&&e.dispose()}));var d,a=u("apply"),c=function(e){d||(d=e)},s=[];return r.forEach((function(e){if(e.apply){var r=e.apply(c);if(r)for(var n=0;n<r.length;n++)s.push(r[n])}})),Promise.all([i,a]).then((function(){return d?u("fail").then((function(){throw d})):t?h(e).then((function(e){return s.forEach((function(r){e.indexOf(r)<0&&e.push(r)})),e})):u("idle").then((function(){return s}))}))}function m(){if(t)return n||(n=[]),Object.keys(o.hmrI).forEach((function(e){t.forEach((function(r){o.hmrI[e](r,n)}))})),t=void 0,!0}o.hmrD=i,o.i.push((function(h){var m,v,y,g,w=h.module,b=function(n,t){var o=d[t];if(!o)return n;var i=function(r){if(o.hot.active){if(d[r]){var i=d[r].parents;-1===i.indexOf(t)&&i.push(t)}else a=[t],e=r;-1===o.children.indexOf(r)&&o.children.push(r)}else console.warn("[HMR] unexpected require("+r+") from disposed module "+t),a=[];return n(r)},c=function(e){return{configurable:!0,enumerable:!0,get:function(){return n[e]},set:function(r){n[e]=r}}};for(var f in n)Object.prototype.hasOwnProperty.call(n,f)&&"e"!==f&&Object.defineProperty(i,f,c(f));return i.e=function(e){return function(e){switch(s){case"ready":return u("prepare"),r.push(e),l((function(){return u("ready")})),e;case"prepare":return r.push(e),e;default:return e}}(n.e(e))},i}(h.require,h.id);w.hot=(m=h.id,v=w,g={_acceptedDependencies:{},_acceptedErrorHandlers:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:y=e!==m,_requireSelf:function(){a=v.parents.slice(),e=y?void 0:m,o(m)},active:!0,accept:function(e,r,n){if(void 0===e)g._selfAccepted=!0;else if("function"==typeof e)g._selfAccepted=e;else if("object"==typeof e&&null!==e)for(var t=0;t<e.length;t++)g._acceptedDependencies[e[t]]=r||function(){},g._acceptedErrorHandlers[e[t]]=n;else g._acceptedDependencies[e]=r||function(){},g._acceptedErrorHandlers[e]=n},decline:function(e){if(void 0===e)g._selfDeclined=!0;else if("object"==typeof e&&null!==e)for(var r=0;r<e.length;r++)g._declinedDependencies[e[r]]=!0;else g._declinedDependencies[e]=!0},dispose:function(e){g._disposeHandlers.push(e)},addDisposeHandler:function(e){g._disposeHandlers.push(e)},removeDisposeHandler:function(e){var r=g._disposeHandlers.indexOf(e);r>=0&&g._disposeHandlers.splice(r,1)},invalidate:function(){switch(this._selfInvalidated=!0,s){case"idle":n=[],Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](m,n)})),u("ready");break;case"ready":Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](m,n)}));break;case"prepare":case"check":case"dispose":case"apply":(t=t||[]).push(m)}},check:f,apply:p,status:function(e){if(!e)return s;c.push(e)},addStatusHandler:function(e){c.push(e)},removeStatusHandler:function(e){var r=c.indexOf(e);r>=0&&c.splice(r,1)},data:i[m]},e=void 0,g),w.parents=a,w.children=[],a=[],h.require=b})),o.hmrC={},o.hmrI={}})(),o.p="/",(()=>{var e,r,n,t,i=o.hmrS_jsonp=o.hmrS_jsonp||{179:0},d={};function a(e){return new Promise(((r,n)=>{d[e]=r;var t=o.p+o.hu(e),i=new Error;o.l(t,(r=>{if(d[e]){d[e]=void 0;var t=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;i.message="Loading hot update chunk "+e+" failed.\n("+t+": "+o+")",i.name="ChunkLoadError",i.type=t,i.request=o,n(i)}}))}))}function c(d){function a(e){for(var r=[e],n={},t=r.map((function(e){return{chain:[e],id:e}}));t.length>0;){var i=t.pop(),d=i.id,a=i.chain,s=o.c[d];if(s&&(!s.hot._selfAccepted||s.hot._selfInvalidated)){if(s.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:d};if(s.hot._main)return{type:"unaccepted",chain:a,moduleId:d};for(var u=0;u<s.parents.length;u++){var l=s.parents[u],f=o.c[l];if(f){if(f.hot._declinedDependencies[d])return{type:"declined",chain:a.concat([l]),moduleId:d,parentId:l};-1===r.indexOf(l)&&(f.hot._acceptedDependencies[d]?(n[l]||(n[l]=[]),c(n[l],[d])):(delete n[l],r.push(l),t.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:r,outdatedDependencies:n}}function c(e,r){for(var n=0;n<r.length;n++){var t=r[n];-1===e.indexOf(t)&&e.push(t)}}o.f&&delete o.f.jsonpHmr,e=void 0;var s={},u=[],l={},f=function(e){console.warn("[HMR] unexpected require("+e.id+") to disposed module")};for(var p in r)if(o.o(r,p)){var h,m=r[p],v=!1,y=!1,g=!1,w="";switch((h=m?a(p):{type:"disposed",moduleId:p}).chain&&(w="\nUpdate propagation: "+h.chain.join(" -> ")),h.type){case"self-declined":d.onDeclined&&d.onDeclined(h),d.ignoreDeclined||(v=new Error("Aborted because of self decline: "+h.moduleId+w));break;case"declined":d.onDeclined&&d.onDeclined(h),d.ignoreDeclined||(v=new Error("Aborted because of declined dependency: "+h.moduleId+" in "+h.parentId+w));break;case"unaccepted":d.onUnaccepted&&d.onUnaccepted(h),d.ignoreUnaccepted||(v=new Error("Aborted because "+p+" is not accepted"+w));break;case"accepted":d.onAccepted&&d.onAccepted(h),y=!0;break;case"disposed":d.onDisposed&&d.onDisposed(h),g=!0;break;default:throw new Error("Unexception type "+h.type)}if(v)return{error:v};if(y)for(p in l[p]=m,c(u,h.outdatedModules),h.outdatedDependencies)o.o(h.outdatedDependencies,p)&&(s[p]||(s[p]=[]),c(s[p],h.outdatedDependencies[p]));g&&(c(u,[h.moduleId]),l[p]=f)}r=void 0;for(var b,_=[],I=0;I<u.length;I++){var E=u[I],k=o.c[E];k&&(k.hot._selfAccepted||k.hot._main)&&l[E]!==f&&!k.hot._selfInvalidated&&_.push({module:E,require:k.hot._requireSelf,errorHandler:k.hot._selfAccepted})}return{dispose:function(){var e;n.forEach((function(e){delete i[e]})),n=void 0;for(var r,t=u.slice();t.length>0;){var d=t.pop(),a=o.c[d];if(a){var c={},l=a.hot._disposeHandlers;for(I=0;I<l.length;I++)l[I].call(null,c);for(o.hmrD[d]=c,a.hot.active=!1,delete o.c[d],delete s[d],I=0;I<a.children.length;I++){var f=o.c[a.children[I]];f&&(e=f.parents.indexOf(d))>=0&&f.parents.splice(e,1)}}}for(var p in s)if(o.o(s,p)&&(a=o.c[p]))for(b=s[p],I=0;I<b.length;I++)r=b[I],(e=a.children.indexOf(r))>=0&&a.children.splice(e,1)},apply:function(e){for(var r in l)o.o(l,r)&&(o.m[r]=l[r]);for(var n=0;n<t.length;n++)t[n](o);for(var i in s)if(o.o(s,i)){var a=o.c[i];if(a){b=s[i];for(var c=[],f=[],p=[],h=0;h<b.length;h++){var m=b[h],v=a.hot._acceptedDependencies[m],y=a.hot._acceptedErrorHandlers[m];if(v){if(-1!==c.indexOf(v))continue;c.push(v),f.push(y),p.push(m)}}for(var g=0;g<c.length;g++)try{c[g].call(null,b)}catch(r){if("function"==typeof f[g])try{f[g](r,{moduleId:i,dependencyId:p[g]})}catch(n){d.onErrored&&d.onErrored({type:"accept-error-handler-errored",moduleId:i,dependencyId:p[g],error:n,originalError:r}),d.ignoreErrored||(e(n),e(r))}else d.onErrored&&d.onErrored({type:"accept-errored",moduleId:i,dependencyId:p[g],error:r}),d.ignoreErrored||e(r)}}}for(var w=0;w<_.length;w++){var I=_[w],E=I.module;try{I.require(E)}catch(r){if("function"==typeof I.errorHandler)try{I.errorHandler(r,{moduleId:E,module:o.c[E]})}catch(n){d.onErrored&&d.onErrored({type:"self-accept-error-handler-errored",moduleId:E,error:n,originalError:r}),d.ignoreErrored||(e(n),e(r))}else d.onErrored&&d.onErrored({type:"self-accept-errored",moduleId:E,error:r}),d.ignoreErrored||e(r)}}return u}}}this.webpackHotUpdate_flatfile_hooks=(e,n,i)=>{for(var a in n)o.o(n,a)&&(r[a]=n[a]);i&&t.push(i),d[e]&&(d[e](),d[e]=void 0)},o.hmrI.jsonp=function(e,i){r||(r={},t=[],n=[],i.push(c)),o.o(r,e)||(r[e]=o.m[e])},o.hmrC.jsonp=function(d,s,u,l,f,p){f.push(c),e={},n=s,r=u.reduce((function(e,r){return e[r]=!1,e}),{}),t=[],d.forEach((function(r){o.o(i,r)&&void 0!==i[r]&&(l.push(a(r)),e[r]=!0)})),o.f&&(o.f.jsonpHmr=function(r,n){e&&!o.o(e,r)&&o.o(i,r)&&void 0!==i[r]&&(n.push(a(r)),e[r]=!0)})},o.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(o.p+o.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})(),o(697)})()}));

@@ -11,2 +11,6 @@ import { IPayload } from '../types/IPayload';

get rows(): import("../types/Record").IRawRecord[];
get env(): {
[k: string]: any;
} | undefined;
get envSignature(): string;
}

@@ -8,3 +8,7 @@ import { IRawRecord } from './Record';

endUser?: any;
env?: {
[k: string]: any;
};
envSignature: string;
rows: IRawRecord[];
}
{
"name": "@flatfile/hooks",
"version": "1.0.0",
"description": "Flatfile data hooks helper",
"version": "1.0.1",
"description": "",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

@@ -1,36 +0,1 @@

# @flatfile/hooks
## Use
```js
const rows = [
{
rawData: {
email: 'max@mail.com',
name: 'Max'
},
rowId: 1
},
{
rawData: {
email: 'test@mail.com',
name: 'Test'
},
rowId: 2
}
]
const records = new FlatfileRecords(rows)
records.mapRecords(async (record) => {
const { email, name } = record.value
await new Promise(resolve => setTimeout(resolve, 100))
record
.set('email', email + '@mail.com')
.set('name', name + 'Test')
.set('qwe', 'qwe') // consoles an error (field doesn't exist)
.addComment(['name', 'email'], 'modified this')
.addError('email2', 'this is a test message') // consoles an error (field doesn't exist)
})
```
# @flatfile/hooks

@@ -29,2 +29,10 @@ import { IPayload } from '../types/IPayload'

}
}
get env() {
return this.payload.env
}
get envSignature() {
return this.payload.envSignature
}
}

@@ -9,4 +9,5 @@ import { IRawRecord } from './Record'

endUser?: any // TODO
env?: {[k:string]: any}
envSignature: string
rows: IRawRecord[]
}
}
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