Comparing version 1.2.3 to 1.2.4
@@ -56,3 +56,3 @@ 'use strict'; | ||
if (s === '/' && s1 === '*') { | ||
let c = idx + 1, open = 0, close = 0, lastOpen; | ||
let c = idx + 1, open = 0, close = 0, lastOpen, lastClose; | ||
while (++c < len - 1 && close <= open) { | ||
@@ -65,2 +65,3 @@ if (sql[c] === '/' && sql[c + 1] === '*') { | ||
if (sql[c] === '*' && sql[c + 1] === '/') { | ||
lastClose = c; | ||
close++; | ||
@@ -75,7 +76,14 @@ c++; | ||
} | ||
if (sql[idx + 2] !== '!') { | ||
if (sql[idx + 2] === '!') { | ||
if (options.compress) { | ||
space = false; | ||
} | ||
addSpace(); | ||
result += sql.substring(idx, lastClose + 2); | ||
idx = lastClose + 1; | ||
} else { | ||
idx = c - 1; | ||
skipGaps(); | ||
continue; | ||
} | ||
skipGaps(); | ||
continue; | ||
} | ||
@@ -195,2 +203,4 @@ | ||
// minify('p /*!t*/ s'); | ||
module.exports = minify; |
{ | ||
"name": "pg-minify", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Minifies PostgreSQL scripts.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -13,3 +13,3 @@ pg-minify | ||
* Removes `/*multi-line*/` (including nested) and `--single-line` comments | ||
* Preserves special multi-line comments that start with `/*!` | ||
* Preserves special/copyright multi-line comments that start with `/*!` | ||
* Concatenates multi-line strings into a single line with `\n` | ||
@@ -16,0 +16,0 @@ * Fixes multi-line text, prefixing it with `E` where needed |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15275
320