Skip to main content

feat: add working application and synthetic sample data

GBB Demo authored on Nov 2, 2026

commit 97fcf0e461ec

Root commit: changes are relative to an empty tree.

4 files changed, +34 −0

  • .gitignore+3 −0
    @@ -1,0 +1,3 @@
    1+__pycache__/
    2+node_modules/
    3+.env
  • README.md+5 −0
    @@ -1,0 +1,5 @@
    1+# Feature Flags
    2+
    3+A deterministic feature flag evaluator with an explicit default and user targeting.
    4+
    5+Synthetic evaluation project.
  • app.mjs+11 −0
    @@ -1,0 +1,11 @@
    1+export function evaluate(flag, userId) {
    2+ if (!flag.enabled) return false;
    3+ if (flag.users.includes(userId)) return true;
    4+ return flag.default === true;
    5+}
    6+export function validateFlag(flag) {
    7+ return typeof flag.key === "string" && flag.key.length > 0 &&
    8+ typeof flag.enabled === "boolean" && typeof flag.default === "boolean" &&
    9+ Array.isArray(flag.users) && flag.users.every(user => typeof user === "string");
    10+}
    11+
  • data/sample.json+15 −0
    @@ -1,0 +1,15 @@
    1+{
    2+ "environment": "demo",
    3+ "items": [
    4+ {
    5+ "id": "sample-1",
    6+ "name": "Explore the source",
    7+ "done": true
    8+ },
    9+ {
    10+ "id": "sample-2",
    11+ "name": "Review the draft PR",
    12+ "done": false
    13+ }
    14+ ]
    15+}