HEX
Server: Apache
System: Linux iad1-shared-e1-13 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: dh_x7ke6i (5503775)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //usr/share/nodejs/is-path-inside/index.js
'use strict';
const path = require('path');

module.exports = (childPath, parentPath) => {
	const relation = path.relative(parentPath, childPath);
	return Boolean(
		relation &&
		relation !== '..' &&
		!relation.startsWith(`..${path.sep}`) &&
		relation !== path.resolve(childPath)
	);
};