Socket
Socket
Sign inDemoInstall

json-to-csv-in-browser

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

lib/download/download.d.ts

43

lib/bundle.js

@@ -55,9 +55,44 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.download = exports.JsonArray = void 0;
var JsonArray_1 = require("./JsonArray");
exports.CsvTojson = exports.download = exports.JsonArray = void 0;
var JsonArray_1 = require("./download/JsonArray");
Object.defineProperty(exports, "JsonArray", { enumerable: true, get: function () { return JsonArray_1.JsonArray; } });
var download_1 = require("./download");
var download_1 = require("./download/download");
Object.defineProperty(exports, "download", { enumerable: true, get: function () { return download_1.download; } });
var csv_1 = __importDefault(require("./upload/csv"));
exports.CsvTojson = csv_1.default;
},{"./JsonArray":1,"./download":2}]},{},[3]);
},{"./download/JsonArray":1,"./download/download":2,"./upload/csv":4}],4:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CsvTojson = /** @class */ (function () {
function CsvTojson(_blob) {
var _this = this;
this.fileText = "";
this.headers = [];
this._blob = _blob;
var fileredear = new FileReader();
fileredear.onload = function (e) {
var _a;
_this.fileText = (_a = e.target) === null || _a === void 0 ? void 0 : _a.result;
};
fileredear.readAsText(this._blob);
this.setHeaders();
}
CsvTojson.prototype.getheaders = function () {
return this.headers;
};
CsvTojson.prototype.setHeaders = function () {
var ret = [];
var firstLineIndex = this.fileText.search("\n");
var headerLine = this.fileText.substring(0, firstLineIndex);
this.headers = headerLine.split(",");
};
return CsvTojson;
}());
exports.default = CsvTojson;
},{}]},{},[3]);

7

lib/index.d.ts

@@ -1,4 +0,5 @@

import { JsonArray } from "./JsonArray";
import { download } from "./download";
export { JsonArray, download };
import { JsonArray } from "./download/JsonArray";
import { download } from "./download/download";
import CsvTojson from "./upload/csv";
export { JsonArray, download, CsvTojson };
//# sourceMappingURL=index.d.ts.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.download = exports.JsonArray = void 0;
var JsonArray_1 = require("./JsonArray");
exports.CsvTojson = exports.download = exports.JsonArray = void 0;
var JsonArray_1 = require("./download/JsonArray");
Object.defineProperty(exports, "JsonArray", { enumerable: true, get: function () { return JsonArray_1.JsonArray; } });
var download_1 = require("./download");
var download_1 = require("./download/download");
Object.defineProperty(exports, "download", { enumerable: true, get: function () { return download_1.download; } });
var csv_1 = __importDefault(require("./upload/csv"));
exports.CsvTojson = csv_1.default;
//# sourceMappingURL=index.js.map
{
"name": "json-to-csv-in-browser",
"version": "1.0.3",
"version": "1.0.4",
"description": "This converts the json array in the browser to csv file that can be stored in disc",
"main": "lib/index.js",
"scripts": {
"dev" : "tsc -p . && cd lib && browserify index.js -o bundle.js && cd ../ && yalc publish && cd test && yalc update json-to-csv-in-browser && browserify client.js -o bundle.js"
"dev": "tsc -p . && cd lib && browserify index.js -o bundle.js && cd ../ && yalc publish && cd test && yalc update json-to-csv-in-browser && browserify client.js -o bundle.js"
},

@@ -9,0 +9,0 @@ "repository": {

@@ -1,5 +0,6 @@

import {JsonArray} from "./JsonArray"
import {download} from "./download"
import {JsonArray} from "./download/JsonArray"
import {download} from "./download/download"
import CsvTojson from "./upload/csv"
export {JsonArray, download}
export {JsonArray, download, CsvTojson}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc