Comparing version 0.3.0 to 0.4.0
@@ -245,6 +245,8 @@ 'use strict'; | ||
} else { | ||
// TODO: extract error type | ||
// TODO: list which patches failed | ||
var err = Error('Not all patches succeeded'); | ||
var err = new Error('Not all patches succeeded'); | ||
err.model = updatedModel; | ||
err.diffMap = diffMap; | ||
err.failedURIs = new Set(urisToPatch.filter(function (uri) { | ||
return !patchedURIs.has(uri); | ||
})); | ||
throw err; | ||
@@ -251,0 +253,0 @@ } |
{ | ||
"name": "modelld", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "A JavaScript API for selecting and manipulating linked data subgraphs", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -94,4 +94,5 @@ # modelld | ||
// Update a field's value | ||
const name = profile.get('name')[0] | ||
profile | ||
.set('name', {value: 'Daniel'}) | ||
.set(name, {value: 'Daniel'}) | ||
.get('name') => [Field('Daniel')] | ||
@@ -101,4 +102,5 @@ | ||
// (Assume 'web' is the LDP web client, currently assumed to be https://github.com/solid/solid-web-client) | ||
const name = profile.get('name')[0] | ||
profile | ||
.set('name', {value: 'Daniel'}) | ||
.set(name, {value: 'Daniel'}) | ||
.add('phone', phone('tel:123-456-7890')) | ||
@@ -110,2 +112,7 @@ .save(rdf, web) | ||
}) | ||
.catch(err => { | ||
// err.model is the model including all the updates which worked | ||
// err.diffMap describes the RDF statements which should have been inserted and removed from the server | ||
// err.failedURIs describes the URIs for which the PATCH requests failed | ||
}) | ||
``` | ||
@@ -112,0 +119,0 @@ |
Sorry, the diff of this file is too big to display
163695
1012
122