Skip to content

Commit

Permalink
Merge pull request #812 from motdotla/patch-12
Browse files Browse the repository at this point in the history
patch issue with node 12
  • Loading branch information
motdotla authored Feb 13, 2024
2 parents 06fd9bb + 1dc22d3 commit f40a8c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function configDotenv (options) {
let encoding = 'utf8'
const debug = Boolean(options && options.debug)

if (options?.encoding) {
if (options && options.encoding) {
encoding = options.encoding
} else {
if (debug) {
Expand All @@ -216,7 +216,7 @@ function configDotenv (options) {
}

let optionPathsThatExist = []
if (options?.path) {
if (options && options.path) {

This comment has been minimized.

Copy link
@magikcypress

magikcypress Feb 16, 2024

I not sure, but here the browser doesn't like this conditional syntax

This comment has been minimized.

Copy link
@motdotla

motdotla Feb 16, 2024

Author Owner

what error are you getting back? i can type something like this in the browser console and it works just fine:

var obj = {}
if (obj && obj.path) { console.log('hello') }
if (!Array.isArray(options.path)) {
if (fs.existsSync(options.path)) {
optionPathsThatExist = [_resolveHome(options.path)]
Expand Down

0 comments on commit f40a8c3

Please sign in to comment.