-
Notifications
You must be signed in to change notification settings - Fork 8
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
re implements vector and changes zip #77
Conversation
Thank you for contributing to tgui-core! The workflow 'Chromatic Security' requires repository secrets and will not run without approval. Maintainers can add the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should add tests for these in the repo. Node has built in testing now, maybe we could make use of it?
actually not a bad idea. |
About the PR
Re-implements the vector functions, using the built ins and moving the zip function to mapping to have it consistent.
Best to look over the code please.
We will now always fill vectors up with undefined if any is longer than the other. The image below was the common test case beforehand, which now also has the undefined and fill up to have it behave the same no matter which vector is the longer one.
![grafik](https://private-user-images.githubusercontent.com/144968721/407478459-4842ebfe-8fac-475b-a70b-654c033580e2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzA2OTgsIm5iZiI6MTczODk3MDM5OCwicGF0aCI6Ii8xNDQ5Njg3MjEvNDA3NDc4NDU5LTQ4NDJlYmZlLThmYWMtNDc1Yi1hNzBiLTY1NGMwMzM1ODBlMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QyMzE5NThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05YmJmYTFmM2FmNTQ0ODJkMTMzYzRiMTZkM2U1NzI5MDljZDgyNzZiZjJhYzVjZjY4Nzc3OWQyYzg0NDQyNDY5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7tPraPgcqipZ7kOWWdCDl4djl9yuXiMkgY7nVGxnE-I)
Swapping the test case to have the larger vector as the first vector on original code:
![grafik](https://private-user-images.githubusercontent.com/144968721/407478049-98d97ddd-eca9-4061-ba9e-116d1d5c4f8f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzA2OTgsIm5iZiI6MTczODk3MDM5OCwicGF0aCI6Ii8xNDQ5Njg3MjEvNDA3NDc4MDQ5LTk4ZDk3ZGRkLWVjYTktNDA2MS1iYTllLTExNmQxZDVjNGY4Zi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QyMzE5NThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYTM3NTNjN2IyNWZhMzJhOTMyNzQyYmQ0OWU5YjM1ZmRmNmQyYjk4YmI0NDkzODFjNjM4OTIxZmNlZGRjN2VlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.W4CYJycvgAnureYvnH4b7QW8xWVM9OF5Dx-DySJcNj4)
Why's this needed?
We've multiple UIs relying on zip and vector, so we should be able to import them from tgui core