Skip to content

Commit

Permalink
fix: Switching to using String.fromCodePoint() instead of String.from…
Browse files Browse the repository at this point in the history
…CharCode()
  • Loading branch information
yegor-pelykh committed Mar 26, 2024
1 parent bf9546f commit e78bdf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/common/input-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class InputBuffer<T extends TypedArray> {
while (!this.isEOS) {
const c = this.read();
if (c === 0) {
return String.fromCharCode(...codes);
return String.fromCodePoint(...codes);
}
codes.push(c);
}
Expand All @@ -265,7 +265,7 @@ export class InputBuffer<T extends TypedArray> {

const s = this.readRange(length);
const bytes = s.toUint8Array();
const result = String.fromCharCode(...bytes);
const result = String.fromCodePoint(...bytes);
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/exif/ifd-value/ifd-ascii-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class IfdAsciiValue extends IfdValue {
if (typeof value === 'string') {
this._value = value;
} else {
this._value = String.fromCharCode(...value);
this._value = String.fromCodePoint(...value);
}
}

Expand Down

0 comments on commit e78bdf5

Please sign in to comment.