Skip to content

Commit

Permalink
fix: Buffer not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
nbouvrette committed Apr 30, 2023
1 parent e5cb8d8 commit 26dde24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"prettier": "2.8.8",
"prettier-plugin-organize-imports": "3.2.2",
"prettier-plugin-sh": "0.12.8",
"release-it": "15.10.1",
"release-it": "15.10.2",
"ts-jest": "29.1.0",
"ts-node": "10.9.1",
"typescript": "5.0.4"
Expand Down
2 changes: 1 addition & 1 deletion src/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Properties {
* @param content - The content of a `.properties` file.
*/
constructor(content: string | Buffer) {
const stringContent = Buffer.isBuffer(content) ? content.toString() : content
const stringContent = typeof content === 'string' ? content : content.toString()
this.hasBom = stringContent.codePointAt(0) === BOM_CODE_POINT
this.eolCharacter = getFirstEolCharacter(stringContent) ?? DEFAULT_END_OF_LINE_CHARACTER
this.lines = (this.hasBom ? stringContent.slice(1) : stringContent).split(/\r?\n/)
Expand Down

0 comments on commit 26dde24

Please sign in to comment.