Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "hsdk", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A hypermedia standard development kit for knowing about home api endpoints", | ||
@@ -5,0 +5,0 @@ "main": "transpiled/source/index.js", |
@@ -11,7 +11,6 @@ import {prop} from "ramda" | ||
const indexedByIntent = map(map(indexByIntent)) | ||
const asRequest = map(prop("request")) | ||
const asRequests = map(map(map(asRequest))) | ||
const asRequest = map(map(map(prop("request")))) | ||
export default function treeify (responses) { | ||
return asRequests(indexedByIntent(groupedByVersion(groupByNamespace(responses)))) | ||
return asRequest(indexedByIntent(groupedByVersion(groupByNamespace(responses)))) | ||
} |
@@ -36,17 +36,17 @@ import {describe, it} from "mocha" | ||
it("has a show property for v1/accounts", () => { | ||
expect(treeify(raw)).to.have.deep.property("accounts.v1.show") | ||
expect(treeify(raw)).to.have.deep.property("accounts.v1.show").that.is.instanceOf(Function) | ||
}) | ||
it("has a list property for v1/accounts", () => { | ||
expect(treeify(raw)).to.have.deep.property("accounts.v1.list") | ||
expect(treeify(raw)).to.have.deep.property("accounts.v1.list").that.is.instanceOf(Function) | ||
}) | ||
it("has a show property for v2/accounts", () => { | ||
expect(treeify(raw)).to.have.deep.property("accounts.v2.show") | ||
expect(treeify(raw)).to.have.deep.property("accounts.v2.show").that.is.instanceOf(Function) | ||
}) | ||
it("has a show property for v1/sessions", () => { | ||
expect(treeify(raw)).to.have.deep.property("sessions.v2.create") | ||
expect(treeify(raw)).to.have.deep.property("sessions.v2.create").that.is.instanceOf(Function) | ||
}) | ||
}) | ||
}) |
@@ -15,7 +15,6 @@ "use strict"; | ||
var indexedByIntent = (0, _ramda.map)((0, _ramda.map)(indexByIntent)); | ||
var asRequest = (0, _ramda.map)((0, _ramda.prop)("request")); | ||
var asRequests = (0, _ramda.map)((0, _ramda.map)((0, _ramda.map)(asRequest))); | ||
var asRequest = (0, _ramda.map)((0, _ramda.map)((0, _ramda.map)((0, _ramda.prop)("request")))); | ||
function treeify(responses) { | ||
return asRequests(indexedByIntent(groupedByVersion(groupByNamespace(responses)))); | ||
return asRequest(indexedByIntent(groupedByVersion(groupByNamespace(responses)))); | ||
} |
34368
707