We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
replaceChunk
replaceParent
1 parent 5fa6caa commit 848b5aeCopy full SHA for 848b5ae
1 file changed
lib/Chunk.js
@@ -169,6 +169,26 @@ class Chunk {
169
module.rewriteChunkInReasons(this, [otherChunk]);
170
}
171
172
+ replaceChunk(oldChunk, newChunk) {
173
+ const idx = this.chunks.indexOf(oldChunk);
174
+ if(idx >= 0) {
175
+ this.chunks.splice(idx, 1);
176
+ }
177
+ if(this !== newChunk && newChunk.addParent(this)) {
178
+ this.addChunk(newChunk);
179
180
181
+
182
+ replaceParent(oldParent, newParent) {
183
+ const idx = this.parents.indexOf(oldParent);
184
185
+ this.parents.splice(idx, 1);
186
187
+ if(this !== newParent && newParent.addChunk(this)) {
188
+ this.addParent(newParent);
189
190
191
192
integrate(other, reason) {
193
if(!this.canBeIntegrated(other)) {
194
return false;
0 commit comments