Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fed_dev/deps.ts>terser.WeightedIdentifierMangler

A Bundler with the web in mind.
Latest
interface terser.WeightedIdentifierMangler
import { type terser } from "https://deno.land/x/fed_dev@0.9.0/deps.ts";
const { WeightedIdentifierMangler } = terser;

An identifier mangler that leverages character frequency analysis to determine identifier precedence.

Methods

consider(chars: string, delta: number): number

Modifies the internal weighting of the input characters by the specified delta. Will be invoked on the entire printed AST, and then deduct mangleable identifiers.

reset(): void

Resets character weights.

sort(): void

Sorts identifiers by character frequency, in preparation for calls to get(n).