extraction
Advanced tools
Comparing version 0.9.6 to 0.9.7
{ | ||
"name": "extraction", | ||
"version": "0.9.6", | ||
"version": "0.9.7", | ||
"description": "Tree Extraction for JavaScript Object Graphs", | ||
@@ -5,0 +5,0 @@ "main": "lib/extraction.js", |
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -5,0 +5,0 @@ ** Permission is hereby granted, free of charge, to any person obtaining |
{ | ||
"name": "extraction", | ||
"version": "0.9.6", | ||
"version": "0.9.7", | ||
"description": "Tree Extraction for JavaScript Object Graphs", | ||
@@ -5,0 +5,0 @@ "keywords": [ "tree", "graph", "data", "structure", "extraction", "object" ], |
@@ -26,9 +26,14 @@ | ||
The Extraction library is primarily intended for two particular use | ||
cases: to support the persisting and restoring of arbitrary in-memory | ||
object graph structures (where the cycle problem has to be resolved) | ||
and to support the generation of responses in REST APIs based on object | ||
graphs (where the cycle problem and the partial information problem has | ||
to be resolved). | ||
The Extraction library is intended for two main use cases: primarily, to | ||
support the generation of responses in REST APIs based on object graphs | ||
(where the cycle problem and the partial information problem has to be | ||
resolved) and, secondarily, to support the persisting and restoring of | ||
arbitrary in-memory object graph structures (where the cycle problem has | ||
to be resolved, too). | ||
Notice: this library intentionally does provide only a query language | ||
for the tree extraction (starting at a certain tree root node) and not | ||
also a query language for locating the tree root node. Locating nodes in | ||
a graph is not within the scope of this library. | ||
Sneak Preview | ||
@@ -61,7 +66,3 @@ ------------- | ||
/* use case 1: graph persistance */ | ||
let storage = JSON.stringify(extract(Graph, "{ -> oo }")) | ||
expect(reify(JSON.parse(storage))).to.be.deep.equal(Graph) | ||
/* use case 2: tree extraction */ | ||
/* use case 1: tree extraction */ | ||
let tree = extract(Graph.Person[0], | ||
@@ -71,2 +72,6 @@ "{ name, rival: { home: { *, !owner, !subs } } }") | ||
{ name: "God", rival: { home: { id: 999, name: "Hell" } } }) | ||
/* use case 2: graph persistance */ | ||
let storage = JSON.stringify(extract(Graph, "{ -> oo }")) | ||
expect(reify(JSON.parse(storage))).to.be.deep.equal(Graph) | ||
``` | ||
@@ -350,3 +355,3 @@ | ||
transpiled to ECMAScript 5 and this way runs in really all(!) current | ||
(as of 2015) JavaScript environments, of course. | ||
(as of 2016/Q1) JavaScript environments, of course. | ||
@@ -356,3 +361,3 @@ License | ||
Copyright (c) 2015 Ralf S. Engelschall (http://engelschall.com/) | ||
Copyright (c) 2015-2016 Ralf S. Engelschall (http://engelschall.com/) | ||
@@ -359,0 +364,0 @@ Permission is hereby granted, free of charge, to any person obtaining |
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -5,0 +5,0 @@ ** Permission is hereby granted, free of charge, to any person obtaining |
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -5,0 +5,0 @@ ** Permission is hereby granted, free of charge, to any person obtaining |
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -5,0 +5,0 @@ ** Permission is hereby granted, free of charge, to any person obtaining |
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -5,0 +5,0 @@ ** Permission is hereby granted, free of charge, to any person obtaining |
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -25,6 +25,9 @@ ** Permission is hereby granted, free of charge, to any person obtaining | ||
/* import the two main API functions */ | ||
import extract from "./extraction-extract.js" | ||
import reify from "./extraction-reify.js" | ||
/* export them the standard CommonJS way to be | ||
100% compatible with non-ES6 environments */ | ||
module.exports = { extract, reify } | ||
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -27,5 +27,2 @@ ** Permission is hereby granted, free of charge, to any person obtaining | ||
/* support source-maps */ | ||
// require("source-map-support").install() | ||
/* provide exception swallowing */ | ||
@@ -32,0 +29,0 @@ global.swallow = function (thrower) { try { thrower(); } catch (e) {} }; |
/* | ||
** Extraction -- Tree Extraction for JavaScript Object Graphs | ||
** Copyright (c) 2015 Ralf S. Engelschall <rse@engelschall.com> | ||
** Copyright (c) 2015-2016 Ralf S. Engelschall <rse@engelschall.com> | ||
** | ||
@@ -5,0 +5,0 @@ ** Permission is hereby granted, free of charge, to any person obtaining |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
205534
986
378