Is local path - Node.js File

Node.js examples for File:Path

Description

Is local path

Demo Code

function isLocal(excludes, path) {
    var matched = false;
    excludes.forEach(function(domain) {
        if (path.match('^https?://[^/]*'+domain) || path.match('^//[^/]*'+domain)) {
            matched = true;//w  w  w. j  a  v a2 s .c o  m
        }
    });
    return matched;
}

Related Tutorials