Tons of Solutions Engineering work done today for the rest of the CS team! Headway, Howard Hanna, Engels, Brighton, etc. Also completed Datasnippers auth flow and worked on Anthology's script. Cloned Anthology's courses (900..) and will clone Full Story on Monday.
This commit is contained in:
16
Scripts/node_modules/fs-extra/lib/json/index.js
generated
vendored
Normal file
16
Scripts/node_modules/fs-extra/lib/json/index.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict'
|
||||
|
||||
const u = require('universalify').fromCallback
|
||||
const jsonFile = require('./jsonfile')
|
||||
|
||||
jsonFile.outputJson = u(require('./output-json'))
|
||||
jsonFile.outputJsonSync = require('./output-json-sync')
|
||||
// aliases
|
||||
jsonFile.outputJSON = jsonFile.outputJson
|
||||
jsonFile.outputJSONSync = jsonFile.outputJsonSync
|
||||
jsonFile.writeJSON = jsonFile.writeJson
|
||||
jsonFile.writeJSONSync = jsonFile.writeJsonSync
|
||||
jsonFile.readJSON = jsonFile.readJson
|
||||
jsonFile.readJSONSync = jsonFile.readJsonSync
|
||||
|
||||
module.exports = jsonFile
|
||||
12
Scripts/node_modules/fs-extra/lib/json/jsonfile.js
generated
vendored
Normal file
12
Scripts/node_modules/fs-extra/lib/json/jsonfile.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
const u = require('universalify').fromCallback
|
||||
const jsonFile = require('jsonfile')
|
||||
|
||||
module.exports = {
|
||||
// jsonfile exports
|
||||
readJson: u(jsonFile.readFile),
|
||||
readJsonSync: jsonFile.readFileSync,
|
||||
writeJson: u(jsonFile.writeFile),
|
||||
writeJsonSync: jsonFile.writeFileSync
|
||||
}
|
||||
18
Scripts/node_modules/fs-extra/lib/json/output-json-sync.js
generated
vendored
Normal file
18
Scripts/node_modules/fs-extra/lib/json/output-json-sync.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
const fs = require('graceful-fs')
|
||||
const path = require('path')
|
||||
const mkdir = require('../mkdirs')
|
||||
const jsonFile = require('./jsonfile')
|
||||
|
||||
function outputJsonSync (file, data, options) {
|
||||
const dir = path.dirname(file)
|
||||
|
||||
if (!fs.existsSync(dir)) {
|
||||
mkdir.mkdirsSync(dir)
|
||||
}
|
||||
|
||||
jsonFile.writeJsonSync(file, data, options)
|
||||
}
|
||||
|
||||
module.exports = outputJsonSync
|
||||
27
Scripts/node_modules/fs-extra/lib/json/output-json.js
generated
vendored
Normal file
27
Scripts/node_modules/fs-extra/lib/json/output-json.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const mkdir = require('../mkdirs')
|
||||
const pathExists = require('../path-exists').pathExists
|
||||
const jsonFile = require('./jsonfile')
|
||||
|
||||
function outputJson (file, data, options, callback) {
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
const dir = path.dirname(file)
|
||||
|
||||
pathExists(dir, (err, itDoes) => {
|
||||
if (err) return callback(err)
|
||||
if (itDoes) return jsonFile.writeJson(file, data, options, callback)
|
||||
|
||||
mkdir.mkdirs(dir, err => {
|
||||
if (err) return callback(err)
|
||||
jsonFile.writeJson(file, data, options, callback)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = outputJson
|
||||
Reference in New Issue
Block a user