src/vs/base/common/glob.ts/wrapRelativePattern
function wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string | IRelativePattern): ParsedStringPattern {
	if (typeof arg2 === 'string') {
		return parsedPattern;
	}

	return function (path, basename) {
		if (!extpath.isEqualOrParent(path, arg2.base)) {
			return null;
		}
		return parsedPattern(paths.relative(arg2.base, path), basename);
	};
}