How to use the es5-ext/array/#/remove.apply function in es5-ext

To help you get started, we’ve selected a few es5-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github medikoo / fs2 / readdir.js View on Github external
(nuData.files.onend = function (newFiles) {
							delete this.readers[rootPath];
							if (newFiles.length) {
								newFiles = newFiles.map(getPath);
								remove.apply(result, newFiles);
								if (promise.resolved || stream) {
									promise.emit("change", {
										data: result,
										removed: newFiles,
										added: []
									});
								}
							}
						}.bind(this))
					);
github medikoo / fs2 / readdir.js View on Github external
.done(function () {
						if (files) {
							removed = data.removed.filter(contains, files);
							if (removed.length || (nFiles && nFiles.length)) {
								remove.apply(files, removed);
								if (nFiles) push.apply(files, nFiles);
								result.files.emit("change", {
									data: files,
									removed: removed,
									added: nFiles || []
								});
							}
						}
						if (getDirs) {
							removed = data.removed.filter(contains, dirs);
							if (removed.length || (nDirs && nDirs.length)) {
								remove.apply(dirs, removed);
								if (nDirs) push.apply(dirs, nDirs);
								result.dirs.emit("change", {
									data: dirs,
									removed: removed,
github medikoo / fs2 / readdir.js View on Github external
if (files) {
							removed = data.removed.filter(contains, files);
							if (removed.length || (nFiles && nFiles.length)) {
								remove.apply(files, removed);
								if (nFiles) push.apply(files, nFiles);
								result.files.emit("change", {
									data: files,
									removed: removed,
									added: nFiles || []
								});
							}
						}
						if (getDirs) {
							removed = data.removed.filter(contains, dirs);
							if (removed.length || (nDirs && nDirs.length)) {
								remove.apply(dirs, removed);
								if (nDirs) push.apply(dirs, nDirs);
								result.dirs.emit("change", {
									data: dirs,
									removed: removed,
									added: nDirs || []
								});
							}
						}
					});
			});
github medikoo / fs2 / readdir.js View on Github external
nuData.files.on("change", function (nextData) {
					var removed, added;
					removed = rootPath ? nextData.removed.map(getPath) : nextData.removed;
					added = rootPath ? nextData.added.map(getPath) : nextData.added;
					remove.apply(result, removed);
					push.apply(result, added);
					if (promise.resolved || stream) {
						promise.emit("change", { data: result, removed: removed, added: added });
					}
				});
			}
github medikoo / fs2 / readdir.js View on Github external
original(path, function (err, data) {
					var removed, added;
					if (err) {
						promise.emit("end", files, err);
						return;
					}
					removed = diff.call(files, data);
					added = diff.call(data, files);
					if (removed.length || added.length) {
						remove.apply(files, removed);
						push.apply(files, added);
						promise.emit("change", { data: files, removed: removed, added: added });
					}
				});
			});
github medikoo / fs2 / readdir.js View on Github external
paths.on("change", function (data) {
				var removed, added;
				removed = data.removed.filter(contains, result);
				added = data.added.filter(filter);
				if (removed.length || added.length) {
					remove.apply(result, removed);
					push.apply(result, added);
					promise.emit("change", { data: result, removed: removed, added: added });
				}
			});
			paths.on("end", function (data, err) { promise.emit("end", result, err); });
github medikoo / fs2 / readdir.js View on Github external
onEnd = function () {
					if (removed.length || added.length) {
						remove.apply(result, removed);
						push.apply(result, added);
						promise.emit("change", { data: result, removed: removed, added: added });
					}
				};
				if (!waiting) {