-
Notifications
You must be signed in to change notification settings - Fork 522
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
V2: move convertToBlob from core/io to io-utils for coherence & practicality #509
Conversation
…elf) * replaced prepareOutput + convertToBlob (used in almost all packages) with solidsAsBlob() utility * lots of related tweaks & cleanups
* have a more specific package (do one thing & do it well) * resolve circular dependency problems between packages
2eb9459
to
43ff4cf
Compare
@z3dev this is ready for review :
|
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.
Just a general question... can the movement from ‘core to IO’ be split from the new array package (I like this)?
packages/utils/array-utils/index.js
Outdated
@@ -30,4 +30,20 @@ const nth = (index, data) => { | |||
return data[index] | |||
} | |||
|
|||
module.exports = {toArray, head, flatten, nth} | |||
/* function flatten (array) { |
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.
See the flatten in modeling, which is recursive. I think that’s a better implementation.
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.
Ah yes, btw I did not touch the array things in modeling because there are other people doing changes in modeling, and we can always make modeling import array utils.
Btw about recursive vs non recursive : perhaps we should have both: I remember there was a case where a single level of flattening was expected (I cannot recall the exact location, sorry :( )
We could provide a 'flattenDeep' or 'flattenNested' or a parameter ?
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.
I would just go with the recursive version for flatten() as that's what we really want for handling lists of objects coming into API functions.
If we need a function to 'clean' an array then let's create and name appropriately.
I found another package using a specific toArray() function... svg-deserializer |
No, sadly, because as stated above just the move results in circular dependencies. |
good catch ! will update |
@z3dev should be all good |
I didn’t have time to review in full. I’ll finish tomorrow morning, which should be while you are sleeping. 😃 |
packages/utils/array-utils/index.js
Outdated
@@ -30,4 +30,20 @@ const nth = (index, data) => { | |||
return data[index] | |||
} | |||
|
|||
module.exports = {toArray, head, flatten, nth} | |||
/* function flatten (array) { |
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.
I would just go with the recursive version for flatten() as that's what we really want for handling lists of objects coming into API functions.
If we need a function to 'clean' an array then let's create and name appropriately.
@kaosat-dev nice last commit. 👍🏻 You can merge. I’m very satisfied with this. |
thanks @z3dev ! Merging ! |
All Submissions:
@z3dev : this is a small one, but long overdue, and fixes a few issues I had locally