pgsql-ast-parser
Advanced tools
Comparing version 4.1.6 to 4.1.7
{ | ||
"name": "pgsql-ast-parser", | ||
"version": "4.1.6", | ||
"version": "4.1.7", | ||
"description": "Yet another simple Postgres SQL parser/modifier", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,2 +59,8 @@ import { Interval } from '../syntax/ast'; | ||
if (ret.months || ret.years) { | ||
const m = (ret.months ?? 0) + (ret.years ?? 0) * 12; | ||
ret.months = m % 12; | ||
ret.years = (m - ret.months) / 12; | ||
} | ||
// normalize time | ||
@@ -61,0 +67,0 @@ let t = (ret.hours ?? 0) * 3600 |
@@ -91,3 +91,9 @@ import 'mocha'; | ||
checkInterval(`2 years 13 months 50 days`, { years: 3, months: 1, days: 50 }); | ||
checkInterval(`2 years 13 months`, { years: 3, months: 1 }); | ||
checkInterval(`2 years -13 months 50 days`, { months: 11, days: 50 }); | ||
it('produces a string', () => { | ||
@@ -94,0 +100,0 @@ expect(intervalToString({ years: 1 })).to.equal('1 year'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1119532
12221