vite-plugin-postgres-import 0.3.2 → 0.3.3

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/package.json +1 -1
  2. package/parse.js +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-postgres-import",
3
3
  "description": "Vite plugin for importing SQL files as JS modules with sqlc-style annotations",
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "main": "plugin.js",
6
6
  "type": "module",
7
7
  "author": "SirKostya009",
package/parse.js CHANGED
@@ -26,7 +26,7 @@ function metadata(/** @type {string} */ s, /** @type {ReturnType<typeof metadata
26
26
  annotationRegex.lastIndex = 0;
27
27
  const match = firstMeta ? /--\s*(?<tags>(:\w+\s*)*)\r?\n/.exec(s) : annotationRegex.exec(s);
28
28
  const meta = match?.groups;
29
- const query = s.substring(match[0].length).trim();
29
+ const query = s.substring(match?.[0]?.length ?? 0).trim();
30
30
 
31
31
  return {
32
32
  name: firstMeta?.name || meta?.name,