0.2.4 • Published 11 months ago

unalias v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Unalias

Installation

npm install unalias

Usage

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
0.2.3

11 months ago

0.2.4

11 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.2

1 year ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago