Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

added a replace string to remove BOM from json file before parse #153

Conversation

Blackbaud-BrandonJones
Copy link
Contributor

Currently if editing the skyuxconfig.json file in Visual Studio, it addes a Byte Order Mark to the file, which causes the json parse to explode.

nodejs/node-v0.x-archive#1918 (comment)

This is a work around as readFileSync doesn't strip out BOM by default.
Related to:
blackbaud/skyux2#700

@codecov-io
Copy link

codecov-io commented May 16, 2017

Codecov Report

Merging #153 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #153   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          34     34           
  Lines         694    694           
  Branches       85     85           
=====================================
  Hits          694    694
Flag Coverage Δ
#builder 100% <100%> (ø) ⬆️
#runtime 100% <ø> (ø) ⬆️
Impacted Files Coverage Δ
config/sky-pages/sky-pages.config.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14b74df...cdc3fc8. Read the comment docs.

@Blackbaud-PaulCrowder
Copy link
Member

Does using readJsonAsync from fs-extras also work? fs-extras uses the jsonfile package to read JSON documents which strips the BOM before parsing the document.

Copy link
Member

@Blackbaud-PaulCrowder Blackbaud-PaulCrowder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my previous comment about fs-extras.

@Blackbaud-PaulCrowder Blackbaud-PaulCrowder merged commit 29b430d into blackbaud:master May 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants