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

Scalar variables mapped as strings #8

Open
moravcik opened this issue Jan 31, 2018 · 1 comment
Open

Scalar variables mapped as strings #8

moravcik opened this issue Jan 31, 2018 · 1 comment

Comments

@moravcik
Copy link

Hello, thank you for your nice lib. I am using it to resolve environment properties in complex configuration.

However, I have found a problem when mapping scalar variables, they are resolved always as strings.
Here is my code:

import { object } from 'json-templater';
object({ foo: '{{bar}}' }, { bar: 5 }); 

The result is { foo: '5' }, but expected result is with number value: { foo: 5 }

When I use object as variable,

object({ foo: '{{bar}}' }, { bar: { baz: 6 } })

it is correctly resolved in result with all types within a variable retained:

{ foo: { baz: 6 } }

Do you have any idea, or am I missing something? Thank you

@jjaroczynski
Copy link

I would love to have this as well.

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