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

Add cloneDeepWithoutLoc #10670

Closed
jridgewell opened this issue Nov 6, 2019 · 2 comments · Fixed by #10680
Closed

Add cloneDeepWithoutLoc #10670

jridgewell opened this issue Nov 6, 2019 · 2 comments · Fixed by #10680
Assignees
Labels
claimed good first issue Has PR i: enhancement outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types

Comments

@jridgewell
Copy link
Member

I had a need for a t.cloneDeepWithoutLoc function today. We have a t.cloneDeep and a t.cloneWithoutLoc (both deprecated, but that's OK), but we do not have a t.cloneDeepWithoutLoc.

These functions all live in https://github.com/babel/babel/tree/bdb4318f47ec42ca4e325b5163e2e8ad57de4849/packages/babel-types/src/clone.

They are exported publicly at

// clone
export { default as cloneNode } from "./clone/cloneNode";
export { default as clone } from "./clone/clone";
export { default as cloneDeep } from "./clone/cloneDeep";
export { default as cloneWithoutLoc } from "./clone/cloneWithoutLoc";
.

We can add the functionality as a new optional-boolean parameter t.cloneNode. Let's call it withoutLoc. While we're add it, we can update t.cloneWithoutLoc to use this new parameter.

Let's also add tests, and flow and typescript types.

@Taym95
Copy link
Contributor

Taym95 commented Nov 6, 2019

I would like to work on it!

@nicolo-ribaudo
Copy link
Member

It's yours!

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jun 16, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
claimed good first issue Has PR i: enhancement outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants