How to use the dissocPath function from ramda
Find comprehensive JavaScript ramda.dissocPath code examples handpicked from public code repositorys.
GitHub: getodk/central-backend
395 396 397 398 399 400 401 402 403 404
asAlice.get("/v1/projects/1/forms/doubleRepeat.svc/Submissions('double')?$select=*") .expect(200) .then(({ body }) => { // have to manually check and clear the date for exact match: body.value[0].__system.submissionDate.should.be.an.isoDate(); const bodyWithoutSubmissionDate = dissocPath(['value', 0, '__system', 'submissionDate'], body); bodyWithoutSubmissionDate.should.eql({ '@odata.context': 'http://localhost:8989/v1/projects/1/forms/doubleRepeat.svc/$metadata#Submissions', value: [{
49
43
0
+ 5 other calls in file
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551
* @sig [String] -> a -> {k: v} -> {k: v} * @param {Array} path the path to set * @param {*} val the new value * @param {Object} obj the object to clone * @return {Object} a new object similar to the original except along the specified path. * @see R.dissocPath * @example * * R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}} */
0
0
0
+ 35 other calls in file
25 26 27 28 29 30 31 32 33 34
if (sizeInKB(valueEval) > sizeInKB(keyEval)) { // remove the value trimmedObj = R.modifyPath(pathName, e => '...' , trimmedObj); } else { // remove the name trimmedObj = R.dissocPath(pathName, trimmedObj); } const newSize = sizeInKB(JSON.stringify(trimmedObj)); if (newSize <= maxKBytes) { break;
0
0
0
ramda.clone is the most popular function in ramda (30311 examples)