Skip to content

Commit

Permalink
fix(vscode): Update data variable to fix BOM character (#4437)
Browse files Browse the repository at this point in the history
Update data variable to fix BOM character
  • Loading branch information
ccastrotrejo authored Mar 25, 2024
1 parent e5d3347 commit d0ea7ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/vs-code-designer/src/app/utils/parseJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import * as jsonc from 'jsonc-parser';
* @returns {T} Parsed data in JSON format.
*/
export function parseJson<T extends object>(data: string): T {
let updateData = data;
if (updateData.charCodeAt(0) === 0xfeff) {
updateData = updateData.slice(1);
if (data.charCodeAt(0) === 0xfeff) {
data = data.slice(1);
}

const errors: jsonc.ParseError[] = [];
Expand Down

0 comments on commit d0ea7ed

Please sign in to comment.