This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const toInt = (string) => parseInt(string) || 0 | |
| console.log( | |
| toInt(null), // 0 | |
| toInt(undefined), // 0 | |
| toInt(NaN), // 0 | |
| toInt(""), // 0 | |
| toInt({}), // 0 | |
| toInt(0), // 0 | |
| toInt([]), // 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const signer = require('node-signpdf').default | |
| const fs = require('fs') | |
| const { plainAddPlaceholder } = require('node-signpdf/dist/helpers'); | |
| const pdfSignedPath = `./signed.pdf`; | |
| const pdfBuffer = fs.readFileSync(`./source.pdf`); | |
| const certBuffer = fs.readFileSync(`./certificate.p12`); | |
| let inputBuffer = plainAddPlaceholder({ | |
| pdfBuffer, |
OlderNewer