inibase 1.4.8 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -228,7 +228,7 @@ export default class Inibase {
228
228
  table.schema?.length) {
229
229
  const replaceOldPathes = Utils.findChangedProperties(this.schemaToIdsPath(tableName, table.schema), this.schemaToIdsPath(tableName, schema));
230
230
  if (replaceOldPathes)
231
- await Promise.all(Object.entries(replaceOldPathes).map(async ([oldPath, newPath]) => {
231
+ await Promise.allSettled(Object.entries(replaceOldPathes).map(async ([oldPath, newPath]) => {
232
232
  if (await File.isExists(join(tablePath, oldPath))) {
233
233
  // if newPath is null, it means the field was removed
234
234
  if (newPath === null)
@@ -1581,7 +1581,7 @@ export default class Inibase {
1581
1581
  .name.split("-")
1582
1582
  .map(Number);
1583
1583
  }
1584
- await Promise.all((await readdir(tablePath))
1584
+ await Promise.allSettled((await readdir(tablePath))
1585
1585
  ?.filter((fileName) => fileName.endsWith(this.getFileExtension(tableName)))
1586
1586
  .map(async (file) => unlink(join(tablePath, file))));
1587
1587
  if (globalConfig[this.databasePath].tables.get(tableName).config.cache)
@@ -1615,13 +1615,13 @@ export default class Inibase {
1615
1615
  }
1616
1616
  if (pagination[1] &&
1617
1617
  pagination[1] - (Array.isArray(where) ? where.length : 1) > 0) {
1618
- await Promise.all(files.map(async (file) => renameList.push(await File.remove(join(tablePath, file), where))));
1619
- await Promise.all(renameList
1618
+ await Promise.allSettled(files.map(async (file) => renameList.push(await File.remove(join(tablePath, file), where))));
1619
+ await Promise.allSettled(renameList
1620
1620
  .filter(([_, filePath]) => filePath)
1621
1621
  .map(async ([tempPath, filePath]) => rename(tempPath, filePath)));
1622
1622
  }
1623
1623
  else
1624
- await Promise.all((await readdir(tablePath))
1624
+ await Promise.allSettled((await readdir(tablePath))
1625
1625
  ?.filter((fileName) => fileName.endsWith(this.getFileExtension(tableName)))
1626
1626
  .map(async (file) => unlink(join(tablePath, file))));
1627
1627
  if (globalConfig[this.databasePath].tables.get(tableName).config.cache)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",