Skip to content

Home > @opengovsg/validators > PathValidatorOptions > basePath

PathValidatorOptions.basePath property ​

The base path to use for validation. This must be an absolute path.

All provided paths, resolved relative to the working directory of the Node process, must be within this directory (or its subdirectories), or they will be considered unsafe. You should provide a safe base path that does not contain sensitive files or directories.

Signature:

typescript
basePath: string;

Example ​

'/var/www'