Comparing version 3.1.2 to 3.1.3
26
index.js
@@ -395,2 +395,3 @@ 'use strict' | ||
let offset = 0 | ||
let startAfter = parsedUrl.query['start-after'] | ||
const prevToken = parsedUrl.query['continuation-token'] | ||
@@ -403,4 +404,17 @@ if (prevToken) { | ||
offset = tokenInfo.offset | ||
if (tokenInfo.startAfter) { | ||
startAfter = tokenInfo.startAfter | ||
} | ||
} | ||
if (startAfter) { | ||
const index = rawObjects.findIndex((o) => { | ||
return o.key === startAfter | ||
}) | ||
if (index >= 0) { | ||
rawObjects = rawObjects.slice(index + 1) | ||
} | ||
} | ||
const end = offset + maxKeys | ||
@@ -413,3 +427,3 @@ const resultObjects = rawObjects.slice(offset, end) | ||
nextToken = cuuid() | ||
this.tokens[nextToken] = { offset: end } | ||
this.tokens[nextToken] = { offset: end, startAfter: startAfter } | ||
} | ||
@@ -471,12 +485,2 @@ | ||
const startAfter = parsedUrl.query['start-after'] | ||
if (startAfter) { | ||
const index = objects.findIndex((o) => { | ||
return o.key === startAfter | ||
}) | ||
if (index >= 0) { | ||
objects = objects.slice(index + 1) | ||
} | ||
} | ||
const prefix = parsedUrl.query.prefix | ||
@@ -483,0 +487,0 @@ if (prefix) { |
{ | ||
"name": "fake-s3", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "a fake s3 server for testing purposes", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
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
46436
1389