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
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
# npx force-resolutions : in case of Permission denied: run it locally to fix package-lock.json
run: |
echo "install"
pnpm run preinstall
pnpm install
echo "show outdated (if any)"
pnpm outdated --depth=3 || echo "you must think about update your dependencies :)"
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,7 @@ For security reason, since [#102](https://github.com/boly38/node-mongotools/issu
You're not a dev ? just submit an issue (bug, improvements, questions). Or else:
* Clone
* Install deps
* Then mocha tests
```
git clone https://github.com/boly38/node-mongotools.git
pnpm install
pnpm run test
```
* Then mocha tests (cf. [README](./tests/README.md))
* you could also fork, feature branch, then submit a pull request.

### Services or activated bots
Expand Down
12 changes: 8 additions & 4 deletions lib/MTDropbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ export default class MTDropbox {
})
.catch(filesListError => {
MUST_LOG_DEBUG && console.log('filesListError', filesListError)
const {status} = filesListError;
if (status === 409) {
reject(new Error(`Dropbox path '${path}' dont exist`));
if (isPathNotFoundError(filesListError)) {
resolve([]);
return;
}
reject(new Error(
Expand Down Expand Up @@ -230,8 +229,13 @@ function getDropbox(options) {
})
}

function isPathNotFoundError(filesListError) {
const {status, error} = filesListError;
return (status === 409 && error?.error_summary?.includes("not_found"));
}

function dropboxErrorResponseToSummary(dropboxResponseError) {
const {status, error} = dropboxResponseError
const error_summary = error?.error_summary /* deprecated */ || error;
const error_summary = error?.error_summary || error;
return `[status:${status}] ${error_summary}`;
}
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"scripts": {
"lint": "eslint .",
"audit": "npm audit --omit=dev",
"preinstall": "npx force-resolutions",
"test-requirement": "echo You must do: source ./env/initEnv.test.sh",
"test": "echo test&& mocha --bail --unhandled-rejections=strict tests/*.test.js --timeout 50000",
"test21": "echo beta test with nodejs 21&& node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info --test tests",
Expand All @@ -39,12 +38,7 @@
],
"copyright": {
"title": "node-mongotools",
"years": [
2020,
2021,
2022,
2023
],
"years": [2020,2021,2022,2023,2024,2025],
"author": "Brice Vandeputte"
},
"dependencies": {
Expand All @@ -55,7 +49,7 @@
"devDependencies": {
"@eslint/js": "^9.35.0",
"@stylistic/eslint-plugin": "^5.3.1",
"@types/node": "^24.5.1",
"@types/node": "^24.5.2",
"chai": "^6.0.1",
"chai-string": "^1.6.0",
"eslint": "^9.35.0",
Expand All @@ -66,14 +60,20 @@
"json5": "^2.2.3",
"mocha": "^11.7.2",
"mongoose": "^8.18.1",
"npm-force-resolutions": "^0.0.10",
"nyc": "^17.1.0"
},
"pnpm": {
"overrides": {
"form-data": "^4.0.4"
"form-data": "^4.0.4",
"chai-string>chai": "^6.0.1",
"glob": "^9.3.5",
"rimraf": "^3.0.2"
}
},
"doc": {
"npm-force-resolutions": "needed by GHA",
"rimraf": "need to move from nyc to c8"
},
"jshintConfig": {
"esversion": 6
},
Expand Down
Loading