effect-io-ai

Package: effect
Module: JsonPointer

JsonPointer.unescapeToken

Decodes a JSON Pointer reference token according to RFC 6901 escaping rules.

When to use

Use when you need to decode a single escaped JSON Pointer path segment.

Details

Gotchas

The replacement order matters: ~1 is replaced before ~0 to prevent incorrect decoding.

Example (Unescaping special characters)

import { JsonPointer } from "effect"

JsonPointer.unescapeToken("a~1b") // "a/b"
JsonPointer.unescapeToken("c~0d") // "c~d"
JsonPointer.unescapeToken("path~1to~0key") // "path/to~key"

See

Signature

declare const unescapeToken: (token: string) => string

Source

Since v4.0.0