0.0.12 • Published 4 years ago

@oss-stealth/satya v0.0.12

Weekly downloads
-
License
-
Repository
github
Last release
4 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

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago