-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- var → const - 100% testing coverage - Little style refactor
- Loading branch information
Showing
3 changed files
with
148 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
'use strict' | ||
|
||
var os = require('os') | ||
var parse = require('parse-json') | ||
var asyncify = require('async/asyncify') | ||
var loadJsonFile = require('load-json-file') | ||
var writeJsonFile = require('write-json-file') | ||
var stringifySafe = require('json-stringify-safe') | ||
const os = require('os') | ||
const parse = require('parse-json') | ||
const asyncify = require('async/asyncify') | ||
const loadJsonFile = require('load-json-file') | ||
const writeJsonFile = require('write-json-file') | ||
const stringifySafe = require('json-stringify-safe') | ||
|
||
function stringify (data, replacer, space) { | ||
return stringifySafe(data, replacer, space) + os.EOL | ||
} | ||
|
||
module.exports.stringify = stringify | ||
module.exports.stringifyAsync = asyncify(stringify) | ||
module.exports.parse = parse | ||
module.exports.parseAsync = asyncify(parse) | ||
module.exports.load = loadJsonFile.sync | ||
module.exports.loadAsync = loadJsonFile | ||
module.exports.save = writeJsonFile.sync | ||
module.exports.saveAsync = writeJsonFile | ||
module.exports = { | ||
stringify: stringify, | ||
stringifyAsync: asyncify(stringify), | ||
parse: parse, | ||
parseAsync: asyncify(parse), | ||
load: loadJsonFile.sync, | ||
loadAsync: loadJsonFile, | ||
save: writeJsonFile.sync, | ||
saveAsync: writeJsonFile | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters