UNPKG

nyks

Version:

nodejs exupery style

12 lines (9 loc) 298 B
"use strict"; const path = require('path'); const startsWith = require('mout/string/startsWith'); module.exports = function(base, file) { var rest = path.join.apply(path, arguments); if(!startsWith(rest, base)) throw `path.jail escape attempt in ${base}/${file}`; return rest; };