Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/store/node-server-sdk-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"lint": "npx eslint . --ext .ts",
"lint:fix": "yarn run lint --fix"
},
"dependencies": {
"ioredis": "^5.3.2"
},
"peerDependencies": {
"@aws-sdk/client-dynamodb": "^3.53.0",
"@launchdarkly/node-server-sdk": ">=9.4.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class DynamoDBBigSegmentStore implements interfaces.BigSegmentSto
if (data) {
const attr = data[ATTR_SYNC_ON];
if (attr && attr.N) {
return { lastUpToDate: parseInt(attr.N!, 10) };
return { lastUpToDate: parseInt(attr.N, 10) };
}
}
return {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class DynamoDBClientState {
private _owned: boolean;

constructor(options?: LDDynamoDBOptions) {
this._prefix = options?.prefix ? `${options!.prefix}:` : DEFAULT_PREFIX;
this._prefix = options?.prefix ? `${options.prefix}:` : DEFAULT_PREFIX;

// We track if we own the client so that we can destroy clients that we own.
if (options?.dynamoDBClient) {
Expand Down Expand Up @@ -75,8 +75,8 @@ export default class DynamoDBClientState {
async batchWrite(table: string, params: WriteRequest[]) {
const batches: WriteRequest[][] = [];
// Split into batches of at most 25 commands.
while (params.length) {
batches.push(params.splice(0, WRITE_BATCH_SIZE));
for (let i = 0; i < params.length; i += WRITE_BATCH_SIZE) {
batches.push(params.slice(i, i + WRITE_BATCH_SIZE));
}

// Execute all the batches and wait for them to complete.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export default function TtlFromOptions(options?: LDDynamoDBOptions): number {
if (options?.cacheTTL === undefined || options.cacheTTL === null) {
return DEFAULT_CACHE_TTL_S;
}
return options!.cacheTTL;
return options.cacheTTL;
}
Loading