How to use the junk.isnt function in junk

To help you get started, we’ve selected a few junk 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 OrgCurrent / Android / node / bower / lib / core / resolvers / FsResolver.js View on Github external
.then(function (files) {
        var file;
        var oldPath;
        var newPath;

        // Remove any OS specific files from the files array
        // before checking its length
        files = files.filter(junk.isnt);

        // Only rename if there's only one file and it's not the json
        if (files.length === 1 && !/^(bower|component)\.json$/.test(files[0])) {
            file = files[0];
            this._singleFile = 'index' + path.extname(file);
            oldPath = path.join(this._tempDir, file);
            newPath = path.join(this._tempDir, this._singleFile);

            return Q.nfcall(fs.rename, oldPath, newPath);
        }
    }.bind(this));
};
github bower / bower / lib / core / resolvers / UrlResolver.js View on Github external
function(files) {
            var file;
            var oldPath;
            var newPath;

            // Remove any OS specific files from the files array
            // before checking its length
            files = files.filter(junk.isnt);

            // Only rename if there's only one file and it's not the json
            if (
                files.length === 1 &&
                !/^(component|bower)\.json$/.test(files[0])
            ) {
                file = files[0];
                this._singleFile = 'index' + path.extname(file);
                oldPath = path.join(this._tempDir, file);
                newPath = path.join(this._tempDir, this._singleFile);

                return Q.nfcall(fs.rename, oldPath, newPath);
            }
        }.bind(this)
    );
github bower / bower / lib / core / resolvers / FsResolver.js View on Github external
function(files) {
            var file;
            var oldPath;
            var newPath;

            // Remove any OS specific files from the files array
            // before checking its length
            files = files.filter(junk.isnt);

            // Only rename if there's only one file and it's not the json
            if (
                files.length === 1 &&
                !/^(bower|component)\.json$/.test(files[0])
            ) {
                file = files[0];
                this._singleFile = 'index' + path.extname(file);
                oldPath = path.join(this._tempDir, file);
                newPath = path.join(this._tempDir, this._singleFile);

                return Q.nfcall(fs.rename, oldPath, newPath);
            }
        }.bind(this)
    );
github OrgCurrent / Android / node / bower / lib / core / resolvers / UrlResolver.js View on Github external
.then(function (files) {
        var file;
        var oldPath;
        var newPath;

        // Remove any OS specific files from the files array
        // before checking its length
        files = files.filter(junk.isnt);

        // Only rename if there's only one file and it's not the json
        if (files.length === 1 && !/^(component|bower)\.json$/.test(files[0])) {
            file = files[0];
            this._singleFile = 'index' + path.extname(file);
            oldPath = path.join(this._tempDir, file);
            newPath = path.join(this._tempDir, this._singleFile);

            return Q.nfcall(fs.rename, oldPath, newPath);
        }
    }.bind(this));
};
github ippontech / tatami / web / node_modules / bower / lib / util / extract.js View on Github external
.then(function (files) {
        var singleDir;

        // Remove any OS specific files from the files array
        // before checking its length
        files = files.filter(junk.isnt);

        if (files.length !== 1) {
            return false;
        }

        singleDir = path.join(dir, files[0]);

        return Q.nfcall(fs.stat, singleDir)
        .then(function (stat) {
            return stat.isDirectory() ? singleDir : false;
        });
    });
}
github hw2-archive / upt / src / lib / util / extract.js View on Github external
.then(function (files) {
                var singleDir;

                // Remove any OS specific files from the files array
                // before checking its length
                files = files.filter(junk.isnt);

                if (files.length !== 1) {
                    return false;
                }

                singleDir = path.join(dir, files[0]);

                return Q.nfcall(fs.stat, singleDir)
                        .then(function (stat) {
                            return stat.isDirectory() ? singleDir : false;
                        });
            });
}
github hw2-archive / upt / src / lib / core / resolvers / FsResolver.js View on Github external
.then(function (files) {
                var file;
                var oldPath;
                var newPath;

                // Remove any OS specific files from the files array
                // before checking its length
                files = files.filter(junk.isnt);

                // Only rename in specific cases
                if (files.length === 1 && path.extname(files[0]) === ".js") {
                    file = files[0];
                    this._singleFile = 'index' + path.extname(file);
                    oldPath = path.join(this._workingDir, file);
                    newPath = path.join(this._workingDir, this._singleFile);

                    return Q.nfcall(fs.rename, oldPath, newPath);
                }
            }.bind(this));
};
github bower / bower / lib / util / extract.js View on Github external
return Q.nfcall(fs.readdir, dir).then(function(files) {
        var singleDir;

        // Remove any OS specific files from the files array
        // before checking its length
        files = files.filter(junk.isnt);

        if (files.length !== 1) {
            return false;
        }

        singleDir = path.join(dir, files[0]);

        return Q.nfcall(fs.stat, singleDir).then(function(stat) {
            return stat.isDirectory() ? singleDir : false;
        });
    });
}

junk

Filter out system junk files like .DS_Store and Thumbs.db

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Popular junk functions