Module
Pathy.Sandboxed
- Package
- purescript-pathy
- Repository
- slamdata/purescript-pathy
#SandboxedPath Source
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 b a. 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 b a. 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 b a. SandboxedPath a b -> Path Abs Dir
Returns the location a SandboxedPath
was sandboxed to.
#unsandbox Source
unsandbox :: forall b a. SandboxedPath a b -> Path a b
Extracts the original path from a SandboxedPath
.