Skip to content

Commit

Permalink
Post reviews fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Oct 22, 2024
1 parent 751140a commit cb09de6
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/algos/list/delimiter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict';

const Extension = require('./Extension').default;
const { inc, listingParamsMasterKeysV0ToV1,
Expand Down
3 changes: 1 addition & 2 deletions lib/models/LifecycleConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ export default class LifecycleConfiguration {
break;
} else {
const propName = prop.propName;

delete prop.propName;
if (prop[propName] !== undefined) {
ruleObj[propName] = prop[propName];
Expand Down Expand Up @@ -675,7 +674,7 @@ export default class LifecycleConfiguration {
':([0-5][0-9])' + // Second
'(\\.[0-9]+)?' + // Fractional second
'(Z|[+-][01][0-9]:[0-5][0-9])?$', // Timezone
'g'
'g',
);
const matches = [...date.matchAll(isoRegex)];
if (matches.length !== 1) {
Expand Down
1 change: 0 additions & 1 deletion lib/models/ObjectMDAmzRestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default class ObjectMDAmzRestore {
*/
static isValid(data: { 'ongoing-request': boolean; 'expiry-date': Date | string }) {
try {

new ObjectMDAmzRestore(data['ongoing-request'], data['expiry-date']);
return true;
} catch {
Expand Down
1 change: 0 additions & 1 deletion lib/models/ObjectMDArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default class ObjectMDArchive {
restoreWillExpireAt?: Date;
}) {
try {

new ObjectMDArchive(
data.archiveInfo,
data.restoreRequestedAt,
Expand Down
1 change: 0 additions & 1 deletion lib/policyEvaluator/utils/wildcards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const handleWildcards = (string: string) => {
// Escape all regExp special characters
// Then replace the AWS special characters with regExp equivalents
const regExStr = string.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&').replace(

/(\\\*)|(\\\?)|(\\\$\\\{\\\*\\\})|(\\\$\\\{\\\?\\\})|(\\\$\\\{\\\$\\\})/g,
characterMap
);
Expand Down
1 change: 0 additions & 1 deletion lib/s3middleware/processMpuParts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export function generateMpuPartStorageInfo(filteredPartList: any[]) {
cipheredDataKey: location.sseCipheredDataKey,
};
dataLocations.push(pieceRetrievalInfo);

calculatedSize += pieceSize;
}
});
Expand Down
4 changes: 3 additions & 1 deletion lib/s3middleware/userMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export function getMetaHeaders(headers: http.IncomingHttpHeaders) {
const rawHeaders = Object.entries(headers);
const filtered = rawHeaders.filter(([k]) => k.startsWith('x-amz-meta-'));
const totalLength = filtered.reduce((length, [k, v]) => {
if (!v) {return length;}
if (!v) {
return length;

Check warning on line 15 in lib/s3middleware/userMetadata.ts

View check run for this annotation

Codecov / codecov/patch

lib/s3middleware/userMetadata.ts#L15

Added line #L15 was not covered by tests
}
return length + k.length + v.toString().length;
}, 0);
if (totalLength <= constants.maximumMetaHeadersSize) {
Expand Down
2 changes: 1 addition & 1 deletion lib/versioning/Version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class Version {
const needComma = stringifiedObject.charAt(index) !== '{';
return (
`${stringifiedObject.slice(0, stringifiedObject.length - 1)}${
needComma ? ',' : ''
needComma ? ',' : ''
}"${key}":"${value}"}`
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/clustering/ClusterRPC.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function runTest(testUrl, cb) {
.on('error', err => cb(err));
}

describe.only('ClusterRPC', () => {
describe('ClusterRPC', () => {
beforeAll(done => startTestServer(done));
afterAll(done => stopTestServer(done));

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/algos/list/delimiterMaster.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict';

const assert = require('assert');

Expand Down

0 comments on commit cb09de6

Please sign in to comment.