node-http-server – Rev 35
?pathlinks?
#!/usr/bin/env node
/*************************************************************************/
/* Copyright (C) 2017 Wizardry and Steamworks - License: GNU GPLv3 */
/*************************************************************************/
// Checks whether userPath is a child of rootPath.
var was = {
isRooted: function(userPath, rootPath, separator, callback) {
userPath = userPath.split(separator).filter(Boolean);
rootPath = rootPath.split(separator).filter(Boolean);
callback(userPath.length >= rootPath.length &&
rootPath.every((e, i) => e === userPath[i]));
}
}
module.exports = was;
Generated by GNU Enscript 1.6.5.90.