sveltekit-data-plugin 1.5.0 → 1.5.2

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/plugin.js CHANGED
@@ -3,8 +3,11 @@
3
3
  })(this, function(fm, path, fs) {
4
4
  "use strict";
5
5
  const REGEX = {
6
- IMAGE: /^\S*(jpg|png|webp|avif|jpeg)$/,
7
- YOUTUBE: /^(https?\:\/\/)?((www\.)?youtube\.com|youtu\.be)\/.+$/
6
+ IMAGE: new RegExp(/^\S*(jpg|png|webp|avif|jpeg)$/, "i"),
7
+ YOUTUBE: new RegExp(
8
+ /^(https?\:\/\/)?((www\.)?youtube\.com|youtu\.be)\/.+$/,
9
+ "i"
10
+ )
8
11
  };
9
12
  function oembed(type, url) {
10
13
  switch (type) {
@@ -77,7 +80,7 @@
77
80
  ...attributes,
78
81
  _internal: {
79
82
  id: path.basename(obj),
80
- absolute: obj
83
+ absolute: markdownFile
81
84
  },
82
85
  body: data.body
83
86
  };
package/dist/plugin.mjs CHANGED
@@ -2,8 +2,11 @@ import fm from "front-matter";
2
2
  import path from "path";
3
3
  import fs from "fs/promises";
4
4
  const REGEX = {
5
- IMAGE: /^\S*(jpg|png|webp|avif|jpeg)$/,
6
- YOUTUBE: /^(https?\:\/\/)?((www\.)?youtube\.com|youtu\.be)\/.+$/
5
+ IMAGE: new RegExp(/^\S*(jpg|png|webp|avif|jpeg)$/, "i"),
6
+ YOUTUBE: new RegExp(
7
+ /^(https?\:\/\/)?((www\.)?youtube\.com|youtu\.be)\/.+$/,
8
+ "i"
9
+ )
7
10
  };
8
11
  function oembed(type, url) {
9
12
  switch (type) {
@@ -76,7 +79,7 @@ async function convert(opts, obj, { base, relative, depth = 1 } = {}) {
76
79
  ...attributes,
77
80
  _internal: {
78
81
  id: path.basename(obj),
79
- absolute: obj
82
+ absolute: markdownFile
80
83
  },
81
84
  body: data.body
82
85
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-data-plugin",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "author": {
5
5
  "name": "Jonny Thaw",
6
6
  "url": "https://jthaw.me"