read-excel-file 5.7.1 → 5.8.0

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.
Files changed (213) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +45 -19
  3. package/bundle/read-excel-file.min.js +1 -1
  4. package/bundle/read-excel-file.min.js.map +1 -1
  5. package/commonjs/read/coordinates.js +7 -10
  6. package/commonjs/read/coordinates.js.map +1 -1
  7. package/commonjs/read/dropEmptyColumns.js +6 -18
  8. package/commonjs/read/dropEmptyColumns.js.map +1 -1
  9. package/commonjs/read/dropEmptyColumns.test.js.map +1 -1
  10. package/commonjs/read/dropEmptyRows.js +11 -23
  11. package/commonjs/read/dropEmptyRows.js.map +1 -1
  12. package/commonjs/read/dropEmptyRows.test.js.map +1 -1
  13. package/commonjs/read/getData.js +31 -43
  14. package/commonjs/read/getData.js.map +1 -1
  15. package/commonjs/read/isDateTimestamp.js +51 -40
  16. package/commonjs/read/isDateTimestamp.js.map +1 -1
  17. package/commonjs/read/parseCell.js +3 -10
  18. package/commonjs/read/parseCell.js.map +1 -1
  19. package/commonjs/read/parseCellValue.js +28 -59
  20. package/commonjs/read/parseCellValue.js.map +1 -1
  21. package/commonjs/read/parseCells.js +3 -7
  22. package/commonjs/read/parseCells.js.map +1 -1
  23. package/commonjs/read/parseDate.js +5 -5
  24. package/commonjs/read/parseDate.js.map +1 -1
  25. package/commonjs/read/parseDate.test.js.map +1 -1
  26. package/commonjs/read/parseDimensions.js +6 -18
  27. package/commonjs/read/parseDimensions.js.map +1 -1
  28. package/commonjs/read/parseFilePaths.js +4 -11
  29. package/commonjs/read/parseFilePaths.js.map +1 -1
  30. package/commonjs/read/parseProperties.js +6 -8
  31. package/commonjs/read/parseProperties.js.map +1 -1
  32. package/commonjs/read/parseSharedStrings.js +0 -3
  33. package/commonjs/read/parseSharedStrings.js.map +1 -1
  34. package/commonjs/read/parseSheet.js +3 -7
  35. package/commonjs/read/parseSheet.js.map +1 -1
  36. package/commonjs/read/parseStyles.js +13 -21
  37. package/commonjs/read/parseStyles.js.map +1 -1
  38. package/commonjs/read/readSheetNamesBrowser.js +0 -3
  39. package/commonjs/read/readSheetNamesBrowser.js.map +1 -1
  40. package/commonjs/read/readSheetNamesNode.js +0 -3
  41. package/commonjs/read/readSheetNamesNode.js.map +1 -1
  42. package/commonjs/read/readSheetNamesNode.test.js.map +1 -1
  43. package/commonjs/read/readSheetNamesWebWorker.js +0 -3
  44. package/commonjs/read/readSheetNamesWebWorker.js.map +1 -1
  45. package/commonjs/read/readXlsx.js +34 -42
  46. package/commonjs/read/readXlsx.js.map +1 -1
  47. package/commonjs/read/readXlsxFileBrowser.js +0 -5
  48. package/commonjs/read/readXlsxFileBrowser.js.map +1 -1
  49. package/commonjs/read/readXlsxFileContents.js +12 -22
  50. package/commonjs/read/readXlsxFileContents.js.map +1 -1
  51. package/commonjs/read/readXlsxFileNode.js +0 -5
  52. package/commonjs/read/readXlsxFileNode.js.map +1 -1
  53. package/commonjs/read/readXlsxFileNode.test.js.map +1 -1
  54. package/commonjs/read/readXlsxFileWebWorker.js +0 -5
  55. package/commonjs/read/readXlsxFileWebWorker.js.map +1 -1
  56. package/commonjs/read/schema/convertMapToSchema.js +1 -8
  57. package/commonjs/read/schema/convertMapToSchema.js.map +1 -1
  58. package/commonjs/read/schema/convertMapToSchema.test.js.map +1 -1
  59. package/commonjs/read/schema/convertToJson.js +143 -142
  60. package/commonjs/read/schema/convertToJson.js.map +1 -1
  61. package/commonjs/read/schema/convertToJson.legacy.js +60 -0
  62. package/commonjs/read/schema/convertToJson.legacy.js.map +1 -0
  63. package/commonjs/read/schema/convertToJson.legacy.test.js.map +1 -0
  64. package/commonjs/read/schema/convertToJson.spreadsheet.js +25 -0
  65. package/commonjs/read/schema/convertToJson.spreadsheet.js.map +1 -0
  66. package/commonjs/read/schema/convertToJson.spreadsheet.test.js.map +1 -0
  67. package/commonjs/read/schema/convertToJson.test.js.map +1 -1
  68. package/commonjs/read/unpackXlsxFileBrowser.js +3 -9
  69. package/commonjs/read/unpackXlsxFileBrowser.js.map +1 -1
  70. package/commonjs/read/unpackXlsxFileNode.js +9 -15
  71. package/commonjs/read/unpackXlsxFileNode.js.map +1 -1
  72. package/commonjs/types/Boolean.js +0 -4
  73. package/commonjs/types/Boolean.js.map +1 -1
  74. package/commonjs/types/Date.js +0 -12
  75. package/commonjs/types/Date.js.map +1 -1
  76. package/commonjs/types/Email.js +0 -7
  77. package/commonjs/types/Email.js.map +1 -1
  78. package/commonjs/types/Email.test.js.map +1 -1
  79. package/commonjs/types/Integer.js +0 -7
  80. package/commonjs/types/Integer.js.map +1 -1
  81. package/commonjs/types/Integer.test.js.map +1 -1
  82. package/commonjs/types/InvalidError.js +8 -28
  83. package/commonjs/types/InvalidError.js.map +1 -1
  84. package/commonjs/types/Number.js +2 -10
  85. package/commonjs/types/Number.js.map +1 -1
  86. package/commonjs/types/String.js +4 -11
  87. package/commonjs/types/String.js.map +1 -1
  88. package/commonjs/types/URL.js +5 -8
  89. package/commonjs/types/URL.js.map +1 -1
  90. package/commonjs/types/URL.test.js.map +1 -1
  91. package/commonjs/xml/dom.js +6 -25
  92. package/commonjs/xml/dom.js.map +1 -1
  93. package/commonjs/xml/xlsx.js +1 -24
  94. package/commonjs/xml/xlsx.js.map +1 -1
  95. package/commonjs/xml/xml.js +1 -4
  96. package/commonjs/xml/xml.js.map +1 -1
  97. package/commonjs/xml/xmlBrowser.js +1 -2
  98. package/commonjs/xml/xmlBrowser.js.map +1 -1
  99. package/commonjs/xml/xpath/xlsx-xpath.js +3 -16
  100. package/commonjs/xml/xpath/xlsx-xpath.js.map +1 -1
  101. package/commonjs/xml/xpath/xpathBrowser.js +3 -5
  102. package/commonjs/xml/xpath/xpathBrowser.js.map +1 -1
  103. package/commonjs/xml/xpath/xpathNode.js +1 -5
  104. package/commonjs/xml/xpath/xpathNode.js.map +1 -1
  105. package/map/index.cjs +2 -0
  106. package/map/index.cjs.js +7 -0
  107. package/map/index.d.ts +11 -0
  108. package/map/index.js +1 -0
  109. package/map/package.json +17 -0
  110. package/modules/read/coordinates.js +7 -8
  111. package/modules/read/coordinates.js.map +1 -1
  112. package/modules/read/dropEmptyColumns.js +6 -17
  113. package/modules/read/dropEmptyColumns.js.map +1 -1
  114. package/modules/read/dropEmptyColumns.test.js.map +1 -1
  115. package/modules/read/dropEmptyRows.js +11 -22
  116. package/modules/read/dropEmptyRows.js.map +1 -1
  117. package/modules/read/dropEmptyRows.test.js.map +1 -1
  118. package/modules/read/getData.js +31 -39
  119. package/modules/read/getData.js.map +1 -1
  120. package/modules/read/isDateTimestamp.js +52 -39
  121. package/modules/read/isDateTimestamp.js.map +1 -1
  122. package/modules/read/parseCell.js +6 -6
  123. package/modules/read/parseCell.js.map +1 -1
  124. package/modules/read/parseCellValue.js +30 -55
  125. package/modules/read/parseCellValue.js.map +1 -1
  126. package/modules/read/parseCells.js +3 -3
  127. package/modules/read/parseCells.js.map +1 -1
  128. package/modules/read/parseDate.js +5 -4
  129. package/modules/read/parseDate.js.map +1 -1
  130. package/modules/read/parseDate.test.js.map +1 -1
  131. package/modules/read/parseDimensions.js +9 -17
  132. package/modules/read/parseDimensions.js.map +1 -1
  133. package/modules/read/parseFilePaths.js +5 -10
  134. package/modules/read/parseFilePaths.js.map +1 -1
  135. package/modules/read/parseProperties.js +8 -7
  136. package/modules/read/parseProperties.js.map +1 -1
  137. package/modules/read/parseSharedStrings.js +0 -1
  138. package/modules/read/parseSharedStrings.js.map +1 -1
  139. package/modules/read/parseSheet.js +3 -2
  140. package/modules/read/parseSheet.js.map +1 -1
  141. package/modules/read/parseStyles.js +16 -21
  142. package/modules/read/parseStyles.js.map +1 -1
  143. package/modules/read/readSheetNamesBrowser.js +1 -1
  144. package/modules/read/readSheetNamesBrowser.js.map +1 -1
  145. package/modules/read/readSheetNamesNode.js +1 -1
  146. package/modules/read/readSheetNamesNode.js.map +1 -1
  147. package/modules/read/readSheetNamesNode.test.js.map +1 -1
  148. package/modules/read/readSheetNamesWebWorker.js +1 -1
  149. package/modules/read/readSheetNamesWebWorker.js.map +1 -1
  150. package/modules/read/readXlsx.js +37 -35
  151. package/modules/read/readXlsx.js.map +1 -1
  152. package/modules/read/readXlsxFileBrowser.js +1 -1
  153. package/modules/read/readXlsxFileBrowser.js.map +1 -1
  154. package/modules/read/readXlsxFileContents.js +12 -17
  155. package/modules/read/readXlsxFileContents.js.map +1 -1
  156. package/modules/read/readXlsxFileNode.js +1 -1
  157. package/modules/read/readXlsxFileNode.js.map +1 -1
  158. package/modules/read/readXlsxFileNode.test.js.map +1 -1
  159. package/modules/read/readXlsxFileWebWorker.js +1 -1
  160. package/modules/read/readXlsxFileWebWorker.js.map +1 -1
  161. package/modules/read/schema/convertMapToSchema.js +1 -7
  162. package/modules/read/schema/convertMapToSchema.js.map +1 -1
  163. package/modules/read/schema/convertMapToSchema.test.js.map +1 -1
  164. package/modules/read/schema/convertToJson.js +143 -133
  165. package/modules/read/schema/convertToJson.js.map +1 -1
  166. package/modules/read/schema/convertToJson.legacy.js +53 -0
  167. package/modules/read/schema/convertToJson.legacy.js.map +1 -0
  168. package/modules/read/schema/convertToJson.legacy.test.js.map +1 -0
  169. package/modules/read/schema/convertToJson.spreadsheet.js +19 -0
  170. package/modules/read/schema/convertToJson.spreadsheet.js.map +1 -0
  171. package/modules/read/schema/convertToJson.spreadsheet.test.js.map +1 -0
  172. package/modules/read/schema/convertToJson.test.js.map +1 -1
  173. package/modules/read/unpackXlsxFileBrowser.js +4 -7
  174. package/modules/read/unpackXlsxFileBrowser.js.map +1 -1
  175. package/modules/read/unpackXlsxFileNode.js +9 -7
  176. package/modules/read/unpackXlsxFileNode.js.map +1 -1
  177. package/modules/types/Boolean.js +0 -1
  178. package/modules/types/Boolean.js.map +1 -1
  179. package/modules/types/Date.js +0 -8
  180. package/modules/types/Date.js.map +1 -1
  181. package/modules/types/Email.js +0 -2
  182. package/modules/types/Email.js.map +1 -1
  183. package/modules/types/Email.test.js.map +1 -1
  184. package/modules/types/Integer.js +0 -2
  185. package/modules/types/Integer.js.map +1 -1
  186. package/modules/types/Integer.test.js.map +1 -1
  187. package/modules/types/InvalidError.js +7 -25
  188. package/modules/types/InvalidError.js.map +1 -1
  189. package/modules/types/Number.js +2 -7
  190. package/modules/types/Number.js.map +1 -1
  191. package/modules/types/String.js +4 -8
  192. package/modules/types/String.js.map +1 -1
  193. package/modules/types/URL.js +5 -4
  194. package/modules/types/URL.js.map +1 -1
  195. package/modules/types/URL.test.js.map +1 -1
  196. package/modules/xml/dom.js +6 -18
  197. package/modules/xml/dom.js.map +1 -1
  198. package/modules/xml/xlsx.js +4 -13
  199. package/modules/xml/xlsx.js.map +1 -1
  200. package/modules/xml/xml.js.map +1 -1
  201. package/modules/xml/xmlBrowser.js.map +1 -1
  202. package/modules/xml/xpath/xlsx-xpath.js +2 -1
  203. package/modules/xml/xpath/xlsx-xpath.js.map +1 -1
  204. package/modules/xml/xpath/xpathBrowser.js +3 -4
  205. package/modules/xml/xpath/xpathBrowser.js.map +1 -1
  206. package/modules/xml/xpath/xpathNode.js +1 -0
  207. package/modules/xml/xpath/xpathNode.js.map +1 -1
  208. package/package.json +6 -1
  209. package/schema/index.cjs +2 -2
  210. package/schema/index.cjs.js +2 -2
  211. package/schema/index.d.ts +7 -2
  212. package/schema/index.js +1 -1
  213. package/types.d.ts +25 -2
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = parseExcelDate;
7
-
8
7
  // Parses an Excel Date ("serial") into a corresponding javascript Date in UTC+0 timezone.
9
8
  // (with time equal to 00:00)
10
9
  //
@@ -16,7 +15,9 @@ function parseExcelDate(excelSerialDate, options) {
16
15
  // https://support.microsoft.com/en-gb/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel
17
16
  if (options && options.epoch1904) {
18
17
  excelSerialDate += 1462;
19
- } // "Excel serial date" is just
18
+ }
19
+
20
+ // "Excel serial date" is just
20
21
  // the count of days since `01/01/1900`
21
22
  // (seems that it may be even fractional).
22
23
  //
@@ -25,9 +26,9 @@ function parseExcelDate(excelSerialDate, options) {
25
26
  // till `01/01/1970` (Unix epoch).
26
27
  // Accounts for leap years
27
28
  // (19 of them, yielding 19 extra days).
29
+ var daysBeforeUnixEpoch = 70 * 365 + 19;
28
30
 
29
-
30
- var daysBeforeUnixEpoch = 70 * 365 + 19; // An hour, approximately, because a minute
31
+ // An hour, approximately, because a minute
31
32
  // may be longer than 60 seconds, due to "leap seconds".
32
33
  //
33
34
  // Still, Javascript `Date` (and UNIX time in general) intentionally
@@ -66,7 +67,6 @@ function parseExcelDate(excelSerialDate, options) {
66
67
  // https://en.wikipedia.org/wiki/Leap_year
67
68
  // https://en.wikipedia.org/wiki/Leap_second
68
69
  //
69
-
70
70
  var hour = 60 * 60 * 1000;
71
71
  return new Date(Math.round((excelSerialDate - daysBeforeUnixEpoch) * 24 * hour));
72
72
  }
@@ -1 +1 @@
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\nexport 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":";;;;;;;AAAA;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
+ {"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\nexport 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":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAcA,CAACC,eAAe,EAAEC,OAAO,EAAE;EAC/D;EACA,IAAIA,OAAO,IAAIA,OAAO,CAACC,SAAS,EAAE;IAChCF,eAAe,IAAI,IAAI;EACzB;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMG,mBAAmB,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE;;EAEzC;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,EAAE,GAAG,EAAE,GAAG,IAAI;EAE3B,OAAO,IAAIC,IAAI,CAACC,IAAI,CAACC,KAAK,CAAC,CAACP,eAAe,GAAGG,mBAAmB,IAAI,EAAE,GAAGC,IAAI,CAAC,CAAC;AAClF"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"parseDate.test.js","names":["_parseDate","_interopRequireDefault","require","obj","__esModule","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,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAsC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAEtCE,QAAQ,CAAC,WAAW,EAAE,YAAM;EAC3BC,EAAE,CAAC,mCAAmC,EAAE,YAAM;IAC7C,IAAMC,IAAI,GAAGC,oBAAoB,CAAC,IAAIC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1D;IACA;IACF,IAAAC,qBAAS,EAAC,KAAK,CAAC,CAACC,OAAO,CAAC,CAAC,CAACC,MAAM,CAACC,KAAK,CAACN,IAAI,CAACI,OAAO,CAAC,CAAC,CAAC;EACxD,CAAC,CAAC;AACH,CAAC,CAAC;;AAEF;AACA,SAASH,oBAAoBA,CAACD,IAAI,EAAE;EACnC;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,IAAIE,IAAI,CAACF,IAAI,CAACI,OAAO,CAAC,CAAC,GAAGJ,IAAI,CAACO,iBAAiB,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACvE"}
@@ -4,50 +4,38 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = parseDimensions;
7
-
8
7
  var _coordinates = require("./coordinates.js");
9
-
10
8
  var _xlsx = require("../xml/xlsx.js");
11
-
12
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
-
14
10
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
-
16
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
-
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
-
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
-
12
+ 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; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
22
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
-
24
15
  // `dimensions` defines the spreadsheet area containing all non-empty cells.
25
16
  // https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.sheetdimension?view=openxml-2.8.1
26
17
  function parseDimensions(sheet) {
27
18
  var dimensions = (0, _xlsx.getDimensions)(sheet);
28
-
29
19
  if (dimensions) {
30
20
  dimensions = dimensions.split(':').map(_coordinates.parseCellCoordinates).map(function (_ref) {
31
21
  var _ref2 = _slicedToArray(_ref, 2),
32
- row = _ref2[0],
33
- column = _ref2[1];
34
-
22
+ row = _ref2[0],
23
+ column = _ref2[1];
35
24
  return {
36
25
  row: row,
37
26
  column: column
38
27
  };
39
- }); // Sometimes there can be just a single cell as a spreadsheet's "dimensions".
28
+ });
29
+ // Sometimes there can be just a single cell as a spreadsheet's "dimensions".
40
30
  // For example, the default "dimensions" in Apache POI library is "A1",
41
31
  // meaning that only the first cell in the spreadsheet is used.
42
32
  //
43
33
  // A quote from Apache POI library:
44
34
  // "Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1')."
45
35
  //
46
-
47
36
  if (dimensions.length === 1) {
48
37
  dimensions = [dimensions[0], dimensions[0]];
49
38
  }
50
-
51
39
  return dimensions;
52
40
  }
53
41
  }
@@ -1 +1 @@
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
+ {"version":3,"file":"parseDimensions.js","names":["_coordinates","require","_xlsx","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","len","length","arr2","r","l","t","Symbol","iterator","e","u","a","f","next","done","push","value","isArray","parseDimensions","sheet","dimensions","getDimensions","split","map","parseCellCoordinates","_ref","_ref2","row","column"],"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":"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"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = parseFilePaths;
7
-
8
7
  var _xlsx = require("../xml/xlsx.js");
9
-
10
8
  /**
11
9
  * Returns sheet file paths.
12
10
  * Seems that the correct place to look for the `sheetId` -> `filename` mapping
@@ -31,27 +29,24 @@ function parseFilePaths(content, xml) {
31
29
  sharedStrings: undefined,
32
30
  styles: undefined
33
31
  };
34
-
35
32
  var addFilePathInfo = function addFilePathInfo(relationship) {
36
33
  var filePath = relationship.getAttribute('Target');
37
34
  var fileType = relationship.getAttribute('Type');
38
-
39
35
  switch (fileType) {
40
36
  case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles':
41
37
  filePaths.styles = getFilePath(filePath);
42
38
  break;
43
-
44
39
  case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings':
45
40
  filePaths.sharedStrings = getFilePath(filePath);
46
41
  break;
47
-
48
42
  case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet':
49
43
  filePaths.sheets[relationship.getAttribute('Id')] = getFilePath(filePath);
50
44
  break;
51
45
  }
52
46
  };
47
+ (0, _xlsx.getRelationships)(document).forEach(addFilePathInfo);
53
48
 
54
- (0, _xlsx.getRelationships)(document).forEach(addFilePathInfo); // Seems like "sharedStrings.xml" is not required to exist.
49
+ // Seems like "sharedStrings.xml" is not required to exist.
55
50
  // For example, when the spreadsheet doesn't contain any strings.
56
51
  // https://github.com/catamphetamine/read-excel-file/issues/85
57
52
  // if (!filePaths.sharedStrings) {
@@ -60,7 +55,6 @@ function parseFilePaths(content, xml) {
60
55
 
61
56
  return filePaths;
62
57
  }
63
-
64
58
  function getFilePath(path) {
65
59
  // Normally, `path` is a relative path inside the ZIP archive,
66
60
  // like "worksheets/sheet1.xml", or "sharedStrings.xml", or "styles.xml".
@@ -71,13 +65,12 @@ function getFilePath(path) {
71
65
  // seem to support such absolute file paths, so this library does too.
72
66
  if (path[0] === '/') {
73
67
  return path.slice('/'.length);
74
- } // // Seems like a path could also be a URL.
68
+ }
69
+ // // Seems like a path could also be a URL.
75
70
  // // http://officeopenxml.com/anatomyofOOXML-xlsx.php
76
71
  // if (/^[a-z]+\:\/\//.test(path)) {
77
72
  // return path
78
73
  // }
79
-
80
-
81
74
  return 'xl/' + path;
82
75
  }
83
76
  //# sourceMappingURL=parseFilePaths.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"parseFilePaths.js","names":["_xlsx","require","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,IAAAA,KAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAcA,CAACC,OAAO,EAAEC,GAAG,EAAE;EACnD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMC,QAAQ,GAAGD,GAAG,CAACE,cAAc,CAACH,OAAO,CAAC;EAE5C,IAAMI,SAAS,GAAG;IAChBC,MAAM,EAAE,CAAC,CAAC;IACVC,aAAa,EAAEC,SAAS;IACxBC,MAAM,EAAED;EACV,CAAC;EAED,IAAME,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,YAAY,EAAK;IACxC,IAAMC,QAAQ,GAAGD,YAAY,CAACE,YAAY,CAAC,QAAQ,CAAC;IACpD,IAAMC,QAAQ,GAAGH,YAAY,CAACE,YAAY,CAAC,MAAM,CAAC;IAClD,QAAQC,QAAQ;MACd,KAAK,4EAA4E;QAC/ET,SAAS,CAACI,MAAM,GAAGM,WAAW,CAACH,QAAQ,CAAC;QACxC;MACF,KAAK,mFAAmF;QACtFP,SAAS,CAACE,aAAa,GAAGQ,WAAW,CAACH,QAAQ,CAAC;QAC/C;MACF,KAAK,+EAA+E;QAClFP,SAAS,CAACC,MAAM,CAACK,YAAY,CAACE,YAAY,CAAC,IAAI,CAAC,CAAC,GAAGE,WAAW,CAACH,QAAQ,CAAC;QACzE;IACJ;EACF,CAAC;EAED,IAAAI,sBAAgB,EAACb,QAAQ,CAAC,CAACc,OAAO,CAACP,eAAe,CAAC;;EAEnD;EACA;EACA;EACA;EACA;EACA;;EAEA,OAAOL,SAAS;AAClB;AAEA,SAASU,WAAWA,CAACG,IAAI,EAAE;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAIA,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;IACnB,OAAOA,IAAI,CAACC,KAAK,CAAC,GAAG,CAACC,MAAM,CAAC;EAC/B;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,KAAK,GAAGF,IAAI;AACrB"}
@@ -4,21 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = parseProperties;
7
-
8
7
  var _xlsx = require("../xml/xlsx.js");
9
-
10
8
  // I guess `xl/workbook.xml` file should always be present inside the *.xlsx archive.
11
9
  function parseProperties(content, xml) {
12
10
  var book = xml.createDocument(content);
13
- var properties = {}; // Read `<workbookPr/>` element to detect whether dates are 1900-based or 1904-based.
11
+ var properties = {};
12
+
13
+ // Read `<workbookPr/>` element to detect whether dates are 1900-based or 1904-based.
14
14
  // https://support.microsoft.com/en-gb/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel
15
15
  // http://webapp.docx4java.org/OnlineDemo/ecma376/SpreadsheetML/workbookPr.html
16
16
 
17
17
  var workbookProperties = (0, _xlsx.getWorkbookProperties)(book);
18
-
19
18
  if (workbookProperties && workbookProperties.getAttribute('date1904') === '1') {
20
19
  properties.epoch1904 = true;
21
- } // Get sheets info (indexes, names, if they're available).
20
+ }
21
+
22
+ // Get sheets info (indexes, names, if they're available).
22
23
  // Example:
23
24
  // <sheets>
24
25
  // <sheet
@@ -29,9 +30,7 @@ function parseProperties(content, xml) {
29
30
  // </sheets>
30
31
  // http://www.datypic.com/sc/ooxml/e-ssml_sheet-1.html
31
32
 
32
-
33
33
  properties.sheets = [];
34
-
35
34
  var addSheetInfo = function addSheetInfo(sheet) {
36
35
  if (sheet.getAttribute('name')) {
37
36
  properties.sheets.push({
@@ -41,7 +40,6 @@ function parseProperties(content, xml) {
41
40
  });
42
41
  }
43
42
  };
44
-
45
43
  (0, _xlsx.getSheets)(book).forEach(addSheetInfo);
46
44
  return properties;
47
45
  }
@@ -1 +1 @@
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
+ {"version":3,"file":"parseProperties.js","names":["_xlsx","require","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,IAAAA,KAAA,GAAAC,OAAA;AAKA;AACe,SAASC,eAAeA,CAACC,OAAO,EAAEC,GAAG,EAAE;EACpD,IAAMC,IAAI,GAAGD,GAAG,CAACE,cAAc,CAACH,OAAO,CAAC;EAExC,IAAMI,UAAU,GAAG,CAAC,CAAC;;EAErB;EACA;EACA;;EAEA,IAAMC,kBAAkB,GAAG,IAAAC,2BAAqB,EAACJ,IAAI,CAAC;EAEtD,IAAIG,kBAAkB,IAAIA,kBAAkB,CAACE,YAAY,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE;IAC7EH,UAAU,CAACI,SAAS,GAAG,IAAI;EAC7B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEAJ,UAAU,CAACK,MAAM,GAAG,EAAE;EAEtB,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAK,EAAK;IAC9B,IAAIA,KAAK,CAACJ,YAAY,CAAC,MAAM,CAAC,EAAE;MAC9BH,UAAU,CAACK,MAAM,CAACG,IAAI,CAAC;QACrBC,EAAE,EAAEF,KAAK,CAACJ,YAAY,CAAC,SAAS,CAAC;QACjCO,IAAI,EAAEH,KAAK,CAACJ,YAAY,CAAC,MAAM,CAAC;QAChCQ,UAAU,EAAEJ,KAAK,CAACJ,YAAY,CAAC,MAAM;MACvC,CAAC,CAAC;IACJ;EACF,CAAC;EAED,IAAAS,eAAS,EAACd,IAAI,CAAC,CAACe,OAAO,CAACP,YAAY,CAAC;EAErC,OAAON,UAAU;AACnB"}
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = parseSharedStrings;
7
-
8
7
  var _xlsx = require("../xml/xlsx.js");
9
-
10
8
  function parseSharedStrings(content, xml) {
11
9
  if (!content) {
12
10
  return [];
13
11
  }
14
-
15
12
  return (0, _xlsx.getSharedStrings)(xml.createDocument(content));
16
13
  }
17
14
  //# sourceMappingURL=parseSharedStrings.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"parseSharedStrings.js","names":["_xlsx","require","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,IAAAA,KAAA,GAAAC,OAAA;AAIe,SAASC,kBAAkBA,CAACC,OAAO,EAAEC,GAAG,EAAE;EACvD,IAAI,CAACD,OAAO,EAAE;IACZ,OAAO,EAAE;EACX;EACA,OAAO,IAAAE,sBAAgB,EAACD,GAAG,CAACE,cAAc,CAACH,OAAO,CAAC,CAAC;AACtD"}
@@ -4,20 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = parseSheet;
7
-
8
7
  var _parseCells = _interopRequireDefault(require("./parseCells.js"));
9
-
10
8
  var _parseDimensions = _interopRequireDefault(require("./parseDimensions.js"));
11
-
12
9
  var _coordinates = require("./coordinates.js");
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
11
  function parseSheet(content, xml, values, styles, properties, options) {
17
12
  var sheet = xml.createDocument(content);
18
- var cells = (0, _parseCells["default"])(sheet, xml, values, styles, properties, options); // `dimensions` defines the spreadsheet area containing all non-empty cells.
19
- // https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.sheetdimension?view=openxml-2.8.1
13
+ var cells = (0, _parseCells["default"])(sheet, xml, values, styles, properties, options);
20
14
 
15
+ // `dimensions` defines the spreadsheet area containing all non-empty cells.
16
+ // https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.sheetdimension?view=openxml-2.8.1
21
17
  var dimensions = (0, _parseDimensions["default"])(sheet) || (0, _coordinates.calculateDimensions)(cells);
22
18
  return {
23
19
  cells: cells,
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"parseSheet.js","names":["_parseCells","_interopRequireDefault","require","_parseDimensions","_coordinates","obj","__esModule","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,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAAsD,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAEvC,SAASE,UAAUA,CAACC,OAAO,EAAEC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAE;EACpF,IAAMC,KAAK,GAAGL,GAAG,CAACM,cAAc,CAACP,OAAO,CAAC;EAEzC,IAAMQ,KAAK,GAAG,IAAAC,sBAAU,EAACH,KAAK,EAAEL,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAEC,OAAO,CAAC;;EAEzE;EACA;EACA,IAAMK,UAAU,GAAG,IAAAC,2BAAe,EAACL,KAAK,CAAC,IAAI,IAAAM,gCAAmB,EAACJ,KAAK,CAAC;EAEvE,OAAO;IAAEA,KAAK,EAALA,KAAK;IAAEE,UAAU,EAAVA;EAAW,CAAC;AAC9B"}
@@ -4,25 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = parseStyles;
7
-
8
7
  var _xlsx = require("../xml/xlsx.js");
9
-
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
-
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
-
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
-
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
14
  // http://officeopenxml.com/SSstyles.php
17
15
  // Returns an array of cell styles.
18
16
  // A cell style index is its ID.
19
17
  function parseStyles(content, xml) {
20
18
  if (!content) {
21
19
  return {};
22
- } // 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
23
- // https://www.office-forums.com/threads/cellxfs-cellstylexfs.2163519/
24
-
20
+ }
25
21
 
22
+ // 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
23
+ // https://www.office-forums.com/threads/cellxfs-cellstylexfs.2163519/
26
24
  var doc = xml.createDocument(content);
27
25
  var baseStyles = (0, _xlsx.getBaseStyles)(doc).map(parseCellStyle);
28
26
  var numberFormats = (0, _xlsx.getNumberFormats)(doc).map(parseNumberFormatStyle).reduce(function (formats, format) {
@@ -31,33 +29,28 @@ function parseStyles(content, xml) {
31
29
  formats[format.id] = format;
32
30
  return formats;
33
31
  }, []);
34
-
35
32
  var getCellStyle = function getCellStyle(xf) {
36
33
  if (xf.hasAttribute('xfId')) {
37
34
  return _objectSpread(_objectSpread({}, baseStyles[xf.xfId]), parseCellStyle(xf, numberFormats));
38
35
  }
39
-
40
36
  return parseCellStyle(xf, numberFormats);
41
37
  };
42
-
43
38
  return (0, _xlsx.getCellStyles)(doc).map(getCellStyle);
44
39
  }
45
-
46
40
  function parseNumberFormatStyle(numFmt) {
47
41
  return {
48
42
  id: numFmt.getAttribute('numFmtId'),
49
43
  template: numFmt.getAttribute('formatCode')
50
44
  };
51
- } // http://www.datypic.com/sc/ooxml/e-ssml_xf-2.html
52
-
45
+ }
53
46
 
47
+ // http://www.datypic.com/sc/ooxml/e-ssml_xf-2.html
54
48
  function parseCellStyle(xf, numFmts) {
55
49
  var style = {};
56
-
57
50
  if (xf.hasAttribute('numFmtId')) {
58
- var numberFormatId = xf.getAttribute('numFmtId'); // Built-in number formats don't have a `<numFmt/>` element in `styles.xml`.
51
+ var numberFormatId = xf.getAttribute('numFmtId');
52
+ // Built-in number formats don't have a `<numFmt/>` element in `styles.xml`.
59
53
  // https://hexdocs.pm/xlsxir/number_styles.html
60
-
61
54
  if (numFmts[numberFormatId]) {
62
55
  style.numberFormat = numFmts[numberFormatId];
63
56
  } else {
@@ -66,7 +59,6 @@ function parseCellStyle(xf, numFmts) {
66
59
  };
67
60
  }
68
61
  }
69
-
70
62
  return style;
71
63
  }
72
64
  //# sourceMappingURL=parseStyles.js.map
@@ -1 +1 @@
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":";;;;;;;AAAA;;;;;;;;AAMA;AACA;AACA;AACe,SAASA,WAAT,CAAqBC,OAArB,EAA8BC,GAA9B,EAAmC;EAChD,IAAI,CAACD,OAAL,EAAc;IACZ,OAAO,EAAP;EACD,CAH+C,CAKhD;EACA;;;EACA,IAAME,GAAG,GAAGD,GAAG,CAACE,cAAJ,CAAmBH,OAAnB,CAAZ;EAEA,IAAMI,UAAU,GAAG,IAAAC,mBAAA,EAAcH,GAAd,EAChBI,GADgB,CACZC,cADY,CAAnB;EAGA,IAAMC,aAAa,GAAG,IAAAC,sBAAA,EAAiBP,GAAjB,EACnBI,GADmB,CACfI,sBADe,EAEnBC,MAFmB,CAEZ,UAACC,OAAD,EAAUC,MAAV,EAAqB;IAC3B;IACA;IACAD,OAAO,CAACC,MAAM,CAACC,EAAR,CAAP,GAAqBD,MAArB;IACA,OAAOD,OAAP;EACD,CAPmB,EAOjB,EAPiB,CAAtB;;EASA,IAAMG,YAAY,GAAG,SAAfA,YAAe,CAACC,EAAD,EAAQ;IAC3B,IAAIA,EAAE,CAACC,YAAH,CAAgB,MAAhB,CAAJ,EAA6B;MAC3B,uCACKb,UAAU,CAACY,EAAE,CAACE,IAAJ,CADf,GAEKX,cAAc,CAACS,EAAD,EAAKR,aAAL,CAFnB;IAID;;IACD,OAAOD,cAAc,CAACS,EAAD,EAAKR,aAAL,CAArB;EACD,CARD;;EAUA,OAAO,IAAAW,mBAAA,EAAcjB,GAAd,EAAmBI,GAAnB,CAAuBS,YAAvB,CAAP;AACD;;AAED,SAASL,sBAAT,CAAgCU,MAAhC,EAAwC;EACtC,OAAO;IACLN,EAAE,EAAEM,MAAM,CAACC,YAAP,CAAoB,UAApB,CADC;IAELC,QAAQ,EAAEF,MAAM,CAACC,YAAP,CAAoB,YAApB;EAFL,CAAP;AAID,C,CAED;;;AACA,SAASd,cAAT,CAAwBS,EAAxB,EAA4BO,OAA5B,EAAqC;EACnC,IAAMC,KAAK,GAAG,EAAd;;EACA,IAAIR,EAAE,CAACC,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"}
1
+ {"version":3,"file":"parseStyles.js","names":["_xlsx","require","_typeof","o","Symbol","iterator","constructor","prototype","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","call","TypeError","Number","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":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIuB,SAAAC,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAAA,SAAAK,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAX,CAAA,GAAAS,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAP,CAAA,GAAAA,CAAA,CAAAY,MAAA,WAAAL,CAAA,WAAAE,MAAA,CAAAI,wBAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAR,CAAA,YAAAQ,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAAZ,CAAA,UAAAC,CAAA,WAAAU,SAAA,CAAAX,CAAA,IAAAW,SAAA,CAAAX,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAY,OAAA,WAAAb,CAAA,IAAAc,eAAA,CAAAf,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAa,yBAAA,GAAAb,MAAA,CAAAc,gBAAA,CAAAjB,CAAA,EAAAG,MAAA,CAAAa,yBAAA,CAAAd,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAY,OAAA,WAAAb,CAAA,IAAAE,MAAA,CAAAe,cAAA,CAAAlB,CAAA,EAAAC,CAAA,EAAAE,MAAA,CAAAI,wBAAA,CAAAL,CAAA,EAAAD,CAAA,iBAAAD,CAAA;AAAA,SAAAe,gBAAAI,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAhB,MAAA,CAAAe,cAAA,CAAAC,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAb,UAAA,QAAAe,YAAA,QAAAC,QAAA,oBAAAL,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAG,GAAA,QAAAL,GAAA,GAAAM,YAAA,CAAAD,GAAA,oBAAAhC,OAAA,CAAA2B,GAAA,iBAAAA,GAAA,GAAAO,MAAA,CAAAP,GAAA;AAAA,SAAAM,aAAAE,KAAA,EAAAC,IAAA,QAAApC,OAAA,CAAAmC,KAAA,kBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAjC,MAAA,CAAAoC,WAAA,OAAAD,IAAA,KAAAE,SAAA,QAAAC,GAAA,GAAAH,IAAA,CAAAI,IAAA,CAAAN,KAAA,EAAAC,IAAA,oBAAApC,OAAA,CAAAwC,GAAA,uBAAAA,GAAA,YAAAE,SAAA,4DAAAN,IAAA,gBAAAF,MAAA,GAAAS,MAAA,EAAAR,KAAA;AAEvB;AACA;AACA;AACe,SAASS,WAAWA,CAACC,OAAO,EAAEC,GAAG,EAAE;EAChD,IAAI,CAACD,OAAO,EAAE;IACZ,OAAO,CAAC,CAAC;EACX;;EAEA;EACA;EACA,IAAME,GAAG,GAAGD,GAAG,CAACE,cAAc,CAACH,OAAO,CAAC;EAEvC,IAAMI,UAAU,GAAG,IAAAC,mBAAa,EAACH,GAAG,CAAC,CAClCI,GAAG,CAACC,cAAc,CAAC;EAEtB,IAAMC,aAAa,GAAG,IAAAC,sBAAgB,EAACP,GAAG,CAAC,CACxCI,GAAG,CAACI,sBAAsB,CAAC,CAC3BC,MAAM,CAAC,UAACC,OAAO,EAAEC,MAAM,EAAK;IAC3B;IACA;IACAD,OAAO,CAACC,MAAM,CAACC,EAAE,CAAC,GAAGD,MAAM;IAC3B,OAAOD,OAAO;EAChB,CAAC,EAAE,EAAE,CAAC;EAER,IAAMG,YAAY,GAAG,SAAfA,YAAYA,CAAIC,EAAE,EAAK;IAC3B,IAAIA,EAAE,CAACC,YAAY,CAAC,MAAM,CAAC,EAAE;MAC3B,OAAA5C,aAAA,CAAAA,aAAA,KACK+B,UAAU,CAACY,EAAE,CAACE,IAAI,CAAC,GACnBX,cAAc,CAACS,EAAE,EAAER,aAAa,CAAC;IAExC;IACA,OAAOD,cAAc,CAACS,EAAE,EAAER,aAAa,CAAC;EAC1C,CAAC;EAED,OAAO,IAAAW,mBAAa,EAACjB,GAAG,CAAC,CAACI,GAAG,CAACS,YAAY,CAAC;AAC7C;AAEA,SAASL,sBAAsBA,CAACU,MAAM,EAAE;EACtC,OAAO;IACLN,EAAE,EAAEM,MAAM,CAACC,YAAY,CAAC,UAAU,CAAC;IACnCC,QAAQ,EAAEF,MAAM,CAACC,YAAY,CAAC,YAAY;EAC5C,CAAC;AACH;;AAEA;AACA,SAASd,cAAcA,CAACS,EAAE,EAAEO,OAAO,EAAE;EACnC,IAAMC,KAAK,GAAG,CAAC,CAAC;EAChB,IAAIR,EAAE,CAACC,YAAY,CAAC,UAAU,CAAC,EAAE;IAC/B,IAAMQ,cAAc,GAAGT,EAAE,CAACK,YAAY,CAAC,UAAU,CAAC;IAClD;IACA;IACA,IAAIE,OAAO,CAACE,cAAc,CAAC,EAAE;MAC3BD,KAAK,CAACE,YAAY,GAAGH,OAAO,CAACE,cAAc,CAAC;IAC9C,CAAC,MAAM;MACLD,KAAK,CAACE,YAAY,GAAG;QAAEZ,EAAE,EAAEW;MAAe,CAAC;IAC7C;EACF;EACA,OAAOD,KAAK;AACd"}
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = readSheetNames;
7
-
8
7
  var _readXlsxFileBrowser = _interopRequireDefault(require("./readXlsxFileBrowser.js"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
9
  /**
13
10
  * Reads the list of sheet names in an XLSX file in a web browser.
14
11
  * @param {file} file - A file being uploaded in the browser.
@@ -1 +1 @@
1
- {"version":3,"file":"readSheetNamesBrowser.js","names":["readSheetNames","file","readXlsxFile","getSheets","then","sheets","map","sheet","name"],"sources":["../../source/read/readSheetNamesBrowser.js"],"sourcesContent":["import readXlsxFile from './readXlsxFileBrowser.js'\r\n\r\n/**\r\n * Reads the list of sheet names in an XLSX file in a web browser.\r\n * @param {file} file - A file being uploaded in the browser.\r\n * @return {Promise} Resolves to an array of objects of shape `{ name: string }`.\r\n */\r\nexport default function readSheetNames(file) {\r\n\treturn readXlsxFile(file, { getSheets: true })\r\n\t\t.then(sheets => sheets.map(sheet => sheet.name))\r\n}"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,CAAwBC,IAAxB,EAA8B;EAC5C,OAAO,IAAAC,+BAAA,EAAaD,IAAb,EAAmB;IAAEE,SAAS,EAAE;EAAb,CAAnB,EACLC,IADK,CACA,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,GAAP,CAAW,UAAAC,KAAK;MAAA,OAAIA,KAAK,CAACC,IAAV;IAAA,CAAhB,CAAJ;EAAA,CADN,CAAP;AAEA"}
1
+ {"version":3,"file":"readSheetNamesBrowser.js","names":["_readXlsxFileBrowser","_interopRequireDefault","require","obj","__esModule","readSheetNames","file","readXlsxFile","getSheets","then","sheets","map","sheet","name"],"sources":["../../source/read/readSheetNamesBrowser.js"],"sourcesContent":["import readXlsxFile from './readXlsxFileBrowser.js'\r\n\r\n/**\r\n * Reads the list of sheet names in an XLSX file in a web browser.\r\n * @param {file} file - A file being uploaded in the browser.\r\n * @return {Promise} Resolves to an array of objects of shape `{ name: string }`.\r\n */\r\nexport default function readSheetNames(file) {\r\n\treturn readXlsxFile(file, { getSheets: true })\r\n\t\t.then(sheets => sheets.map(sheet => sheet.name))\r\n}"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAEnD;AACA;AACA;AACA;AACA;AACe,SAASE,cAAcA,CAACC,IAAI,EAAE;EAC5C,OAAO,IAAAC,+BAAY,EAACD,IAAI,EAAE;IAAEE,SAAS,EAAE;EAAK,CAAC,CAAC,CAC5CC,IAAI,CAAC,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,GAAG,CAAC,UAAAC,KAAK;MAAA,OAAIA,KAAK,CAACC,IAAI;IAAA,EAAC;EAAA,EAAC;AAClD"}
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = readSheetNames;
7
-
8
7
  var _readXlsxFileNode = _interopRequireDefault(require("./readXlsxFileNode.js"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
9
  /**
13
10
  * Reads the list of sheet names in an XLSX file in Node.js.
14
11
  * @param {(string|Stream|Buffer)} input - A Node.js readable stream or a `Buffer` or a path to a file.
@@ -1 +1 @@
1
- {"version":3,"file":"readSheetNamesNode.js","names":["readSheetNames","input","readXlsxFile","getSheets","then","sheets","map","sheet","name"],"sources":["../../source/read/readSheetNamesNode.js"],"sourcesContent":["import readXlsxFile from './readXlsxFileNode.js'\r\n\r\n/**\r\n * Reads the list of sheet names in an XLSX file in Node.js.\r\n * @param {(string|Stream|Buffer)} input - A Node.js readable stream or a `Buffer` or a path to a file.\r\n * @return {Promise} Resolves to an array of objects of shape `{ name: string }`.\r\n */\r\nexport default function readSheetNames(input) {\r\n\treturn readXlsxFile(input, { getSheets: true })\r\n\t\t.then(sheets => sheets.map(sheet => sheet.name))\r\n}"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,CAAwBC,KAAxB,EAA+B;EAC7C,OAAO,IAAAC,4BAAA,EAAaD,KAAb,EAAoB;IAAEE,SAAS,EAAE;EAAb,CAApB,EACLC,IADK,CACA,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,GAAP,CAAW,UAAAC,KAAK;MAAA,OAAIA,KAAK,CAACC,IAAV;IAAA,CAAhB,CAAJ;EAAA,CADN,CAAP;AAEA"}
1
+ {"version":3,"file":"readSheetNamesNode.js","names":["_readXlsxFileNode","_interopRequireDefault","require","obj","__esModule","readSheetNames","input","readXlsxFile","getSheets","then","sheets","map","sheet","name"],"sources":["../../source/read/readSheetNamesNode.js"],"sourcesContent":["import readXlsxFile from './readXlsxFileNode.js'\r\n\r\n/**\r\n * Reads the list of sheet names in an XLSX file in Node.js.\r\n * @param {(string|Stream|Buffer)} input - A Node.js readable stream or a `Buffer` or a path to a file.\r\n * @return {Promise} Resolves to an array of objects of shape `{ name: string }`.\r\n */\r\nexport default function readSheetNames(input) {\r\n\treturn readXlsxFile(input, { getSheets: true })\r\n\t\t.then(sheets => sheets.map(sheet => sheet.name))\r\n}"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAEhD;AACA;AACA;AACA;AACA;AACe,SAASE,cAAcA,CAACC,KAAK,EAAE;EAC7C,OAAO,IAAAC,4BAAY,EAACD,KAAK,EAAE;IAAEE,SAAS,EAAE;EAAK,CAAC,CAAC,CAC7CC,IAAI,CAAC,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,GAAG,CAAC,UAAAC,KAAK;MAAA,OAAIA,KAAK,CAACC,IAAI;IAAA,EAAC;EAAA,EAAC;AAClD"}
@@ -1 +1 @@
1
- {"version":3,"file":"readSheetNamesNode.test.js","names":["describe","it","readSheetNamesNode","path","resolve","then","sheetNames","should","deep","equal"],"sources":["../../source/read/readSheetNamesNode.test.js"],"sourcesContent":["import path from 'path'\r\n\r\nimport readSheetNamesNode from './readSheetNamesNode.js'\r\n\r\ndescribe('readSheetNamesNode', () => {\r\n\tit('should read the list of sheet names in an *.xlsx file in Node.js', () => {\r\n\t\treturn readSheetNamesNode(path.resolve('./test/spreadsheets/multiple-sheets.xlsx')).then((sheetNames) => {\r\n\t\t\tsheetNames.should.deep.equal(['sheet 1', 'sheet 2'])\r\n\t\t})\r\n\t})\r\n})"],"mappings":";;AAAA;;AAEA;;;;AAEAA,QAAQ,CAAC,oBAAD,EAAuB,YAAM;EACpCC,EAAE,CAAC,kEAAD,EAAqE,YAAM;IAC5E,OAAO,IAAAC,8BAAA,EAAmBC,gBAAA,CAAKC,OAAL,CAAa,0CAAb,CAAnB,EAA6EC,IAA7E,CAAkF,UAACC,UAAD,EAAgB;MACxGA,UAAU,CAACC,MAAX,CAAkBC,IAAlB,CAAuBC,KAAvB,CAA6B,CAAC,SAAD,EAAY,SAAZ,CAA7B;IACA,CAFM,CAAP;EAGA,CAJC,CAAF;AAKA,CANO,CAAR"}
1
+ {"version":3,"file":"readSheetNamesNode.test.js","names":["_path","_interopRequireDefault","require","_readSheetNamesNode","obj","__esModule","describe","it","readSheetNamesNode","path","resolve","then","sheetNames","should","deep","equal"],"sources":["../../source/read/readSheetNamesNode.test.js"],"sourcesContent":["import path from 'path'\r\n\r\nimport readSheetNamesNode from './readSheetNamesNode.js'\r\n\r\ndescribe('readSheetNamesNode', () => {\r\n\tit('should read the list of sheet names in an *.xlsx file in Node.js', () => {\r\n\t\treturn readSheetNamesNode(path.resolve('./test/spreadsheets/multiple-sheets.xlsx')).then((sheetNames) => {\r\n\t\t\tsheetNames.should.deep.equal(['sheet 1', 'sheet 2'])\r\n\t\t})\r\n\t})\r\n})"],"mappings":";;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAwD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAExDE,QAAQ,CAAC,oBAAoB,EAAE,YAAM;EACpCC,EAAE,CAAC,kEAAkE,EAAE,YAAM;IAC5E,OAAO,IAAAC,8BAAkB,EAACC,gBAAI,CAACC,OAAO,CAAC,0CAA0C,CAAC,CAAC,CAACC,IAAI,CAAC,UAACC,UAAU,EAAK;MACxGA,UAAU,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC,CAAC;EACH,CAAC,CAAC;AACH,CAAC,CAAC"}
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = readSheetNames;
7
-
8
7
  var _readXlsxFileWebWorker = _interopRequireDefault(require("./readXlsxFileWebWorker.js"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
9
  /**
13
10
  * Reads the list of sheet names in an XLSX file in a Web Worker.
14
11
  * @param {file} file - The file.
@@ -1 +1 @@
1
- {"version":3,"file":"readSheetNamesWebWorker.js","names":["readSheetNames","file","readXlsxFile","getSheets","then","sheets","map","sheet","name"],"sources":["../../source/read/readSheetNamesWebWorker.js"],"sourcesContent":["import readXlsxFile from './readXlsxFileWebWorker.js'\r\n\r\n/**\r\n * Reads the list of sheet names in an XLSX file in a Web Worker.\r\n * @param {file} file - The file.\r\n * @return {Promise} Resolves to an array of objects of shape `{ name: string }`.\r\n */\r\nexport default function readSheetNames(file) {\r\n\treturn readXlsxFile(file, { getSheets: true })\r\n\t\t.then(sheets => sheets.map(sheet => sheet.name))\r\n}"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,CAAwBC,IAAxB,EAA8B;EAC5C,OAAO,IAAAC,iCAAA,EAAaD,IAAb,EAAmB;IAAEE,SAAS,EAAE;EAAb,CAAnB,EACLC,IADK,CACA,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,GAAP,CAAW,UAAAC,KAAK;MAAA,OAAIA,KAAK,CAACC,IAAV;IAAA,CAAhB,CAAJ;EAAA,CADN,CAAP;AAEA"}
1
+ {"version":3,"file":"readSheetNamesWebWorker.js","names":["_readXlsxFileWebWorker","_interopRequireDefault","require","obj","__esModule","readSheetNames","file","readXlsxFile","getSheets","then","sheets","map","sheet","name"],"sources":["../../source/read/readSheetNamesWebWorker.js"],"sourcesContent":["import readXlsxFile from './readXlsxFileWebWorker.js'\r\n\r\n/**\r\n * Reads the list of sheet names in an XLSX file in a Web Worker.\r\n * @param {file} file - The file.\r\n * @return {Promise} Resolves to an array of objects of shape `{ name: string }`.\r\n */\r\nexport default function readSheetNames(file) {\r\n\treturn readXlsxFile(file, { getSheets: true })\r\n\t\t.then(sheets => sheets.map(sheet => sheet.name))\r\n}"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAqD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAErD;AACA;AACA;AACA;AACA;AACe,SAASE,cAAcA,CAACC,IAAI,EAAE;EAC5C,OAAO,IAAAC,iCAAY,EAACD,IAAI,EAAE;IAAEE,SAAS,EAAE;EAAK,CAAC,CAAC,CAC5CC,IAAI,CAAC,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,GAAG,CAAC,UAAAC,KAAK;MAAA,OAAIA,KAAK,CAACC,IAAI;IAAA,EAAC;EAAA,EAAC;AAClD"}