feat: only allow bundled preload scripts (#17308)
This commit is contained in:
parent
3d307e5610
commit
8cf15cc931
11 changed files with 79 additions and 3 deletions
6
lib/common/path-utils.ts
Normal file
6
lib/common/path-utils.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import * as path from 'path'
|
||||
|
||||
export const isParentDir = function (parent: string, dir: string) {
|
||||
const relative = path.relative(parent, dir)
|
||||
return !!relative && !relative.startsWith('..') && !path.isAbsolute(relative)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue