Skip to content

Commit

Permalink
fix: stop using os
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherry committed May 22, 2024
1 parent b438bd5 commit 67a74a3
Show file tree
Hide file tree
Showing 3 changed files with 2,044 additions and 5,948 deletions.
7 changes: 4 additions & 3 deletions ini.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/* eslint-disable no-use-before-define */
const {hasOwnProperty} = Object.prototype;

const eol = require('os').EOL;

function isConstructorOrProto(obj, key){
return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__';
}
Expand All @@ -23,6 +21,9 @@ const encode = (obj, options) => {
options = options || Object.create(null);
options.whitespace = options.whitespace === true;
}
options.platform = options.platform || (typeof process !== 'undefined' && process.platform);
const eol = options.platform === 'win32' ? '\r\n' : '\n';

const separator = options.whitespace ? ' = ' : '=';

for(const [key, val] of Object.entries(obj)){
Expand Down Expand Up @@ -234,4 +235,4 @@ module.exports = {
encode,
safe,
unsafe,
};
};
Loading

0 comments on commit 67a74a3

Please sign in to comment.