Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint max-lines: off */
"use strict";
var push = Array.prototype.push
, fs = require("fs")
, pathUtils = require("path")
, aFrom = require("es5-ext/array/from")
, diff = require("es5-ext/array/#/diff")
, startsWith = require("es5-ext/string/#/starts-with")
, deferred = require("deferred")
, delay = deferred.delay
, promisify = deferred.promisify
, mkdir = promisify(fs.mkdir)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, rmdir = promisify(fs.rmdir)
, basename = pathUtils.basename
, resolve = pathUtils.resolve
, sep = pathUtils.sep
, pgPath = resolve(__dirname, "./__playground/readdir");
module.exports = function (t) {
var pathsAll, paths2, paths0, files2, replaceSep, DELAY = 100;
replaceSep = function (path) { return path.replace(/\//g, sep); };
pathsAll = [
"done", "done/done", "done/done/dthree", "done/done/dthree/dthree",
"done/done/dthree/dthree/foo", "done/done/dthree/dtwo", "done/done/dthree/dtwo/foo",
"use strict";
var fs = require("fs")
, deferred = require("deferred")
, resolve = require("path").resolve
, promisify = deferred.promisify
, delay = deferred.delay
, mkdir = promisify(fs.mkdir)
, rmdir = promisify(fs.rmdir)
, gitMode = require("../../lib/ignore-modes/git")
, rootPath = resolve(__dirname, "../__playground/lib/find-root");
module.exports = function (t, a, d) {
var gitRoot = resolve(rootPath, ".git")
, onePath = resolve(rootPath, "one")
, gitOnePath = resolve(onePath, ".git")
, twoPath = resolve(onePath, "two")
, gitTwoPath = resolve(twoPath, ".git")
, filePath = resolve(twoPath, "file.xxx");
var DELAY = 100, watcher, events = [];
// Create /.git
"use strict";
var deferred = require("deferred")
, bufferFrom = require("../lib/buffer-from")
, delay = deferred.delay
, promisify = deferred.promisify
, isBuffer = Buffer.isBuffer
, fs = require("fs")
, resolve = require("path").resolve
, open = promisify(fs.open)
, write = promisify(fs.write)
, close = promisify(fs.close)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, pgPath = resolve(__dirname, "./__playground/read-file");
module.exports = function (t) {
var DELAY = 100;
return {
Regular: {
"use strict";
var fs = require("fs")
, resolve = require("path").resolve
, deferred = require("deferred")
, bufferFrom = require("../lib/buffer-from")
, delay = deferred.delay
, promisify = deferred.promisify
, mkdir = promisify(fs.mkdir)
, open = promisify(fs.open)
, rename = promisify(fs.rename)
, write = promisify(fs.write)
, close = promisify(fs.close)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, rmdir = promisify(fs.rmdir)
, pgPath = resolve(__dirname, "./__playground/watch");
module.exports = function (t, a, d) {
var ondirchange = 0
, onfilechange = 0
, ondirend = 0
, onfileend = 0
"use strict";
var fs = require("fs")
, resolve = require("path").resolve
, deferred = require("deferred")
, bufferFrom = require("../../lib/buffer-from")
, delay = deferred.delay
, promisify = deferred.promisify
, mkdir = promisify(fs.mkdir)
, open = promisify(fs.open)
, rename = promisify(fs.rename)
, write = promisify(fs.write)
, close = promisify(fs.close)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, rmdir = promisify(fs.rmdir)
, pgPath = resolve(__dirname, "../__playground/lib/watch-alt");
module.exports = function (t, a, d) {
var ondirchange = 0
, onfilechange = 0
, ondirend = 0
, onfileend = 0
"use strict";
var fs = require("fs")
, resolve = require("path").resolve
, deferred = require("deferred")
, bufferFrom = require("../../lib/buffer-from")
, delay = deferred.delay
, promisify = deferred.promisify
, mkdir = promisify(fs.mkdir)
, open = promisify(fs.open)
, rename = promisify(fs.rename)
, write = promisify(fs.write)
, close = promisify(fs.close)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, rmdir = promisify(fs.rmdir)
, pgPath = resolve(__dirname, "../__playground/lib/watch");
module.exports = function (t, a, d) {
var ondirchange = 0
, onfilechange = 0
, ondirend = 0
, onfileend = 0
"use strict";
var fs = require("fs")
, resolve = require("path").resolve
, deferred = require("deferred")
, bufferFrom = require("../lib/buffer-from")
, delay = deferred.delay
, promisify = deferred.promisify
, mkdir = promisify(fs.mkdir)
, open = promisify(fs.open)
, rename = promisify(fs.rename)
, write = promisify(fs.write)
, close = promisify(fs.close)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, rmdir = promisify(fs.rmdir)
, pgPath = resolve(__dirname, "./__playground/watch-path");
module.exports = function (t, a, d) {
var ondirchange = []
, onfilechange = []
, DELAY = 100
, dirPath = resolve(pgPath, "tmpdir")
"use strict";
var fs = require("fs")
, resolve = require("path").resolve
, omap = require("es5-ext/object/map")
, deferred = require("deferred")
, delay = deferred.delay
, promisify = deferred.promisify
, mkdir = promisify(fs.mkdir)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, rmdir = promisify(fs.rmdir)
, mode = require("../../lib/ignore-modes/git")
, pgPath = resolve(__dirname, "../__playground/lib/get-conf-file-map");
module.exports = function (t, a, d) {
var data
, invoked = false
, DELAY = 100
, gitRoot = resolve(pgPath, ".git")
, rootFile = resolve(pgPath, ".gitignore")
, onePath = resolve(pgPath, "one")
, oneFile = resolve(onePath, ".gitignore")
"use strict";
var fs = require("fs")
, resolve = require("path").resolve
, noop = require("es5-ext/function/noop")
, deferred = require("deferred")
, delay = deferred.delay
, promisify = deferred.promisify
, mkdir = promisify(fs.mkdir)
, writeFile = promisify(fs.writeFile)
, unlink = promisify(fs.unlink)
, rmdir = promisify(fs.rmdir)
, modes = require("../lib/ignore-modes")
, pgPath = resolve(__dirname, "./__playground/is-ignored");
module.exports = function (t, a, d) {
var invoked = null
, testIsRoot
, DELAY = 100
, gitRoot = resolve(pgPath, ".git")
, rootFile = resolve(pgPath, ".gitignore")
, onePath = resolve(pgPath, "one")
, oneFile = resolve(onePath, ".gitignore")
"use strict";
var isValue = require("es5-ext/object/is-value")
, fs = require("fs")
, deferred = require("deferred")
, resolve = require("path").resolve
, promisify = deferred.promisify
, delay = deferred.delay
, mkdir = promisify(fs.mkdir)
, rmdir = promisify(fs.rmdir)
, isArray = Array.isArray
, rootPath = resolve(__dirname, "../../__playground/lib/ignore-modes/git");
module.exports = function (t, a, d) {
var gitRoot = resolve(rootPath, ".git")
, onePath = resolve(rootPath, "one")
, gitOnePath = resolve(onePath, ".git")
, twoPath = resolve(onePath, "two")
, gitTwoPath = resolve(twoPath, ".git")
, rootEvents = []
, oneEvents = []
, twoEvents = []
, w1
, w2