1
0
mirror of https://github.com/S2-/gitlit synced 2025-10-06 19:30:10 +02:00

update dependencies

This commit is contained in:
s2
2018-10-10 15:11:12 +02:00
parent da4083f574
commit 5c55c54b71
90877 changed files with 339776 additions and 33677 deletions

View File

@@ -1,2 +0,0 @@
test/
.travis.yml

View File

@@ -1,3 +1,21 @@
4.0.0 / 2017-07-12
------------------
- **BREAKING:** Remove global `spaces` option.
- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js.
- Remove undocumented `passParsingErrors` option.
- Added `EOL` override option to `writeFile` when using `spaces`. [#89]
3.0.1 / 2017-07-05
------------------
- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written.
3.0.0 / 2017-04-25
------------------
- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false`
2.4.0 / 2016-09-15
------------------
### Changed
@@ -79,12 +97,13 @@ changes it according to docs. [#12][#12]
------------------
* Initial release.
[#89]: https://github.com/jprichardson/node-jsonfile/pull/89
[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails"
[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file"
[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file"
[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch"
[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working"
[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesnt work from Path-value"
[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value"
[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)"
[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature"
[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file"

72
app/node_modules/jsonfile/README.md generated vendored
View File

@@ -44,9 +44,8 @@ jsonfile.readFile(file, function(err, obj) {
### readFileSync(filename, [options])
`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
- `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, throw the error.
If `false`, returns `null` for the object.
`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object.
```js
var jsonfile = require('jsonfile')
@@ -58,7 +57,7 @@ console.dir(jsonfile.readFileSync(file))
### writeFile(filename, obj, [options], callback)
`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`.
`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
```js
@@ -85,10 +84,37 @@ jsonfile.writeFile(file, obj, {spaces: 2}, function(err) {
})
```
**overriding EOL:**
```js
var jsonfile = require('jsonfile')
var file = '/tmp/data.json'
var obj = {name: 'JP'}
jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, function(err) {
console.error(err)
})
```
**appending to an existing JSON file:**
You can use `fs.writeFile` option `{flag: 'a'}` to achieve this.
```js
var jsonfile = require('jsonfile')
var file = '/tmp/mayAlreadyExistedData.json'
var obj = {name: 'JP'}
jsonfile.writeFile(file, obj, {flag: 'a'}, function (err) {
console.error(err)
})
```
### writeFileSync(filename, obj, [options])
`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`.
`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
```js
var jsonfile = require('jsonfile')
@@ -110,50 +136,30 @@ var obj = {name: 'JP'}
jsonfile.writeFileSync(file, obj, {spaces: 2})
```
### spaces
Global configuration to set spaces to indent JSON files.
**default:** `null`
**overriding EOL:**
```js
var jsonfile = require('jsonfile')
jsonfile.spaces = 4
var file = '/tmp/data.json'
var obj = {name: 'JP'}
// json file has four space indenting now
jsonfile.writeFile(file, obj, function (err) {
console.error(err)
})
jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'})
```
Note, it's bound to `this.spaces`. So, if you do this:
**appending to an existing JSON file:**
```js
var myObj = {}
myObj.writeJsonSync = jsonfile.writeFileSync
// => this.spaces = null
```
Could do the following:
You can use `fs.writeFileSync` option `{flag: 'a'}` to achieve this.
```js
var jsonfile = require('jsonfile')
jsonfile.spaces = 4
jsonfile.writeFileSync(file, obj) // will have 4 spaces indentation
var myCrazyObj = {spaces: 32}
myCrazyObj.writeJsonSync = jsonfile.writeFileSync
myCrazyObj.writeJsonSync(file, obj) // will have 32 space indentation
myCrazyObj.writeJsonSync(file, obj, {spaces: 2}) // will have only 2
var file = '/tmp/mayAlreadyExistedData.json'
var obj = {name: 'JP'}
jsonfile.writeFileSync(file, obj, {flag: 'a'})
```
License
-------

View File

@@ -1,28 +0,0 @@
# Test against this version of Node.js
environment:
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "5"
- nodejs_version: "6"
# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm config set loglevel warn
- npm install --silent
# Post-install test scripts.
test_script:
# Output useful info for debugging.
- node --version
- npm --version
# run tests
- npm test
# Don't actually build.
build: off

51
app/node_modules/jsonfile/index.js generated vendored
View File

@@ -19,10 +19,7 @@ function readFile (file, options, callback) {
var fs = options.fs || _fs
var shouldThrow = true
// DO NOT USE 'passParsingErrors' THE NAME WILL CHANGE!!!, use 'throws' instead
if ('passParsingErrors' in options) {
shouldThrow = options.passParsingErrors
} else if ('throws' in options) {
if ('throws' in options) {
shouldThrow = options.throws
}
@@ -56,17 +53,13 @@ function readFileSync (file, options) {
var fs = options.fs || _fs
var shouldThrow = true
// DO NOT USE 'passParsingErrors' THE NAME WILL CHANGE!!!, use 'throws' instead
if ('passParsingErrors' in options) {
shouldThrow = options.passParsingErrors
} else if ('throws' in options) {
if ('throws' in options) {
shouldThrow = options.throws
}
var content = fs.readFileSync(file, options)
content = stripBom(content)
try {
var content = fs.readFileSync(file, options)
content = stripBom(content)
return JSON.parse(content, options.reviver)
} catch (err) {
if (shouldThrow) {
@@ -78,6 +71,23 @@ function readFileSync (file, options) {
}
}
function stringify (obj, options) {
var spaces
var EOL = '\n'
if (typeof options === 'object' && options !== null) {
if (options.spaces) {
spaces = options.spaces
}
if (options.EOL) {
EOL = options.EOL
}
}
var str = JSON.stringify(obj, options ? options.replacer : null, spaces)
return str.replace(/\n/g, EOL) + EOL
}
function writeFile (file, obj, options, callback) {
if (callback == null) {
callback = options
@@ -86,16 +96,13 @@ function writeFile (file, obj, options, callback) {
options = options || {}
var fs = options.fs || _fs
var spaces = typeof options === 'object' && options !== null
? 'spaces' in options
? options.spaces : this.spaces
: this.spaces
var str = ''
try {
str = JSON.stringify(obj, options ? options.replacer : null, spaces) + '\n'
str = stringify(obj, options)
} catch (err) {
if (callback) return callback(err, null)
// Need to return whether a callback was passed or not
if (callback) callback(err, null)
return
}
fs.writeFile(file, str, options, callback)
@@ -105,12 +112,7 @@ function writeFileSync (file, obj, options) {
options = options || {}
var fs = options.fs || _fs
var spaces = typeof options === 'object' && options !== null
? 'spaces' in options
? options.spaces : this.spaces
: this.spaces
var str = JSON.stringify(obj, options.replacer, spaces) + '\n'
var str = stringify(obj, options)
// not sure if fs.writeFileSync returns anything, but just in case
return fs.writeFileSync(file, str, options)
}
@@ -123,7 +125,6 @@ function stripBom (content) {
}
var jsonfile = {
spaces: null,
readFile: readFile,
readFileSync: readFileSync,
writeFile: writeFile,

View File

@@ -1,35 +1,28 @@
{
"_args": [
[
"jsonfile@2.4.0",
"E:\\projects\\p\\gitlit\\app"
]
],
"_development": true,
"_from": "jsonfile@2.4.0",
"_id": "jsonfile@2.4.0",
"_from": "jsonfile@^4.0.0",
"_id": "jsonfile@4.0.0",
"_inBundle": false,
"_integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"_integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"_location": "/jsonfile",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "jsonfile@2.4.0",
"raw": "jsonfile@^4.0.0",
"name": "jsonfile",
"escapedName": "jsonfile",
"rawSpec": "2.4.0",
"rawSpec": "^4.0.0",
"saveSpec": null,
"fetchSpec": "2.4.0"
"fetchSpec": "^4.0.0"
},
"_requiredBy": [
"/electron-packager/electron-download/fs-extra",
"/fs-extra",
"/mksnapshot/fs-extra"
"/electron-packager/fs-extra",
"/fs-extra"
],
"_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
"_spec": "2.4.0",
"_where": "E:\\projects\\p\\gitlit\\app",
"_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"_shasum": "8771aae0799b64076b76640fca058f9c10e33ecb",
"_spec": "jsonfile@^4.0.0",
"_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\fs-extra",
"author": {
"name": "JP Richardson",
"email": "jprichardson@gmail.com"
@@ -37,16 +30,20 @@
"bugs": {
"url": "https://github.com/jprichardson/node-jsonfile/issues"
},
"bundleDependencies": false,
"dependencies": {
"graceful-fs": "^4.1.6"
},
"deprecated": false,
"description": "Easily read/write JSON files.",
"devDependencies": {
"mocha": "2.x",
"mock-fs": "^3.8.0",
"rimraf": "^2.4.0",
"standard": "^6.0.8"
"standard": "^10.0.3"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jprichardson/node-jsonfile#readme",
"keywords": [
"read",
@@ -71,5 +68,5 @@
"test": "npm run lint && npm run unit",
"unit": "mocha"
},
"version": "2.4.0"
"version": "4.0.0"
}