Comparing version 0.20.0 to 0.21.0
/// <reference types="node" /> | ||
import XLSX, { AOA2SheetOpts, AutoFilterInfo, ColInfo, ParsingOptions, ProtectInfo, Range, RowInfo, Sheet2JSONOpts, WritingOptions } from 'xlsx'; | ||
import { AOA2SheetOpts, AutoFilterInfo, ColInfo, ParsingOptions, ProtectInfo, Range, RowInfo, Sheet2JSONOpts, WritingOptions } from 'xlsx'; | ||
export declare const parse: (mixed: unknown, options?: Sheet2JSONOpts & ParsingOptions) => { | ||
@@ -9,3 +9,3 @@ name: string; | ||
name: string; | ||
data: XLSX.Range | null; | ||
data: Range | null; | ||
}[]; | ||
@@ -36,9 +36,9 @@ export declare type WorkSheetOptions = { | ||
declare const _default: { | ||
parse: (mixed: unknown, options?: XLSX.Sheet2JSONOpts & XLSX.ParsingOptions) => { | ||
parse: (mixed: unknown, options?: Sheet2JSONOpts & ParsingOptions) => { | ||
name: string; | ||
data: unknown[]; | ||
}[]; | ||
parseMetadata: (mixed: unknown, options?: XLSX.ParsingOptions) => { | ||
parseMetadata: (mixed: unknown, options?: ParsingOptions) => { | ||
name: string; | ||
data: XLSX.Range | null; | ||
data: Range | null; | ||
}[]; | ||
@@ -45,0 +45,0 @@ build: (worksheets: WorkSheet<unknown>[], { parseOptions, writeOptions, sheetOptions, ...otherOptions }?: BuildOptions) => Buffer; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.build = exports.parseMetadata = exports.parse = void 0; | ||
const xlsx_1 = __importStar(require("xlsx")); | ||
const xlsx_1 = require("xlsx"); | ||
const helpers_1 = require("./helpers"); | ||
@@ -29,4 +10,4 @@ const workbook_1 = require("./workbook"); | ||
const workBook = (0, helpers_1.isString)(mixed) | ||
? xlsx_1.default.readFile(mixed, { dateNF, raw, ...otherOptions }) | ||
: xlsx_1.default.read(mixed, { dateNF, raw, ...otherOptions }); | ||
? (0, xlsx_1.readFile)(mixed, { dateNF, raw, ...otherOptions }) | ||
: (0, xlsx_1.read)(mixed, { dateNF, raw, ...otherOptions }); | ||
return Object.keys(workBook.Sheets).map((name) => { | ||
@@ -36,3 +17,3 @@ const sheet = workBook.Sheets[name]; | ||
name, | ||
data: xlsx_1.default.utils.sheet_to_json(sheet, { | ||
data: xlsx_1.utils.sheet_to_json(sheet, { | ||
dateNF, | ||
@@ -51,6 +32,6 @@ header, | ||
const parseMetadata = (mixed, options = {}) => { | ||
const workBook = (0, helpers_1.isString)(mixed) ? xlsx_1.default.readFile(mixed, options) : xlsx_1.default.read(mixed, options); | ||
const workBook = (0, helpers_1.isString)(mixed) ? (0, xlsx_1.readFile)(mixed, options) : (0, xlsx_1.read)(mixed, options); | ||
return Object.keys(workBook.Sheets).map((name) => { | ||
const sheet = workBook.Sheets[name]; | ||
return { name, data: sheet['!ref'] ? xlsx_1.default.utils.decode_range(sheet['!ref']) : null }; | ||
return { name, data: sheet['!ref'] ? xlsx_1.utils.decode_range(sheet['!ref']) : null }; | ||
}); | ||
@@ -77,5 +58,5 @@ }; | ||
}, new workbook_1.WorkBook()); | ||
return xlsx_1.default.write(workBook, { bookType, bookSST, type, ...otherWriteOptions }); | ||
return (0, xlsx_1.write)(workBook, { bookType, bookSST, type, ...otherWriteOptions }); | ||
}; | ||
exports.build = build; | ||
exports.default = { parse: exports.parse, parseMetadata: exports.parseMetadata, build: exports.build }; |
{ | ||
"name": "node-xlsx", | ||
"author": "Olivier Louvignes <olivier@mg-crea.com>", | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"description": "NodeJS Excel files parser & builder", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14523
160