Add capacitorjs runtime

This commit is contained in:
olcxja 2026-05-03 17:09:55 +02:00
commit f90c0e6c40
8362 changed files with 1502407 additions and 1 deletions

182
node_modules/git-raw-commits/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,182 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
### [2.0.11](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits-v2.0.10...git-raw-commits-v2.0.11) (2021-12-29)
### Bug Fixes
* allow raw commits to be filtered by path and date range ([#893](https://github.com/conventional-changelog/conventional-changelog/issues/893)) ([b2245a7](https://github.com/conventional-changelog/conventional-changelog/commit/b2245a766c70d280380abbbe85c4894eee04fdd0))
### [2.0.10](https://www.github.com/conventional-changelog/conventional-changelog/compare/v2.0.9...v2.0.10) (2021-01-27)
### Bug Fixes
* align lodash dependency across packages ([#737](https://www.github.com/conventional-changelog/conventional-changelog/issues/737)) ([d9feeb6](https://www.github.com/conventional-changelog/conventional-changelog/commit/d9feeb605de28c00ef55b5c8e229efd1289dd6e8))
* revert normalize git show signature option to false ([c4d9042](https://www.github.com/conventional-changelog/conventional-changelog/commit/c4d9042ae83aa2c823dca181dd72e5a8b3163c1e))
### [2.0.9](https://www.github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.8...v2.0.9) (2020-12-29)
### Bug Fixes
* normalize git show signature option to false ([#671](https://www.github.com/conventional-changelog/conventional-changelog/issues/671)) ([a0b348c](https://www.github.com/conventional-changelog/conventional-changelog/commit/a0b348c7a74ba49bb07053ed1d25c2053a7c3b1a)), closes [conventional-changelog/commitlint#2118](https://www.github.com/conventional-changelog/commitlint/issues/2118)
## [2.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.7...git-raw-commits@2.0.8) (2020-11-05)
### Bug Fixes
* **deps:** update dependency through2 to v4 ([#657](https://github.com/conventional-changelog/conventional-changelog/issues/657)) ([7ae618c](https://github.com/conventional-changelog/conventional-changelog/commit/7ae618c81491841e5b1d796d3933aac0c54bc312))
## [2.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.3...git-raw-commits@2.0.7) (2020-05-08)
### Bug Fixes
* **deps:** update yargs-parser to move off a flagged-vulnerable version. ([#635](https://github.com/conventional-changelog/conventional-changelog/issues/635)) ([aafc0f0](https://github.com/conventional-changelog/conventional-changelog/commit/aafc0f00412c3e4b23b8418300e5a570a48fe24d))
## [2.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.2...git-raw-commits@2.0.3) (2019-11-14)
**Note:** Version bump only for package git-raw-commits
## [2.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.1...git-raw-commits@2.0.2) (2019-04-10)
### Bug Fixes
* **deps:** update dependency through2 to v3 ([#392](https://github.com/conventional-changelog/conventional-changelog/issues/392)) ([26fe91f](https://github.com/conventional-changelog/conventional-changelog/commit/26fe91f))
## [2.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@2.0.0...git-raw-commits@2.0.1) (2018-11-01)
### Bug Fixes
* Upgrade to Lerna 3, fix Node.js v11 error ([#385](https://github.com/conventional-changelog/conventional-changelog/issues/385)) ([cdef282](https://github.com/conventional-changelog/conventional-changelog/commit/cdef282))
<a name="2.0.0"></a>
# [2.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.6...git-raw-commits@2.0.0) (2018-05-29)
### Chores
* **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
### BREAKING CHANGES
* **package:** Set the package's minimum required Node version to be the oldest LTS
currently supported by the Node Release working group. At this time,
that is Node 6 (which is in its Maintenance LTS phase).
<a name="1.3.6"></a>
## [1.3.6](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.5...git-raw-commits@1.3.6) (2018-03-27)
**Note:** Version bump only for package git-raw-commits
<a name="1.3.5"></a>
## [1.3.5](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.4...git-raw-commits@1.3.5) (2018-03-22)
**Note:** Version bump only for package git-raw-commits
<a name="1.3.4"></a>
## [1.3.4](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.3...git-raw-commits@1.3.4) (2018-02-24)
**Note:** Version bump only for package git-raw-commits
<a name="1.3.3"></a>
## [1.3.3](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.2...git-raw-commits@1.3.3) (2018-02-20)
**Note:** Version bump only for package git-raw-commits
<a name="1.3.2"></a>
## [1.3.2](https://github.com/conventional-changelog/git-raw-commits/compare/git-raw-commits@1.3.1...git-raw-commits@1.3.2) (2018-02-13)
**Note:** Version bump only for package git-raw-commits
<a name="1.3.1"></a>
## [1.3.1](https://github.com/conventional-changelog/git-raw-commits/compare/git-raw-commits@1.3.0...git-raw-commits@1.3.1) (2018-02-13)
**Note:** Version bump only for package git-raw-commits
<a name="1.3.0"></a>
# [1.3.0](https://github.com/conventional-changelog/git-raw-commits/compare/git-raw-commits@1.2.0...git-raw-commits@1.3.0) (2017-11-13)
### Features
* **git-raw-commits:** add execOpts.cwd ([2631213](https://github.com/conventional-changelog/git-raw-commits/commit/2631213))
<a name="1.2.0"></a>
# [1.2.0](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.1.2...v1.2.0) (2017-03-10)
### Features
* allow raw commits to be filtered by path ([#172](https://github.com/conventional-changelog/conventional-changelog/issues/172)) ([ec0a25d](https://github.com/conventional-changelog/conventional-changelog/commit/ec0a25d))
* migrate repo to lerna mono-repo ([793e823](https://github.com/conventional-changelog/conventional-changelog/commit/793e823))
<a name="1.1.2"></a>
## [1.1.2](https://github.com/conventional-changelog/git-raw-commits/compare/v1.1.1...v1.1.2) (2016-06-27)
### Bug Fixes
* **windows:** use execFile for executing git ([9ae06df](https://github.com/conventional-changelog/git-raw-commits/commit/9ae06df)), closes [#11](https://github.com/conventional-changelog/git-raw-commits/issues/11)
<a name="1.1.1"></a>
## [1.1.1](https://github.com/conventional-changelog/git-raw-commits/compare/v1.1.0...v1.1.1) (2016-06-26)
### Bug Fixes
* **windows:** escape command percent signs ([005b559](https://github.com/conventional-changelog/git-raw-commits/commit/005b559)), closes [#10](https://github.com/conventional-changelog/git-raw-commits/issues/10)

21
node_modules/git-raw-commits/LICENSE.md generated vendored Normal file
View file

@ -0,0 +1,21 @@
### MIT License
Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

101
node_modules/git-raw-commits/README.md generated vendored Normal file
View file

@ -0,0 +1,101 @@
# [![NPM version][npm-image]][npm-url] [![Build Status: Linux][travis-image]][travis-url] [![Build Status: Windows][appveyor-image]][appveyor-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
> Get raw git commits out of your repository using git-log(1)
## Install
```sh
$ npm install --save git-raw-commits
```
## Usage
```js
var gitRawCommits = require('git-raw-commits');
gitRawCommits(options)
.pipe(...);
```
## API
### gitRawCommits(gitOpts, [execOpts])
Returns a readable stream. Stream is split to break on each commit.
#### gitOpts
Type: `object`
Please check the available options at http://git-scm.com/docs/git-log.
**NOTE:** Single dash arguments are not supported because of https://github.com/sindresorhus/dargs/blob/master/index.js#L5.
*NOTE*: for `<revision range>` we can also use `<from>..<to>` pattern, and this module has the following extra options for shortcut of this pattern:
##### gitOpts.from
Type: `string` Default: `''`
##### gitOpts.to
Type: `string` Default: `'HEAD'`
This module also have the following additions:
##### gitOpts.format
Type: `string` Default: `'%B'`
Please check http://git-scm.com/docs/git-log for format options.
##### gitOpts.debug
Type: `function`
A function to get debug information.
##### gitOpts.path
Type: `string`
Filter commits to the path provided.
##### execOpts
Options to pass to `git` `childProcess`
Type: `object`
##### execOpts.cwd
Type: `string`
Current working directory to execute git in
## CLI
```sh
$ npm install --global git-raw-commits
$ git-raw-commits --help # for more details
```
## License
MIT © [Steve Mao](https://github.com/stevemao)
[npm-image]: https://badge.fury.io/js/git-raw-commits.svg
[npm-url]: https://npmjs.org/package/git-raw-commits
[travis-image]: https://travis-ci.org/conventional-changelog/git-raw-commits.svg?branch=master
[travis-url]: https://travis-ci.org/conventional-changelog/git-raw-commits
[appveyor-image]: https://ci.appveyor.com/api/projects/status/4qm3bjmg41k3dsbv/branch/master?svg=true
[appveyor-url]: https://ci.appveyor.com/project/stevemao/git-raw-commits/branch/master
[daviddm-image]: https://david-dm.org/conventional-changelog/git-raw-commits.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/conventional-changelog/git-raw-commits
[coveralls-image]: https://coveralls.io/repos/conventional-changelog/git-raw-commits/badge.svg
[coveralls-url]: https://coveralls.io/r/conventional-changelog/git-raw-commits

19
node_modules/git-raw-commits/cli.js generated vendored Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env node
'use strict'
const meow = require('meow')
const gitRawCommits = require('./')
const cli = meow(`
Usage
git-raw-commits [<git-log(1)-options>]
Example
git-raw-commits --from HEAD~2 --to HEAD^`
)
gitRawCommits(cli.flags)
.on('error', function (err) {
process.stderr.write(err)
process.exit(1)
})
.pipe(process.stdout)

91
node_modules/git-raw-commits/index.js generated vendored Normal file
View file

@ -0,0 +1,91 @@
'use strict'
const dargs = require('dargs')
const execFile = require('child_process').execFile
const split = require('split2')
const stream = require('stream')
const template = require('lodash/template')
const through = require('through2')
const DELIMITER = '------------------------ >8 ------------------------'
function normalizeExecOpts (execOpts) {
execOpts = execOpts || {}
execOpts.cwd = execOpts.cwd || process.cwd()
return execOpts
}
function normalizeGitOpts (gitOpts) {
gitOpts = gitOpts || {}
gitOpts.format = gitOpts.format || '%B'
gitOpts.from = gitOpts.from || ''
gitOpts.to = gitOpts.to || 'HEAD'
return gitOpts
}
function getGitArgs (gitOpts) {
const gitFormat = template('--format=<%= format %>%n' + DELIMITER)(gitOpts)
const gitFromTo = [gitOpts.from, gitOpts.to].filter(Boolean).join('..')
const gitArgs = ['log', gitFormat, gitFromTo]
.concat(dargs(gitOpts, {
excludes: ['debug', 'from', 'to', 'format', 'path']
}))
// allow commits to focus on a single directory
// this is useful for monorepos.
if (gitOpts.path) {
gitArgs.push('--', gitOpts.path)
}
return gitArgs
}
function gitRawCommits (rawGitOpts, rawExecOpts) {
const readable = new stream.Readable()
readable._read = function () {}
const gitOpts = normalizeGitOpts(rawGitOpts)
const execOpts = normalizeExecOpts(rawExecOpts)
const args = getGitArgs(gitOpts)
if (gitOpts.debug) {
gitOpts.debug('Your git-log command is:\ngit ' + args.join(' '))
}
let isError = false
const child = execFile('git', args, {
cwd: execOpts.cwd,
maxBuffer: Infinity
})
child.stdout
.pipe(split(DELIMITER + '\n'))
.pipe(through(function (chunk, enc, cb) {
readable.push(chunk)
isError = false
cb()
}, function (cb) {
setImmediate(function () {
if (!isError) {
readable.push(null)
readable.emit('close')
}
cb()
})
}))
child.stderr
.pipe(through.obj(function (chunk) {
isError = true
readable.emit('error', new Error(chunk))
readable.emit('close')
}))
return readable
}
module.exports = gitRawCommits

View file

@ -0,0 +1,13 @@
Copyright (c) 2014-2018, Matteo Collina <hello@matteocollina.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,97 @@
# Split2(matcher, mapper, options)
![ci](https://github.com/mcollina/split2/workflows/ci/badge.svg)
Break up a stream and reassemble it so that each line is a chunk.
`split2` is inspired by [@dominictarr](https://github.com/dominictarr) [`split`](https://github.com/dominictarr/split) module,
and it is totally API compatible with it.
However, it is based on Node.js core [`Transform`](https://nodejs.org/api/stream.html#stream_new_stream_transform_options) via [`readable-stream`](https://github.com/nodejs/readable-stream)
`matcher` may be a `String`, or a `RegExp`. Example, read every line in a file ...
``` js
fs.createReadStream(file)
.pipe(split2())
.on('data', function (line) {
//each chunk now is a separate line!
})
```
`split` takes the same arguments as `string.split` except it defaults to '/\r?\n/', and the optional `limit` paremeter is ignored.
[String#split](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/split)
`split` takes an optional options object on it's third argument, which
is directly passed as a
[Transform](https://nodejs.org/api/stream.html#stream_new_stream_transform_options)
option.
Additionally, the `.maxLength` and `.skipOverflow` options are implemented, which set limits on the internal
buffer size and the stream's behavior when the limit is exceeded. There is no limit unless `maxLength` is set. When
the internal buffer size exceeds `maxLength`, the stream emits an error by default. You may also set `skipOverflow` to
true to suppress the error and instead skip past any lines that cause the internal buffer to exceed `maxLength`.
Calling `.destroy` will make the stream emit `close`. Use this to perform cleanup logic
``` js
var splitFile = function(filename) {
var file = fs.createReadStream(filename)
return file
.pipe(split2())
.on('close', function() {
// destroy the file stream in case the split stream was destroyed
file.destroy()
})
}
var stream = splitFile('my-file.txt')
stream.destroy() // will destroy the input file stream
```
# NDJ - Newline Delimited Json
`split2` accepts a function which transforms each line.
``` js
fs.createReadStream(file)
.pipe(split2(JSON.parse))
.on('data', function (obj) {
//each chunk now is a js object
})
.on("error", function(error) => {
//handling parsing errors
})
```
However, in [@dominictarr](https://github.com/dominictarr) [`split`](https://github.com/dominictarr/split) the mapper
is wrapped in a try-catch, while here it is not: if your parsing logic can throw, wrap it yourself. Otherwise, you can also use the stream error handling when mapper function throw.
# Benchmark
```bash
$ node bench.js
benchSplit*10000: 1484.983ms
benchBinarySplit*10000: 1484.080ms
benchSplit*10000: 1407.334ms
benchBinarySplit*10000: 1500.281ms
```
Benchmark taken on Node 8.11.3, on a Macbook i5 2018.
# License
Copyright (c) 2014-2018, Matteo Collina <hello@matteocollina.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,27 @@
'use strict'
var split = require('./')
var bench = require('fastbench')
var binarySplit = require('binary-split')
var fs = require('fs')
function benchSplit (cb) {
fs.createReadStream('package.json')
.pipe(split())
.on('end', cb)
.resume()
}
function benchBinarySplit (cb) {
fs.createReadStream('package.json')
.pipe(binarySplit())
.on('end', cb)
.resume()
}
var run = bench([
benchSplit,
benchBinarySplit
], 10000)
run(run)

View file

@ -0,0 +1,132 @@
/*
Copyright (c) 2014-2018, Matteo Collina <hello@matteocollina.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
'use strict'
const { Transform } = require('readable-stream')
const { StringDecoder } = require('string_decoder')
const kLast = Symbol('last')
const kDecoder = Symbol('decoder')
function transform (chunk, enc, cb) {
var list
if (this.overflow) { // Line buffer is full. Skip to start of next line.
var buf = this[kDecoder].write(chunk)
list = buf.split(this.matcher)
if (list.length === 1) return cb() // Line ending not found. Discard entire chunk.
// Line ending found. Discard trailing fragment of previous line and reset overflow state.
list.shift()
this.overflow = false
} else {
this[kLast] += this[kDecoder].write(chunk)
list = this[kLast].split(this.matcher)
}
this[kLast] = list.pop()
for (var i = 0; i < list.length; i++) {
try {
push(this, this.mapper(list[i]))
} catch (error) {
return cb(error)
}
}
this.overflow = this[kLast].length > this.maxLength
if (this.overflow && !this.skipOverflow) return cb(new Error('maximum buffer reached'))
cb()
}
function flush (cb) {
// forward any gibberish left in there
this[kLast] += this[kDecoder].end()
if (this[kLast]) {
try {
push(this, this.mapper(this[kLast]))
} catch (error) {
return cb(error)
}
}
cb()
}
function push (self, val) {
if (val !== undefined) {
self.push(val)
}
}
function noop (incoming) {
return incoming
}
function split (matcher, mapper, options) {
// Set defaults for any arguments not supplied.
matcher = matcher || /\r?\n/
mapper = mapper || noop
options = options || {}
// Test arguments explicitly.
switch (arguments.length) {
case 1:
// If mapper is only argument.
if (typeof matcher === 'function') {
mapper = matcher
matcher = /\r?\n/
// If options is only argument.
} else if (typeof matcher === 'object' && !(matcher instanceof RegExp)) {
options = matcher
matcher = /\r?\n/
}
break
case 2:
// If mapper and options are arguments.
if (typeof matcher === 'function') {
options = mapper
mapper = matcher
matcher = /\r?\n/
// If matcher and options are arguments.
} else if (typeof mapper === 'object') {
options = mapper
mapper = noop
}
}
options = Object.assign({}, options)
options.transform = transform
options.flush = flush
options.readableObjectMode = true
const stream = new Transform(options)
stream[kLast] = ''
stream[kDecoder] = new StringDecoder('utf8')
stream.matcher = matcher
stream.mapper = mapper
stream.maxLength = options.maxLength
stream.skipOverflow = options.skipOverflow
stream.overflow = false
return stream
}
module.exports = split

View file

@ -0,0 +1,40 @@
{
"name": "split2",
"version": "3.2.2",
"description": "split a Text Stream into a Line Stream, using Stream 3",
"main": "index.js",
"scripts": {
"lint": "standard --verbose",
"unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test.js",
"coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js",
"test:report": "npm run lint && npm run unit:report",
"test": "npm run lint && npm run unit",
"legacy": "tape test.js"
},
"pre-commit": [
"test"
],
"website": "https://github.com/mcollina/split2",
"repository": {
"type": "git",
"url": "https://github.com/mcollina/split2.git"
},
"bugs": {
"url": "http://github.com/mcollina/split2/issues"
},
"author": "Matteo Collina <hello@matteocollina.com>",
"license": "ISC",
"devDependencies": {
"binary-split": "^1.0.3",
"callback-stream": "^1.1.0",
"fastbench": "^1.0.0",
"nyc": "^15.0.1",
"pre-commit": "^1.1.2",
"safe-buffer": "^5.1.1",
"standard": "^14.0.0",
"tape": "^5.0.0"
},
"dependencies": {
"readable-stream": "^3.0.0"
}
}

View file

@ -0,0 +1,392 @@
'use strict'
var test = require('tape')
var split = require('./')
var callback = require('callback-stream')
var Buffer = require('safe-buffer').Buffer
var strcb = callback.bind(null, { decodeStrings: false })
var objcb = callback.bind(null, { objectMode: true })
test('split two lines on end', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello\nworld')
})
test('split two lines on two writes', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.write('hello')
input.write('\nworld')
input.end()
})
test('split four lines on three writes', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world', 'bye', 'world'])
}))
input.write('hello\nwor')
input.write('ld\nbye\nwo')
input.write('rld')
input.end()
})
test('accumulate multiple writes', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['helloworld'])
}))
input.write('hello')
input.write('world')
input.end()
})
test('split using a custom string matcher', function (t) {
t.plan(2)
var input = split('~')
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})
test('split using a custom regexp matcher', function (t) {
t.plan(2)
var input = split(/~/)
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})
test('support an option argument', function (t) {
t.plan(2)
var input = split({ highWaterMark: 2 })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello\nworld')
})
test('support a mapper function', function (t) {
t.plan(2)
var a = { a: '42' }
var b = { b: '24' }
var input = split(JSON.parse)
input.pipe(objcb(function (err, list) {
t.error(err)
t.deepEqual(list, [a, b])
}))
input.write(JSON.stringify(a))
input.write('\n')
input.end(JSON.stringify(b))
})
test('split lines windows-style', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello\r\nworld')
})
test('splits a buffer', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end(Buffer.from('hello\nworld'))
})
test('do not end on undefined', function (t) {
t.plan(2)
var input = split(function (line) { })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, [])
}))
input.end(Buffer.from('hello\nworld'))
})
test('has destroy method', function (t) {
t.plan(1)
var input = split(function (line) { })
input.on('close', function () {
t.ok(true, 'close emitted')
t.end()
})
input.destroy()
})
test('support custom matcher and mapper', function (t) {
t.plan(4)
var a = { a: '42' }
var b = { b: '24' }
var input = split('~', JSON.parse)
t.equal(input.matcher, '~')
t.equal(typeof input.mapper, 'function')
input.pipe(objcb(function (err, list) {
t.notOk(err, 'no errors')
t.deepEqual(list, [a, b])
}))
input.write(JSON.stringify(a))
input.write('~')
input.end(JSON.stringify(b))
})
test('support custom matcher and options', function (t) {
t.plan(6)
var input = split('~', { highWaterMark: 1024 })
t.equal(input.matcher, '~')
t.equal(typeof input.mapper, 'function')
t.equal(input._readableState.highWaterMark, 1024)
t.equal(input._writableState.highWaterMark, 1024)
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.end('hello~world')
})
test('support mapper and options', function (t) {
t.plan(6)
var a = { a: '42' }
var b = { b: '24' }
var input = split(JSON.parse, { highWaterMark: 1024 })
t.ok(input.matcher instanceof RegExp, 'matcher is RegExp')
t.equal(typeof input.mapper, 'function')
t.equal(input._readableState.highWaterMark, 1024)
t.equal(input._writableState.highWaterMark, 1024)
input.pipe(objcb(function (err, list) {
t.error(err)
t.deepEqual(list, [a, b])
}))
input.write(JSON.stringify(a))
input.write('\n')
input.end(JSON.stringify(b))
})
test('split utf8 chars', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['烫烫烫', '锟斤拷'])
}))
var buf = Buffer.from('烫烫烫\r\n锟斤拷', 'utf8')
for (var i = 0; i < buf.length; ++i) {
input.write(buf.slice(i, i + 1))
}
input.end()
})
test('split utf8 chars 2by2', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['烫烫烫', '烫烫烫'])
}))
var str = '烫烫烫\r\n烫烫烫'
var buf = Buffer.from(str, 'utf8')
for (var i = 0; i < buf.length; i += 2) {
input.write(buf.slice(i, i + 2))
}
input.end()
})
test('split lines when the \n comes at the end of a chunk', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['hello', 'world'])
}))
input.write('hello\n')
input.end('world')
})
test('truncated utf-8 char', function (t) {
t.plan(2)
var input = split()
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['烫' + Buffer.from('e7', 'hex').toString()])
}))
var str = '烫烫'
var buf = Buffer.from(str, 'utf8')
input.write(buf.slice(0, 3))
input.end(buf.slice(3, 4))
})
test('maximum buffer limit', function (t) {
t.plan(1)
var input = split({ maxLength: 2 })
input.pipe(strcb(function (err, list) {
t.ok(err)
}))
input.write('hey')
})
test('readable highWaterMark', function (t) {
var input = split()
t.equal(input._readableState.highWaterMark, 16)
t.end()
})
test('maxLength < chunk size', function (t) {
t.plan(2)
var input = split({ maxLength: 2 })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['a', 'b'])
}))
input.end('a\nb')
})
test('maximum buffer limit w/skip', function (t) {
t.plan(2)
var input = split({ maxLength: 2, skipOverflow: true })
input.pipe(strcb(function (err, list) {
t.error(err)
t.deepEqual(list, ['a', 'b', 'c'])
}))
input.write('a\n123')
input.write('456')
input.write('789\nb\nc')
input.end()
})
test("don't modify the options object", function (t) {
t.plan(2)
var options = {}
var input = split(options)
input.pipe(strcb(function (err, list) {
t.error(err)
t.same(options, {})
}))
input.end()
})
test('mapper throws flush', function (t) {
t.plan(1)
var error = new Error()
var input = split(function () {
throw error
})
input.on('error', (err, list) => {
t.same(err, error)
})
input.end('hello')
})
test('mapper throws on transform', function (t) {
t.plan(2)
var error = new Error()
var input = split(function (l) {
throw error
})
input.on('error', (err) => {
t.same(err, error)
})
input.write('a')
input.write('\n')
input.end('b')
})

48
node_modules/git-raw-commits/package.json generated vendored Normal file
View file

@ -0,0 +1,48 @@
{
"name": "git-raw-commits",
"version": "2.0.11",
"description": "Get raw git commits out of your repository using git-log(1)",
"bugs": {
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
},
"homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-raw-commits#readme",
"author": {
"name": "Steve Mao",
"email": "maochenyan@gmail.com",
"url": "https://github.com/stevemao"
},
"repository": {
"type": "git",
"url": "https://github.com/conventional-changelog/conventional-changelog.git"
},
"license": "MIT",
"engines": {
"node": ">=10"
},
"files": [
"index.js",
"cli.js"
],
"keywords": [
"git-raw-commits",
"raw",
"commit",
"commits",
"git",
"log",
"git-log"
],
"dependencies": {
"dargs": "^7.0.0",
"lodash": "^4.17.15",
"meow": "^8.0.0",
"split2": "^3.0.0",
"through2": "^4.0.0"
},
"scripts": {
"test-windows": "mocha --timeout 30000"
},
"bin": {
"git-raw-commits": "cli.js"
}
}