Some utility functions useful in advanced library usage scenarios.
The encodePathElement
function implements the minimal subset of URI component encoding required to
prevent issues when constructing paths in the source object. It encodes the "%" and "/" characters to prevent
conflicts. The decodePathElement
function implements the corresponding decoding.
The makeFluent
function is a convenient way to "upgrade" a simple ValueStorageHandler
implementation to the full FluentHandler
interface by wrapping it in a fluent implementation. This is
useful when implementing a value storage handler from scratch -- one can simply implement the core interface and use
the library implementation of fluent handlers via a call to makeFluent
.
Perform the reverse of encodePathElement
: decode a path element back to its original form.
Encode a path element so that it does not contain any forward slashes (and can be decoded). This is a tiny subset of URI element encoding.
Given an object implementing interface ValueStorageHandler
, wrap it in a FluentHandler
implementation that makes it easier to build customized versions of the handler. The handler is only wrapped if it
is not already a fluent handler.
Add Package
deno add jsr:@scroogieboy/object-to-directory
Import symbol
import * as mod from "@scroogieboy/object-to-directory/utility";
---- OR ----
Import directly with a jsr specifier
import * as mod from "jsr:@scroogieboy/object-to-directory/utility";
Add Package
npx jsr add @scroogieboy/object-to-directory
Import symbol
import * as mod from "@scroogieboy/object-to-directory/utility";
Add Package
yarn dlx jsr add @scroogieboy/object-to-directory
Import symbol
import * as mod from "@scroogieboy/object-to-directory/utility";
Add Package
pnpm dlx jsr add @scroogieboy/object-to-directory
Import symbol
import * as mod from "@scroogieboy/object-to-directory/utility";
Add Package
bunx jsr add @scroogieboy/object-to-directory
Import symbol
import * as mod from "@scroogieboy/object-to-directory/utility";