@gotamedia/shapeshifter
Advanced tools
@@ -22,6 +22,2 @@ /* | ||
| canHandle(input) { | ||
| if (input.substring(0, 5) !== "<?xml") { | ||
| return false; | ||
| } | ||
| const dom = new DOMParser().parseFromString(input, "application/xml"); | ||
@@ -28,0 +24,0 @@ |
@@ -253,2 +253,6 @@ /* | ||
| if (!link) { | ||
| return; | ||
| } | ||
| return { | ||
@@ -265,6 +269,10 @@ id: link.getAttribute("uuid"), | ||
| get places() { | ||
| return this.select("//newsml:link[@rel='subject' and @type='x-im/place']").map(element => ({ | ||
| return this.select("//newsml:link[@rel='subject' and @type='x-im/place'][*]").map(element => ({ | ||
| id: element.getAttribute("uuid"), | ||
| name: element.getAttribute("title"), | ||
| geometry: this.createGeometry(this.selectValue(".//newsml:geometry/text()", undefined, element)) | ||
| geometry: this.createGeometry(this.selectValue(".//newsml:geometry/text()", undefined, element)), | ||
| links: this.select(".//newsml:link[@rel='subject' and @type='x-im/place']", element).map(element => ({ | ||
| id: element.getAttribute("uuid"), | ||
| name: element.getAttribute("title") | ||
| })) | ||
| })); | ||
@@ -277,3 +285,3 @@ } | ||
| */ | ||
| get relatedPlaces () { | ||
| get relatedPlaces() { | ||
| return this.select("//newsml:link[@rel='related-geo']").map(element => { | ||
@@ -356,2 +364,6 @@ const geo = this.selectSingle(".//newsml:uuid", undefined, element); | ||
| if (!newsValue) { | ||
| return; | ||
| } | ||
| return { | ||
@@ -372,2 +384,6 @@ description: this.selectValue(".//newsml:description/text()", undefined, newsValue), | ||
| if (!textSize) { | ||
| return; | ||
| } | ||
| return { | ||
@@ -374,0 +390,0 @@ planned: this.selectValue(".//newsml:planned/@value", undefined, textSize), |
+1
-1
| { | ||
| "name": "@gotamedia/shapeshifter", | ||
| "version": "0.4.0", | ||
| "version": "0.4.3", | ||
| "description": "Shapeshifter is a general format converter. It converts strings of one format (shape) into a string of another.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
44080
0.72%1335
0.75%0
-100%