Skip to main content
Home
This release is 3 versions behind 1.5.3 — the latest version of @fedify/fedify. Jump to latest

@fedify/fedify@1.5.0-dev.640+5886ae8b
Built and signed on GitHub Actions

An ActivityPub/fediverse server framework

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
94%
Published
3 months ago (1.5.0-dev.640+5886ae8b)
import { type LanguageTag, parseLanguageTag } from "npm:@phensley/language-tag@^1.9.0"; /** * A language-tagged string which corresponds to the `rdf:langString` type. */ export class LanguageString extends String { readonly language: LanguageTag; /** * Constructs a new `LanguageString`. * @param value A string value written in the given language. * @param language The language of the string. If a string is given, it will * be parsed as a `LanguageTag`. */ constructor(value: string, language: LanguageTag | string) { super(value); this.language = typeof language === "string" ? parseLanguageTag(language) : language; } [Symbol.for("Deno.customInspect")]( inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string { return `<${this.language.compact()}> ${inspect(this.toString(), options)}`; } [Symbol.for("nodejs.util.inspect.custom")]( _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { return `<${this.language.compact()}> ${inspect(this.toString(), options)}`; } }