@dotenvx/dotenvx 1.11.2 → 1.11.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.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.11.2...main)
5
+ ## [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.11.3...main)
6
+
7
+ ## 1.11.3
8
+
9
+ ### Changed
10
+
11
+ * fallback to `process.env.TERM` for color depth where deno and bun do not support it ([#360](https://github.com/dotenvx/dotenvx/pull/360))
6
12
 
7
13
  ## 1.11.2
8
14
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.11.2",
2
+ "version": "1.11.3",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -1,4 +1,17 @@
1
1
  const { WriteStream } = require('tty')
2
- const getColorDepth = () => WriteStream.prototype.getColorDepth()
2
+
3
+ const getColorDepth = () => {
4
+ try {
5
+ return WriteStream.prototype.getColorDepth()
6
+ } catch (error) {
7
+ const term = process.env.TERM
8
+
9
+ if (term && (term.includes('256color') || term.includes('xterm'))) {
10
+ return 8 // 256 colors
11
+ }
12
+
13
+ return 4
14
+ }
15
+ }
3
16
 
4
17
  module.exports = { getColorDepth }