Package Exports
- unalias
- unalias/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (unalias) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Unalias
Installation
npm install unaliasUsage
import { Resolver, Aliases } from 'unalias';
const aliases: Aliases = {
Al: ["Alyson", "Alyssa", "Alfred", "Albert", "Alphonse"],
Sam: ["Sam", "Samuel", "Samson", "Samantha"],
All: ["Al", "Sam"],
NoSam: ["All", "-Sam"],
};
const resolver = new Resolver(aliases);
resolver.resolveOne('All');
// [
// 'Alyson', 'Alyssa',
// 'Alfred', 'Albert',
// 'Alphonse', 'Samuel',
// 'Samson', 'Samantha'
// ]
// Subtract Als from All.
resolver.resolveAll(['All', '-Al']);
// [ 'Samuel', 'Samson', 'Samantha' ]
resolver.resolveOne('NoSam');
// [
// "Alyson",
// "Alyssa",
// "Alfred",
// "Albert",
// "Alphonse",
// ]Use Cases
- Group values and combine the groups with creating new aliases
- Give static (nick)names to values that can possibly change