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

returning string rather than object?? #5

Open
btmurrell opened this issue Jan 31, 2023 · 4 comments
Open

returning string rather than object?? #5

btmurrell opened this issue Jan 31, 2023 · 4 comments

Comments

@btmurrell
Copy link

Your doc says cssToJS will return an object. In my usage, it returns a string. and the string is not a JSON string, so i cannot parse it. Am I doing something wrong?

this is the string value i am getting:

"{
  RootElement: {
    eWhite: '#FFFFFF',
    eBlack100: '#3c4d5c',
    eBlack200: '#414c56',
    eBlack300: '#364756',
    eBlack400: '#304150',
    eBlack500: '#304250',
    }
}"
@TechStudent10
Copy link

Might be worth a try to use

JSON.parse(data)

@btmurrell
Copy link
Author

Might be worth a try to use

JSON.parse(data)

nope. look at the string. that is not valid JSON. That's my point.

@TechStudent10
Copy link

TechStudent10 commented Feb 1, 2023

Might be worth a try to use

JSON.parse(data)

nope. look at the string. that is not valid JSON. That's my point.

Ahhhhhh, I don't know who to fix this sorry.

@i-lq
Copy link

i-lq commented Dec 22, 2023

Solved this problem this way, it's a quick fix, I guess.

json= eval("(()=>{return "+cssToJS(css)+"})()");

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

3 participants