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

R.Path - Typescript error for an array of objects #430

Open
e1um opened this issue Feb 20, 2019 · 0 comments
Open

R.Path - Typescript error for an array of objects #430

e1um opened this issue Feb 20, 2019 · 0 comments

Comments

@e1um
Copy link

e1um commented Feb 20, 2019

const emailData = {
	payload: {
		headers: [{ name: "header1", value: "value1" }, { name: "header2", value: "value2" }]
	}
}

const headers = R.path(['payload', 'headers'], emailData)
//[{ name: "header1", value: "value1" }, { name: "header2", value: "value2" }]

screen shot 2019-02-20 at 3 16 27 pm

This returns a type of 'path_11<{}>' when it should be typed with a 'path_11<List<{}>>'. When I try and call R.find() on 'headers' I get an error

screen shot 2019-02-20 at 3 20 12 pm

**Apologies if I'm not using the right lingo... fairly new to typescript.

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

1 participant