Module

Pathy.Sandboxed

Package
pathy
Repository
id3as/purescript-pathy

#SandboxedPath Source

data SandboxedPath :: RelOrAbs -> DirOrFile -> Typedata SandboxedPath a b

The type for paths that have been sandboxed.

Instances

#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.