Content-Length: 292801 | pFad | http://github.com/npm/ini/pull/208/commits/2f3b1ad65231082b28c17cc85ce7c5954f4a74f1

9E fix: check process on browser by Creskendoll · Pull Request #208 · npm/ini · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check process on browser #208

Merged
merged 5 commits into from
May 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test coverage
  • Loading branch information
Creskendoll committed May 14, 2023
commit 2f3b1ad65231082b28c17cc85ce7c5954f4a74f1
1 change: 1 addition & 0 deletions lib/ini.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ const encode = (obj, opt = {}) => {
opt.newline = opt.newline === true
opt.sort = opt.sort === true
opt.whitespace = opt.whitespace === true || opt.align === true
// The `typeof` check is required because accessing the `process` directly fails on browsers.
/* istanbul ignore next */
opt.platform = opt.platform || (typeof process !== 'undefined' && process.platform)
opt.bracketedArray = opt.bracketedArray !== false
2 changes: 1 addition & 1 deletion test/foo.js
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ test('encode with align and sort', function (t) {
})

test('encode within browser context', function (t) {
process = undefined
Object.defineProperty(process, 'platform', { value: undefined })

const obj = { log: { type: 'file', level: { label: 'debug', value: 10 } } }
const e = i.encode(obj)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/npm/ini/pull/208/commits/2f3b1ad65231082b28c17cc85ce7c5954f4a74f1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy