Module
Pathy.Sandboxed
- Package
- purescript-pathy
- Repository
- purescript-contrib/purescript-pathy
#SandboxedPath Source
data SandboxedPath :: RelOrAbs -> DirOrFile -> Type
data SandboxedPath a b
The type for paths that have been sandboxed.
Instances
(IsRelOrAbs a, IsDirOrFile b) => Eq (SandboxedPath a b)
(IsRelOrAbs a, IsDirOrFile b) => Ord (SandboxedPath a b)
(IsRelOrAbs a, IsDirOrFile b) => Show (SandboxedPath a b)
#sandbox Source
sandbox :: forall a b. IsRelOrAbs a => Path Abs Dir -> Path a b -> Maybe (SandboxedPath a b)
Attempts to sandbox a path relative to an absolute directory ("sandbox
root"). If the Path a b
escapes the sandbox root Nothing
will be
returned.
#sandboxAny Source
sandboxAny :: forall a b. Path a b -> SandboxedPath a b
Sandboxes any path to /
.
This should only be used for situations where a path is already constrained
within a system so that access to /
is safe - for instance, in URIs.
#sandboxRoot Source
sandboxRoot :: forall a b. SandboxedPath a b -> Path Abs Dir
Returns the location a SandboxedPath
was sandboxed to.
#unsandbox Source
unsandbox :: forall a b. SandboxedPath a b -> Path a b
Extracts the original path from a SandboxedPath
.