Skip to main content

Function: aliasesFor()

aliasesFor(mod, aliases?): Record<string, string>

Defined in: src/core/deprecation.ts:142

The entries of aliases whose target mod exposes (a runtime-factory module may bind fewer wrappers than the generated namespace the table was built for).

Parameters​

mod​

Record<string, WrapperFn>

The module (name → wrapper) the aliases will be attached to.

aliases?​

Record<string, string> = {}

old snake_case name -> new snake_case name table; default {}.

Returns​

Record<string, string>

The subset of aliases whose new name is a key of mod.

Example​

import { aliasesFor, withDeprecatedAliases } from './core/deprecation.js';

import { ESPN_DEPRECATED_ALIASES } from '../generated/aliases.js';

const mod = withDeprecatedAliases(bound, aliasesFor(bound, ESPN_DEPRECATED_ALIASES.nfl));

Remarks​

Use it before withDeprecatedAliases when mod may legitimately lack a target; withDeprecatedAliases throws on a missing one.