Skip to content

Commit

Permalink
feat: bump exceljs from 4.3.0 to 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
damingerdai committed Oct 29, 2024
1 parent be1bb4d commit 14a8d90
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"compression": "^1.7.4",
"cookie-parser": "^1.4.5",
"dotenv": "^16.1.4",
"exceljs": "^4.3.0",
"exceljs": "^4.4.0",
"express": "^4.18.2",
"express-fileupload": "^1.4.0",
"express-joi-validation": "^0.3.0",
Expand Down
23 changes: 12 additions & 11 deletions src/lib/excel/excel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Workbook, Worksheet, WorksheetProtection } from 'exceljs';
import { Workbook, Worksheet } from 'exceljs';
import { Sheets } from './type';

export async function protectSheets(sheets: Worksheet[]): Promise<void> {
const spinCount = Math.min(sheets.length, 10);
await Promise.all(
sheets.map(sheet => sheet.protect(Math.random().toString(), {
selectLockedCells: true,
selectUnlockedCells: true,
formatCells: false,
formatColumns: true,
formatRows: true,
insertRows: false,
insertColumns: false,
spinCount
} as unknown as WorksheetProtection)
sheets.map(sheet =>
sheet.protect(Math.random().toString(), {
selectLockedCells: true,
selectUnlockedCells: true,
formatCells: false,
formatColumns: true,
formatRows: true,
insertRows: false,
insertColumns: false,
spinCount
})
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3431,7 +3431,7 @@ events@^3.2.0:
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==

exceljs@^4.3.0:
exceljs@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/exceljs/-/exceljs-4.4.0.tgz#cfb1cb8dcc82c760a9fc9faa9e52dadab66b0156"
integrity sha512-XctvKaEMaj1Ii9oDOqbW/6e1gXknSY4g/aLCDicOXqBE4M0nRWkUu0PTp++UPNzoFY12BNHMfs/VadKIS6llvg==
Expand Down

0 comments on commit 14a8d90

Please sign in to comment.