notes-to-strapi-export-article-ai 1.0.28 → 1.0.29

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/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "notes-to-strapi-export-article-ai",
3
3
  "name": "Strapi Exporter AI",
4
- "version": "1.0.28",
4
+ "version": "1.0.29",
5
5
  "minAppVersion": "1.5.0",
6
6
  "description": "Effortlessly export your notes to Strapi CMS with AI-powered handling and SEO optimization.",
7
7
  "author": "Cinquin Andy",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notes-to-strapi-export-article-ai",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Effortlessly export your Obsidian notes to Strapi CMS with AI-powered image handling and SEO optimization. Replace all the images in your notes by uploaded images in Strapi, and add SEO metadata to uploaded images.",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -357,7 +357,12 @@ export async function getImageBlob(
357
357
  file.extension.match(/^(jpg|jpeg|png|gif|bmp|webp)$/i)
358
358
  )
359
359
  if (files.length > 0) {
360
- const file = files[0] as TFile
360
+ // check the TFILE type, and not cast it to TFILE
361
+ if (!(files[0] instanceof TFile)) {
362
+ return null
363
+ }
364
+ const file = files[0]
365
+
361
366
  const blob = await app.vault.readBinary(file)
362
367
  return {
363
368
  name: file.name,
@@ -391,7 +396,15 @@ export async function getGalleryImageBlobs(
391
396
  )
392
397
  return Promise.all(
393
398
  files.map(async file => {
394
- const blob = await app.vault.readBinary(file as TFile)
399
+ // check the TFILE type, and not cast it to TFILE
400
+ if (!(file instanceof TFile)) {
401
+ return {
402
+ name: '',
403
+ blob: new Blob(),
404
+ path: '',
405
+ }
406
+ }
407
+ const blob = await app.vault.readBinary(file)
395
408
  return {
396
409
  name: file.name,
397
410
  blob: new Blob([blob], { type: 'image/png' }),
package/versions.json CHANGED
@@ -24,5 +24,6 @@
24
24
  "1.0.25": "1.5.0",
25
25
  "1.0.26": "1.5.0",
26
26
  "1.0.27": "1.5.0",
27
- "1.0.28": "1.5.0"
27
+ "1.0.28": "1.5.0",
28
+ "1.0.29": "1.5.0"
28
29
  }