This commit is contained in:
hatuhn
2019-09-13 09:45:04 +07:00
parent f14a34ba19
commit 558fb07261
16790 changed files with 0 additions and 1642370 deletions

3
node_modules/split/.npmignore generated vendored
View File

@@ -1,3 +0,0 @@
node_modules
node_modules/*
npm_debug.log

4
node_modules/split/.travis.yml generated vendored
View File

@@ -1,4 +0,0 @@
language: node_js
node_js:
- 0.8
- "0.10"

22
node_modules/split/LICENCE generated vendored
View File

@@ -1,22 +0,0 @@
Copyright (c) 2011 Dominic Tarr
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.

View File

@@ -1,26 +0,0 @@
var inspect = require('util').inspect
var es = require('event-stream') //load event-stream
var split = require('../')
if(!module.parent) {
es.pipe( //pipe joins streams together
process.openStdin(), //open stdin
split(), //split stream to break on newlines
es.map(function (data, callback) {//turn this async function into a stream
var j
try {
j = JSON.parse(data) //try to parse input into json
} catch (err) {
return callback(null, data) //if it fails just pass it anyway
}
callback(null, inspect(j)) //render it nicely
}),
process.stdout // pipe it to stdout !
)
}
// run this
//
// curl -sS registry.npmjs.org/event-stream | node pretty.js
//

59
node_modules/split/index.js generated vendored
View File

@@ -1,59 +0,0 @@
//filter will reemit the data if cb(err,pass) pass is truthy
// reduce is more tricky
// maybe we want to group the reductions or emit progress updates occasionally
// the most basic reduce just emits one 'data' event after it has recieved 'end'
var through = require('through')
var Decoder = require('string_decoder').StringDecoder
module.exports = split
//TODO pass in a function to map across the lines.
function split (matcher, mapper) {
var decoder = new Decoder()
var soFar = ''
if('function' === typeof matcher)
mapper = matcher, matcher = null
if (!matcher)
matcher = /\r?\n/
function emit(stream, piece) {
if(mapper) {
try {
piece = mapper(piece)
}
catch (err) {
return stream.emit('error', err)
}
if('undefined' !== typeof piece)
stream.queue(piece)
}
else
stream.queue(piece)
}
function next (stream, buffer) {
var pieces = (soFar + buffer).split(matcher)
soFar = pieces.pop()
for (var i = 0; i < pieces.length; i++) {
var piece = pieces[i]
emit(stream, piece)
}
}
return through(function (b) {
next(this, decoder.write(b))
},
function () {
if(decoder.end)
next(this, decoder.end())
if(soFar != null)
emit(this, soFar)
this.queue(null)
})
}

60
node_modules/split/package.json generated vendored
View File

@@ -1,60 +0,0 @@
{
"_from": "split@0.2",
"_id": "split@0.2.10",
"_inBundle": false,
"_integrity": "sha1-Zwl8YB1pfOE2j0GPBs0gHPBSGlc=",
"_location": "/split",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "split@0.2",
"name": "split",
"escapedName": "split",
"rawSpec": "0.2",
"saveSpec": null,
"fetchSpec": "0.2"
},
"_requiredBy": [
"/event-stream"
],
"_resolved": "https://registry.npmjs.org/split/-/split-0.2.10.tgz",
"_shasum": "67097c601d697ce1368f418f06cd201cf0521a57",
"_spec": "split@0.2",
"_where": "/Applications/XAMPP/xamppfiles/htdocs/wordpress/t-latehome/wp-content/plugins/opal-estate-pro/node_modules/event-stream",
"author": {
"name": "Dominic Tarr",
"email": "dominic.tarr@gmail.com",
"url": "http://bit.ly/dominictarr"
},
"bugs": {
"url": "https://github.com/dominictarr/split/issues"
},
"bundleDependencies": false,
"dependencies": {
"through": "2"
},
"deprecated": false,
"description": "split a Text Stream into a Line Stream",
"devDependencies": {
"asynct": "*",
"event-stream": "~3.0.2",
"it-is": "1",
"stream-spec": "~0.2",
"ubelt": "~2.9"
},
"engines": {
"node": "*"
},
"homepage": "http://github.com/dominictarr/split",
"name": "split",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git://github.com/dominictarr/split.git"
},
"scripts": {
"test": "asynct test/"
},
"version": "0.2.10"
}

39
node_modules/split/readme.markdown generated vendored
View File

@@ -1,39 +0,0 @@
# Split (matcher)
[![build status](https://secure.travis-ci.org/dominictarr/split.png)](http://travis-ci.org/dominictarr/split)
Break up a stream and reassemble it so that each line is a chunk. matcher may be a `String`, or a `RegExp`
Example, read every line in a file ...
``` js
fs.createReadStream(file)
.pipe(split())
.on('data', function (line) {
//each chunk now is a seperate line!
})
```
`split` takes the same arguments as `string.split` except it defaults to '/\r?\n/' instead of ',', and the optional `limit` paremeter is ignored.
[String#split](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/split)
# NDJ - Newline Delimited Json
`split` accepts a function which transforms each line.
``` js
fs.createReadStream(file)
.pipe(split(JSON.parse))
.on('data', function (obj) {
//each chunk now is a a js object
})
.on('error', function (err) {
//syntax errors will land here
//note, this ends the stream.
})
```
# License
MIT

View File

@@ -1,34 +0,0 @@
var it = require('it-is').style('colour')
, split = require('..')
exports ['split data with partitioned unicode character'] = function (test) {
var s = split(/,/g)
, caughtError = false
, rows = []
s.on('error', function (err) {
caughtError = true
})
s.on('data', function (row) { rows.push(row) })
var x = 'テスト試験今日とても,よい天気で'
unicodeData = new Buffer(x);
// partition of 日
piece1 = unicodeData.slice(0, 20);
piece2 = unicodeData.slice(20, unicodeData.length);
s.write(piece1);
s.write(piece2);
s.end()
it(caughtError).equal(false)
it(rows).deepEqual(['テスト試験今日とても', 'よい天気で']);
it(rows).deepEqual(x.split(','))
test.done()
}

View File

@@ -1,85 +0,0 @@
var es = require('event-stream')
, it = require('it-is').style('colour')
, d = require('ubelt')
, split = require('..')
, join = require('path').join
, fs = require('fs')
, Stream = require('stream').Stream
, spec = require('stream-spec')
exports ['split() works like String#split'] = function (test) {
var readme = join(__filename)
, expected = fs.readFileSync(readme, 'utf-8').split('\n')
, cs = split()
, actual = []
, ended = false
, x = spec(cs).through()
var a = new Stream ()
a.write = function (l) {
actual.push(l.trim())
}
a.end = function () {
ended = true
expected.forEach(function (v,k) {
//String.split will append an empty string ''
//if the string ends in a split pattern.
//es.split doesn't which was breaking this test.
//clearly, appending the empty string is correct.
//tests are passing though. which is the current job.
if(v)
it(actual[k]).like(v)
})
//give the stream time to close
process.nextTick(function () {
test.done()
x.validate()
})
}
a.writable = true
fs.createReadStream(readme, {flags: 'r'}).pipe(cs)
cs.pipe(a)
}
exports ['split() takes mapper function'] = function (test) {
var readme = join(__filename)
, expected = fs.readFileSync(readme, 'utf-8').split('\n')
, cs = split(function (line) { return line.toUpperCase() })
, actual = []
, ended = false
, x = spec(cs).through()
var a = new Stream ()
a.write = function (l) {
actual.push(l.trim())
}
a.end = function () {
ended = true
expected.forEach(function (v,k) {
//String.split will append an empty string ''
//if the string ends in a split pattern.
//es.split doesn't which was breaking this test.
//clearly, appending the empty string is correct.
//tests are passing though. which is the current job.
if(v)
it(actual[k]).equal(v.trim().toUpperCase())
})
//give the stream time to close
process.nextTick(function () {
test.done()
x.validate()
})
}
a.writable = true
fs.createReadStream(readme, {flags: 'r'}).pipe(cs)
cs.pipe(a)
}

View File

@@ -1,51 +0,0 @@
var it = require('it-is').style('colour')
, split = require('..')
exports ['emit mapper exceptions as error events'] = function (test) {
var s = split(JSON.parse)
, caughtError = false
, rows = []
s.on('error', function (err) {
caughtError = true
})
s.on('data', function (row) { rows.push(row) })
s.write('{"a":1}\n{"')
it(caughtError).equal(false)
it(rows).deepEqual([ { a: 1 } ])
s.write('b":2}\n{"c":}\n')
it(caughtError).equal(true)
it(rows).deepEqual([ { a: 1 }, { b: 2 } ])
s.end()
test.done()
}
exports ['mapper error events on trailing chunks'] = function (test) {
var s = split(JSON.parse)
, caughtError = false
, rows = []
s.on('error', function (err) {
caughtError = true
})
s.on('data', function (row) { rows.push(row) })
s.write('{"a":1}\n{"')
it(caughtError).equal(false)
it(rows).deepEqual([ { a: 1 } ])
s.write('b":2}\n{"c":}')
it(caughtError).equal(false)
it(rows).deepEqual([ { a: 1 }, { b: 2 } ])
s.end()
it(caughtError).equal(true)
it(rows).deepEqual([ { a: 1 }, { b: 2 } ])
test.done()
}