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

[BUG] Single quotes removed from values #242

Open
1 task done
simoneb opened this issue Feb 19, 2024 · 0 comments
Open
1 task done

[BUG] Single quotes removed from values #242

simoneb opened this issue Feb 19, 2024 · 0 comments
Labels
Needs Triage needs an initial review

Comments

@simoneb
Copy link

simoneb commented Feb 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Decoding then encoding (without further transformation) a file like this:

ActiveIndex = '0'
MaximizedFlag = '1911'
ProductVersion = '14.0.25793.400'
Version = '1'
WindowCount = '1'

Turns it into this:

ActiveIndex=0
MaximizedFlag=1911
ProductVersion=14.0.25793.400
Version=1
WindowCount=1

It basically removed the single quotes around the values, thereby causing a compatibility issue with the software that is supposed to open this file.

Expected Behavior

Single quotes are not removed from values

Steps To Reproduce

import fs from "fs";
import ini from "ini";

const input = `ActiveIndex = '0'
MaximizedFlag = '1911'
ProductVersion = '14.0.25793.400'
Version = '1'
WindowCount = '1'`

const data = ini.parse(input);

// prints the values without quotes
console.log(ini.stringify(data));

Environment

  • npm: 10.2.4
  • Node: 21.5.0
  • OS: Windows 11
  • platform: -
@simoneb simoneb added the Needs Triage needs an initial review label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Triage needs an initial review
Projects
None yet
Development

No branches or pull requests

1 participant