Skip to content

Commit

Permalink
build: update deps and ramda functions (#51)
Browse files Browse the repository at this point in the history
* build(deps): update dependencies

* fix: replace ramda merge with mergeRight

* fix: replace pipeP

* feat: remove pipeP usage
  • Loading branch information
crash7 committed Apr 14, 2024
1 parent ca9b2b5 commit d101a86
Show file tree
Hide file tree
Showing 10 changed files with 801 additions and 549 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,33 @@
]
},
"dependencies": {
"dynamodb-data-types": "^3.0.1",
"dynamodb-data-types": "^4.0.0",
"dynamodb-update-expression": "^0.1.21",
"dynamodb-wrapper": "^1.4.1",
"lodash.camelcase": "^4.3.0",
"ramda": "^0.27.1"
"ramda": "^0.28.0"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@types/aws-sdk": "^2.7.0",
"@types/jest": "^28.1.4",
"aws-sdk": "^2.1167.0",
"@types/jest": "^29.1.2",
"aws-sdk": "^2.1232.0",
"docdash": "^1.2.0",
"eslint": "^8.19.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.2.4",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-promise": "^6.1.0",
"eslint-plugin-ramda": "^2.5.1",
"eslint-plugin-standard": "^5.0.0",
"husky": "^8.0.1",
"is-ci": "^3.0.1",
"jest": "^28.1.2",
"jsdoc": "^3.6.10",
"jest": "^29.1.2",
"jsdoc": "^3.6.11",
"lint-staged": "^13.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1"
Expand Down
6 changes: 3 additions & 3 deletions src/builders/append.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const { evolve, merge, curry } = require('ramda');
const { evolve, mergeRight, curry } = require('ramda');
const catcon = require('./catcon');

/**
Expand All @@ -17,10 +17,10 @@ const catcon = require('./catcon');
function append(attribute, value) {
return evolve({
UpdateExpression: catcon(`#${attribute} = list_append(#${attribute}, :${attribute}), `),
ExpressionAttributeNames: merge({
ExpressionAttributeNames: mergeRight({
[`#${attribute}`]: attribute
}),
ExpressionAttributeValues: merge({
ExpressionAttributeValues: mergeRight({
[`:${attribute}`]: value
})
});
Expand Down
6 changes: 3 additions & 3 deletions src/builders/put.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const { evolve, merge, curry } = require('ramda');
const { evolve, mergeRight, curry } = require('ramda');
const catcon = require('./catcon');

/**
Expand All @@ -17,10 +17,10 @@ const catcon = require('./catcon');
function put(attribute, value) {
return evolve({
UpdateExpression: catcon(`#${attribute} = :${attribute}, `),
ExpressionAttributeNames: merge({
ExpressionAttributeNames: mergeRight({
[`#${attribute}`]: attribute
}),
ExpressionAttributeValues: merge({
ExpressionAttributeValues: mergeRight({
[`:${attribute}`]: value
})
});
Expand Down
6 changes: 3 additions & 3 deletions src/builders/remove.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const { evolve, merge, curry } = require('ramda');
const { evolve, mergeRight, curry } = require('ramda');
const catcon = require('./catcon');

/**
Expand All @@ -16,10 +16,10 @@ const catcon = require('./catcon');
function remove(attribute) {
return evolve({
UpdateExpression: catcon(`#${attribute}, `),
ExpressionAttributeNames: merge({
ExpressionAttributeNames: mergeRight({
[`#${attribute}`]: attribute
}),
ExpressionAttributeValues: merge({})
ExpressionAttributeValues: mergeRight({})
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/count.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html
* @module Count
*/
const { curry, compose, pipeP, bind, prop } = require('ramda');
const { curry, compose, bind, prop } = require('ramda');
const addTableName = require('./table-name');

/**
* @private
*/
const createCount = scan => pipeP(scan, prop('Count'));
const createCount = scan => params => scan(params).then(prop('Count'));

/**
* @private
Expand Down
4 changes: 2 additions & 2 deletions src/get-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html
* @module Scan
*/
const { curry, bind, pipeP, compose } = require('ramda');
const { curry, bind, compose } = require('ramda');
const { unwrapAll } = require('./wrapper');
const addTableName = require('./table-name');

/**
* @private
*/
const createGetAll = scan => pipeP(scan, unwrapAll('Items'));
const createGetAll = scan => params => scan(params).then(unwrapAll('Items'));

/**
* @private
Expand Down
4 changes: 2 additions & 2 deletions src/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html
* @module GetItem
*/
const { curry, bind, pipeP, compose, apply } = require('ramda');
const { curry, bind, compose } = require('ramda');
const { unwrapProp } = require('./wrapper');
const { mapMergeFirstPairOfArgs } = require('./map-merge-args');
const generateKey = require('./generate-key');
Expand All @@ -13,7 +13,7 @@ const addTableName = require('./table-name');
/**
* @private
*/
const getUnwrappedItem = getItem => pipeP(apply(getItem), unwrapProp('Item'));
const getUnwrappedItem = getItem => params => getItem(...params).then(unwrapProp('Item'));

/**
* @private
Expand Down
5 changes: 3 additions & 2 deletions src/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @module DeleteItem
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html
*/
const { apply, bind, compose, curry, pipeP } = require('ramda');
const { bind, compose, curry } = require('ramda');
const { unwrapProp } = require('./wrapper');
const addTableName = require('./table-name');
const { mapMergeFirstPairOfArgs } = require('./map-merge-args');
Expand All @@ -17,7 +17,8 @@ const addReturnValues = require('./return-values');
/**
* @private
*/
const removeAndUnwrapAttributes = deleteItem => pipeP(apply(deleteItem), unwrapProp('Attributes'));
const removeAndUnwrapAttributes = deleteItem => params =>
deleteItem(...params).then(unwrapProp('Attributes'));

/**
* @private
Expand Down
5 changes: 2 additions & 3 deletions src/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
const {
adjust,
apply,
applyTo,
bind,
compose,
Expand All @@ -20,7 +19,6 @@ const {
is,
keys,
map,
pipeP,
toPairs,
unless,
zipObj,
Expand All @@ -38,7 +36,8 @@ const camelCase = require('lodash.camelcase');
/**
* @private
*/
const updateAndUnwrapAttributes = updateItem => pipeP(apply(updateItem), unwrapProp('Attributes'));
const updateAndUnwrapAttributes = updateItem => params =>
updateItem(...params).then(unwrapProp('Attributes'));

/**
* @private
Expand Down

0 comments on commit d101a86

Please sign in to comment.