aws-core-utils
Advanced tools
Comparing version 5.0.23 to 5.0.24
@@ -16,2 +16,3 @@ 'use strict'; | ||
const Objects = require('core-functions/objects'); | ||
const copy = Objects.copy; | ||
@@ -57,3 +58,3 @@ const Strings = require('core-functions/strings'); | ||
// If no options were specified, then use an empty object | ||
const options = dynamoDBDocClientOptions ? Objects.copy(dynamoDBDocClientOptions, true) : {}; | ||
const options = dynamoDBDocClientOptions ? copy(dynamoDBDocClientOptions) : {}; | ||
@@ -95,6 +96,10 @@ // If no region was specified in the given dynamoDBDocClient options, then set it to the current region | ||
} | ||
// Create a new DynamoDB.DocumentClient instance with the modified options | ||
dynamoDBDocClient = new AWS.DynamoDB.DocumentClient(options); | ||
// Cache the new instance and the options used to create it | ||
// Create a new DynamoDB.DocumentClient instance with a COPY of the resolved options (COPY avoids subsequent cache | ||
// comparison failures failures due to later versions of AWS SDK (e.g. 2.45.0) mutating the options passed to the | ||
// constructor, e.g. by adding "attrValue" with value "S8" | ||
dynamoDBDocClient = new AWS.DynamoDB.DocumentClient(options ? copy(options) : options); | ||
// Cache the new instance ... | ||
dynamoDBDocClientByRegionKey.set(regionKey, dynamoDBDocClient); | ||
// ... and cache the ORIGINAL (pre-COPY) options "used" to create it | ||
dynamoDBDocClientOptionsByRegionKey.set(regionKey, options); | ||
@@ -101,0 +106,0 @@ |
{ | ||
"name": "aws-core-utils", | ||
"version": "5.0.23", | ||
"version": "5.0.24", | ||
"description": "Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, Kinesis, DynamoDB.DocumentClients, etc.", | ||
@@ -19,5 +19,5 @@ "author": "Byron du Preez", | ||
"devDependencies": { | ||
"aws-sdk": "2.4.9" | ||
"aws-sdk": "2.54.0" | ||
}, | ||
"repository": "https://github.com/byron-dupreez/aws-core-utils" | ||
} |
@@ -1,2 +0,2 @@ | ||
# aws-core-utils v5.0.23 | ||
# aws-core-utils v5.0.24 | ||
@@ -394,2 +394,6 @@ Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, Kinesis, DynamoDB.DocumentClients, etc. | ||
### 5.0.24 | ||
- BACKPORT of fixes to `dynamodb-doc-client-cache` module from version 6.0.12 to resolve caching failures with current `aws-sdk` versions (e.g. 2.45.0 & 2.54.0) | ||
- Upgraded `aws-sdk` dev dependency to 2.54.0 | ||
### 5.0.23 | ||
@@ -396,0 +400,0 @@ - Upgraded `aws-core-test-utils` test dependency to 1.0.5 |
{ | ||
"name": "aws-core-utils-tests", | ||
"description": "Unit tests for aws-core-utils modules", | ||
"version": "5.0.23", | ||
"version": "5.0.24", | ||
"author": "Byron du Preez", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
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
395822
5974
672