@nesso-how/formats 0.1.0-alpha.25 → 0.1.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,10 +11,10 @@ npm install @nesso-how/formats
11
11
  ## Usage
12
12
 
13
13
  ```ts
14
- import { serializeGraph, deserializeGraph } from "@nesso-how/formats";
14
+ import { serializeGraph, deserializeGraph } from '@nesso-how/formats'
15
15
 
16
- const json = serializeGraph({ name: "My graph", nodes, edges });
17
- const file = deserializeGraph(json);
16
+ const json = serializeGraph({ name: 'My graph', nodes, edges })
17
+ const file = deserializeGraph(json)
18
18
  ```
19
19
 
20
20
  ## License
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ export function deserializeGraph(json) {
15
15
  /** Strip personal FSRS / review history for shareable graph export. Keeps text, elaboration, layout. */
16
16
  export function nodesForGraphShareExport(nodes) {
17
17
  const review = defaultConceptReviewFields();
18
- return nodes.map(node => {
18
+ return nodes.map((node) => {
19
19
  const { text, elaboration } = node.data ?? { text: '' };
20
20
  return {
21
21
  ...node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nesso-how/formats",
3
- "version": "0.1.0-alpha.25",
3
+ "version": "0.1.0-alpha.26",
4
4
  "description": "Nesso graph serialization formats — JSON serialize/deserialize",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@xyflow/react": "^12.6.4",
23
- "@nesso-how/types": "0.1.0-alpha.25"
23
+ "@nesso-how/types": "0.1.0-alpha.26"
24
24
  },
25
25
  "devDependencies": {
26
26
  "typescript": "~5.8.3"
package/src/index.ts CHANGED
@@ -32,11 +32,9 @@ export function deserializeGraph(json: string): NessoGraphFile {
32
32
  }
33
33
 
34
34
  /** Strip personal FSRS / review history for shareable graph export. Keeps text, elaboration, layout. */
35
- export function nodesForGraphShareExport(
36
- nodes: Node<ConceptNodeData>[],
37
- ): Node<ConceptNodeData>[] {
35
+ export function nodesForGraphShareExport(nodes: Node<ConceptNodeData>[]): Node<ConceptNodeData>[] {
38
36
  const review = defaultConceptReviewFields()
39
- return nodes.map(node => {
37
+ return nodes.map((node) => {
40
38
  const { text, elaboration } = node.data ?? { text: '' }
41
39
  return {
42
40
  ...node,
@@ -50,8 +48,6 @@ export function nodesForGraphShareExport(
50
48
  }
51
49
 
52
50
  /** Reset review fields on import so shared files never restore someone else's scheduling. */
53
- export function nodesFromGraphShareImport(
54
- nodes: Node<ConceptNodeData>[],
55
- ): Node<ConceptNodeData>[] {
51
+ export function nodesFromGraphShareImport(nodes: Node<ConceptNodeData>[]): Node<ConceptNodeData>[] {
56
52
  return nodesForGraphShareExport(nodes)
57
53
  }