happy-sql 2.0.5 → 2.0.6

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2026.08.20, v2.0.6
2
+
3
+ feature:
4
+ - eea70b5 @putout/parser: add source of incorrect sql
5
+
1
6
  2026.08.20, v2.0.5
2
7
 
3
8
  fix:
@@ -33,14 +33,16 @@ export const parseSql = (source) => {
33
33
  return convertSource(cst);
34
34
  }
35
35
 
36
- throw Error('Cannot parse SQL');
36
+ throw Error(`Cannot parse SQL: '${source}'`);
37
37
  };
38
38
 
39
+ const isComment = ({text}) => text.startsWith('-- @');
40
+
39
41
  const getSectionName = (leading) => {
40
42
  if (!leading)
41
43
  return null;
42
44
 
43
- const comment = leading.find((c) => c.text.startsWith('-- @'));
45
+ const comment = leading.find(isComment);
44
46
 
45
47
  return comment ? comment.text
46
48
  .slice(2)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "happy-sql",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "type": "module",
5
5
  "description": "sql to js ast parser and printer",
6
6
  "exports": {