ps-direct-sdk
Advanced tools
Comparing version 2.1.10 to 2.1.11
@@ -26,6 +26,4 @@ "use strict"; | ||
}, | ||
get: key => hydrateString(db, {}, "${" + key + "}").map(x => { | ||
return R.tryCatch(JSON.parse, R.always(x))(x); | ||
}) | ||
get: (key, type) => hydrateString(db, {}, "${" + key + "}") | ||
} | ||
}; |
{ | ||
"name": "ps-direct-sdk", | ||
"version": "2.1.10", | ||
"version": "2.1.11", | ||
"description": "Directly ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,3 +14,3 @@ "use strict"; | ||
return function (obj2) { | ||
assert(R.equals(obj1, obj2)); | ||
assert.equal(obj2, obj1); | ||
} | ||
@@ -69,3 +69,3 @@ }; | ||
.tap(assert.ok) | ||
.tap(assertEquals(obj)) | ||
.tap(assertEquals("{\"data\": {\"type\": \"un-stringified data\"}}")) | ||
.pull(done) | ||
@@ -90,3 +90,3 @@ }); | ||
.tap(assert.ok) | ||
.tap(assertEquals(['some data 0', {data: 'some data 1'}])) | ||
.tap(assertEquals("[\"some data 0\",{\"data\": \"some data 1\"}]")) | ||
.pull(done) | ||
@@ -111,3 +111,3 @@ }); | ||
.tap(assert.ok) | ||
.tap(assertEquals({"data": "this is just some data"})) | ||
.tap(assertEquals('{"data": "this is just some data"}')) | ||
.pull(done) | ||
@@ -124,3 +124,3 @@ }); | ||
.tap(assert.ok) | ||
.tap(assertEquals({"data": "data", "innerData": {"data": "data"}})) | ||
.tap(assertEquals('{"data": "data", "innerData": {"data": "data"}}')) | ||
.pull(done) | ||
@@ -140,8 +140,10 @@ }); | ||
.flatMap(() => ps.get('/v1/referenceList')) | ||
.tap(assertEquals([ | ||
{"data": "this is just some data0"}, | ||
{"data": "this is just some data1"}, | ||
{"data": "this is just some data2"}, | ||
{"data": "this is just some data3"} | ||
])) | ||
.tap(x => { | ||
assert.deepEqual(JSON.parse(x), [ | ||
{"data": "this is just some data0"}, | ||
{"data": "this is just some data1"}, | ||
{"data": "this is just some data2"}, | ||
{"data": "this is just some data3"} | ||
]) | ||
}) | ||
.pull(done) | ||
@@ -174,11 +176,11 @@ }); | ||
.flatMap(() => ps.get('/v1/filterTest[1|2]')) | ||
.tap(assertEquals([1, 2])) | ||
.tap(assertEquals("[1,2]")) | ||
.flatMap(() => ps.get('/v1/filterTest[|2]')) | ||
.tap(assertEquals([0, 1, 2])) | ||
.tap(assertEquals("[0,1,2]")) | ||
.flatMap(() => ps.get('/v1/filterTest[1|]')) | ||
.tap(assertEquals([1, 2, 3])) | ||
.tap(assertEquals("[1,2,3]")) | ||
.flatMap(() => ps.get('/v1/filterTest^2')) | ||
.tap(assertEquals([0, 1])) | ||
.tap(assertEquals("[0,1]")) | ||
.flatMap(() => ps.get('/v1/filterTest[1|]^2')) | ||
.tap(assertEquals([1, 2])) | ||
.tap(assertEquals("[1,2]")) | ||
.pull(done) | ||
@@ -194,3 +196,17 @@ }); | ||
}); | ||
describe("get() gives back the right type", () => { | ||
before(done => ps.del('correct/type') | ||
.flatMap(() => ps.put("correct/type", `{"data": "some great json data"}`)) | ||
.pull(done)); | ||
it("Should always give back a string", (done) => { | ||
ps.get("correct/type", "string") | ||
.tap(assertEquals('{"data": "some great json data"}')) | ||
.pull(done) | ||
}); | ||
}) | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33403
758