@gallop.software/studio 1.2.0 → 1.2.1

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.
@@ -705,11 +705,10 @@ async function handleUpload(request) {
705
705
  try {
706
706
  const metadata = await sharp2(buffer).metadata();
707
707
  meta[imageKey] = {
708
- w: metadata.width || 0,
709
- h: metadata.height || 0
708
+ o: { w: metadata.width || 0, h: metadata.height || 0 }
710
709
  };
711
710
  } catch {
712
- meta[imageKey] = { w: 0, h: 0 };
711
+ meta[imageKey] = { o: { w: 0, h: 0 } };
713
712
  }
714
713
  } else {
715
714
  meta[imageKey] = {};
@@ -744,7 +743,7 @@ async function handleDelete(request) {
744
743
  const absolutePath = path6.join(process.cwd(), itemPath);
745
744
  const imageKey = "/" + itemPath.replace(/^public\//, "");
746
745
  const entry = meta[imageKey];
747
- const isPushedToCloud = entry?.c === 1;
746
+ const isPushedToCloud = entry?.c !== void 0;
748
747
  try {
749
748
  const stats = await fs5.stat(absolutePath);
750
749
  if (stats.isDirectory()) {
@@ -752,7 +751,8 @@ async function handleDelete(request) {
752
751
  const prefix = imageKey + "/";
753
752
  for (const key of Object.keys(meta)) {
754
753
  if (key.startsWith(prefix) || key === imageKey) {
755
- if (!meta[key].c) {
754
+ const keyEntry = meta[key];
755
+ if (keyEntry && keyEntry.c === void 0) {
756
756
  for (const thumbPath of getAllThumbnailPaths(key)) {
757
757
  const absoluteThumbPath = path6.join(process.cwd(), "public", thumbPath);
758
758
  try {