read-excel-file 5.2.28 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +1 -1
- package/CHANGELOG.md +8 -3
- package/bundle/read-excel-file.min.js +2 -2
- package/bundle/read-excel-file.min.js.map +1 -1
- package/commonjs/package.json +1 -0
- package/commonjs/read/coordinates.js.map +1 -1
- package/commonjs/read/dropEmptyColumns.js.map +1 -1
- package/commonjs/read/dropEmptyColumns.test.js.map +1 -1
- package/commonjs/read/dropEmptyRows.js.map +1 -1
- package/commonjs/read/dropEmptyRows.test.js.map +1 -1
- package/commonjs/read/getData.js +3 -3
- package/commonjs/read/getData.js.map +1 -1
- package/commonjs/read/parseCell.js +3 -3
- package/commonjs/read/parseCell.js.map +1 -1
- package/commonjs/read/parseCellValue.js +1 -1
- package/commonjs/read/parseCellValue.js.map +1 -1
- package/commonjs/read/parseCells.js +2 -2
- package/commonjs/read/parseCells.js.map +1 -1
- package/commonjs/read/parseDate.js +39 -8
- package/commonjs/read/parseDate.js.map +1 -1
- package/commonjs/read/parseDate.test.js.map +1 -1
- package/commonjs/read/parseDimensions.js +3 -3
- package/commonjs/read/parseDimensions.js.map +1 -1
- package/commonjs/read/parseFilePaths.js +1 -1
- package/commonjs/read/parseFilePaths.js.map +1 -1
- package/commonjs/read/parseProperties.js +1 -1
- package/commonjs/read/parseProperties.js.map +1 -1
- package/commonjs/read/parseSharedStrings.js +1 -1
- package/commonjs/read/parseSharedStrings.js.map +1 -1
- package/commonjs/read/parseSheet.js +3 -3
- package/commonjs/read/parseSheet.js.map +1 -1
- package/commonjs/read/parseStyles.js +3 -3
- package/commonjs/read/parseStyles.js.map +1 -1
- package/commonjs/read/readSheetNamesBrowser.js +1 -1
- package/commonjs/read/readSheetNamesBrowser.js.map +1 -1
- package/commonjs/read/readSheetNamesNode.js +1 -1
- package/commonjs/read/readSheetNamesNode.js.map +1 -1
- package/commonjs/read/readSheetNamesNode.test.js.map +1 -1
- package/commonjs/read/readSheetNamesWebWorker.js +1 -1
- package/commonjs/read/readSheetNamesWebWorker.js.map +1 -1
- package/commonjs/read/readXlsx.js +8 -8
- package/commonjs/read/readXlsx.js.map +1 -1
- package/commonjs/read/readXlsxFileBrowser.js +3 -3
- package/commonjs/read/readXlsxFileBrowser.js.map +1 -1
- package/commonjs/read/readXlsxFileContents.js +5 -5
- package/commonjs/read/readXlsxFileContents.js.map +1 -1
- package/commonjs/read/readXlsxFileNode.js +3 -3
- package/commonjs/read/readXlsxFileNode.js.map +1 -1
- package/commonjs/read/readXlsxFileNode.test.js.map +1 -1
- package/commonjs/read/readXlsxFileWebWorker.js +3 -3
- package/commonjs/read/readXlsxFileWebWorker.js.map +1 -1
- package/commonjs/read/schema/convertMapToSchema.js +1 -1
- package/commonjs/read/schema/convertMapToSchema.js.map +1 -1
- package/commonjs/read/schema/convertMapToSchema.test.js.map +1 -1
- package/commonjs/read/schema/convertToJson.js +9 -9
- package/commonjs/read/schema/convertToJson.js.map +1 -1
- package/commonjs/read/schema/convertToJson.test.js.map +1 -1
- package/commonjs/read/unpackXlsxFileBrowser.js.map +1 -1
- package/commonjs/read/unpackXlsxFileNode.js.map +1 -1
- package/commonjs/types/Email.js.map +1 -1
- package/commonjs/types/Email.test.js.map +1 -1
- package/commonjs/types/Integer.js.map +1 -1
- package/commonjs/types/Integer.test.js.map +1 -1
- package/commonjs/types/URL.js.map +1 -1
- package/commonjs/types/URL.test.js.map +1 -1
- package/commonjs/xml/dom.js +1 -1
- package/commonjs/xml/dom.js.map +1 -1
- package/commonjs/xml/xlsx-xpath.js +7 -7
- package/commonjs/xml/xlsx-xpath.js.map +1 -1
- package/commonjs/xml/xlsx.js +8 -8
- package/commonjs/xml/xlsx.js.map +1 -1
- package/commonjs/xml/xml.js.map +1 -1
- package/commonjs/xml/xmlBrowser.js.map +1 -1
- package/commonjs/xml/xpathBrowser.js.map +1 -1
- package/commonjs/xml/xpathNode.js.map +1 -1
- package/index.cjs +7 -0
- package/index.cjs.js +12 -0
- package/index.js +6 -6
- package/modules/read/coordinates.js.map +1 -1
- package/modules/read/dropEmptyColumns.js.map +1 -1
- package/modules/read/dropEmptyColumns.test.js.map +1 -1
- package/modules/read/dropEmptyRows.js.map +1 -1
- package/modules/read/dropEmptyRows.test.js.map +1 -1
- package/modules/read/getData.js +3 -3
- package/modules/read/getData.js.map +1 -1
- package/modules/read/parseCell.js +3 -3
- package/modules/read/parseCell.js.map +1 -1
- package/modules/read/parseCellValue.js +1 -1
- package/modules/read/parseCellValue.js.map +1 -1
- package/modules/read/parseCells.js +2 -2
- package/modules/read/parseCells.js.map +1 -1
- package/modules/read/parseDate.js +39 -8
- package/modules/read/parseDate.js.map +1 -1
- package/modules/read/parseDate.test.js.map +1 -1
- package/modules/read/parseDimensions.js +3 -3
- package/modules/read/parseDimensions.js.map +1 -1
- package/modules/read/parseFilePaths.js +1 -1
- package/modules/read/parseFilePaths.js.map +1 -1
- package/modules/read/parseProperties.js +1 -1
- package/modules/read/parseProperties.js.map +1 -1
- package/modules/read/parseSharedStrings.js +1 -1
- package/modules/read/parseSharedStrings.js.map +1 -1
- package/modules/read/parseSheet.js +3 -3
- package/modules/read/parseSheet.js.map +1 -1
- package/modules/read/parseStyles.js +3 -3
- package/modules/read/parseStyles.js.map +1 -1
- package/modules/read/readSheetNamesBrowser.js +1 -1
- package/modules/read/readSheetNamesBrowser.js.map +1 -1
- package/modules/read/readSheetNamesNode.js +1 -1
- package/modules/read/readSheetNamesNode.js.map +1 -1
- package/modules/read/readSheetNamesNode.test.js.map +1 -1
- package/modules/read/readSheetNamesWebWorker.js +1 -1
- package/modules/read/readSheetNamesWebWorker.js.map +1 -1
- package/modules/read/readXlsx.js +8 -8
- package/modules/read/readXlsx.js.map +1 -1
- package/modules/read/readXlsxFileBrowser.js +3 -3
- package/modules/read/readXlsxFileBrowser.js.map +1 -1
- package/modules/read/readXlsxFileContents.js +5 -5
- package/modules/read/readXlsxFileContents.js.map +1 -1
- package/modules/read/readXlsxFileNode.js +3 -3
- package/modules/read/readXlsxFileNode.js.map +1 -1
- package/modules/read/readXlsxFileNode.test.js.map +1 -1
- package/modules/read/readXlsxFileWebWorker.js +3 -3
- package/modules/read/readXlsxFileWebWorker.js.map +1 -1
- package/modules/read/schema/convertMapToSchema.js +1 -1
- package/modules/read/schema/convertMapToSchema.js.map +1 -1
- package/modules/read/schema/convertMapToSchema.test.js.map +1 -1
- package/modules/read/schema/convertToJson.js +8 -8
- package/modules/read/schema/convertToJson.js.map +1 -1
- package/modules/read/schema/convertToJson.test.js.map +1 -1
- package/modules/read/unpackXlsxFileBrowser.js.map +1 -1
- package/modules/read/unpackXlsxFileNode.js.map +1 -1
- package/modules/types/Email.js.map +1 -1
- package/modules/types/Email.test.js.map +1 -1
- package/modules/types/Integer.js.map +1 -1
- package/modules/types/Integer.test.js.map +1 -1
- package/modules/types/URL.js.map +1 -1
- package/modules/types/URL.test.js.map +1 -1
- package/modules/xml/dom.js.map +1 -1
- package/modules/xml/xlsx-xpath.js.map +1 -1
- package/modules/xml/xlsx.js +1 -1
- package/modules/xml/xlsx.js.map +1 -1
- package/modules/xml/xml.js.map +1 -1
- package/modules/xml/xmlBrowser.js.map +1 -1
- package/modules/xml/xpathBrowser.js.map +1 -1
- package/modules/xml/xpathNode.js.map +1 -1
- package/node/index.cjs +7 -0
- package/node/index.cjs.js +12 -0
- package/node/index.js +6 -6
- package/node/package.json +9 -1
- package/package.json +46 -23
- package/{rollup.config.js → rollup.config.mjs} +0 -0
- package/runnable/create-commonjs-package-json.js +11 -0
- package/schema/{index.commonjs.js → index.cjs} +2 -2
- package/schema/index.cjs.js +7 -0
- package/schema/index.js +1 -1
- package/schema/package.json +9 -1
- package/web-worker/index.cjs +7 -0
- package/web-worker/index.cjs.js +12 -0
- package/web-worker/index.js +6 -6
- package/web-worker/package.json +9 -1
- package/babel.js +0 -5
- package/index.commonjs.js +0 -7
- package/node/index.commonjs.js +0 -7
- package/web-worker/index.commonjs.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"read-excel-file/commonjs","type":"commonjs","private":true}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"coordinates.js","names":["LETTERS","calculateDimensions","cells","comparator","a","b","allRows","map","cell","row","sort","allCols","column","minRow","maxRow","length","minCol","maxCol","columnLettersToNumber","columnLetters","n","i","indexOf","parseCellCoordinates","coords","split","parseInt","trim"],"sources":["../../source/read/coordinates.js"],"sourcesContent":["// Maps \"A1\"-like coordinates to `{ row, column }` numeric coordinates.\r\nconst LETTERS = [\"\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"]\r\n\r\nexport function calculateDimensions (cells) {\r\n const comparator = (a, b) => a - b\r\n const allRows = cells.map(cell => cell.row).sort(comparator)\r\n const allCols = cells.map(cell => cell.column).sort(comparator)\r\n const minRow = allRows[0]\r\n const maxRow = allRows[allRows.length - 1]\r\n const minCol = allCols[0]\r\n const maxCol = allCols[allCols.length - 1]\r\n\r\n return [\r\n { row: minRow, column: minCol },\r\n { row: maxRow, column: maxCol }\r\n ]\r\n}\r\n\r\n// Converts a letter coordinate to a digit coordinate.\r\n// Examples: \"A\" -> 1, \"B\" -> 2, \"Z\" -> 26, \"AA\" -> 27, etc.\r\nfunction columnLettersToNumber(columnLetters) {\r\n // `for ... of ...` would require Babel polyfill for iterating a string.\r\n let n = 0\r\n let i = 0\r\n while (i < columnLetters.length) {\r\n n *= 26\r\n n += LETTERS.indexOf(columnLetters[i])\r\n i++\r\n }\r\n return n\r\n}\r\n\r\nexport function parseCellCoordinates(coords) {\r\n // Coordinate examples: \"AA2091\", \"R988\", \"B1\".\r\n coords = coords.split(/(\\d+)/)\r\n return [\r\n // Row.\r\n parseInt(coords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AAeD,MAAM,EAAEI;EAAvB,CADK,EAEL;IAAEP,GAAG,EAAEK,MAAP;IAAeF,MAAM,EAAEK;EAAvB,CAFK,CAAP;AAID,C,CAED;AACA;;;AACA,SAASC,qBAAT,CAA+BC,aAA/B,EAA8C;EAC5C;EACA,IAAIC,CAAC,GAAG,CAAR;EACA,IAAIC,CAAC,GAAG,CAAR;;EACA,OAAOA,CAAC,GAAGF,aAAa,CAACJ,MAAzB,EAAiC;IAC/BK,CAAC,IAAI,EAAL;IACAA,CAAC,IAAIpB,OAAO,CAACsB,OAAR,CAAgBH,aAAa,CAACE,CAAD,CAA7B,CAAL;IACAA,CAAC;EACF;;EACD,OAAOD,CAAP;AACD;;AAEM,SAASG,oBAAT,CAA8BC,MAA9B,EAAsC;EAC3C;EACAA,MAAM,GAAGA,MAAM,CAACC,KAAP,CAAa,OAAb,CAAT;EACA,OAAO,CACL;EACAC,QAAQ,CAACF,MAAM,CAAC,CAAD,CAAP,CAFH,EAGL;EACAN,qBAAqB,CAACM,MAAM,CAAC,CAAD,CAAN,CAAUG,IAAV,EAAD,CAJhB,CAAP;AAMD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"dropEmptyColumns.js","names":["dropEmptyColumns","data","accessor","_","onlyTrimAtTheEnd","i","length","empty","row","j","splice"],"sources":["../../source/read/dropEmptyColumns.js"],"sourcesContent":["export default function dropEmptyColumns(data, {\r\n accessor = _ => _,\r\n onlyTrimAtTheEnd\r\n} = {}) {\r\n let i = data[0].length - 1\r\n while (i >= 0) {\r\n let empty = true\r\n for (const row of data) {\r\n if (accessor(row[i]) !== null) {\r\n empty = false\r\n break\r\n }\r\n }\r\n if (empty) {\r\n let j = 0;\r\n while (j < data.length) {\r\n data[j].splice(i, 1)\r\n j++\r\n }\r\n } else if (onlyTrimAtTheEnd) {\r\n break\r\n }\r\n i--\r\n }\r\n return data\r\n}"],"mappings":";;;;;;;;;;;;;AAAe,SAASA,gBAAT,CAA0BC,IAA1B,EAGP;EAAA,+EAAJ,EAAI;EAAA,yBAFNC,QAEM;EAAA,IAFNA,QAEM,8BAFK,UAAAC,CAAC;IAAA,OAAIA,CAAJ;EAAA,CAEN;EAAA,IADNC,gBACM,QADNA,gBACM;;EACN,IAAIC,CAAC,GAAGJ,IAAI,CAAC,CAAD,CAAJ,CAAQK,MAAR,GAAiB,CAAzB;;EACA,OAAOD,CAAC,IAAI,CAAZ,EAAe;IACb,IAAIE,KAAK,GAAG,IAAZ;;IACA,qDAAkBN,IAAlB,wCAAwB;MAAA,IAAbO,GAAa;;MACtB,IAAIN,QAAQ,CAACM,GAAG,CAACH,CAAD,CAAJ,CAAR,KAAqB,IAAzB,EAA+B;QAC7BE,KAAK,GAAG,KAAR;QACA;MACD;IACF;;IACD,IAAIA,KAAJ,EAAW;MACT,IAAIE,CAAC,GAAG,CAAR;;MACA,OAAOA,CAAC,GAAGR,IAAI,CAACK,MAAhB,EAAwB;QACtBL,IAAI,CAACQ,CAAD,CAAJ,CAAQC,MAAR,CAAeL,CAAf,EAAkB,CAAlB;QACAI,CAAC;MACF;IACF,CAND,MAMO,IAAIL,gBAAJ,EAAsB;MAC3B;IACD;;IACDC,CAAC;EACF;;EACD,OAAOJ,IAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"dropEmptyColumns.test.js","names":["describe","it","dropEmptyColumns","onlyTrimAtTheEnd","should","deep","equal"],"sources":["../../source/read/dropEmptyColumns.test.js"],"sourcesContent":["import dropEmptyColumns from './dropEmptyColumns.js'\r\n\r\ndescribe('dropEmptyColumns', () => {\r\n\tit('should drop empty columns (only at the end)', () => {\r\n\t\tdropEmptyColumns([\r\n\t\t\t[null, 'A', 'B', 'C', null, null],\r\n\t\t\t[null, 'D', null, null, null, null],\r\n\t\t\t[null, null, null, null, null, null],\r\n\t\t\t[null, null, 'E', 'F', 'G', null]\r\n\t\t], {\r\n\t\t\tonlyTrimAtTheEnd: true\r\n\t\t})\r\n\t\t.should.deep.equal([\r\n\t\t\t[null, 'A', 'B', 'C', null],\r\n\t\t\t[null, 'D', null, null, null],\r\n\t\t\t[null, null, null, null, null],\r\n\t\t\t[null, null, 'E', 'F', 'G']\r\n\t\t])\r\n\t})\r\n\r\n\tit('should drop empty columns', () => {\r\n\t\tdropEmptyColumns([\r\n\t\t\t[null, 'A', 'B', 'C', null, null],\r\n\t\t\t[null, 'D', null, null, null, null],\r\n\t\t\t[null, null, null, null, null, null],\r\n\t\t\t[null, null, 'E', 'F', 'G', null]\r\n\t\t])\r\n\t\t.should.deep.equal([\r\n\t\t\t['A', 'B', 'C', null],\r\n\t\t\t['D', null, null, null],\r\n\t\t\t[null, null, null, null],\r\n\t\t\t[null, 'E', 'F', 'G']\r\n\t\t])\r\n\t})\r\n})"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,kBAAD,EAAqB,YAAM;EAClCC,EAAE,CAAC,6CAAD,EAAgD,YAAM;IACvD,IAAAC,4BAAA,EAAiB,CAChB,CAAC,IAAD,EAAO,GAAP,EAAY,GAAZ,EAAiB,GAAjB,EAAsB,IAAtB,EAA4B,IAA5B,CADgB,EAEhB,CAAC,IAAD,EAAO,GAAP,EAAY,IAAZ,EAAkB,IAAlB,EAAwB,IAAxB,EAA8B,IAA9B,CAFgB,EAGhB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,EAA+B,IAA/B,CAHgB,EAIhB,CAAC,IAAD,EAAO,IAAP,EAAa,GAAb,EAAkB,GAAlB,EAAuB,GAAvB,EAA4B,IAA5B,CAJgB,CAAjB,EAKG;MACFC,gBAAgB,EAAE;IADhB,CALH,EAQCC,MARD,CAQQC,IARR,CAQaC,KARb,CAQmB,CAClB,CAAC,IAAD,EAAO,GAAP,EAAY,GAAZ,EAAiB,GAAjB,EAAsB,IAAtB,CADkB,EAElB,CAAC,IAAD,EAAO,GAAP,EAAY,IAAZ,EAAkB,IAAlB,EAAwB,IAAxB,CAFkB,EAGlB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAHkB,EAIlB,CAAC,IAAD,EAAO,IAAP,EAAa,GAAb,EAAkB,GAAlB,EAAuB,GAAvB,CAJkB,CARnB;EAcA,CAfC,CAAF;EAiBAL,EAAE,CAAC,2BAAD,EAA8B,YAAM;IACrC,IAAAC,4BAAA,EAAiB,CAChB,CAAC,IAAD,EAAO,GAAP,EAAY,GAAZ,EAAiB,GAAjB,EAAsB,IAAtB,EAA4B,IAA5B,CADgB,EAEhB,CAAC,IAAD,EAAO,GAAP,EAAY,IAAZ,EAAkB,IAAlB,EAAwB,IAAxB,EAA8B,IAA9B,CAFgB,EAGhB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,EAA+B,IAA/B,CAHgB,EAIhB,CAAC,IAAD,EAAO,IAAP,EAAa,GAAb,EAAkB,GAAlB,EAAuB,GAAvB,EAA4B,IAA5B,CAJgB,CAAjB,EAMCE,MAND,CAMQC,IANR,CAMaC,KANb,CAMmB,CAClB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgB,IAAhB,CADkB,EAElB,CAAC,GAAD,EAAM,IAAN,EAAY,IAAZ,EAAkB,IAAlB,CAFkB,EAGlB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAHkB,EAIlB,CAAC,IAAD,EAAO,GAAP,EAAY,GAAZ,EAAiB,GAAjB,CAJkB,CANnB;EAYA,CAbC,CAAF;AAcA,CAhCO,CAAR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"dropEmptyRows.js","names":["dropEmptyRows","data","rowMap","accessor","_","onlyTrimAtTheEnd","i","length","empty","cell","splice"],"sources":["../../source/read/dropEmptyRows.js"],"sourcesContent":["export default function dropEmptyRows(data, {\r\n rowMap,\r\n accessor = _ => _,\r\n onlyTrimAtTheEnd\r\n} = {}) {\r\n // Drop empty rows.\r\n let i = data.length - 1\r\n while (i >= 0) {\r\n // Check if the row is empty.\r\n let empty = true\r\n for (const cell of data[i]) {\r\n if (accessor(cell) !== null) {\r\n empty = false\r\n break\r\n }\r\n }\r\n // Remove the empty row.\r\n if (empty) {\r\n data.splice(i, 1)\r\n if (rowMap) {\r\n rowMap.splice(i, 1)\r\n }\r\n } else if (onlyTrimAtTheEnd) {\r\n break\r\n }\r\n i--\r\n }\r\n return data\r\n}"],"mappings":";;;;;;;;;;;;;AAAe,SAASA,aAAT,CAAuBC,IAAvB,EAIP;EAAA,+EAAJ,EAAI;EAAA,IAHNC,MAGM,QAHNA,MAGM;EAAA,yBAFNC,QAEM;EAAA,IAFNA,QAEM,8BAFK,UAAAC,CAAC;IAAA,OAAIA,CAAJ;EAAA,CAEN;EAAA,IADNC,gBACM,QADNA,gBACM;;EACN;EACA,IAAIC,CAAC,GAAGL,IAAI,CAACM,MAAL,GAAc,CAAtB;;EACA,OAAOD,CAAC,IAAI,CAAZ,EAAe;IACb;IACA,IAAIE,KAAK,GAAG,IAAZ;;IACA,qDAAmBP,IAAI,CAACK,CAAD,CAAvB,wCAA4B;MAAA,IAAjBG,IAAiB;;MAC1B,IAAIN,QAAQ,CAACM,IAAD,CAAR,KAAmB,IAAvB,EAA6B;QAC3BD,KAAK,GAAG,KAAR;QACA;MACD;IACF,CARY,CASb;;;IACA,IAAIA,KAAJ,EAAW;MACTP,IAAI,CAACS,MAAL,CAAYJ,CAAZ,EAAe,CAAf;;MACA,IAAIJ,MAAJ,EAAY;QACVA,MAAM,CAACQ,MAAP,CAAcJ,CAAd,EAAiB,CAAjB;MACD;IACF,CALD,MAKO,IAAID,gBAAJ,EAAsB;MAC3B;IACD;;IACDC,CAAC;EACF;;EACD,OAAOL,IAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"dropEmptyRows.test.js","names":["describe","it","dropEmptyRows","onlyTrimAtTheEnd","should","deep","equal","rowMap"],"sources":["../../source/read/dropEmptyRows.test.js"],"sourcesContent":["import dropEmptyRows from './dropEmptyRows.js'\r\n\r\ndescribe('dropEmptyRows', () => {\r\n\tit('should drop empty rows (only at the end)', () => {\r\n\t\tdropEmptyRows([\r\n\t\t\t[null, null, null],\r\n\t\t\t['A', 'B', 'C'],\r\n\t\t\t[null, 'D', null],\r\n\t\t\t[null, null, null],\r\n\t\t\t['E', 'F', 'G'],\r\n\t\t\t[null, null, null]\r\n\t\t], {\r\n\t\t\tonlyTrimAtTheEnd: true\r\n\t\t})\r\n\t\t.should.deep.equal([\r\n\t\t\t[null, null, null],\r\n\t\t\t['A', 'B', 'C'],\r\n\t\t\t[null, 'D', null],\r\n\t\t\t[null, null, null],\r\n\t\t\t['E', 'F', 'G']\r\n\t\t])\r\n\t})\r\n\r\n\tit('should drop empty rows', () => {\r\n\t\tdropEmptyRows([\r\n\t\t\t[null, null, null],\r\n\t\t\t['A', 'B', 'C'],\r\n\t\t\t[null, 'D', null],\r\n\t\t\t[null, null, null],\r\n\t\t\t['E', 'F', 'G'],\r\n\t\t\t[null, null, null]\r\n\t\t])\r\n\t\t.should.deep.equal([\r\n\t\t\t['A', 'B', 'C'],\r\n\t\t\t[null, 'D', null],\r\n\t\t\t['E', 'F', 'G']\r\n\t\t])\r\n\t})\r\n\r\n\tit('should generate row map when dropping empty rows', () => {\r\n\t\tconst rowMap = [0, 1, 2, 3, 4]\r\n\r\n\t\tdropEmptyRows([\r\n\t\t\t[null, null, null],\r\n\t\t\t['A', 'B', 'C'],\r\n\t\t\t[null, 'D', null],\r\n\t\t\t[null, null, null],\r\n\t\t\t['E', 'F', 'G']\r\n\t\t],\r\n\t\t{ rowMap })\r\n\t\t.should.deep.equal([\r\n\t\t\t['A', 'B', 'C'],\r\n\t\t\t[null, 'D', null],\r\n\t\t\t['E', 'F', 'G']\r\n\t\t])\r\n\r\n\t\trow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GAAD,EAAM,GAAN,EAAW,GAAX,CADkB,EAElB,CAAC,IAAD,EAAO,GAAP,EAAY,IAAZ,CAFkB,EAGlB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAHkB,CARnB;EAaA,CAdC,CAAF;EAgBAL,EAAE,CAAC,kDAAD,EAAqD,YAAM;IAC5D,IAAMM,MAAM,GAAG,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,CAAf;IAEA,IAAAL,yBAAA,EAAc,CACb,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,CADa,EAEb,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAFa,EAGb,CAAC,IAAD,EAAO,GAAP,EAAY,IAAZ,CAHa,EAIb,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,CAJa,EAKb,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CALa,CAAd,EAOA;MAAEK,MAAM,EAANA;IAAF,CAPA,EAQCH,MARD,CAQQC,IARR,CAQaC,KARb,CAQmB,CAClB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CADkB,EAElB,CAAC,IAAD,EAAO,GAAP,EAAY,IAAZ,CAFkB,EAGlB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAHkB,CARnB;IAcAC,MAAM,CAACH,MAAP,CAAcC,IAAd,CAAmBC,KAAnB,CAAyB,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAAzB;EACA,CAlBC,CAAF;AAmBA,CAxDO,CAAR"}
|
package/commonjs/read/getData.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = getData;
|
|
7
7
|
|
|
8
|
-
var _dropEmptyRows = _interopRequireDefault(require("./dropEmptyRows"));
|
|
8
|
+
var _dropEmptyRows = _interopRequireDefault(require("./dropEmptyRows.js"));
|
|
9
9
|
|
|
10
|
-
var _dropEmptyColumns = _interopRequireDefault(require("./dropEmptyColumns"));
|
|
10
|
+
var _dropEmptyColumns = _interopRequireDefault(require("./dropEmptyColumns.js"));
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
21
21
|
|
|
22
22
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
23
23
|
|
|
24
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
25
25
|
|
|
26
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"getData.js","names":["getData","sheet","options","dimensions","cells","length","leftTop","rightBottom","colsCount","column","rowsCount","row","data","Array","i","j","cell","rowIndex","columnIndex","value","rowMap","dropEmptyRows","dropEmptyColumns","onlyTrimAtTheEnd","transformData"],"sources":["../../source/read/getData.js"],"sourcesContent":["import dropEmptyRows from './dropEmptyRows.js'\r\nimport dropEmptyColumns from './dropEmptyColumns.js'\r\n\r\nexport default function getData(sheet, options) {\r\n const { dimensions, cells } = sheet\r\n\r\n // If the sheet is empty.\r\n if (cells.length === 0) {\r\n return []\r\n }\r\n\r\n const [leftTop, rightBottom] = dimensions\r\n\r\n // Don't discard empty rows or columns at the start.\r\n // https://github.com/catamphetamine/read-excel-file/issues/102\r\n // const colsCount = (rightBottom.column - leftTop.column) + 1\r\n // const rowsCount = (rightBottom.row - leftTop.row) + 1\r\n\r\n const colsCount = rightBottom.column\r\n const rowsCount = rightBottom.row\r\n\r\n // Initialize spreadsheet data structure.\r\n let data = new Array(rowsCount)\r\n let i = 0\r\n while (i < rowsCount) {\r\n data[i] = new Array(colsCount)\r\n let j = 0\r\n while (j < colsCount) {\r\n data[i][j] = null\r\n j++\r\n }\r\n i++\r\n }\r\n\r\n // Fill in spreadsheet `data`.\r\n // (this code implies that `cells` aren't necessarily sorted by row and column:\r\n // maybe that's not correct, this piece code was initially copy-pasted\r\n // from some other library that used `XPath`)\r\n for (const cell of cells) {\r\n // Don't discard empty rows or columns at the start.\r\n // https://github.com/catamphetamine/read-excel-file/issues/102\r\n // const rowIndex = cell.row - leftTop.row\r\n // const columnIndex = cell.column - leftTop.column\r\n const rowIndex = cell.row - 1\r\n const columnIndex = cell.column - 1\r\n // Ignore the data in the cell if it's outside of the spreadsheet's \"dimensions\".\r\n if (columnIndex < colsCount && rowIndex < rowsCount) {\r\n data[rowIndex][columnIndex] = cell.value\r\n }\r\n }\r\n\r\n // Fill in the row map.\r\n const { rowMap } = options\r\n if (rowMap) {\r\n let i = 0\r\n while (i < data.length) {\r\n rowMap[i] = i\r\n i++\r\n }\r\n }\r\n\r\n // Drop empty columns or rows.\r\n data = dropEmptyRows(\r\n dropEmptyColumns(data, { onlyTrimAtTheEnd: true }),\r\n { onlyTrimAtTheEnd: true, rowMap }\r\n )\r\n\r\n // Optionally transform data before applying `schema`.\r\n if (options.transformData) {\r\n data = options.transformData(data)\r\n // data = options.transformData(data, {\r\n // dropEmptyRowsAndColumns(data) {\r\n // return dropEmptyRows(dropEmptyColumns(data), { rowMap })\r\n // }\r\n // })\r\n }\r\n\r\n return data\r\n}"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;;;;;;;;;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R,GAAmBlB,OAAnB,CAAQkB,MAAR;;EACA,IAAIA,MAAJ,EAAY;IACV,IAAIN,GAAC,GAAG,CAAR;;IACA,OAAOA,GAAC,GAAGF,IAAI,CAACP,MAAhB,EAAwB;MACtBe,MAAM,CAACN,GAAD,CAAN,GAAYA,GAAZ;MACAA,GAAC;IACF;EACF,CAxD6C,CA0D9C;;;EACAF,IAAI,GAAG,IAAAS,yBAAA,EACL,IAAAC,4BAAA,EAAiBV,IAAjB,EAAuB;IAAEW,gBAAgB,EAAE;EAApB,CAAvB,CADK,EAEL;IAAEA,gBAAgB,EAAE,IAApB;IAA0BH,MAAM,EAANA;EAA1B,CAFK,CAAP,CA3D8C,CAgE9C;;EACA,IAAIlB,OAAO,CAACsB,aAAZ,EAA2B;IACzBZ,IAAI,GAAGV,OAAO,CAACsB,aAAR,CAAsBZ,IAAtB,CAAP,CADyB,CAEzB;IACA;IACA;IACA;IACA;EACD;;EAED,OAAOA,IAAP;AACD"}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = parseCell;
|
|
7
7
|
|
|
8
|
-
var _parseCellValue = _interopRequireDefault(require("./parseCellValue"));
|
|
8
|
+
var _parseCellValue = _interopRequireDefault(require("./parseCellValue.js"));
|
|
9
9
|
|
|
10
|
-
var _coordinates = require("./coordinates");
|
|
10
|
+
var _coordinates = require("./coordinates.js");
|
|
11
11
|
|
|
12
|
-
var _xlsx = require("../xml/xlsx");
|
|
12
|
+
var _xlsx = require("../xml/xlsx.js");
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseCell.js","names":["parseCell","node","sheet","xml","values","styles","properties","options","coords","parseCellCoordinates","getAttribute","valueElement","getCellValue","value","textContent","type","hasAttribute","row","column","parseCellValue","getInlineStringValue","getCellInlineStringValue","getStyleId"],"sources":["../../source/read/parseCell.js"],"sourcesContent":["import parseCellValue from './parseCellValue.js'\r\n\r\nimport {\r\n parseCellCoordinates\r\n} from './coordinates.js'\r\n\r\nimport {\r\n getCellValue,\r\n getCellInlineStringValue\r\n} from '../xml/xlsx.js'\r\n\r\n// Example of a `<c/>`ell element:\r\n//\r\n// <c>\r\n// <f>string</f> — formula.\r\n// <v>string</v> — formula pre-computed value.\r\n// <is>\r\n// <t>string</t> — an `inlineStr` string (rather than a \"common string\" from a dictionary).\r\n// <r>\r\n// <rPr>\r\n// ...\r\n// </rPr>\r\n// <t>string</t>\r\n// </r>\r\n// <rPh sb=\"1\" eb=\"1\">\r\n// <t>string</t>\r\n// </rPh>\r\n// <phoneticPr fontId=\"1\"/>\r\n// </is>\r\n// <extLst>\r\n// <ext>\r\n// <!--any element-->\r\n// </ext>\r\n// </extLst>\r\n// </c>\r\n//\r\nexport default function parseCell(node, sheet, xml, values, styles, properties, options) {\r\n const coords = parseCellCoordinates(node.getAttribute('r'))\r\n\r\n const valueElement = getCellValue(sheet, node)\r\n\r\n // For `xpath`, `value` can be `undefined` while for native `DOMParser` it's `null`.\r\n // So using `value && ...` instead of `if (value !== undefined) { ... }` here\r\n // for uniform compatibility with both `xpath` and native `DOMParser`.\r\n let value = valueElement && valueElement.textContent\r\n\r\n let type\r\n if (node.hasAttribute('t')) {\r\n type = node.getAttribute('t')\r\n }\r\n\r\n return {\r\n row: coords[0],\r\n column: coords[1],\r\n value: parseCellValue(value, type, {\r\n getInlineStringValue: () => getCellInlineStringValue(sheet, node),\r\n getStyleId: () => node.getAttribute('s'),\r\n styles,\r\n values,\r\n properties,\r\n options\r\n })\r\n }\r\n}"],"mappings":";;;;;;;AAAA;;AAEA;;AAIA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,SAAT,CAAmBC,IAAnB,EAAyBC,KAAzB,EAAgCC,GAAhC,EAAqCC,MAArC,EAA6CC,MAA7C,EAAqDC,UAArD,EAAiEC,OAAjE,EAA0E;EACvF,IAAMC,MAAM,GAAG,IAAAC,iCAAA,EAAqBR,IAAI,CAACS,YAAL,CAAkB,GAAlB,CAArB,CAAf;EAEA,IAAMC,YAAY,GAAG,IAAAC,kBAAA,EAAaV,KAAb,EAAoBD,IAApB,CAArB,CAHuF,CAKvF;EACA;EACA;;EACA,IAAIY,KAAK,GAAGF,YAAY,IAAIA,YAAY,CAACG,WAAzC;EAEA,IAAIC,IAAJ;;EACA,IAAId,IAAI,CAACe,YAAL,CAAkB,GAAlB,CAAJ,EAA4B;IAC1BD,IAAI,GAAGd,IAAI,CAACS,YAAL,CAAkB,GAAlB,CAAP;EACD;;EAED,OAAO;IACLO,GAAG,EAAET,MAAM,CAAC,CAAD,CADN;IAELU,MAAM,EAAEV,MAAM,CAAC,CAAD,CAFT;IAGLK,KAAK,EAAE,IAAAM,0BAAA,EAAeN,KAAf,EAAsBE,IAAtB,EAA4B;MACjCK,oBAAoB,EAAE;QAAA,OAAM,IAAAC,8BAAA,EAAyBnB,KAAzB,EAAgCD,IAAhC,CAAN;MAAA,CADW;MAEjCqB,UAAU,EAAE;QAAA,OAAMrB,IAAI,CAACS,YAAL,CAAkB,GAAlB,CAAN;MAAA,CAFqB;MAGjCL,MAAM,EAANA,MAHiC;MAIjCD,MAAM,EAANA,MAJiC;MAKjCE,UAAU,EAAVA,UALiC;MAMjCC,OAAO,EAAPA;IANiC,CAA5B;EAHF,CAAP;AAYD"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = getCellValue;
|
|
7
7
|
|
|
8
|
-
var _parseDate = _interopRequireDefault(require("./parseDate"));
|
|
8
|
+
var _parseDate = _interopRequireDefault(require("./parseDate.js"));
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../source/read/parseCellValue.js"],"names":["BUILT_IN_DATE_NUMBER_FORMAT_IDS","getCellValue","value","type","getInlineStringValue","getStyleId","styles","values","properties","options","trim","undefined","Error","parseInt","decodeError","Date","parseFloat","styleId","style","indexOf","numberFormat","id","dateFormat","template","smartDateParser","isDateTemplate","TypeError","errorCode","toLowerCase","tokens","split","token","DATE_TEMPLATE_TOKENS"],"mappings":";;;;;;;AAAA;;;;;;;;;;AAEA;AACA,IAAMA,+BAA+B,GAAG,CAAC,EAAD,EAAI,EAAJ,EAAO,EAAP,EAAU,EAAV,EAAa,EAAb,EAAgB,EAAhB,EAAmB,EAAnB,EAAsB,EAAtB,EAAyB,EAAzB,EAA4B,EAA5B,EAA+B,EAA/B,EAAkC,EAAlC,EAAqC,EAArC,EAAwC,EAAxC,EAA2C,EAA3C,EAA8C,EAA9C,EAAiD,EAAjD,CAAxC;;AAEe,SAASC,YAAT,CAAsBC,KAAtB,EAA6BC,IAA7B,QAOZ;AAAA,MANFC,oBAME,QANFA,oBAME;AAAA,MALFC,UAKE,QALFA,UAKE;AAAA,MAJFC,MAIE,QAJFA,MAIE;AAAA,MAHFC,MAGE,QAHFA,MAGE;AAAA,MAFFC,UAEE,QAFFA,UAEE;AAAA,MADFC,OACE,QADFA,OACE;;AACD,MAAI,CAACN,IAAL,EAAW;AACT;AACA;AACAA,IAAAA,IAAI,GAAG,GAAP;AACD,GALA,CAOD;AACA;AACA;AACA;AACA;AACA;;;AACA,UAAQA,IAAR;AACE;AACA,SAAK,KAAL;AACED,MAAAA,KAAK,GAAGA,KAAK,CAACQ,IAAN,EAAR;;AACA,UAAIR,KAAK,KAAK,EAAd,EAAkB;AAChBA,QAAAA,KAAK,GAAGS,SAAR;AACD;;AACD;AAEF;;AACA,SAAK,WAAL;AACET,MAAAA,KAAK,GAAGE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AAe,KAAf,CAAf;;AACA,uDAAoBD,MAApB,wCAA4B;AAAA,QAAjBE,KAAiB;;AAC1B,QAAIC,oBAAoB,CAACb,OAArB,CAA6BY,KAA7B,IAAsC,CAA1C,EAA6C;AAC3C,aAAO,KAAP;AACD;AACF;;AACD,SAAO,IAAP;AACD,C,CAED;AACA;;;AACA,IAAMC,oBAAoB,GAAG,CAC3B;AACA,IAF2B,EAG3B;AACA,IAJ2B,EAK3B;AACA,GAN2B,EAO3B;AACA,IAR2B,EAS3B;AACA,IAV2B,EAW3B;AACA,IAZ2B,EAa3B;AACA,GAd2B,EAe3B;AACA,IAhB2B,EAiB3B;AACA,GAlB2B,EAmB3B;AACA,IApB2B,EAqB3B;AACA,KAtB2B,EAuB3B;AACA,MAxB2B,EAyB3B;AACA,IA1B2B,EA2B3B;AACA,MA5B2B,CAA7B","sourcesContent":["import parseDate from './parseDate'\r\n\r\n// https://hexdocs.pm/xlsxir/number_styles.html\r\nconst BUILT_IN_DATE_NUMBER_FORMAT_IDS = [14,15,16,17,18,19,20,21,22,27,30,36,45,46,47,50,57]\r\n\r\nexport default function getCellValue(value, type, {\r\n\tgetInlineStringValue,\r\n\tgetStyleId,\r\n\tstyles,\r\n\tvalues,\r\n\tproperties,\r\n\toptions\r\n}) {\r\n if (!type) {\r\n // Default cell type is \"n\" (numeric).\r\n // http://www.datypic.com/sc/ooxml/t-ssml_CT_Cell.html\r\n type = 'n'\r\n }\r\n\r\n // Available Excel cell types:\r\n // https://github.com/SheetJS/sheetjs/blob/19620da30be2a7d7b9801938a0b9b1fd3c4c4b00/docbits/52_datatype.md\r\n //\r\n // Some other document (seems to be old):\r\n // http://webapp.docx4java.org/OnlineDemo/ecma376/SpreadsheetML/ST_CellType.html\r\n //\r\n switch (type) {\r\n // If the cell contains formula string.\r\n case 'str':\r\n value = value.trim()\r\n if (value === '') {\r\n value = undefined\r\n }\r\n break\r\n\r\n // If the cell contains an \"inline\" (not \"shared\") string.\r\n case 'inlineStr':\r\n value = getInlineStringValue()\r\n if (value === undefined) {\r\n throw new Error(`Unsupported \"inline string\" cell value structure`) // : ${cellNode.textContent}`)\r\n }\r\n value = value.trim()\r\n if (value === '') {\r\n value = undefined\r\n }\r\n break\r\n\r\n // If the cell contains a \"shared\" string.\r\n // \"Shared\" strings is a way for an Excel editor to reduce\r\n // the file size by storing \"commonly used\" strings in a dictionary\r\n // and then referring to such strings by their index in that dictionary.\r\n case 's':\r\n // If a cell has no value then there's no `<c/>` element for it.\r\n // If a `<c/>` element exists then it's not empty.\r\n // The `<v/>`alue is a key in the \"shared strings\" dictionary of the\r\n // XLSX file, so look it up in the `values` dictionary by the numeric key.\r\n value = values[parseInt(value)]\r\n value = value.trim()\r\n if (value === '') {\r\n value = undefined\r\n }\r\n break\r\n\r\n case 'b':\r\n value = value === '1' ? true : false\r\n break\r\n\r\n // Stub: blank stub cell that is ignored by data processing utilities.\r\n case 'z':\r\n value = undefined\r\n break\r\n\r\n // Error: `value` is a numeric code.\r\n // They also wrote: \"and `w` property stores its common name\".\r\n // It's unclear what they meant by that.\r\n case 'e':\r\n value = decodeError(value)\r\n break\r\n\r\n // Date: a string to be parsed as a date.\r\n // (usually a string in \"ISO 8601\" format)\r\n case 'd':\r\n if (value === undefined) {\r\n break\r\n }\r\n value = new Date(value)\r\n break\r\n\r\n case 'n':\r\n if (value === undefined) {\r\n break\r\n }\r\n value = parseFloat(value)\r\n // XLSX does have \"d\" type for dates, but it's not commonly used.\r\n // Instead, spreadsheets prefer using \"n\" type for dates for some reason.\r\n //\r\n // In such cases, sometimes a \"date\" type could be heuristically detected\r\n // by looking at such numeric value \"format\" and seeing if it's a date-specific one.\r\n // https://github.com/catamphetamine/read-excel-file/issues/3#issuecomment-395770777\r\n //\r\n // The list of generic numeric value \"formats\":\r\n // https://xlsxwriter.readthedocs.io/format.html#format-set-num-format\r\n //\r\n const styleId = getStyleId()\r\n if (styleId) {\r\n // styleId = parseInt(styleId)\r\n const style = styles[styleId]\r\n if (!style) {\r\n throw new Error(`Cell style not found: ${styleId}`)\r\n }\r\n if (BUILT_IN_DATE_NUMBER_FORMAT_IDS.indexOf(parseInt(style.numberFormat.id)) >= 0 ||\r\n (options.dateFormat && style.numberFormat.template === options.dateFormat) ||\r\n (options.smartDateParser !== false && style.numberFormat.template && isDateTemplate(style.numberFormat.template))) {\r\n value = parseDate(value, properties)\r\n }\r\n }\r\n break\r\n\r\n default:\r\n throw new TypeError(`Cell type not supported: ${type}`)\r\n }\r\n\r\n // Convert empty values to `null`.\r\n if (value === undefined) {\r\n value = null\r\n }\r\n\r\n return value\r\n}\r\n\r\n// Decodes numeric error code to a string code.\r\n// https://github.com/SheetJS/sheetjs/blob/19620da30be2a7d7b9801938a0b9b1fd3c4c4b00/docbits/52_datatype.md\r\nfunction decodeError(errorCode) {\r\n // While the error values are determined by the application,\r\n // the following are some example error values that could be used:\r\n switch (errorCode) {\r\n case 0x00:\r\n return '#NULL!'\r\n case 0x07:\r\n return '#DIV/0!'\r\n case 0x0F:\r\n return '#VALUE!'\r\n case 0x17:\r\n return '#REF!'\r\n case 0x1D:\r\n return '#NAME?'\r\n case 0x24:\r\n return '#NUM!'\r\n case 0x2A:\r\n return '#N/A'\r\n case 0x2B:\r\n return '#GETTING_DATA'\r\n default:\r\n // Such error code doesn't exist. I made it up.\r\n return `#ERROR_${errorCode}`\r\n }\r\n}\r\n\r\nfunction isDateTemplate(template) {\r\n // Date format tokens could be in upper case or in lower case.\r\n // There seems to be no single standard.\r\n // So lowercase the template first.\r\n template = template.toLowerCase()\r\n const tokens = template.split(/\\W+/)\r\n for (const token of tokens) {\r\n if (DATE_TEMPLATE_TOKENS.indexOf(token) < 0) {\r\n return false\r\n }\r\n }\r\n return true\r\n}\r\n\r\n// These tokens could be in upper case or in lower case.\r\n// There seems to be no single standard, so using lower case.\r\nconst DATE_TEMPLATE_TOKENS = [\r\n // Seconds (min two digits). Example: \"05\".\r\n 'ss',\r\n // Minutes (min two digits). Example: \"05\". Could also be \"Months\". Weird.\r\n 'mm',\r\n // Hours. Example: \"1\".\r\n 'h',\r\n // Hours (min two digits). Example: \"01\".\r\n 'hh',\r\n // \"AM\" part of \"AM/PM\". Lowercased just in case.\r\n 'am',\r\n // \"PM\" part of \"AM/PM\". Lowercased just in case.\r\n 'pm',\r\n // Day. Example: \"1\"\r\n 'd',\r\n // Day (min two digits). Example: \"01\"\r\n 'dd',\r\n // Month (numeric). Example: \"1\".\r\n 'm',\r\n // Month (numeric, min two digits). Example: \"01\". Could also be \"Minutes\". Weird.\r\n 'mm',\r\n // Month (shortened month name). Example: \"Jan\".\r\n 'mmm',\r\n // Month (full month name). Example: \"January\".\r\n 'mmmm',\r\n // Two-digit year. Example: \"20\".\r\n 'yy',\r\n // Full year. Example: \"2020\".\r\n 'yyyy'\r\n];"],"file":"parseCellValue.js"}
|
|
1
|
+
{"version":3,"file":"parseCellValue.js","names":["BUILT_IN_DATE_NUMBER_FORMAT_IDS","getCellValue","value","type","getInlineStringValue","getStyleId","styles","values","properties","options","trim","undefined","Error","parseInt","decodeError","Date","parseFloat","styleId","style","indexOf","numberFormat","id","dateFormat","template","smartDateParser","isDateTemplate","parseDate","TypeError","errorCode","toLowerCase","tokens","split","token","DATE_TEMPLATE_TOKENS"],"sources":["../../source/read/parseCellValue.js"],"sourcesContent":["import parseDate from './parseDate.js'\r\n\r\n// https://hexdocs.pm/xlsxir/number_styles.html\r\nconst BUILT_IN_DATE_NUMBER_FORMAT_IDS = [14,15,16,17,18,19,20,21,22,27,30,36,45,46,47,50,57]\r\n\r\nexport default function getCellValue(value, type, {\r\n\tgetInlineStringValue,\r\n\tgetStyleId,\r\n\tstyles,\r\n\tvalues,\r\n\tproperties,\r\n\toptions\r\n}) {\r\n if (!type) {\r\n // Default cell type is \"n\" (numeric).\r\n // http://www.datypic.com/sc/ooxml/t-ssml_CT_Cell.html\r\n type = 'n'\r\n }\r\n\r\n // Available Excel cell types:\r\n // https://github.com/SheetJS/sheetjs/blob/19620da30be2a7d7b9801938a0b9b1fd3c4c4b00/docbits/52_datatype.md\r\n //\r\n // Some other document (seems to be old):\r\n // http://webapp.docx4java.org/OnlineDemo/ecma376/SpreadsheetML/ST_CellType.html\r\n //\r\n switch (type) {\r\n // If the cell contains formula string.\r\n case 'str':\r\n value = value.trim()\r\n if (value === '') {\r\n value = undefined\r\n }\r\n break\r\n\r\n // If the cell contains an \"inline\" (not \"shared\") string.\r\n case 'inlineStr':\r\n value = getInlineStringValue()\r\n if (value === undefined) {\r\n throw new Error(`Unsupported \"inline string\" cell value structure`) // : ${cellNode.textContent}`)\r\n }\r\n value = value.trim()\r\n if (value === '') {\r\n value = undefined\r\n }\r\n break\r\n\r\n // If the cell contains a \"shared\" string.\r\n // \"Shared\" strings is a way for an Excel editor to reduce\r\n // the file size by storing \"commonly used\" strings in a dictionary\r\n // and then referring to such strings by their index in that dictionary.\r\n case 's':\r\n // If a cell has no value then there's no `<c/>` element for it.\r\n // If a `<c/>` element exists then it's not empty.\r\n // The `<v/>`alue is a key in the \"shared strings\" dictionary of the\r\n // XLSX file, so look it up in the `values` dictionary by the numeric key.\r\n value = values[parseInt(value)]\r\n value = value.trim()\r\n if (value === '') {\r\n value = undefined\r\n }\r\n break\r\n\r\n case 'b':\r\n value = value === '1' ? true : false\r\n break\r\n\r\n // Stub: blank stub cell that is ignored by data processing utilities.\r\n case 'z':\r\n value = undefined\r\n break\r\n\r\n // Error: `value` is a numeric code.\r\n // They also wrote: \"and `w` property stores its common name\".\r\n // It's unclear what they meant by that.\r\n case 'e':\r\n value = decodeError(value)\r\n break\r\n\r\n // Date: a string to be parsed as a date.\r\n // (usually a string in \"ISO 8601\" format)\r\n case 'd':\r\n if (value === undefined) {\r\n break\r\n }\r\n value = new Date(value)\r\n break\r\n\r\n case 'n':\r\n if (value === undefined) {\r\n break\r\n }\r\n value = parseFloat(value)\r\n // XLSX does have \"d\" type for dates, but it's not commonly used.\r\n // Instead, spreadsheets prefer using \"n\" type for dates for some reason.\r\n //\r\n // In such cases, sometimes a \"date\" type could be heuristically detected\r\n // by looking at such numeric value \"format\" and seeing if it's a date-specific one.\r\n // https://github.com/catamphetamine/read-excel-file/issues/3#issuecomment-395770777\r\n //\r\n // The list of generic numeric value \"formats\":\r\n // https://xlsxwriter.readthedocs.io/format.html#format-set-num-format\r\n //\r\n const styleId = getStyleId()\r\n if (styleId) {\r\n // styleId = parseInt(styleId)\r\n const style = styles[styleId]\r\n if (!style) {\r\n throw new Error(`Cell style not found: ${styleId}`)\r\n }\r\n if (BUILT_IN_DATE_NUMBER_FORMAT_IDS.indexOf(parseInt(style.numberFormat.id)) >= 0 ||\r\n (options.dateFormat && style.numberFormat.template === options.dateFormat) ||\r\n (options.smartDateParser !== false && style.numberFormat.template && isDateTemplate(style.numberFormat.template))) {\r\n value = parseDate(value, properties)\r\n }\r\n }\r\n break\r\n\r\n default:\r\n throw new TypeError(`Cell type not supported: ${type}`)\r\n }\r\n\r\n // Convert empty values to `null`.\r\n if (value === undefined) {\r\n value = null\r\n }\r\n\r\n return value\r\n}\r\n\r\n// Decodes numeric error code to a string code.\r\n// https://github.com/SheetJS/sheetjs/blob/19620da30be2a7d7b9801938a0b9b1fd3c4c4b00/docbits/52_datatype.md\r\nfunction decodeError(errorCode) {\r\n // While the error values are determined by the application,\r\n // the following are some example error values that could be used:\r\n switch (errorCode) {\r\n case 0x00:\r\n return '#NULL!'\r\n case 0x07:\r\n return '#DIV/0!'\r\n case 0x0F:\r\n return '#VALUE!'\r\n case 0x17:\r\n return '#REF!'\r\n case 0x1D:\r\n return '#NAME?'\r\n case 0x24:\r\n return '#NUM!'\r\n case 0x2A:\r\n return '#N/A'\r\n case 0x2B:\r\n return '#GETTING_DATA'\r\n default:\r\n // Such error code doesn't exist. I made it up.\r\n return `#ERROR_${errorCode}`\r\n }\r\n}\r\n\r\nfunction isDateTemplate(template) {\r\n // Date format tokens could be in upper case or in lower case.\r\n // There seems to be no single standard.\r\n // So lowercase the template first.\r\n template = template.toLowerCase()\r\n const tokens = template.split(/\\W+/)\r\n for (const token of tokens) {\r\n if (DATE_TEMPLATE_TOKENS.indexOf(token) < 0) {\r\n return false\r\n }\r\n }\r\n return true\r\n}\r\n\r\n// These tokens could be in upper case or in lower case.\r\n// There seems to be no single standard, so using lower case.\r\nconst DATE_TEMPLATE_TOKENS = [\r\n // Seconds (min two digits). Example: \"05\".\r\n 'ss',\r\n // Minutes (min two digits). Example: \"05\". Could also be \"Months\". Weird.\r\n 'mm',\r\n // Hours. Example: \"1\".\r\n 'h',\r\n // Hours (min two digits). Example: \"01\".\r\n 'hh',\r\n // \"AM\" part of \"AM/PM\". Lowercased just in case.\r\n 'am',\r\n // \"PM\" part of \"AM/PM\". Lowercased just in case.\r\n 'pm',\r\n // Day. Example: \"1\"\r\n 'd',\r\n // Day (min two digits). Example: \"01\"\r\n 'dd',\r\n // Month (numeric). Example: \"1\".\r\n 'm',\r\n // Month (numeric, min two digits). Example: \"01\". Could also be \"Minutes\". Weird.\r\n 'mm',\r\n // Month (shortened month name). Example: \"Jan\".\r\n 'mmm',\r\n // Month (full month name). Example: \"January\".\r\n 'mmmm',\r\n // Two-digit year. Example: \"20\".\r\n 'yy',\r\n // Full year. Example: \"2020\".\r\n 'yyyy'\r\n];"],"mappings":";;;;;;;AAAA;;;;;;;;;;AAEA;AACA,IAAMA,+BAA+B,GAAG,CAAC,EAAD,EAAI,EAAJ,EAAO,EAAP,EAAU,EAAV,EAAa,EAAb,EAAgB,EAAhB,EAAmB,EAAnB,EAAsB,EAAtB,EAAyB,EAAzB,EAA4B,EAA5B,EAA+B,EAA/B,EAAkC,EAAlC,EAAqC,EAArC,EAAwC,EAAxC,EAA2C,EAA3C,EAA8C,EAA9C,EAAiD,EAAjD,CAAxC;;AAEe,SAASC,YAAT,CAAsBC,KAAtB,EAA6BC,IAA7B,QAOZ;EAAA,IANFC,oBAME,QANFA,oBAME;EAAA,IALFC,UAKE,QALFA,UAKE;EAAA,IAJFC,MAIE,QAJFA,MAIE;EAAA,IAHFC,MAGE,QAHFA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AK,IAAL;MACE,OAAO,OAAP;;IACF,KAAK,IAAL;MACE,OAAO,MAAP;;IACF,KAAK,IAAL;MACE,OAAO,eAAP;;IACF;MACE;MACA,wBAAiBA,SAAjB;EAnBJ;AAqBD;;AAED,SAASH,cAAT,CAAwBF,QAAxB,EAAkC;EAChC;EACA;EACA;EACAA,QAAQ,GAAGA,QAAQ,CAACM,WAAT,EAAX;EACA,IAAMC,MAAM,GAAGP,QAAQ,CAACQ,KAAT,CAAe,KAAf,CAAf;;EACA,qDAAoBD,MAApB,wCAA4B;IAAA,IAAjBE,KAAiB;;IAC1B,IAAIC,oBAAoB,CAACd,OAArB,CAA6Ba,KAA7B,IAAsC,CAA1C,EAA6C;MAC3C,OAAO,KAAP;IACD;EACF;;EACD,OAAO,IAAP;AACD,C,CAED;AACA;;;AACA,IAAMC,oBAAoB,GAAG,CAC3B;AACA,IAF2B,EAG3B;AACA,IAJ2B,EAK3B;AACA,GAN2B,EAO3B;AACA,IAR2B,EAS3B;AACA,IAV2B,EAW3B;AACA,IAZ2B,EAa3B;AACA,GAd2B,EAe3B;AACA,IAhB2B,EAiB3B;AACA,GAlB2B,EAmB3B;AACA,IApB2B,EAqB3B;AACA,KAtB2B,EAuB3B;AACA,MAxB2B,EAyB3B;AACA,IA1B2B,EA2B3B;AACA,MA5B2B,CAA7B"}
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = parseCells;
|
|
7
7
|
|
|
8
|
-
var _parseCell = _interopRequireDefault(require("./parseCell"));
|
|
8
|
+
var _parseCell = _interopRequireDefault(require("./parseCell.js"));
|
|
9
9
|
|
|
10
|
-
var _xlsx = require("../xml/xlsx");
|
|
10
|
+
var _xlsx = require("../xml/xlsx.js");
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseCells.js","names":["parseCells","sheet","xml","values","styles","properties","options","cells","getCells","length","map","node","parseCell"],"sources":["../../source/read/parseCells.js"],"sourcesContent":["import parseCell from './parseCell.js'\r\n\r\nimport {\r\n getCells,\r\n getMergedCells\r\n} from '../xml/xlsx.js'\r\n\r\nexport default function parseCells(sheet, xml, values, styles, properties, options) {\r\n const cells = getCells(sheet)\r\n\r\n if (cells.length === 0) {\r\n return []\r\n }\r\n\r\n // const mergedCells = getMergedCells(sheet)\r\n // for (const mergedCell of mergedCells) {\r\n // const [from, to] = mergedCell.split(':').map(parseCellCoordinates)\r\n // console.log('Merged Cell.', 'From:', from, 'To:', to)\r\n // }\r\n\r\n return cells.map((node) => {\r\n return parseCell(node, sheet, xml, values, styles, properties, options)\r\n })\r\n}"],"mappings":";;;;;;;AAAA;;AAEA;;;;AAKe,SAASA,UAAT,CAAoBC,KAApB,EAA2BC,GAA3B,EAAgCC,MAAhC,EAAwCC,MAAxC,EAAgDC,UAAhD,EAA4DC,OAA5D,EAAqE;EAClF,IAAMC,KAAK,GAAG,IAAAC,cAAA,EAASP,KAAT,CAAd;;EAEA,IAAIM,KAAK,CAACE,MAAN,KAAiB,CAArB,EAAwB;IACtB,OAAO,EAAP;EACD,CALiF,CAOlF;EACA;EACA;EACA;EACA;;;EAEA,OAAOF,KAAK,CAACG,GAAN,CAAU,UAACC,IAAD,EAAU;IACzB,OAAO,IAAAC,qBAAA,EAAUD,IAAV,EAAgBV,KAAhB,EAAuBC,GAAvB,EAA4BC,MAA5B,EAAoCC,MAApC,EAA4CC,UAA5C,EAAwDC,OAAxD,CAAP;EACD,CAFM,CAAP;AAGD"}
|
|
@@ -5,15 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = parseExcelDate;
|
|
7
7
|
|
|
8
|
-
// Parses an Excel Date ("serial") into a
|
|
9
|
-
// corresponding javascript Date in UTC+0 timezone.
|
|
8
|
+
// Parses an Excel Date ("serial") into a corresponding javascript Date in UTC+0 timezone.
|
|
10
9
|
// (with time equal to 00:00)
|
|
11
10
|
//
|
|
12
|
-
// Doesn't account for leap seconds.
|
|
13
|
-
// Therefore is not 100% correct.
|
|
14
|
-
// But will do, I guess, since we're
|
|
15
|
-
// not doing rocket science here.
|
|
16
|
-
//
|
|
17
11
|
// https://www.pcworld.com/article/3063622/software/mastering-excel-date-time-serial-numbers-networkdays-datevalue-and-more.html
|
|
18
12
|
// "If you need to calculate dates in your spreadsheets,
|
|
19
13
|
// Excel uses its own unique system, which it calls Serial Numbers".
|
|
@@ -34,7 +28,44 @@ function parseExcelDate(excelSerialDate, options) {
|
|
|
34
28
|
|
|
35
29
|
|
|
36
30
|
var daysBeforeUnixEpoch = 70 * 365 + 19; // An hour, approximately, because a minute
|
|
37
|
-
// may be longer than 60 seconds,
|
|
31
|
+
// may be longer than 60 seconds, due to "leap seconds".
|
|
32
|
+
//
|
|
33
|
+
// Still, Javascript `Date` (and UNIX time in general) intentionally
|
|
34
|
+
// drops the concept of "leap seconds" in order to make things simpler.
|
|
35
|
+
// So it's fine.
|
|
36
|
+
// https://stackoverflow.com/questions/53019726/where-are-the-leap-seconds-in-javascript
|
|
37
|
+
//
|
|
38
|
+
// "The JavaScript Date object specifically adheres to the concept of Unix Time
|
|
39
|
+
// (albeit with higher precision). This is part of the POSIX specification,
|
|
40
|
+
// and thus is sometimes called "POSIX Time". It does not count leap seconds,
|
|
41
|
+
// but rather assumes every day had exactly 86,400 seconds. You can read about
|
|
42
|
+
// this in section 20.3.1.1 of the current ECMAScript specification, which states:
|
|
43
|
+
//
|
|
44
|
+
// "Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC.
|
|
45
|
+
// In time values leap seconds are ignored. It is assumed that there are exactly
|
|
46
|
+
// 86,400,000 milliseconds per day."
|
|
47
|
+
//
|
|
48
|
+
// The fact is, that the unpredictable nature of leap seconds makes them very
|
|
49
|
+
// difficult to work with in APIs. One can't generally pass timestamps around
|
|
50
|
+
// that need leap seconds tables to be interpreted correctly, and expect that
|
|
51
|
+
// one system will interpret them the same as another. For example, while your
|
|
52
|
+
// example timestamp 1483228826 is 2017-01-01T00:00:00Z on your system,
|
|
53
|
+
// it would be interpreted as 2017-01-01T00:00:26Z on POSIX based systems,
|
|
54
|
+
// or systems without leap second tables. So they aren't portable.
|
|
55
|
+
// Even on systems that have full updated tables, there's no telling what those
|
|
56
|
+
// tables will contain in the future (beyond the 6-month IERS announcement period),
|
|
57
|
+
// so I can't produce a future timestamp without risk that it may eventually change.
|
|
58
|
+
//
|
|
59
|
+
// To be clear - to support leap seconds in a programming language, the implementation
|
|
60
|
+
// must go out of its way to do so, and must make tradeoffs that are not always acceptable.
|
|
61
|
+
// Though there are exceptions, the general position is to not support them - not because
|
|
62
|
+
// of any subversion or active countermeasures, but because supporting them properly is much,
|
|
63
|
+
// much harder."
|
|
64
|
+
//
|
|
65
|
+
// https://en.wikipedia.org/wiki/Unix_time#Leap_seconds
|
|
66
|
+
// https://en.wikipedia.org/wiki/Leap_year
|
|
67
|
+
// https://en.wikipedia.org/wiki/Leap_second
|
|
68
|
+
//
|
|
38
69
|
|
|
39
70
|
var hour = 60 * 60 * 1000;
|
|
40
71
|
return new Date(Math.round((excelSerialDate - daysBeforeUnixEpoch) * 24 * hour));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseDate.js","names":["parseExcelDate","excelSerialDate","options","epoch1904","daysBeforeUnixEpoch","hour","Date","Math","round"],"sources":["../../source/read/parseDate.js"],"sourcesContent":[" // Parses an Excel Date (\"serial\") into a corresponding javascript Date in UTC+0 timezone.\r\n // (with time equal to 00:00)\r\n //\r\n // https://www.pcworld.com/article/3063622/software/mastering-excel-date-time-serial-numbers-networkdays-datevalue-and-more.html\r\n // \"If you need to calculate dates in your spreadsheets,\r\n // Excel uses its own unique system, which it calls Serial Numbers\".\r\n //\r\n export default function parseExcelDate(excelSerialDate, options) {\r\n // https://support.microsoft.com/en-gb/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel\r\n if (options && options.epoch1904) {\r\n excelSerialDate += 1462\r\n }\r\n\r\n // \"Excel serial date\" is just\r\n // the count of days since `01/01/1900`\r\n // (seems that it may be even fractional).\r\n //\r\n // The count of days elapsed\r\n // since `01/01/1900` (Excel epoch)\r\n // till `01/01/1970` (Unix epoch).\r\n // Accounts for leap years\r\n // (19 of them, yielding 19 extra days).\r\n const daysBeforeUnixEpoch = 70 * 365 + 19\r\n\r\n // An hour, approximately, because a minute\r\n // may be longer than 60 seconds, due to \"leap seconds\".\r\n //\r\n // Still, Javascript `Date` (and UNIX time in general) intentionally\r\n // drops the concept of \"leap seconds\" in order to make things simpler.\r\n // So it's fine.\r\n // https://stackoverflow.com/questions/53019726/where-are-the-leap-seconds-in-javascript\r\n //\r\n // \"The JavaScript Date object specifically adheres to the concept of Unix Time\r\n // (albeit with higher precision). This is part of the POSIX specification,\r\n // and thus is sometimes called \"POSIX Time\". It does not count leap seconds,\r\n // but rather assumes every day had exactly 86,400 seconds. You can read about\r\n // this in section 20.3.1.1 of the current ECMAScript specification, which states:\r\n //\r\n // \"Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC.\r\n // In time values leap seconds are ignored. It is assumed that there are exactly\r\n // 86,400,000 milliseconds per day.\"\r\n //\r\n // The fact is, that the unpredictable nature of leap seconds makes them very\r\n // difficult to work with in APIs. One can't generally pass timestamps around\r\n // that need leap seconds tables to be interpreted correctly, and expect that\r\n // one system will interpret them the same as another. For example, while your\r\n // example timestamp 1483228826 is 2017-01-01T00:00:00Z on your system,\r\n // it would be interpreted as 2017-01-01T00:00:26Z on POSIX based systems,\r\n // or systems without leap second tables. So they aren't portable.\r\n // Even on systems that have full updated tables, there's no telling what those\r\n // tables will contain in the future (beyond the 6-month IERS announcement period),\r\n // so I can't produce a future timestamp without risk that it may eventually change.\r\n //\r\n // To be clear - to support leap seconds in a programming language, the implementation\r\n // must go out of its way to do so, and must make tradeoffs that are not always acceptable.\r\n // Though there are exceptions, the general position is to not support them - not because\r\n // of any subversion or active countermeasures, but because supporting them properly is much,\r\n // much harder.\"\r\n //\r\n // https://en.wikipedia.org/wiki/Unix_time#Leap_seconds\r\n // https://en.wikipedia.org/wiki/Leap_year\r\n // https://en.wikipedia.org/wiki/Leap_second\r\n //\r\n const hour = 60 * 60 * 1000\r\n\r\n return new Date(Math.round((excelSerialDate - daysBeforeUnixEpoch) * 24 * hour))\r\n }"],"mappings":";;;;;;;AAAI;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,CAAwBC,eAAxB,EAAyCC,OAAzC,EAAkD;EAC/D;EACA,IAAIA,OAAO,IAAIA,OAAO,CAACC,SAAvB,EAAkC;IAChCF,eAAe,IAAI,IAAnB;EACD,CAJ8D,CAM/D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;EACA,IAAMG,mBAAmB,GAAG,KAAK,GAAL,GAAW,EAAvC,CAf+D,CAiB/D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EACA,IAAMC,IAAI,GAAG,KAAK,EAAL,GAAU,IAAvB;EAEA,OAAO,IAAIC,IAAJ,CAASC,IAAI,CAACC,KAAL,CAAW,CAACP,eAAe,GAAGG,mBAAnB,IAA0C,EAA1C,GAA+CC,IAA1D,CAAT,CAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseDate.test.js","names":["describe","it","date","convertToUTCTimezone","Date","parseDate","getTime","should","equal","getTimezoneOffset"],"sources":["../../source/read/parseDate.test.js"],"sourcesContent":["import parseDate from './parseDate.js'\r\n\r\ndescribe('parseDate', () => {\r\n\tit('should parse Excel \"serial\" dates', () => {\r\n\t\tconst date = convertToUTCTimezone(new Date(2018, 3 - 1, 24))\r\n // Excel stores dates as integers.\r\n // E.g. '24/03/2018' === 43183\r\n\t\tparseDate(43183).getTime().should.equal(date.getTime())\r\n\t})\r\n})\r\n\r\n// Converts timezone to UTC while preserving the same time\r\nfunction convertToUTCTimezone(date) {\r\n\t// Doesn't account for leap seconds but I guess that's ok\r\n\t// given that javascript's own `Date()` does not either.\r\n\t// https://www.timeanddate.com/time/leap-seconds-background.html\r\n\t//\r\n\t// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset\r\n\t//\r\n\treturn new Date(date.getTime() - date.getTimezoneOffset() * 60 * 1000)\r\n}\r\n"],"mappings":";;AAAA;;;;AAEAA,QAAQ,CAAC,WAAD,EAAc,YAAM;EAC3BC,EAAE,CAAC,mCAAD,EAAsC,YAAM;IAC7C,IAAMC,IAAI,GAAGC,oBAAoB,CAAC,IAAIC,IAAJ,CAAS,IAAT,EAAe,IAAI,CAAnB,EAAsB,EAAtB,CAAD,CAAjC,CAD6C,CAE3C;IACA;;IACF,IAAAC,qBAAA,EAAU,KAAV,EAAiBC,OAAjB,GAA2BC,MAA3B,CAAkCC,KAAlC,CAAwCN,IAAI,CAACI,OAAL,EAAxC;EACA,CALC,CAAF;AAMA,CAPO,CAAR,C,CASA;;AACA,SAASH,oBAAT,CAA8BD,IAA9B,EAAoC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,IAAIE,IAAJ,CAASF,IAAI,CAACI,OAAL,KAAiBJ,IAAI,CAACO,iBAAL,KAA2B,EAA3B,GAAgC,IAA1D,CAAP;AACA"}
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = parseDimensions;
|
|
7
7
|
|
|
8
|
-
var _coordinates = require("./coordinates");
|
|
8
|
+
var _coordinates = require("./coordinates.js");
|
|
9
9
|
|
|
10
|
-
var _xlsx = require("../xml/xlsx");
|
|
10
|
+
var _xlsx = require("../xml/xlsx.js");
|
|
11
11
|
|
|
12
12
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
17
17
|
|
|
18
18
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
19
19
|
|
|
20
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
20
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
21
21
|
|
|
22
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseDimensions.js","names":["parseDimensions","sheet","dimensions","getDimensions","split","map","parseCellCoordinates","row","column","length"],"sources":["../../source/read/parseDimensions.js"],"sourcesContent":["import {\r\n parseCellCoordinates\r\n} from './coordinates.js'\r\n\r\nimport {\r\n getDimensions\r\n} from '../xml/xlsx.js'\r\n\r\n// `dimensions` defines the spreadsheet area containing all non-empty cells.\r\n// https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.sheetdimension?view=openxml-2.8.1\r\nexport default function parseDimensions(sheet) {\r\n let dimensions = getDimensions(sheet)\r\n if (dimensions) {\r\n dimensions = dimensions.split(':').map(parseCellCoordinates).map(([row, column]) => ({\r\n row,\r\n column\r\n }))\r\n // Sometimes there can be just a single cell as a spreadsheet's \"dimensions\".\r\n // For example, the default \"dimensions\" in Apache POI library is \"A1\",\r\n // meaning that only the first cell in the spreadsheet is used.\r\n //\r\n // A quote from Apache POI library:\r\n // \"Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1').\"\r\n //\r\n if (dimensions.length === 1) {\r\n dimensions = [dimensions[0], dimensions[0]]\r\n }\r\n return dimensions\r\n }\r\n}\r\n\r\n"],"mappings":";;;;;;;AAAA;;AAIA;;;;;;;;;;;;;;AAIA;AACA;AACe,SAASA,eAAT,CAAyBC,KAAzB,EAAgC;EAC7C,IAAIC,UAAU,GAAG,IAAAC,mBAAA,EAAcF,KAAd,CAAjB;;EACA,IAAIC,UAAJ,EAAgB;IACdA,UAAU,GAAGA,UAAU,CAACE,KAAX,CAAiB,GAAjB,EAAsBC,GAAtB,CAA0BC,iCAA1B,EAAgDD,GAAhD,CAAoD;MAAA;MAAA,IAAEE,GAAF;MAAA,IAAOC,MAAP;;MAAA,OAAoB;QACnFD,GAAG,EAAHA,GADmF;QAEnFC,MAAM,EAANA;MAFmF,CAApB;IAAA,CAApD,CAAb,CADc,CAKd;IACA;IACA;IACA;IACA;IACA;IACA;;IACA,IAAIN,UAAU,CAACO,MAAX,KAAsB,CAA1B,EAA6B;MAC3BP,UAAU,GAAG,CAACA,UAAU,CAAC,CAAD,CAAX,EAAgBA,UAAU,CAAC,CAAD,CAA1B,CAAb;IACD;;IACD,OAAOA,UAAP;EACD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseFilePaths.js","names":["parseFilePaths","content","xml","document","createDocument","filePaths","sheets","sharedStrings","undefined","styles","addFilePathInfo","relationship","filePath","getAttribute","fileType","getFilePath","getRelationships","forEach","path","slice","length"],"sources":["../../source/read/parseFilePaths.js"],"sourcesContent":["import {\r\n getRelationships\r\n} from '../xml/xlsx.js'\r\n\r\n/**\r\n * Returns sheet file paths.\r\n * Seems that the correct place to look for the `sheetId` -> `filename` mapping\r\n * is `xl/_rels/workbook.xml.rels` file.\r\n * https://github.com/tidyverse/readxl/issues/104\r\n * @param {string} content — `xl/_rels/workbook.xml.rels` file contents.\r\n * @param {object} xml\r\n * @return {object}\r\n */\r\nexport default function parseFilePaths(content, xml) {\r\n // Example:\r\n // <Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\r\n // ...\r\n // <Relationship\r\n // Id=\"rId3\"\r\n // Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\"\r\n // Target=\"worksheets/sheet1.xml\"/>\r\n // </Relationships>\r\n const document = xml.createDocument(content)\r\n\r\n const filePaths = {\r\n sheets: {},\r\n sharedStrings: undefined,\r\n styles: undefined\r\n }\r\n\r\n const addFilePathInfo = (relationship) => {\r\n const filePath = relationship.getAttribute('Target')\r\n const fileType = relationship.getAttribute('Type')\r\n switch (fileType) {\r\n case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles':\r\n filePaths.styles = getFilePath(filePath)\r\n break\r\n case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings':\r\n filePaths.sharedStrings = getFilePath(filePath)\r\n break\r\n case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet':\r\n filePaths.sheets[relationship.getAttribute('Id')] = getFilePath(filePath)\r\n break\r\n }\r\n }\r\n\r\n getRelationships(document).forEach(addFilePathInfo)\r\n\r\n // Seems like \"sharedStrings.xml\" is not required to exist.\r\n // For example, when the spreadsheet doesn't contain any strings.\r\n // https://github.com/catamphetamine/read-excel-file/issues/85\r\n // if (!filePaths.sharedStrings) {\r\n // throw new Error('\"sharedStrings.xml\" file not found in the *.xlsx file')\r\n // }\r\n\r\n return filePaths\r\n}\r\n\r\nfunction getFilePath(path) {\r\n // Normally, `path` is a relative path inside the ZIP archive,\r\n // like \"worksheets/sheet1.xml\", or \"sharedStrings.xml\", or \"styles.xml\".\r\n // There has been one weird case when file path was an absolute path,\r\n // like \"/xl/worksheets/sheet1.xml\" (specifically for sheets):\r\n // https://github.com/catamphetamine/read-excel-file/pull/95\r\n // Other libraries (like `xlsx`) and software (like Google Docs)\r\n // seem to support such absolute file paths, so this library does too.\r\n if (path[0] === '/') {\r\n return path.slice('/'.length)\r\n }\r\n // // Seems like a path could also be a URL.\r\n // // http://officeopenxml.com/anatomyofOOXML-xlsx.php\r\n // if (/^[a-z]+\\:\\/\\//.test(path)) {\r\n // return path\r\n // }\r\n return 'xl/' + path\r\n}"],"mappings":";;;;;;;AAAA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,CAAwBC,OAAxB,EAAiCC,GAAjC,EAAsC;EACnD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMC,QAAQ,GAAGD,GAAG,CAACE,cAAJ,CAAmBH,OAAnB,CAAjB;EAEA,IAAMI,SAAS,GAAG;IAChBC,MAAM,EAAE,EADQ;IAEhBC,aAAa,EAAEC,SAFC;IAGhBC,MAAM,EAAED;EAHQ,CAAlB;;EAMA,IAAME,eAAe,GAAG,SAAlBA,eAAkB,CAACC,YAAD,EAAkB;IACxC,IAAMC,QAAQ,GAAGD,YAAY,CAACE,YAAb,CAA0B,QAA1B,CAAjB;IACA,IAAMC,QAAQ,GAAGH,YAAY,CAACE,YAAb,CAA0B,MAA1B,CAAjB;;IACA,QAAQC,QAAR;MACE,KAAK,4EAAL;QACET,SAAS,CAACI,MAAV,GAAmBM,WAAW,CAACH,QAAD,CAA9B;QACA;;MACF,KAAK,mFAAL;QACEP,SAAS,CAACE,aAAV,GAA0BQ,WAAW,CAACH,QAAD,CAArC;QACA;;MACF,KAAK,+EAAL;QACEP,SAAS,CAACC,MAAV,CAAiBK,YAAY,CAACE,YAAb,CAA0B,IAA1B,CAAjB,IAAoDE,WAAW,CAACH,QAAD,CAA/D;QACA;IATJ;EAWD,CAdD;;EAgBA,IAAAI,sBAAA,EAAiBb,QAAjB,EAA2Bc,OAA3B,CAAmCP,eAAnC,EAjCmD,CAmCnD;EACA;EACA;EACA;EACA;EACA;;EAEA,OAAOL,SAAP;AACD;;AAED,SAASU,WAAT,CAAqBG,IAArB,EAA2B;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAIA,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAhB,EAAqB;IACnB,OAAOA,IAAI,CAACC,KAAL,CAAW,IAAIC,MAAf,CAAP;EACD,CAVwB,CAWzB;EACA;EACA;EACA;EACA;;;EACA,OAAO,QAAQF,IAAf;AACD"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = parseProperties;
|
|
7
7
|
|
|
8
|
-
var _xlsx = require("../xml/xlsx");
|
|
8
|
+
var _xlsx = require("../xml/xlsx.js");
|
|
9
9
|
|
|
10
10
|
// I guess `xl/workbook.xml` file should always be present inside the *.xlsx archive.
|
|
11
11
|
function parseProperties(content, xml) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseProperties.js","names":["parseProperties","content","xml","book","createDocument","properties","workbookProperties","getWorkbookProperties","getAttribute","epoch1904","sheets","addSheetInfo","sheet","push","id","name","relationId","getSheets","forEach"],"sources":["../../source/read/parseProperties.js"],"sourcesContent":["import {\r\n getWorkbookProperties,\r\n getSheets\r\n} from '../xml/xlsx.js'\r\n\r\n// I guess `xl/workbook.xml` file should always be present inside the *.xlsx archive.\r\nexport default function parseProperties(content, xml) {\r\n const book = xml.createDocument(content)\r\n\r\n const properties = {};\r\n\r\n // Read `<workbookPr/>` element to detect whether dates are 1900-based or 1904-based.\r\n // https://support.microsoft.com/en-gb/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel\r\n // http://webapp.docx4java.org/OnlineDemo/ecma376/SpreadsheetML/workbookPr.html\r\n\r\n const workbookProperties = getWorkbookProperties(book)\r\n\r\n if (workbookProperties && workbookProperties.getAttribute('date1904') === '1') {\r\n properties.epoch1904 = true\r\n }\r\n\r\n // Get sheets info (indexes, names, if they're available).\r\n // Example:\r\n // <sheets>\r\n // <sheet\r\n // xmlns:ns=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\r\n // name=\"Sheet1\"\r\n // sheetId=\"1\"\r\n // ns:id=\"rId3\"/>\r\n // </sheets>\r\n // http://www.datypic.com/sc/ooxml/e-ssml_sheet-1.html\r\n\r\n properties.sheets = []\r\n\r\n const addSheetInfo = (sheet) => {\r\n if (sheet.getAttribute('name')) {\r\n properties.sheets.push({\r\n id: sheet.getAttribute('sheetId'),\r\n name: sheet.getAttribute('name'),\r\n relationId: sheet.getAttribute('r:id')\r\n })\r\n }\r\n }\r\n\r\n getSheets(book).forEach(addSheetInfo)\r\n\r\n return properties;\r\n}"],"mappings":";;;;;;;AAAA;;AAKA;AACe,SAASA,eAAT,CAAyBC,OAAzB,EAAkCC,GAAlC,EAAuC;EACpD,IAAMC,IAAI,GAAGD,GAAG,CAACE,cAAJ,CAAmBH,OAAnB,CAAb;EAEA,IAAMI,UAAU,GAAG,EAAnB,CAHoD,CAKpD;EACA;EACA;;EAEA,IAAMC,kBAAkB,GAAG,IAAAC,2BAAA,EAAsBJ,IAAtB,CAA3B;;EAEA,IAAIG,kBAAkB,IAAIA,kBAAkB,CAACE,YAAnB,CAAgC,UAAhC,MAAgD,GAA1E,EAA+E;IAC7EH,UAAU,CAACI,SAAX,GAAuB,IAAvB;EACD,CAbmD,CAepD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;EAEAJ,UAAU,CAACK,MAAX,GAAoB,EAApB;;EAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;IAC9B,IAAIA,KAAK,CAACJ,YAAN,CAAmB,MAAnB,CAAJ,EAAgC;MAC9BH,UAAU,CAACK,MAAX,CAAkBG,IAAlB,CAAuB;QACrBC,EAAE,EAAEF,KAAK,CAACJ,YAAN,CAAmB,SAAnB,CADiB;QAErBO,IAAI,EAAEH,KAAK,CAACJ,YAAN,CAAmB,MAAnB,CAFe;QAGrBQ,UAAU,EAAEJ,KAAK,CAACJ,YAAN,CAAmB,MAAnB;MAHS,CAAvB;IAKD;EACF,CARD;;EAUA,IAAAS,eAAA,EAAUd,IAAV,EAAgBe,OAAhB,CAAwBP,YAAxB;EAEA,OAAON,UAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseSharedStrings.js","names":["parseSharedStrings","content","xml","getSharedStrings","createDocument"],"sources":["../../source/read/parseSharedStrings.js"],"sourcesContent":["import {\r\n getSharedStrings\r\n} from '../xml/xlsx.js'\r\n\r\nexport default function parseSharedStrings(content, xml) {\r\n if (!content) {\r\n return []\r\n }\r\n return getSharedStrings(xml.createDocument(content))\r\n}"],"mappings":";;;;;;;AAAA;;AAIe,SAASA,kBAAT,CAA4BC,OAA5B,EAAqCC,GAArC,EAA0C;EACvD,IAAI,CAACD,OAAL,EAAc;IACZ,OAAO,EAAP;EACD;;EACD,OAAO,IAAAE,sBAAA,EAAiBD,GAAG,CAACE,cAAJ,CAAmBH,OAAnB,CAAjB,CAAP;AACD"}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = parseSheet;
|
|
7
7
|
|
|
8
|
-
var _parseCells = _interopRequireDefault(require("./parseCells"));
|
|
8
|
+
var _parseCells = _interopRequireDefault(require("./parseCells.js"));
|
|
9
9
|
|
|
10
|
-
var _parseDimensions = _interopRequireDefault(require("./parseDimensions"));
|
|
10
|
+
var _parseDimensions = _interopRequireDefault(require("./parseDimensions.js"));
|
|
11
11
|
|
|
12
|
-
var _coordinates = require("./coordinates");
|
|
12
|
+
var _coordinates = require("./coordinates.js");
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseSheet.js","names":["parseSheet","content","xml","values","styles","properties","options","sheet","createDocument","cells","parseCells","dimensions","parseDimensions","calculateDimensions"],"sources":["../../source/read/parseSheet.js"],"sourcesContent":["import parseCells from './parseCells.js'\r\nimport parseDimensions from './parseDimensions.js'\r\n\r\nimport { calculateDimensions } from './coordinates.js'\r\n\r\nexport default function parseSheet(content, xml, values, styles, properties, options) {\r\n const sheet = xml.createDocument(content)\r\n\r\n const cells = parseCells(sheet, xml, values, styles, properties, options)\r\n\r\n // `dimensions` defines the spreadsheet area containing all non-empty cells.\r\n // https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.sheetdimension?view=openxml-2.8.1\r\n const dimensions = parseDimensions(sheet) || calculateDimensions(cells)\r\n\r\n return { cells, dimensions }\r\n}"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAEe,SAASA,UAAT,CAAoBC,OAApB,EAA6BC,GAA7B,EAAkCC,MAAlC,EAA0CC,MAA1C,EAAkDC,UAAlD,EAA8DC,OAA9D,EAAuE;EACpF,IAAMC,KAAK,GAAGL,GAAG,CAACM,cAAJ,CAAmBP,OAAnB,CAAd;EAEA,IAAMQ,KAAK,GAAG,IAAAC,sBAAA,EAAWH,KAAX,EAAkBL,GAAlB,EAAuBC,MAAvB,EAA+BC,MAA/B,EAAuCC,UAAvC,EAAmDC,OAAnD,CAAd,CAHoF,CAKpF;EACA;;EACA,IAAMK,UAAU,GAAG,IAAAC,2BAAA,EAAgBL,KAAhB,KAA0B,IAAAM,gCAAA,EAAoBJ,KAApB,CAA7C;EAEA,OAAO;IAAEA,KAAK,EAALA,KAAF;IAASE,UAAU,EAAVA;EAAT,CAAP;AACD"}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = parseStyles;
|
|
7
7
|
|
|
8
|
-
var _xlsx = require("../xml/xlsx");
|
|
8
|
+
var _xlsx = require("../xml/xlsx.js");
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
|
|
14
14
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parseStyles.js","names":["parseStyles","content","xml","doc","createDocument","baseStyles","getBaseStyles","map","parseCellStyle","numberFormats","getNumberFormats","parseNumberFormatStyle","reduce","formats","format","id","getCellStyle","xf","hasAttribute","xfId","getCellStyles","numFmt","getAttribute","template","numFmts","style","numberFormatId","numberFormat"],"sources":["../../source/read/parseStyles.js"],"sourcesContent":["import {\r\n getBaseStyles,\r\n getCellStyles,\r\n getNumberFormats\r\n} from '../xml/xlsx.js'\r\n\r\n// http://officeopenxml.com/SSstyles.php\r\n// Returns an array of cell styles.\r\n// A cell style index is its ID.\r\nexport default function parseStyles(content, xml) {\r\n if (!content) {\r\n return {}\r\n }\r\n\r\n // https://social.msdn.microsoft.com/Forums/sqlserver/en-US/708978af-b598-45c4-a598-d3518a5a09f0/howwhen-is-cellstylexfs-vs-cellxfs-applied-to-a-cell?forum=os_binaryfile\r\n // https://www.office-forums.com/threads/cellxfs-cellstylexfs.2163519/\r\n const doc = xml.createDocument(content)\r\n\r\n const baseStyles = getBaseStyles(doc)\r\n .map(parseCellStyle)\r\n\r\n const numberFormats = getNumberFormats(doc)\r\n .map(parseNumberFormatStyle)\r\n .reduce((formats, format) => {\r\n // Format ID is a numeric index.\r\n // There're some standard \"built-in\" formats (in Excel) up to about `100`.\r\n formats[format.id] = format\r\n return formats\r\n }, [])\r\n\r\n const getCellStyle = (xf) => {\r\n if (xf.hasAttribute('xfId')) {\r\n return {\r\n ...baseStyles[xf.xfId],\r\n ...parseCellStyle(xf, numberFormats)\r\n }\r\n }\r\n return parseCellStyle(xf, numberFormats)\r\n }\r\n\r\n return getCellStyles(doc).map(getCellStyle)\r\n}\r\n\r\nfunction parseNumberFormatStyle(numFmt) {\r\n return {\r\n id: numFmt.getAttribute('numFmtId'),\r\n template: numFmt.getAttribute('formatCode')\r\n }\r\n}\r\n\r\n// http://www.datypic.com/sc/ooxml/e-ssml_xf-2.html\r\nfunction parseCellStyle(xf, numFmts) {\r\n const style = {}\r\n if (xf.hasAttribute('numFmtId')) {\r\n const numberFormatId = xf.getAttribute('numFmtId')\r\n // Built-in number formats don't have a `<numFmt/>` element in `styles.xml`.\r\n // https://hexdocs.pm/xlsxir/number_styles.html\r\n if (numFmts[numberFormatId]) {\r\n style.numberFormat = numFmts[numberFormatId]\r\n } else {\r\n style.numberFormat = { id: numberFormatId }\r\n }\r\n }\r\n return style\r\n}"],"mappings":";;;;;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YAAH,CAAgB,UAAhB,CAAJ,EAAiC;IAC/B,IAAMQ,cAAc,GAAGT,EAAE,CAACK,YAAH,CAAgB,UAAhB,CAAvB,CAD+B,CAE/B;IACA;;IACA,IAAIE,OAAO,CAACE,cAAD,CAAX,EAA6B;MAC3BD,KAAK,CAACE,YAAN,GAAqBH,OAAO,CAACE,cAAD,CAA5B;IACD,CAFD,MAEO;MACLD,KAAK,CAACE,YAAN,GAAqB;QAAEZ,EAAE,EAAEW;MAAN,CAArB;IACD;EACF;;EACD,OAAOD,KAAP;AACD"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = readSheetNames;
|
|
7
7
|
|
|
8
|
-
var _readXlsxFileBrowser = _interopRequireDefault(require("./readXlsxFileBrowser"));
|
|
8
|
+
var _readXlsxFileBrowser = _interopRequireDefault(require("./readXlsxFileBrowser.js"));
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|