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

fix(duplicate files): always result in unique file names #1405

Merged
merged 2 commits into from
Feb 27, 2019

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Feb 14, 2019

Make sure that the typescript transpiler plugin always results in unique
file names. For example, given the following input:

foo.js
foo.ts

It will transpile foo.ts to foo.js, the result is now:

foo.js

Fixes #1318

Make sure that the typescript transpiler plugin always results in unique
file names. For example, given the following input:

```
foo.js
foo.ts
```

It will transpile `foo.ts` to `foo.js`, the result is now:

```
foo.js
```
@ghost ghost assigned nicojs Feb 14, 2019
@ghost ghost added the 🔎 Needs review label Feb 14, 2019
@nicojs nicojs changed the title fix(duplicate files): make transpile always result in unique file names fix(duplicate files): always result in unique file names Feb 14, 2019
@bartekleon
Copy link
Member

@nicojs instead of using object you could try Set (sth like array) or Map (sth like object), they don't allow same elements to be added :/

@nicojs
Copy link
Member Author

nicojs commented Feb 25, 2019

@kmdrGroch a Set would not be useful. Objects are by their nature always unique. A Map could work. The problem is that they don't serialize easily (although we're using surrial which can serialize anything).

What are the advantages of using a map over an object?

@bartekleon
Copy link
Member

@nicojs Well Map has better / cleaner syntax than an object, there are also some articles about it if you are interested:
https://medium.com/front-end-weekly/es6-map-vs-object-what-and-when-b80621932373
But it's really up to you which one you prefer

@nicojs nicojs merged commit a3018d2 into master Feb 27, 2019
@ghost ghost removed the 🔎 Needs review label Feb 27, 2019
@nicojs nicojs deleted the 1318/duplicate-files-ts-transpiler branch February 27, 2019 08:28
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

Successfully merging this pull request may close these issues.

None yet

3 participants