0.0.12 • Published 6 years ago

@oss-stealth/satya v0.0.12

Weekly downloads
-
License
-
Repository
github
Last release
6 years ago

Satya

Tree immutable undo/redo stack using immer RFC6902 style patches

const satya = new Satya(typescriptSchema);
satya.update([
  {
    type: "node",
    operation: {
      path: [],
      op: "replace",
      value: sourceFile
    }
  }
]);
satya.update([
  {
    type: "node",
    operation: {
      path: ["statements", 0],
      op: "add",
      value: {}
    }
  }
]);
satya.update([
  {
    type: "metadata",
    operation: {
      path: ["statements", 0, SatyaMetaSym, "general", "expanded"],
      op: "add",
      value: true
    }
  }
]);
const meta1 = satya.readMetaData(
  ((satya.state as ts.SourceFile)
    .statements[0] as unknown) as ts.VariableDeclaration,
  "general",
  "expanded"
);
expect(meta1).toBe(true);

##TODO

  • compute reverse for "replace" | "remove" | "add"
  • implement helper functions for undo/redo
0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago