Skip to content

Commit b7e679d

Browse files
committed
chore: export BOM constant
1 parent 23fd4a1 commit b7e679d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/properties.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export type KeyValuePair = {
2727
*/
2828
export const empty = (): Properties => ({lines: []})
2929

30+
/**
31+
* Byte-order mark.
32+
*/
33+
export const BOM = 0xfeff
34+
3035
/**
3136
* Parses java properties file contents.
3237
*
@@ -43,7 +48,7 @@ export const parse = (contents: string): Properties => {
4348
}
4449

4550
// Remove BOM from the first line
46-
if (lines.length > 0 && lines[0].codePointAt(0) === 0xfeff) {
51+
if (lines.length > 0 && lines[0].codePointAt(0) === BOM) {
4752
lines[0] = lines[0].slice(1)
4853
}
4954

0 commit comments

Comments
 (0)