first commit

This commit is contained in:
s.golasch
2023-08-01 13:49:46 +02:00
commit 1fc239fd54
20238 changed files with 3112246 additions and 0 deletions

13
build/node_modules/gulp-sourcemaps/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,13 @@
Copyright (c) 2014, Florian Reiterer
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.

252
build/node_modules/gulp-sourcemaps/README.md generated vendored Normal file
View File

@@ -0,0 +1,252 @@
## gulp-sourcemaps [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url]
### Usage
#### Write inline source maps
Inline source maps are embedded in the source file.
Example:
```javascript
var gulp = require('gulp');
var plugin1 = require('gulp-plugin1');
var plugin2 = require('gulp-plugin2');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('javascript', function() {
gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist'));
});
```
All plugins between `sourcemaps.init()` and `sourcemaps.write()` need to have support for `gulp-sourcemaps`. You can find a list of such plugins in the [wiki](https://github.com/floridoo/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support).
#### Write external source map files
To write external source map files, pass a path relative to the destination to `sourcemaps.write()`.
Example:
```javascript
var gulp = require('gulp');
var plugin1 = require('gulp-plugin1');
var plugin2 = require('gulp-plugin2');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('javascript', function() {
gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write('../maps'))
.pipe(gulp.dest('dist'));
});
```
#### Load existing source maps
To load existing source maps, pass the option `loadMaps: true` to `sourcemaps.init()`.
Example:
```javascript
var gulp = require('gulp');
var plugin1 = require('gulp-plugin1');
var plugin2 = require('gulp-plugin2');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('javascript', function() {
gulp.src('src/**/*.js')
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist'));
});
```
#### Handle source files from different directories
Use the `base` option on `gulp.src` to make sure all files are relative to a common base directory.
Example:
```javascript
var gulp = require('gulp');
var plugin1 = require('gulp-plugin1');
var plugin2 = require('gulp-plugin2');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('javascript', function() {
gulp.src(['src/test.js', 'src/testdir/test2.js'], { base: 'src' })
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write('../maps'))
.pipe(gulp.dest('dist'));
});
```
### Init Options
- `loadMaps`
Set to true to load existing maps for source files. Supports the following:
- inline source maps
- source map files referenced by a `sourceMappingURL=` comment
- source map files with the same name (plus .map) in the same directory
- `debug`
Set this to `true` to output debug messages (e.g. about missing source content).
### Write Options
- `addComment`
By default a comment containing / referencing the source map is added. Set this to `false` to disable the comment (e.g. if you want to load the source maps by header).
Example:
```javascript
gulp.task('javascript', function() {
var stream = gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write('../maps', {addComment: false}))
.pipe(gulp.dest('dist'));
});
```
- `includeContent`
By default the source maps include the source code. Pass `false` to use the original files.
Including the content is the recommended way, because it "just works". When setting this to `false` you have to host the source files and set the correct `sourceRoot`.
- `sourceRoot`
Set the path where the source files are hosted (use this when `includeContent` is set to `false`). This is an URL (or subpath) relative to the source map, not a local file system path. If you have sources in different subpaths, an absolute path (from the domain root) pointing to the source file root is recommended, or define it with a function.
Example:
```javascript
gulp.task('javascript', function() {
var stream = gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write({includeContent: false, sourceRoot: '/src'}))
.pipe(gulp.dest('dist'));
});
```
Example (using a function):
```javascript
gulp.task('javascript', function() {
var stream = gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write({
includeContent: false,
sourceRoot: function(file) {
return '/src';
}
}))
.pipe(gulp.dest('dist'));
});
```
- `sourceMappingURLPrefix`
Specify a prefix to be prepended onto the source map URL when writing external source maps. Relative paths will have their leading dots stripped.
Example:
```javascript
gulp.task('javascript', function() {
var stream = gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write('../maps', {
sourceMappingURLPrefix: 'https://asset-host.example.com/assets'
}))
.pipe(gulp.dest('public/scripts'));
});
```
This will result in a source mapping URL comment like `sourceMappingURL=https://asset-host.example.com/assets/maps/helloworld.js.map`.
- `sourceMappingURL`
If you need full control over the source map URL you can pass a function to this option. The output of the function must be the full URL to the source map (in function of the output file).
Example:
```javascript
gulp.task('javascript', function() {
var stream = gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(plugin1())
.pipe(plugin2())
.pipe(sourcemaps.write('../maps', {
sourceMappingURL: function(file) {
return 'https://asset-host.example.com/' + file.relative + '.map';
}
}))
.pipe(gulp.dest('public/scripts'));
});
```
This will result in a source mapping URL comment like `sourceMappingURL=https://asset-host.example.com/helloworld.js.map`.
- `debug`
Set this to `true` to output debug messages (e.g. about missing source content).
### Plugin developers only: How to add source map support to plugins
- Generate a source map for the transformation the plugin is applying
- **Important**: Make sure the paths in the generated source map (`file` and `sources`) are relative to `file.base` (e.g. use `file.relative`).
- Apply this source map to the vinyl `file`. E.g. by using [vinyl-sourcemaps-apply](https://github.com/floridoo/vinyl-sourcemaps-apply).
This combines the source map of this plugin with the source maps coming from plugins further up the chain.
- Add your plugin to the [wiki page](https://github.com/floridoo/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support)
#### Example:
```javascript
var through = require('through2');
var applySourceMap = require('vinyl-sourcemaps-apply');
var myTransform = require('myTransform');
module.exports = function(options) {
function transform(file, encoding, callback) {
// generate source maps if plugin source-map present
if (file.sourceMap) {
options.makeSourceMaps = true;
}
// do normal plugin logic
var result = myTransform(file.contents, options);
file.contents = new Buffer(result.code);
// apply source map to the chain
if (file.sourceMap) {
applySourceMap(file, result.map);
}
this.push(file);
callback();
}
return through.obj(transform);
};
```
[npm-image]: https://img.shields.io/npm/v/gulp-sourcemaps.svg
[npm-url]: https://www.npmjs.com/package/gulp-sourcemaps
[travis-image]: https://img.shields.io/travis/floridoo/gulp-sourcemaps.svg
[travis-url]: https://travis-ci.org/floridoo/gulp-sourcemaps
[coveralls-image]: https://img.shields.io/coveralls/floridoo/gulp-sourcemaps.svg
[coveralls-url]: https://coveralls.io/r/floridoo/gulp-sourcemaps?branch=master

269
build/node_modules/gulp-sourcemaps/index.js generated vendored Normal file
View File

@@ -0,0 +1,269 @@
'use strict';
var through = require('through2');
var fs = require('graceful-fs');
var path = require('path');
var File = require('vinyl');
var convert = require('convert-source-map');
var stripBom = require('strip-bom');
var PLUGIN_NAME = 'gulp-sourcemap';
var urlRegex = /^(https?|webpack(-[^:]+)?):\/\//;
/**
* Initialize source mapping chain
*/
module.exports.init = function init(options) {
function sourceMapInit(file, encoding, callback) {
/*jshint validthis:true */
// pass through if file is null or already has a source map
if (file.isNull() || file.sourceMap) {
this.push(file);
return callback();
}
if (file.isStream()) {
return callback(new Error(PLUGIN_NAME + '-init: Streaming not supported'));
}
var fileContent = file.contents.toString();
var sourceMap;
if (options && options.loadMaps) {
var sourcePath = ''; //root path for the sources in the map
// Try to read inline source map
sourceMap = convert.fromSource(fileContent);
if (sourceMap) {
sourceMap = sourceMap.toObject();
// sources in map are relative to the source file
sourcePath = path.dirname(file.path);
fileContent = convert.removeComments(fileContent);
} else {
// look for source map comment referencing a source map file
var mapComment = convert.mapFileCommentRegex.exec(fileContent);
var mapFile;
if (mapComment) {
mapFile = path.resolve(path.dirname(file.path), mapComment[1] || mapComment[2]);
fileContent = convert.removeMapFileComments(fileContent);
// if no comment try map file with same name as source file
} else {
mapFile = file.path + '.map';
}
// sources in external map are relative to map file
sourcePath = path.dirname(mapFile);
try {
sourceMap = JSON.parse(stripBom(fs.readFileSync(mapFile, 'utf8')));
} catch(e) {}
}
// fix source paths and sourceContent for imported source map
if (sourceMap) {
sourceMap.sourcesContent = sourceMap.sourcesContent || [];
sourceMap.sources.forEach(function(source, i) {
if (source.match(urlRegex)) {
sourceMap.sourcesContent[i] = sourceMap.sourcesContent[i] || null;
return;
}
var absPath = path.resolve(sourcePath, source);
sourceMap.sources[i] = unixStylePath(path.relative(file.base, absPath));
if (!sourceMap.sourcesContent[i]) {
var sourceContent = null;
if (sourceMap.sourceRoot) {
if (sourceMap.sourceRoot.match(urlRegex)) {
sourceMap.sourcesContent[i] = null;
return;
}
absPath = path.resolve(sourcePath, sourceMap.sourceRoot, source);
}
// if current file: use content
if (absPath === file.path) {
sourceContent = fileContent;
// else load content from file
} else {
try {
if (options.debug)
console.log(PLUGIN_NAME + '-init: No source content for "' + source + '". Loading from file.');
sourceContent = stripBom(fs.readFileSync(absPath, 'utf8'));
} catch (e) {
if (options.debug)
console.warn(PLUGIN_NAME + '-init: source file not found: ' + absPath);
}
}
sourceMap.sourcesContent[i] = sourceContent;
}
});
// remove source map comment from source
file.contents = new Buffer(fileContent, 'utf8');
}
}
if (!sourceMap) {
// Make an empty source map
sourceMap = {
version : 3,
names: [],
mappings: '',
sources: [unixStylePath(file.relative)],
sourcesContent: [fileContent]
};
}
sourceMap.file = unixStylePath(file.relative);
file.sourceMap = sourceMap;
this.push(file);
callback();
}
return through.obj(sourceMapInit);
};
/**
* Write the source map
*
* @param options options to change the way the source map is written
*
*/
module.exports.write = function write(destPath, options) {
if (options === undefined && Object.prototype.toString.call(destPath) === '[object Object]') {
options = destPath;
destPath = undefined;
}
options = options || {};
// set defaults for options if unset
if (options.includeContent === undefined)
options.includeContent = true;
if (options.addComment === undefined)
options.addComment = true;
function sourceMapWrite(file, encoding, callback) {
/*jshint validthis:true */
if (file.isNull() || !file.sourceMap) {
this.push(file);
return callback();
}
if (file.isStream()) {
return callback(new Error(PLUGIN_NAME + '-write: Streaming not supported'));
}
var sourceMap = file.sourceMap;
// fix paths if Windows style paths
sourceMap.file = unixStylePath(file.relative);
sourceMap.sources = sourceMap.sources.map(function(filePath) {
return unixStylePath(filePath);
});
if (typeof options.sourceRoot === 'function') {
sourceMap.sourceRoot = options.sourceRoot(file);
} else {
sourceMap.sourceRoot = options.sourceRoot;
}
if (options.includeContent) {
sourceMap.sourcesContent = sourceMap.sourcesContent || [];
// load missing source content
for (var i = 0; i < file.sourceMap.sources.length; i++) {
if (!sourceMap.sourcesContent[i]) {
var sourcePath = path.resolve(sourceMap.sourceRoot || file.base, sourceMap.sources[i]);
try {
if (options.debug)
console.log(PLUGIN_NAME + '-write: No source content for "' + sourceMap.sources[i] + '". Loading from file.');
sourceMap.sourcesContent[i] = stripBom(fs.readFileSync(sourcePath, 'utf8'));
} catch (e) {
if (options.debug)
console.warn(PLUGIN_NAME + '-write: source file not found: ' + sourcePath);
}
}
}
if (sourceMap.sourceRoot === undefined) {
sourceMap.sourceRoot = '/source/';
} else if (sourceMap.sourceRoot === null) {
sourceMap.sourceRoot = undefined;
}
} else {
delete sourceMap.sourcesContent;
}
var extension = file.relative.split('.').pop();
var commentFormatter;
switch (extension) {
case 'css':
commentFormatter = function(url) { return "\n/*# sourceMappingURL=" + url + " */\n"; };
break;
case 'js':
commentFormatter = function(url) { return "\n//# sourceMappingURL=" + url + "\n"; };
break;
default:
commentFormatter = function(url) { return ""; };
}
var comment, sourceMappingURLPrefix;
if (!destPath) {
// encode source map into comment
var base64Map = new Buffer(JSON.stringify(sourceMap)).toString('base64');
comment = commentFormatter('data:application/json;base64,' + base64Map);
} else {
var sourceMapPath = path.join(file.base, destPath, file.relative) + '.map';
// add new source map file to stream
var sourceMapFile = new File({
cwd: file.cwd,
base: file.base,
path: sourceMapPath,
contents: new Buffer(JSON.stringify(sourceMap)),
stat: {
isFile: function () { return true; },
isDirectory: function () { return false; },
isBlockDevice: function () { return false; },
isCharacterDevice: function () { return false; },
isSymbolicLink: function () { return false; },
isFIFO: function () { return false; },
isSocket: function () { return false; }
}
});
this.push(sourceMapFile);
var sourceMapPathRelative = path.relative(path.dirname(file.path), sourceMapPath);
if (options.sourceMappingURLPrefix) {
var prefix = '';
if (typeof options.sourceMappingURLPrefix === 'function') {
prefix = options.sourceMappingURLPrefix(file);
} else {
prefix = options.sourceMappingURLPrefix;
}
sourceMapPathRelative = prefix+path.join('/', sourceMapPathRelative);
}
comment = commentFormatter(unixStylePath(sourceMapPathRelative));
if (options.sourceMappingURL && typeof options.sourceMappingURL === 'function') {
comment = commentFormatter(options.sourceMappingURL(file));
}
}
// append source map comment
if (options.addComment)
file.contents = Buffer.concat([file.contents, new Buffer(comment)]);
this.push(file);
callback();
}
return through.obj(sourceMapWrite);
};
function unixStylePath(filePath) {
return filePath.split(path.sep).join('/');
}

View File

@@ -0,0 +1,3 @@
test
.jshintrc
.travis.yml

View File

@@ -0,0 +1,336 @@
<!doctype html>
<!-- Created with GFM2HTML: https://github.com/rvagg/gfm2html -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="created-with" content="https://github.com/rvagg/gfm2html">
<style type="text/css">
/* most of normalize.css */
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}[hidden],template{display:none;}html{font-family:sans-serif;/*1*/-ms-text-size-adjust:100%;/*2*/-webkit-text-size-adjust:100%;/*2*/}body{margin:0;}a{background:transparent;}a:focus{outline:thindotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em0;}abbr[title]{border-bottom:1pxdotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C""\201D""\2018""\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}table{border-collapse:collapse;border-spacing:0;}
html {
font: 14px 'Helvetica Neue', Helvetica, arial, freesans, clean, sans-serif;
}
.container {
line-height: 1.6;
color: #333;
background: #eee;
border-radius: 3px;
padding: 3px;
width: 790px;
margin: 10px auto;
}
.body-content {
background-color: #fff;
border: 1px solid #CACACA;
padding: 30px;
}
.body-content > *:first-child {
margin-top: 0 !important;
}
a, a:visited {
color: #4183c4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0;
}
.markdown-body h1
, .markdown-body h2
, .markdown-body h3
, .markdown-body h4
, .markdown-body h5
, .markdown-body h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
}
h1 {
font-size: 2.5em;
color: #000;
border-bottom: 1px solid #ddd;
}
h2 {
font-size: 2em;
border-bottom: 1px solid #eee;
color: #000;
}
img {
max-width: 100%;
}
hr {
background: transparent url("/img/hr.png") repeat-x 0 0;
border: 0 none;
color: #ccc;
height: 4px;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body tr {
border-top: 1px solid #ccc;
background-color: #fff;
}
td, th {
border: 1px solid #ccc;
padding: 6px 13px;
}
th {
font-weight: bold;
}
blockquote {
border-left: 4px solid #ddd;
padding: 0 15px;
color: #777;
}
blockquote > :last-child, blockquote > :first-child {
margin-bottom: 0px;
}
pre, code {
font-size: 13px;
font-family: 'UbuntuMono', monospace;
white-space: nowrap;
margin: 0 2px;
padding: 0px 5px;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px;
}
pre > code {
white-space: pre;
}
pre {
overflow-x: auto;
white-space: pre;
padding: 10px;
line-height: 150%;
background-color: #f8f8f8;
border-color: #ccc;
}
pre code, pre tt {
margin: 0;
padding: 0;
border: 0;
background-color: transparent;
border: none;
}
.highlight .c
, .highlight .cm
, .highlight .cp
, .highlight .c1 {
color:#999988;
font-style:italic;
}
.highlight .err {
color:#a61717;
background-color:#e3d2d2
}
.highlight .o
, .highlight .gs
, .highlight .kc
, .highlight .kd
, .highlight .kn
, .highlight .kp
, .highlight .kr {
font-weight:bold
}
.highlight .cs {
color:#999999;
font-weight:bold;
font-style:italic
}
.highlight .gd {
color:#000000;
background-color:#ffdddd
}
.highlight .gd .x {
color:#000000;
background-color:#ffaaaa
}
.highlight .ge {
font-style:italic
}
.highlight .gr
, .highlight .gt {
color:#aa0000
}
.highlight .gh
, .highlight .bp {
color:#999999
}
.highlight .gi {
color:#000000;
background-color:#ddffdd
}
.highlight .gi .x {
color:#000000;
background-color:#aaffaa
}
.highlight .go {
color:#888888
}
.highlight .gp
, .highlight .nn {
color:#555555
}
.highlight .gu {
color:#800080;
font-weight:bold
}
.highlight .kt {
color:#445588;
font-weight:bold
}
.highlight .m
, .highlight .mf
, .highlight .mh
, .highlight .mi
, .highlight .mo
, .highlight .il {
color:#009999
}
.highlight .s
, .highlight .sb
, .highlight .sc
, .highlight .sd
, .highlight .s2
, .highlight .se
, .highlight .sh
, .highlight .si
, .highlight .sx
, .highlight .s1 {
color:#d14
}
.highlight .n {
color:#333333
}
.highlight .na
, .highlight .no
, .highlight .nv
, .highlight .vc
, .highlight .vg
, .highlight .vi
, .highlight .nb {
color:#0086B3
}
.highlight .nc {
color:#445588;
font-weight:bold
}
.highlight .ni {
color:#800080
}
.highlight .ne
, .highlight .nf {
color:#990000;
font-weight:bold
}
.highlight .nt {
color:#000080
}
.highlight .ow {
font-weight:bold
}
.highlight .w {
color:#bbbbbb
}
.highlight .sr {
color:#009926
}
.highlight .ss {
color:#990073
}
.highlight .gc {
color:#999;
background-color:#EAF2F5
}
@media print {
.container {
background: transparent;
border-radius: 0;
padding: 0;
}
.body-content {
border: none;
}
}
</style>
</head>
<body>
<div class="container">
<div class="body-content"><h1 id="the-mit-license-mit-">The MIT License (MIT)</h1>
<p><strong>Copyright (c) 2016 Rod Vagg (the &quot;Original Author&quot;) and additional contributors</strong></p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), 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:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, 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.</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,9 @@
# The MIT License (MIT)
**Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors**
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

@@ -0,0 +1,136 @@
# through2
[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/)
**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise**
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**.
```js
fs.createReadStream('ex.txt')
.pipe(through2(function (chunk, enc, callback) {
for (var i = 0; i < chunk.length; i++)
if (chunk[i] == 97)
chunk[i] = 122 // swap 'a' for 'z'
this.push(chunk)
callback()
}))
.pipe(fs.createWriteStream('out.txt'))
.on('finish', function () {
doSomethingSpecial()
})
```
Or object streams:
```js
var all = []
fs.createReadStream('data.csv')
.pipe(csv2())
.pipe(through2.obj(function (chunk, enc, callback) {
var data = {
name : chunk[0]
, address : chunk[3]
, phone : chunk[10]
}
this.push(data)
callback()
}))
.on('data', function (data) {
all.push(data)
})
.on('end', function () {
doSomethingSpecial(all)
})
```
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
## API
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
### options
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2({ objectMode: true, allowHalfOpen: false },
function (chunk, enc, cb) {
cb(null, 'wut?') // note we can use the second argument on the callback
// to provide data as an alternative to this.push('wut?')
}
)
.pipe(fs.createWriteStream('/tmp/wut.txt'))
```
### transformFunction
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
To queue a new chunk, call `this.push(chunk)`&mdash;this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
### flushFunction
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2(
function (chunk, enc, cb) { cb(null, chunk) }, // transform is a noop
function (cb) { // flush function
this.push('tacking on an extra buffer to the end');
cb();
}
))
.pipe(fs.createWriteStream('/tmp/wut.txt'));
```
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
```js
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
if (record.temp != null && record.unit == "F") {
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
record.unit = "C"
}
this.push(record)
callback()
})
// Create instances of FToC like so:
var converter = new FToC()
// Or:
var converter = FToC()
// Or specify/override options when you instantiate, if you prefer:
var converter = FToC({objectMode: true})
```
## See Also
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
- the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one
## License
**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

View File

@@ -0,0 +1,68 @@
{
"_args": [
[
"through2@2.0.3",
"/Users/asciidisco/Desktop/asciidisco.com/build"
]
],
"_from": "through2@2.0.3",
"_id": "through2@2.0.3",
"_inBundle": false,
"_integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
"_location": "/gulp-sourcemaps/through2",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "through2@2.0.3",
"name": "through2",
"escapedName": "through2",
"rawSpec": "2.0.3",
"saveSpec": null,
"fetchSpec": "2.0.3"
},
"_requiredBy": [
"/gulp-sourcemaps"
],
"_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
"_spec": "2.0.3",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
"author": {
"name": "Rod Vagg",
"email": "r@va.gg",
"url": "https://github.com/rvagg"
},
"bugs": {
"url": "https://github.com/rvagg/through2/issues"
},
"dependencies": {
"readable-stream": "^2.1.5",
"xtend": "~4.0.1"
},
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
"devDependencies": {
"bl": "~1.1.2",
"faucet": "0.0.1",
"stream-spigot": "~3.0.5",
"tape": "~4.6.2"
},
"homepage": "https://github.com/rvagg/through2#readme",
"keywords": [
"stream",
"streams2",
"through",
"transform"
],
"license": "MIT",
"main": "through2.js",
"name": "through2",
"repository": {
"type": "git",
"url": "git+https://github.com/rvagg/through2.git"
},
"scripts": {
"test": "node test/test.js | faucet",
"test-local": "brtapsauce-local test/basic-test.js"
},
"version": "2.0.3"
}

View File

@@ -0,0 +1,96 @@
var Transform = require('readable-stream/transform')
, inherits = require('util').inherits
, xtend = require('xtend')
function DestroyableTransform(opts) {
Transform.call(this, opts)
this._destroyed = false
}
inherits(DestroyableTransform, Transform)
DestroyableTransform.prototype.destroy = function(err) {
if (this._destroyed) return
this._destroyed = true
var self = this
process.nextTick(function() {
if (err)
self.emit('error', err)
self.emit('close')
})
}
// a noop _transform function
function noop (chunk, enc, callback) {
callback(null, chunk)
}
// create a new export function, used by both the main export and
// the .ctor export, contains common logic for dealing with arguments
function through2 (construct) {
return function (options, transform, flush) {
if (typeof options == 'function') {
flush = transform
transform = options
options = {}
}
if (typeof transform != 'function')
transform = noop
if (typeof flush != 'function')
flush = null
return construct(options, transform, flush)
}
}
// main export, just make me a transform stream!
module.exports = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(options)
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})
// make me a reusable prototype that I can `new`, or implicitly `new`
// with a constructor call
module.exports.ctor = through2(function (options, transform, flush) {
function Through2 (override) {
if (!(this instanceof Through2))
return new Through2(override)
this.options = xtend(options, override)
DestroyableTransform.call(this, this.options)
}
inherits(Through2, DestroyableTransform)
Through2.prototype._transform = transform
if (flush)
Through2.prototype._flush = flush
return Through2
})
module.exports.obj = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})

82
build/node_modules/gulp-sourcemaps/package.json generated vendored Normal file
View File

@@ -0,0 +1,82 @@
{
"_args": [
[
"gulp-sourcemaps@1.6.0",
"/Users/asciidisco/Desktop/asciidisco.com/build"
]
],
"_from": "gulp-sourcemaps@1.6.0",
"_id": "gulp-sourcemaps@1.6.0",
"_inBundle": false,
"_integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=",
"_location": "/gulp-sourcemaps",
"_phantomChildren": {
"readable-stream": "2.3.3",
"xtend": "4.0.1"
},
"_requested": {
"type": "version",
"registry": true,
"raw": "gulp-sourcemaps@1.6.0",
"name": "gulp-sourcemaps",
"escapedName": "gulp-sourcemaps",
"rawSpec": "1.6.0",
"saveSpec": null,
"fetchSpec": "1.6.0"
},
"_requiredBy": [
"/vinyl-fs"
],
"_resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz",
"_spec": "1.6.0",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
"author": {
"name": "Florian Reiterer",
"email": "me@florianreiterer.com"
},
"bugs": {
"url": "https://github.com/floridoo/gulp-sourcemaps/issues"
},
"dependencies": {
"convert-source-map": "^1.1.1",
"graceful-fs": "^4.1.2",
"strip-bom": "^2.0.0",
"through2": "^2.0.0",
"vinyl": "^1.0.0"
},
"description": "Source map support for Gulp.js",
"devDependencies": {
"coveralls": "^2.11.4",
"faucet": "0.0.1",
"istanbul": "^0.3.21",
"jshint": "^2.8.0",
"tape": "^4.2.0"
},
"files": [
"index.js",
"package.json",
"README.md",
"LICENSE.md"
],
"homepage": "http://github.com/floridoo/gulp-sourcemaps",
"keywords": [
"gulpplugin",
"gulp",
"source maps",
"sourcemaps"
],
"license": "ISC",
"main": "index.js",
"name": "gulp-sourcemaps",
"repository": {
"type": "git",
"url": "git://github.com/floridoo/gulp-sourcemaps.git"
},
"scripts": {
"cover": "istanbul cover --dir reports/coverage tape \"test/*.js\"",
"coveralls": "istanbul cover tape \"test/*.js\" --report lcovonly && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"tap": "tape test/*.js",
"test": "jshint *.js test/*.js && faucet test/*.js"
},
"version": "1.6.0"
}