@gatekeeper_technology/excel-utils 1.0.7 → 1.0.8

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/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Gatekeeper's Excel Utils
2
2
 
3
3
  ## Changelog
4
+ ### [1.00.08] 24-08-2022
5
+ ### Added
6
+ - Ability to get worksheet by name.
7
+ - Ability to get worksheet by index.
4
8
  ### [1.00.07] 24-08-2022
5
9
  ### Fixed
6
10
  - Fixed bug where workbook_creator class was not exported properly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gatekeeper_technology/excel-utils",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Gatekeeper's excel Utils - shared in NPM",
5
5
  "author": "David Holtzhausen",
6
6
  "main": "index.js",
@@ -124,6 +124,26 @@ let WorkbookCreator = class {
124
124
  };
125
125
  }
126
126
 
127
+ /**
128
+ * Gets worksheet with specified name within workbook
129
+ * @param {ExcelJS.Workbook} workbook
130
+ * @param {string} worksheet_name
131
+ * @returns {ExcelJS.Worksheet} Worksheet with specified name
132
+ */
133
+ getWorksheetByName(workbook, worksheet_name) {
134
+ return workbook.getWorksheet(worksheet_name);
135
+ }
136
+
137
+ /**
138
+ * Gets worksheet at specified index within workbook
139
+ * @param {ExcelJS.Workbook} workbook
140
+ * @param {number} index
141
+ * @returns {ExcelJS.Worksheet} Worksheet at specified index
142
+ */
143
+ getWorksheetByIndex(workbook, worksheet_index) {
144
+ return workbook.worksheets[worksheet_index];
145
+ }
146
+
127
147
  }
128
148
 
129
149
  module.exports = WorkbookCreator;