0.0.12 • Published 5 years ago

@oss-stealth/satya v0.0.12

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

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago