Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
good-lly committed Nov 27, 2024
1 parent 4383581 commit aa14535
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 150 deletions.
12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
serverModuleFormat: 'js',
bracketSpacing: true,
bracketSameLine: false,
singleQuote: true,
semi: true,
endOfLine: "lf",
tabWidth: 2,
trailingComma: 'all',
arrowParens: 'avoid',
printWidth: 120,
};
12 changes: 0 additions & 12 deletions .prettierrc.json

This file was deleted.

7 changes: 6 additions & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/index.min.js.map

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ type HttpMethod = 'POST' | 'GET' | 'HEAD' | 'PUT' | 'DELETE';
type ExistResponseCode = false | true | null;

// the old way to work with crypto - without browser support
// let _createHmac = crypto.createHmac || (await import('node:crypto')).createHmac;
// let _createHash = crypto.createHash || (await import('node:crypto')).createHash;
let _createHmac = crypto.createHmac || (await import('node:crypto')).createHmac;
let _createHash = crypto.createHash || (await import('node:crypto')).createHash;

import { _createHmac, _createHash } from 'crypto-wrapper';
if (typeof _createHmac === 'undefined' && typeof _createHash === 'undefined') {
console.error(
'ultralight-S3 Module: Crypto functions are not available, please report the issue with necessary description: https://github.com/sentienhq/ultralight-s3/issues',
Expand Down Expand Up @@ -1098,10 +1097,7 @@ class S3 {
method,
headers,
body: ['GET', 'HEAD'].includes(method) ? undefined : body,
signal: this.requestAbortTimeout !== undefined ? AbortSignal.timeout(this.requestAbortTimeout) : undefined,
mode: 'cors', // Ensure CORS mode is enabled
credentials: 'omit', // Ensure credentials are included
cache: 'no-store',
signal: this.requestAbortTimeout !== undefined ? AbortSignal.timeout(this.requestAbortTimeout) : undefined
});
this._log('info', `Response status: ${(res.status, toleratedStatusCodes)}`);
if (!res.ok && !toleratedStatusCodes.includes(res.status)) {
Expand Down
123 changes: 0 additions & 123 deletions src/utils/crypto-wrapper.ts

This file was deleted.

4 changes: 0 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
"esModuleInterop": true,
"sourceMap": true,
"baseUrl": ".",
"paths": {
"crypto-wrapper": ["src/utils/crypto-wrapper.ts"]
}
},
"include": ["src/*", "src/utils/crypto-wrapper.ts"],
"exclude": ["node_modules", "dev", "tests", "lib"],
}

0 comments on commit aa14535

Please sign in to comment.