@dimah-s3/server 1.5.8 → 1.5.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.
package/dist/plugins.js CHANGED
@@ -980,7 +980,7 @@ async function handleComplete(config, input, request) {
980
980
  const uploadId = input.uploadId;
981
981
  const parts = [
982
982
  ...new Set(input.parts.map(({ partNumber }) => partNumber))
983
- ].sort((a, b) => a - b);
983
+ ].toSorted((a, b) => a - b);
984
984
  const partRefs = parts.map((partNumber) => ({ partNumber }));
985
985
  await runHook(route.upload.multipart.guard, {
986
986
  ...stored,
@@ -1591,7 +1591,7 @@ function applyPlugins(config) {
1591
1591
  const endpoints = {};
1592
1592
  for (const plugin of plugins) {
1593
1593
  for (const [name, endpoint] of Object.entries(plugin.endpoints ?? {})) {
1594
- if (reservedNames.has(name) || name in endpoints) {
1594
+ if (reservedNames.has(name) || Object.hasOwn(endpoints, name)) {
1595
1595
  throw new Error(
1596
1596
  `Plugin "${plugin.id}" endpoint "${name}" collides with an existing endpoint.`
1597
1597
  );