Comparing version 0.0.4 to 0.0.5
@@ -33,2 +33,3 @@ export const SEPARATORS = { | ||
link.setAttribute('download', name); | ||
link.click(); | ||
} | ||
@@ -35,0 +36,0 @@ function escape(text) { |
@@ -1,1 +0,1 @@ | ||
(function(a,b){if('function'==typeof define&&define.amd)define(['exports'],b);else if('undefined'!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.CSV=c.exports}})(this,function(a){'use strict';function b(a){return'"'+(a+'')+'"'}Object.defineProperty(a,'__esModule',{value:!0}),a.generate=function(a){var d='';return a.header.forEach(function(a){d+=b(a.name)+c.cell}),a.processors=a.processors||Object.create(null),d+=c.row,a.body.forEach(function(e){a.header.forEach(function(f){e[f.id]&&(a.processors[f.id]?d+=b(a.processors[f.id](e[f.id])):d+=b(e[f.id])),d+=c.cell}),d+=c.row}),d},a.download=function(a,b){var c=encodeURI('data:text/csv;charset=utf-8,'+a),d=document.createElement('a');d.setAttribute('href',c),d.setAttribute('download',b)};var c=a.SEPARATORS={cell:',',row:'\n'}}); | ||
(function(a,b){if('function'==typeof define&&define.amd)define(['exports'],b);else if('undefined'!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.CSV=c.exports}})(this,function(a){'use strict';function b(a){return'"'+(a+'')+'"'}Object.defineProperty(a,'__esModule',{value:!0}),a.generate=function(a){var d='';return a.header.forEach(function(a){d+=b(a.name)+c.cell}),a.processors=a.processors||Object.create(null),d+=c.row,a.body.forEach(function(e){a.header.forEach(function(f){e[f.id]&&(a.processors[f.id]?d+=b(a.processors[f.id](e[f.id])):d+=b(e[f.id])),d+=c.cell}),d+=c.row}),d},a.download=function(a,b){var c=encodeURI('data:text/csv;charset=utf-8,'+a),d=document.createElement('a');d.setAttribute('href',c),d.setAttribute('download',b),d.click()};var c=a.SEPARATORS={cell:',',row:'\n'}}); |
{ | ||
"name": "csv-gen", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"dependencies": {}, | ||
@@ -5,0 +5,0 @@ "types": "./dist/CSV.d.ts", |
@@ -48,2 +48,3 @@ export const SEPARATORS = { | ||
link.setAttribute('download', name); | ||
link.click(); | ||
} | ||
@@ -50,0 +51,0 @@ |
4470
113