-
Notifications
You must be signed in to change notification settings - Fork 106
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
[QUESTION] through.obj remove duplicate files using path #108
Comments
Sorry, this is entirely a gulp question not a through2 one so you'll have to continue the conversation there. My guess would be that you should keep a list of files outside of the stream chain and within one of the streams in the chain be filtering out duplicates which you keep a record of in the list of files. const files = {}
thing.pipe(through2.obj((f, _, cb) => {
if (!files[f]) {
files[f] = true
this.write(f)
}
cb()
}).pipe(...)
... or something like that (this is off the top of my head and likely the specific semantics are a little wrong cause I haven't had to author one for a few months! but hopefully you get the idea). |
How to get path, just tell me
it showing lots of things |
Getting 🚀 ~ file: plugin.ts ~ line 69 ~ fileThing DestroyableTransform {
_readableState: ReadableState {
objectMode: true,
highWaterMark: 16,
buffer: BufferList { length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
ended: false,
endEmitted: false,
reading: false,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null
},
readable: true,
_events: [Object: null prototype] {
end: [Function: bound onceWrapper] { listener: [Function: onend] },
prefinish: [Function: prefinish]
},
_eventsCount: 2,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: true,
highWaterMark: 16,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function (anonymous)],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree: CorkedRequest {
next: null,
entry: null,
finish: [Function (anonymous)]
}
},
writable: true,
allowHalfOpen: true,
_transformState: {
afterTransform: [Function: bound afterTransform],
needTransform: false,
transforming: false,
writecb: null,
writechunk: null,
writeencoding: null
},
_destroyed: false,
_transform: [Function (anonymous)],
_flush: [Function (anonymous)],
[Symbol(kCapture)]: false
} |
Because for thomas-darling/gulp-dependents#12
The text was updated successfully, but these errors were encountered: