itsHabib / ffts

Feature flag manager in typescript. Used only to learn about the typescript language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFTS

Feature flag manager written in Typescript. Primary purpose was to help me become familiar with TS.

Concept

A user creates a feature flag with a name and default value. Within a feature flag are rule blocks. Each rule block holds rules that are unique by the combination of primary + secondary tags. Within a rule block are rule chains that describe the various rules related to the set of tags for the block. As an example, the below rule chain describes a rule in which both the 'env' tag has to equal the value 'dev' and the 'org' tag must start with 'internal'.

const rc: RuleChain = {
  PrimaryRule: {
    tag: {
      name: 'env',
      value: 'dev',
    },
    ruleOp: RuleOp.EQUALS,
  },
  SecondaryRule: {
    tag: {
      name: 'org',
      value: 'internal',
    },
    ruleOp: RuleOp.STARTS_WITH,
  },
  ChainOp: RuleChainOp.AND,
};

About

Feature flag manager in typescript. Used only to learn about the typescript language


Languages

Language:TypeScript 94.9%Language:Shell 4.2%Language:JavaScript 0.5%Language:Dockerfile 0.3%