Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add platform option to force line endings #199

Merged
merged 1 commit into from Apr 12, 2023
Merged

feat: add platform option to force line endings #199

merged 1 commit into from Apr 12, 2023

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented Apr 11, 2023

Rebase and cleanup of #64
Author: @asnowfix

nlf
nlf previously approved these changes Apr 12, 2023
This is useful when  generating a file which is not  intended to be used
on the same platform as the current one.  Most embedded system today use
the DOS/Windows format only.
@wraithgar wraithgar merged commit 6a3cb38 into main Apr 12, 2023
22 checks passed
@wraithgar wraithgar deleted the gar/pr64 branch April 12, 2023 16:49
@github-actions github-actions bot mentioned this pull request Apr 12, 2023
Copy link
Contributor

@Creskendoll Creskendoll left a comment

Choose a reason for hiding this comment

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

Hello, wanted to let you know that this change is not compatible with browser environments.
I'm aware that the library is meant to be used with Node, but the implementation should be platform-agnostic.
I'll create a PR that addresses this.
Thank you for your work 🙏

opt.whitespace = opt.whitespace === true
opt.newline = opt.newline === true
/* istanbul ignore next */
opt.platform = opt.platform || process?.platform
Copy link
Contributor

Choose a reason for hiding this comment

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

Trying to access process in a browser environment fails.
The availability of the value needs to be checked with typeof process === 'undefined'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants