Comments (18)
I'm not sure what you mean. What's the difference between what it does by default and what you want?
from deepmerge.
Is this what you want?
{
arrayMerge: (target, source, options) => {
const destination = source.slice();
source.forEach((item, index) => {
destination.push(item);
});
return destination;
}
}
from deepmerge.
I'm not sure what you mean. What's the difference between what it does by default and what you want?
My current deepmerge.all() returns:
{
purge: {
content: [
'a/path/to/my/file-ca/path/to/my/file-da/path/to/my/file-ca/path/to/my/file-d'
]
}
}
Instead of:
{
purge: {
content: [
'a/path/to/my/file-c',
'a/path/to/my/file-d',
'a/path/to/my/file-c',
'a/path/to/my/file-d'
]
}
}
Edit: arrayMerge didn't work, the item is already concatenated when it does destination.push(item)
from deepmerge.
oh, the strings are getting concatenated together.
What does your arrayMerge
function look like?
from deepmerge.
Currently no options are included, so the default of deepmerge.all()
from deepmerge.
I'm not able to recreate the issue: https://codesandbox.io/s/stupefied-matan-df2ri6?file=/src/index.ts
from deepmerge.
I'm not sure what might be causing this issue. You could try using my library instead and see if you are having the same issue with it: https://www.npmjs.com/package/deepmerge-ts
Note: deepmerge-ts was originally planned to be the next version of this library.
from deepmerge.
Which function in your lib would replace the .all()
method?
from deepmerge.
deepmerge
; it can take any number of arguments.
Note: If you want to provide it with an array of values, call it using the spread operator e.g. deepmerge(...args)
from deepmerge.
And deepmerge a object with an object? For some reason I can't figure out this API
I have two situations:
- Merge a array of objects
- Merge an object with the result of 1
Note: Previously I would do deepmerge(deepmerge.all(myArray.map((extension) => {})), MyBaseObject)
from deepmerge.
So for 1. - Merging an array of objects into a single object, would just be deepmerge(...myArrayOfObjects)
.
I'm not sure what you mean by 2. but if it is just that line of code, the equivalent would be:
deepmerge(...(myArray.map((extension) => {})), MyBaseObject)
from deepmerge.
If you link me your code, I can take a look at it for you.
from deepmerge.
The themes.json looks like:
{
"extensions": [
{
"name": "package-a",
"src": "vendor/internal/package-a/src"
},
{
"name": "package-b",
"src": "vendor/internal/package-b/src"
}
]
}
And a custom tailwind.config.js inside of one of those paths:
module.exports = {
purge: {
content: [
'/view/frontend/templates/**/*.phtml',
]
}
}
Put a lot of time in this... almost at a point where I'm just telling myself to use the fix and move on haha
from deepmerge.
Does this work for you?
return deepmerge(
...themeConfig.extensions.map((extension) => {
const configFilePath = themeDirBackTrails[backtrail] + extension.src + "/tailwind.config.js";
if (fs.existsSync(configFilePath)) {
return require(configFilePath);
}
return {};
}),
baseConfig
);
Here's a playground link: https://codesandbox.io/s/beautiful-perlman-edswlz?file=/src/test.js
from deepmerge.
It's doing something, but break somewhere in the middle. Hard to explain what's going on.
from deepmerge.
If you're able to provide more data I'll look into it more tomorrow.
from deepmerge.
If you're able to provide more data I'll look into it more tomorrow.
Is there a way I can reach you via chat or something? Would communicate a lot easier if you ask me. I'm going with my current solution because I really spent to much time into this issue where I can't understand a package would by default concatenate arrays...
Let me know
from deepmerge.
To get more help you would need to provide a REPL link that replicates your problem, and demonstrates the output that you expect as opposed to what the code produces
from deepmerge.
Related Issues (20)
- Is it possible to deepmerge an HTML dom object? HOT 3
- is this library no longer maintained ? HOT 1
- [feature request] more contextual info customMerge HOT 2
- is-mergeable-object is a devDependency HOT 4
- Deepmerge deletes values of ArrayBuffer and replaces to an empty object HOT 4
- How to use one object as target HOT 8
- Deno? HOT 7
- High CPU usage with large object merge HOT 1
- use recursive partial for type definitions HOT 1
- Will we ever see the v5? HOT 4
- When a particular property of the source object is undefined while the target one has a value, the value will be override by undefined HOT 2
- How to delete an element from an array with deepmerge. HOT 1
- `is-mergeable-object` is a `devDependency` but used in `index.js` HOT 7
- An error occuren when merge axios config: config.signal.addEventListener is not a function HOT 3
- add ESM, support for module and browser HOT 5
- Possible to remove duplicate objects in arrays? HOT 1
- deepmerge_1.default) is not a function (No Webpack) HOT 4
- A class instance in an array in an object get formed into an object.
- It need filter on merge
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepmerge.