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

Suggestion: option to remove $ from keys #17

Open
cheshrkat opened this issue May 3, 2017 · 1 comment
Open

Suggestion: option to remove $ from keys #17

cheshrkat opened this issue May 3, 2017 · 1 comment

Comments

@cheshrkat
Copy link

Great package!

Idea for a feature: I had some feedback that the leading $ was a bit weird when using the JSON elsewhere. Perhaps a good option to add, something like "stripLeadingDollar" (boolean).

@Sicria
Copy link

Sicria commented May 29, 2018

For anyone else also wanting this, in the meantime you can use this.

function formatScssVariables(obj) {
  return Object.entries(obj).reduce((payload, [key, value]) => ({
    ...payload,
    [key.replace('$', '')]: value,
  }), {});
}

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

No branches or pull requests

2 participants