versioned-d.ts-tools 0.8.2 → 0.8.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.
@@ -112,8 +112,16 @@ function escapeRegExp(string) {
112
112
  return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
113
113
  }
114
114
  function removeExtraBlankLines(content) {
115
- // Replace 3 or more consecutive newlines with just 2 newlines (1 blank line)
116
- return content.replace(/\n{3,}/g, '\n\n');
115
+ // Detect line ending style (CRLF or LF)
116
+ const hasCRLF = content.includes('\r\n');
117
+ if (hasCRLF) {
118
+ // For CRLF: Replace 3 or more consecutive line breaks with just 2
119
+ return content.replace(/(\r\n){3,}/g, '\r\n\r\n');
120
+ }
121
+ else {
122
+ // For LF: Replace 3 or more consecutive newlines with just 2
123
+ return content.replace(/\n{3,}/g, '\n\n');
124
+ }
117
125
  }
118
126
  // CLI entry point
119
127
  if (require.main === module) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "versioned-d.ts-tools",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Tools for managing versioned TypeScript definition files",
5
5
  "main": "dist/index.js",
6
6
  "bin": {