forked from enviPath/enviPy
Current Dev State
This commit is contained in:
21
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/LICENSE
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>
|
||||
|
||||
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.
|
||||
40
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/README.md
generated
vendored
Normal file
40
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/README.md
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
# @gulp-sourcemaps/identity-map
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Gulp plugin for generating an identity sourcemap for a file.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var identityMap = require('@gulp-sourcemaps/identity-map');
|
||||
|
||||
gulp.src(...)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(identityMap()) // .js and .css files will get a generated sourcemap
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(...))
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `identityMap()`
|
||||
|
||||
Returns an `objectMode` Transform stream that processes each file with a `.sourceMap` property and buffered contents. A sourcemap is generated and attached for each `.js` and `.css` file.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/@gulp-sourcemaps/identity-map.svg
|
||||
[npm-url]: https://npmjs.org/package/@gulp-sourcemaps/identity-map
|
||||
[npm-image]: http://img.shields.io/npm/v/@gulp-sourcemaps/identity-map.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulp-sourcemaps/identity-map
|
||||
[travis-image]: http://img.shields.io/travis/gulp-sourcemaps/identity-map.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/phated/identity-map
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/phated/identity-map.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulp-sourcemaps/identity-map
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulp-sourcemaps/identity-map.svg
|
||||
35
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/index.js
generated
vendored
Normal file
35
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/index.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
var through = require('through2');
|
||||
var normalizePath = require('normalize-path');
|
||||
|
||||
var generate = require('./lib/generate');
|
||||
|
||||
function identityMap() {
|
||||
|
||||
function transform(file, _, cb) {
|
||||
if (!file.sourceMap || !file.isBuffer()) {
|
||||
return cb(null, file);
|
||||
}
|
||||
|
||||
var sourcePath = normalizePath(file.relative);
|
||||
var contents = file.contents.toString();
|
||||
|
||||
switch (file.extname) {
|
||||
case '.js': {
|
||||
file.sourceMap = generate.js(sourcePath, contents);
|
||||
break;
|
||||
}
|
||||
case '.css': {
|
||||
file.sourceMap = generate.css(sourcePath, contents);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cb(null, file);
|
||||
}
|
||||
|
||||
return through.obj(transform);
|
||||
}
|
||||
|
||||
module.exports = identityMap;
|
||||
65
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/lib/generate.js
generated
vendored
Normal file
65
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/lib/generate.js
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
'use strict';
|
||||
|
||||
var css = require('css');
|
||||
var acorn = require('acorn');
|
||||
var SourceMapGenerator = require('source-map').SourceMapGenerator;
|
||||
|
||||
function generateJs(sourcePath, fileContent) {
|
||||
var generator = new SourceMapGenerator({ file: sourcePath });
|
||||
var tokenizer = acorn.tokenizer(fileContent, { allowHashBang: true, locations: true });
|
||||
|
||||
while (true) {
|
||||
var token = tokenizer.getToken();
|
||||
|
||||
if (token.type.label === 'eof') {
|
||||
break;
|
||||
}
|
||||
var mapping = {
|
||||
original: token.loc.start,
|
||||
generated: token.loc.start,
|
||||
source: sourcePath,
|
||||
};
|
||||
if (token.type.label === 'name') {
|
||||
mapping.name = token.value;
|
||||
}
|
||||
generator.addMapping(mapping);
|
||||
}
|
||||
generator.setSourceContent(sourcePath, fileContent);
|
||||
|
||||
return generator.toJSON();
|
||||
}
|
||||
|
||||
function generateCss(sourcePath, fileContent) {
|
||||
var generator = new SourceMapGenerator({ file: sourcePath });
|
||||
var ast = css.parse(fileContent, { silent: true });
|
||||
|
||||
function registerTokens(ast) {
|
||||
if (ast.position) {
|
||||
generator.addMapping({
|
||||
original: ast.position.start,
|
||||
generated: ast.position.start,
|
||||
source: sourcePath,
|
||||
});
|
||||
}
|
||||
|
||||
for (var key in ast) {
|
||||
if (key === 'position' || !ast[key]) {
|
||||
break;
|
||||
}
|
||||
if (Object.prototype.toString.call(ast[key]) === '[object Object]') {
|
||||
registerTokens(ast[key]);
|
||||
} else if (Array.isArray(ast[key])) {
|
||||
ast[key].forEach(registerTokens);
|
||||
}
|
||||
}
|
||||
}
|
||||
registerTokens(ast);
|
||||
generator.setSourceContent(sourcePath, fileContent);
|
||||
|
||||
return generator.toJSON();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
js: generateJs,
|
||||
css: generateCss,
|
||||
};
|
||||
69
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/AUTHORS
generated
vendored
Normal file
69
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
List of Acorn contributors. Updated before every release.
|
||||
|
||||
Adrian Rakovsky
|
||||
Alistair Braidwood
|
||||
Amila Welihinda
|
||||
Andres Suarez
|
||||
Angelo
|
||||
Aparajita Fishman
|
||||
Arian Stolwijk
|
||||
Artem Govorov
|
||||
Bradley Heinz
|
||||
Brandon Mills
|
||||
Charles Hughes
|
||||
Conrad Irwin
|
||||
Daniel Tschinder
|
||||
David Bonnet
|
||||
Domenico Matteo
|
||||
ehmicky
|
||||
Forbes Lindesay
|
||||
Gilad Peleg
|
||||
impinball
|
||||
Ingvar Stepanyan
|
||||
Jackson Ray Hamilton
|
||||
Jesse McCarthy
|
||||
Jiaxing Wang
|
||||
Joel Kemp
|
||||
Johannes Herr
|
||||
John-David Dalton
|
||||
Jordan Klassen
|
||||
Jürg Lehni
|
||||
Kai Cataldo
|
||||
keeyipchan
|
||||
Keheliya Gallaba
|
||||
Kevin Irish
|
||||
Kevin Kwok
|
||||
krator
|
||||
Marek
|
||||
Marijn Haverbeke
|
||||
Martin Carlberg
|
||||
Mat Garcia
|
||||
Mathias Bynens
|
||||
Mathieu 'p01' Henri
|
||||
Matthew Bastien
|
||||
Max Schaefer
|
||||
Max Zerzouri
|
||||
Mihai Bazon
|
||||
Mike Rennie
|
||||
naoh
|
||||
Nicholas C. Zakas
|
||||
Nick Fitzgerald
|
||||
Olivier Thomann
|
||||
Oskar Schöldström
|
||||
Paul Harper
|
||||
Peter Rust
|
||||
PlNG
|
||||
Prayag Verma
|
||||
ReadmeCritic
|
||||
r-e-d
|
||||
Richard Gibson
|
||||
Rich Harris
|
||||
Sebastian McKenzie
|
||||
Shahar Soel
|
||||
Simen Bekkhus
|
||||
Teddy Katz
|
||||
Timothy Gu
|
||||
Toru Nagashima
|
||||
Victor Homyakov
|
||||
Wexpo Lyu
|
||||
zsjforcn
|
||||
374
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/CHANGELOG.md
generated
vendored
Normal file
374
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,374 @@
|
||||
## 5.2.1 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a token context corruption bug.
|
||||
|
||||
## 5.2.0 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix token context tracking for `class` and `function` in property-name position.
|
||||
|
||||
Make sure `%*` isn't parsed as a valid operator.
|
||||
|
||||
The `full` and `fullAncestor` walkers no longer visit nodes multiple times.
|
||||
|
||||
Allow shorthand properties `get` and `set` to be followed by default values.
|
||||
|
||||
Disallow `super` when not in callee or object position.
|
||||
|
||||
### New features
|
||||
|
||||
Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
|
||||
|
||||
## 5.1.2 (2017-09-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disable parsing of legacy HTML-style comments in modules.
|
||||
|
||||
Fix parsing of async methods whose names are keywords.
|
||||
|
||||
## 5.1.1 (2017-07-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix problem with disambiguating regexp and division after a class.
|
||||
|
||||
## 5.1.0 (2017-07-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
|
||||
|
||||
Parse zero-prefixed numbers with non-octal digits as decimal.
|
||||
|
||||
Allow object/array patterns in rest parameters.
|
||||
|
||||
Don't error when `yield` is used as a property name.
|
||||
|
||||
Allow `async` as a shorthand object property.
|
||||
|
||||
Make the ES module version of the loose parser actually work.
|
||||
|
||||
### New features
|
||||
|
||||
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
|
||||
|
||||
New walker functions `full` and `fullAncestor`.
|
||||
|
||||
## 5.0.3 (2017-04-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix spurious duplicate variable definition errors for named functions.
|
||||
|
||||
## 5.0.2 (2017-03-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
|
||||
|
||||
## 5.0.0 (2017-03-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Raise an error for duplicated lexical bindings.
|
||||
|
||||
Fix spurious error when an assignement expression occurred after a spread expression.
|
||||
|
||||
Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
|
||||
|
||||
Allow labels in front or `var` declarations, even in strict mode.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
|
||||
|
||||
## 4.0.11 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow all forms of member expressions to be parenthesized as lvalue.
|
||||
|
||||
## 4.0.10 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't expect semicolons after default-exported functions or classes,
|
||||
even when they are expressions.
|
||||
|
||||
Check for use of `'use strict'` directives in non-simple parameter
|
||||
functions, even when already in strict mode.
|
||||
|
||||
## 4.0.9 (2017-02-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix incorrect error raised for parenthesized simple assignment
|
||||
targets, so that `(x) = 1` parses again.
|
||||
|
||||
## 4.0.8 (2017-02-03)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Solve spurious parenthesized pattern errors by temporarily erring on
|
||||
the side of accepting programs that our delayed errors don't handle
|
||||
correctly yet.
|
||||
|
||||
## 4.0.7 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Accept invalidly rejected code like `(x).y = 2` again.
|
||||
|
||||
Don't raise an error when a function _inside_ strict code has a
|
||||
non-simple parameter list.
|
||||
|
||||
## 4.0.6 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix exponential behavior (manifesting itself as a complete hang for
|
||||
even relatively small source files) introduced by the new 'use strict'
|
||||
check.
|
||||
|
||||
## 4.0.5 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow parenthesized pattern expressions.
|
||||
|
||||
Allow keywords as export names.
|
||||
|
||||
Don't allow the `async` keyword to be parenthesized.
|
||||
|
||||
Properly raise an error when a keyword contains a character escape.
|
||||
|
||||
Allow `"use strict"` to appear after other string literal expressions.
|
||||
|
||||
Disallow labeled declarations.
|
||||
|
||||
## 4.0.4 (2016-12-19)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix issue with loading acorn_loose.js with an AMD loader.
|
||||
|
||||
Fix crash when `export` was followed by a keyword that can't be
|
||||
exported.
|
||||
|
||||
## 4.0.3 (2016-08-16)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow regular function declarations inside single-statement `if`
|
||||
branches in loose mode. Forbid them entirely in strict mode.
|
||||
|
||||
Properly parse properties named `async` in ES2017 mode.
|
||||
|
||||
Fix bug where reserved words were broken in ES2017 mode.
|
||||
|
||||
## 4.0.2 (2016-08-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't ignore period or 'e' characters after octal numbers.
|
||||
|
||||
Fix broken parsing for call expressions in default parameter values
|
||||
of arrow functions.
|
||||
|
||||
## 4.0.1 (2016-08-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix false positives in duplicated export name errors.
|
||||
|
||||
## 4.0.0 (2016-08-07)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default `ecmaVersion` option value is now 7.
|
||||
|
||||
A number of internal method signatures changed, so plugins might need
|
||||
to be updated.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The parser now raises errors on duplicated export names.
|
||||
|
||||
`arguments` and `eval` can now be used in shorthand properties.
|
||||
|
||||
Duplicate parameter names in non-simple argument lists now always
|
||||
produce an error.
|
||||
|
||||
### New features
|
||||
|
||||
The `ecmaVersion` option now also accepts year-style version numbers
|
||||
(2015, etc).
|
||||
|
||||
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
|
||||
|
||||
Support for trailing commas in call expressions when `ecmaVersion`
|
||||
is >= 8.
|
||||
|
||||
## 3.3.0 (2016-07-25)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug in tokenizing of regexp operator after a function declaration.
|
||||
|
||||
Fix parser crash when parsing an array pattern with a hole.
|
||||
|
||||
### New features
|
||||
|
||||
Implement check against complex argument lists in functions that
|
||||
enable strict mode in ES7.
|
||||
|
||||
## 3.2.0 (2016-06-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve handling of lack of unicode regexp support in host
|
||||
environment.
|
||||
|
||||
Properly reject shorthand properties whose name is a keyword.
|
||||
|
||||
Don't crash when the loose parser is called without options object.
|
||||
|
||||
### New features
|
||||
|
||||
Visitors created with `visit.make` now have their base as _prototype_,
|
||||
rather than copying properties into a fresh object.
|
||||
|
||||
Make it possible to use `visit.ancestor` with a walk state.
|
||||
|
||||
## 3.1.0 (2016-04-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix issue where the loose parser created invalid TemplateElement nodes
|
||||
for unclosed template literals.
|
||||
|
||||
Properly tokenize the division operator directly after a function
|
||||
expression.
|
||||
|
||||
Allow trailing comma in destructuring arrays.
|
||||
|
||||
### New features
|
||||
|
||||
The walker now allows defining handlers for `CatchClause` nodes.
|
||||
|
||||
## 3.0.4 (2016-02-25)
|
||||
|
||||
### Fixes
|
||||
|
||||
Allow update expressions as left-hand-side of the ES7 exponential
|
||||
operator.
|
||||
|
||||
## 3.0.2 (2016-02-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix bug that accidentally made `undefined` a reserved word when
|
||||
parsing ES7.
|
||||
|
||||
## 3.0.0 (2016-02-10)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default value of the `ecmaVersion` option is now 6 (used to be 5).
|
||||
|
||||
Support for comprehension syntax (which was dropped from the draft
|
||||
spec) has been removed.
|
||||
|
||||
### Fixes
|
||||
|
||||
`let` and `yield` are now “contextual keywords”, meaning you can
|
||||
mostly use them as identifiers in ES5 non-strict code.
|
||||
|
||||
A parenthesized class or function expression after `export default` is
|
||||
now parsed correctly.
|
||||
|
||||
### New features
|
||||
|
||||
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation
|
||||
operator (`**`).
|
||||
|
||||
The identifier character ranges are now based on Unicode 8.0.0.
|
||||
|
||||
Plugins can now override the `raiseRecoverable` method to override the
|
||||
way non-critical errors are handled.
|
||||
|
||||
## 2.7.0 (2016-01-04)
|
||||
|
||||
### Fixes
|
||||
|
||||
Stop allowing rest parameters in setters.
|
||||
|
||||
Make sure the loose parser always attaches a `local` property to
|
||||
`ImportNamespaceSpecifier` nodes.
|
||||
|
||||
Disallow `y` rexexp flag in ES5.
|
||||
|
||||
Disallow `\00` and `\000` escapes in strict mode.
|
||||
|
||||
Raise an error when an import name is a reserved word.
|
||||
|
||||
## 2.6.4 (2015-11-12)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix crash in loose parser when parsing invalid object pattern.
|
||||
|
||||
### New features
|
||||
|
||||
Support plugins in the loose parser.
|
||||
|
||||
## 2.6.2 (2015-11-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Don't crash when no options object is passed.
|
||||
|
||||
## 2.6.0 (2015-11-09)
|
||||
|
||||
### Fixes
|
||||
|
||||
Add `await` as a reserved word in module sources.
|
||||
|
||||
Disallow `yield` in a parameter default value for a generator.
|
||||
|
||||
Forbid using a comma after a rest pattern in an array destructuring.
|
||||
|
||||
### New features
|
||||
|
||||
Support parsing stdin in command-line tool.
|
||||
|
||||
## 2.5.2 (2015-10-27)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix bug where the walker walked an exported `let` statement as an
|
||||
expression.
|
||||
|
||||
## 2.5.0 (2015-10-27)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix tokenizer support in the command-line tool.
|
||||
|
||||
In the loose parser, don't allow non-string-literals as import
|
||||
sources.
|
||||
|
||||
Stop allowing `new.target` outside of functions.
|
||||
|
||||
Remove legacy `guard` and `guardedHandler` properties from try nodes.
|
||||
|
||||
Stop allowing multiple `__proto__` properties on an object literal in
|
||||
strict mode.
|
||||
|
||||
Don't allow rest parameters to be non-identifier patterns.
|
||||
|
||||
Check for duplicate paramter names in arrow functions.
|
||||
19
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/LICENSE
generated
vendored
Normal file
19
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (C) 2012-2017 by various contributors (see AUTHORS)
|
||||
|
||||
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.
|
||||
452
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/README.md
generated
vendored
Normal file
452
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/README.md
generated
vendored
Normal file
@ -0,0 +1,452 @@
|
||||
# Acorn
|
||||
|
||||
[](https://travis-ci.org/ternjs/acorn)
|
||||
[](https://www.npmjs.com/package/acorn)
|
||||
[](https://cdnjs.com/libraries/acorn)
|
||||
[Author funding status: ](https://marijnhaverbeke.nl/fund/)
|
||||
|
||||
A tiny, fast JavaScript parser, written completely in JavaScript.
|
||||
|
||||
## Community
|
||||
|
||||
Acorn is open source software released under an
|
||||
[MIT license](https://github.com/ternjs/acorn/blob/master/LICENSE).
|
||||
|
||||
You are welcome to
|
||||
[report bugs](https://github.com/ternjs/acorn/issues) or create pull
|
||||
requests on [github](https://github.com/ternjs/acorn). For questions
|
||||
and discussion, please use the
|
||||
[Tern discussion forum](https://discuss.ternjs.net).
|
||||
|
||||
## Installation
|
||||
|
||||
The easiest way to install acorn is with [`npm`][npm].
|
||||
|
||||
[npm]: https://www.npmjs.com/
|
||||
|
||||
```sh
|
||||
npm install acorn
|
||||
```
|
||||
|
||||
Alternately, download the source.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/ternjs/acorn.git
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
When run in a CommonJS (node.js) or AMD environment, exported values
|
||||
appear in the interfaces exposed by the individual files, as usual.
|
||||
When loaded in the browser (Acorn works in any JS-enabled browser more
|
||||
recent than IE5) without any kind of module management, a single
|
||||
global object `acorn` will be defined, and all the exported properties
|
||||
will be added to that.
|
||||
|
||||
### Main parser
|
||||
|
||||
This is implemented in `dist/acorn.js`, and is what you get when you
|
||||
`require("acorn")` in node.js.
|
||||
|
||||
**parse**`(input, options)` is used to parse a JavaScript program.
|
||||
The `input` parameter is a string, `options` can be undefined or an
|
||||
object setting some of the options listed below. The return value will
|
||||
be an abstract syntax tree object as specified by the
|
||||
[ESTree spec][estree].
|
||||
|
||||
When encountering a syntax error, the parser will raise a
|
||||
`SyntaxError` object with a meaningful message. The error object will
|
||||
have a `pos` property that indicates the character offset at which the
|
||||
error occurred, and a `loc` object that contains a `{line, column}`
|
||||
object referring to that same position.
|
||||
|
||||
[estree]: https://github.com/estree/estree
|
||||
|
||||
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
|
||||
either 3, 5, 6 (2015), 7 (2016), 8 (2017), or 9 (2018, partial
|
||||
support). This influences support for strict mode, the set of
|
||||
reserved words, and support for new syntax features. Default is 7.
|
||||
|
||||
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
|
||||
implemented by Acorn.
|
||||
|
||||
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
||||
either `"script"` or `"module"`. This influences global strict mode
|
||||
and parsing of `import` and `export` declarations.
|
||||
|
||||
- **onInsertedSemicolon**: If given a callback, that callback will be
|
||||
called whenever a missing semicolon is inserted by the parser. The
|
||||
callback will be given the character offset of the point where the
|
||||
semicolon is inserted as argument, and if `locations` is on, also a
|
||||
`{line, column}` object representing this position.
|
||||
|
||||
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
|
||||
commas.
|
||||
|
||||
- **allowReserved**: If `false`, using a reserved word will generate
|
||||
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
|
||||
versions. When given the value `"never"`, reserved words and
|
||||
keywords can also not be used as property names (as in Internet
|
||||
Explorer's old parser).
|
||||
|
||||
- **allowReturnOutsideFunction**: By default, a return statement at
|
||||
the top level raises an error. Set this to `true` to accept such
|
||||
code.
|
||||
|
||||
- **allowImportExportEverywhere**: By default, `import` and `export`
|
||||
declarations can only appear at a program's top level. Setting this
|
||||
option to `true` allows them anywhere where a statement is allowed.
|
||||
|
||||
- **allowHashBang**: When this is enabled (off by default), if the
|
||||
code starts with the characters `#!` (as in a shellscript), the
|
||||
first line will be treated as a comment.
|
||||
|
||||
- **locations**: When `true`, each node has a `loc` object attached
|
||||
with `start` and `end` subobjects, each of which contains the
|
||||
one-based line and zero-based column numbers in `{line, column}`
|
||||
form. Default is `false`.
|
||||
|
||||
- **onToken**: If a function is passed for this option, each found
|
||||
token will be passed in same format as tokens returned from
|
||||
`tokenizer().getToken()`.
|
||||
|
||||
If array is passed, each found token is pushed to it.
|
||||
|
||||
Note that you are not allowed to call the parser from the
|
||||
callback—that will corrupt its internal state.
|
||||
|
||||
- **onComment**: If a function is passed for this option, whenever a
|
||||
comment is encountered the function will be called with the
|
||||
following parameters:
|
||||
|
||||
- `block`: `true` if the comment is a block comment, false if it
|
||||
is a line comment.
|
||||
- `text`: The content of the comment.
|
||||
- `start`: Character offset of the start of the comment.
|
||||
- `end`: Character offset of the end of the comment.
|
||||
|
||||
When the `locations` options is on, the `{line, column}` locations
|
||||
of the comment’s start and end are passed as two additional
|
||||
parameters.
|
||||
|
||||
If array is passed for this option, each found comment is pushed
|
||||
to it as object in Esprima format:
|
||||
|
||||
```javascript
|
||||
{
|
||||
"type": "Line" | "Block",
|
||||
"value": "comment text",
|
||||
"start": Number,
|
||||
"end": Number,
|
||||
// If `locations` option is on:
|
||||
"loc": {
|
||||
"start": {line: Number, column: Number}
|
||||
"end": {line: Number, column: Number}
|
||||
},
|
||||
// If `ranges` option is on:
|
||||
"range": [Number, Number]
|
||||
}
|
||||
```
|
||||
|
||||
Note that you are not allowed to call the parser from the
|
||||
callback—that will corrupt its internal state.
|
||||
|
||||
- **ranges**: Nodes have their start and end characters offsets
|
||||
recorded in `start` and `end` properties (directly on the node,
|
||||
rather than the `loc` object, which holds line/column data. To also
|
||||
add a [semi-standardized][range] `range` property holding a
|
||||
`[start, end]` array with the same numbers, set the `ranges` option
|
||||
to `true`.
|
||||
|
||||
- **program**: It is possible to parse multiple files into a single
|
||||
AST by passing the tree produced by parsing the first file as the
|
||||
`program` option in subsequent parses. This will add the toplevel
|
||||
forms of the parsed file to the "Program" (top) node of an existing
|
||||
parse tree.
|
||||
|
||||
- **sourceFile**: When the `locations` option is `true`, you can pass
|
||||
this option to add a `source` attribute in every node’s `loc`
|
||||
object. Note that the contents of this option are not examined or
|
||||
processed in any way; you are free to use whatever format you
|
||||
choose.
|
||||
|
||||
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
|
||||
will be added (regardless of the `location` option) directly to the
|
||||
nodes, rather than the `loc` object.
|
||||
|
||||
- **preserveParens**: If this option is `true`, parenthesized expressions
|
||||
are represented by (non-standard) `ParenthesizedExpression` nodes
|
||||
that have a single `expression` property containing the expression
|
||||
inside parentheses.
|
||||
|
||||
[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
|
||||
|
||||
**parseExpressionAt**`(input, offset, options)` will parse a single
|
||||
expression in a string, and return its AST. It will not complain if
|
||||
there is more of the string left after the expression.
|
||||
|
||||
**getLineInfo**`(input, offset)` can be used to get a `{line,
|
||||
column}` object for a given program string and character offset.
|
||||
|
||||
**tokenizer**`(input, options)` returns an object with a `getToken`
|
||||
method that can be called repeatedly to get the next token, a `{start,
|
||||
end, type, value}` object (with added `loc` property when the
|
||||
`locations` option is enabled and `range` property when the `ranges`
|
||||
option is enabled). When the token's type is `tokTypes.eof`, you
|
||||
should stop calling the method, since it will keep returning that same
|
||||
token forever.
|
||||
|
||||
In ES6 environment, returned result can be used as any other
|
||||
protocol-compliant iterable:
|
||||
|
||||
```javascript
|
||||
for (let token of acorn.tokenizer(str)) {
|
||||
// iterate over the tokens
|
||||
}
|
||||
|
||||
// transform code to array of tokens:
|
||||
var tokens = [...acorn.tokenizer(str)];
|
||||
```
|
||||
|
||||
**tokTypes** holds an object mapping names to the token type objects
|
||||
that end up in the `type` properties of tokens.
|
||||
|
||||
#### Note on using with [Escodegen][escodegen]
|
||||
|
||||
Escodegen supports generating comments from AST, attached in
|
||||
Esprima-specific format. In order to simulate same format in
|
||||
Acorn, consider following example:
|
||||
|
||||
```javascript
|
||||
var comments = [], tokens = [];
|
||||
|
||||
var ast = acorn.parse('var x = 42; // answer', {
|
||||
// collect ranges for each node
|
||||
ranges: true,
|
||||
// collect comments in Esprima's format
|
||||
onComment: comments,
|
||||
// collect token ranges
|
||||
onToken: tokens
|
||||
});
|
||||
|
||||
// attach comments using collected information
|
||||
escodegen.attachComments(ast, comments, tokens);
|
||||
|
||||
// generate code
|
||||
console.log(escodegen.generate(ast, {comment: true}));
|
||||
// > 'var x = 42; // answer'
|
||||
```
|
||||
|
||||
[escodegen]: https://github.com/estools/escodegen
|
||||
|
||||
### dist/acorn_loose.js ###
|
||||
|
||||
This file implements an error-tolerant parser. It exposes a single
|
||||
function. The loose parser is accessible in node.js via `require("acorn/dist/acorn_loose")`.
|
||||
|
||||
**parse_dammit**`(input, options)` takes the same arguments and
|
||||
returns the same syntax tree as the `parse` function in `acorn.js`,
|
||||
but never raises an error, and will do its best to parse syntactically
|
||||
invalid code in as meaningful a way as it can. It'll insert identifier
|
||||
nodes with name `"✖"` as placeholders in places where it can't make
|
||||
sense of the input. Depends on `acorn.js`, because it uses the same
|
||||
tokenizer.
|
||||
|
||||
### dist/walk.js ###
|
||||
|
||||
Implements an abstract syntax tree walker. Will store its interface in
|
||||
`acorn.walk` when loaded without a module system.
|
||||
|
||||
**simple**`(node, visitors, base, state)` does a 'simple' walk over
|
||||
a tree. `node` should be the AST node to walk, and `visitors` an
|
||||
object with properties whose names correspond to node types in the
|
||||
[ESTree spec][estree]. The properties should contain functions
|
||||
that will be called with the node object and, if applicable the state
|
||||
at that point. The last two arguments are optional. `base` is a walker
|
||||
algorithm, and `state` is a start state. The default walker will
|
||||
simply visit all statements and expressions and not produce a
|
||||
meaningful state. (An example of a use of state is to track scope at
|
||||
each point in the tree.)
|
||||
|
||||
```js
|
||||
const acorn = require("acorn")
|
||||
const walk = require("acorn/dist/walk")
|
||||
|
||||
walk.simple(acorn.parse("let x = 10"), {
|
||||
Literal(node) {
|
||||
console.log(`Found a literal: ${node.value}`)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
**ancestor**`(node, visitors, base, state)` does a 'simple' walk over
|
||||
a tree, building up an array of ancestor nodes (including the current node)
|
||||
and passing the array to the callbacks as a third parameter.
|
||||
|
||||
```js
|
||||
const acorn = require("acorn")
|
||||
const walk = require("acorn/dist/walk")
|
||||
|
||||
walk.ancestor(acorn.parse("foo('hi')"), {
|
||||
Literal(_, ancestors) {
|
||||
console.log("This literal's ancestors are:",
|
||||
ancestors.map(n => n.type))
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
**recursive**`(node, state, functions, base)` does a 'recursive'
|
||||
walk, where the walker functions are responsible for continuing the
|
||||
walk on the child nodes of their target node. `state` is the start
|
||||
state, and `functions` should contain an object that maps node types
|
||||
to walker functions. Such functions are called with `(node, state, c)`
|
||||
arguments, and can cause the walk to continue on a sub-node by calling
|
||||
the `c` argument on it with `(node, state)` arguments. The optional
|
||||
`base` argument provides the fallback walker functions for node types
|
||||
that aren't handled in the `functions` object. If not given, the
|
||||
default walkers will be used.
|
||||
|
||||
**make**`(functions, base)` builds a new walker object by using the
|
||||
walker functions in `functions` and filling in the missing ones by
|
||||
taking defaults from `base`.
|
||||
|
||||
**full**`(node, callback, base, state)` does a 'full'
|
||||
walk over a tree, calling the callback with the arguments (node, state, type)
|
||||
for each node
|
||||
|
||||
**fullAncestor**`(node, callback, base, state)` does a 'full' walk over
|
||||
a tree, building up an array of ancestor nodes (including the current node)
|
||||
and passing the array to the callbacks as a third parameter.
|
||||
|
||||
```js
|
||||
const acorn = require("acorn")
|
||||
const walk = require("acorn/dist/walk")
|
||||
|
||||
walk.full(acorn.parse("1 + 1"), node => {
|
||||
console.log(`There's a ${node.type} node at ${node.ch}`)
|
||||
})
|
||||
```
|
||||
|
||||
**findNodeAt**`(node, start, end, test, base, state)` tries to
|
||||
locate a node in a tree at the given start and/or end offsets, which
|
||||
satisfies the predicate `test`. `start` and `end` can be either `null`
|
||||
(as wildcard) or a number. `test` may be a string (indicating a node
|
||||
type) or a function that takes `(nodeType, node)` arguments and
|
||||
returns a boolean indicating whether this node is interesting. `base`
|
||||
and `state` are optional, and can be used to specify a custom walker.
|
||||
Nodes are tested from inner to outer, so if two nodes match the
|
||||
boundaries, the inner one will be preferred.
|
||||
|
||||
**findNodeAround**`(node, pos, test, base, state)` is a lot like
|
||||
`findNodeAt`, but will match any node that exists 'around' (spanning)
|
||||
the given position.
|
||||
|
||||
**findNodeAfter**`(node, pos, test, base, state)` is similar to
|
||||
`findNodeAround`, but will match all nodes *after* the given position
|
||||
(testing outer nodes before inner nodes).
|
||||
|
||||
## Command line interface
|
||||
|
||||
The `bin/acorn` utility can be used to parse a file from the command
|
||||
line. It accepts as arguments its input file and the following
|
||||
options:
|
||||
|
||||
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9`: Sets the ECMAScript version
|
||||
to parse. Default is version 7.
|
||||
|
||||
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
|
||||
|
||||
- `--locations`: Attaches a "loc" object to each node with "start" and
|
||||
"end" subobjects, each of which contains the one-based line and
|
||||
zero-based column numbers in `{line, column}` form.
|
||||
|
||||
- `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment.
|
||||
|
||||
- `--compact`: No whitespace is used in the AST output.
|
||||
|
||||
- `--silent`: Do not output the AST, just return the exit status.
|
||||
|
||||
- `--help`: Print the usage information and quit.
|
||||
|
||||
The utility spits out the syntax tree as JSON data.
|
||||
|
||||
## Build system
|
||||
|
||||
Acorn is written in ECMAScript 6, as a set of small modules, in the
|
||||
project's `src` directory, and compiled down to bigger ECMAScript 3
|
||||
files in `dist` using [Browserify](http://browserify.org) and
|
||||
[Babel](http://babeljs.io/). If you are already using Babel, you can
|
||||
consider including the modules directly.
|
||||
|
||||
The command-line test runner (`npm test`) uses the ES6 modules. The
|
||||
browser-based test page (`test/index.html`) uses the compiled modules.
|
||||
The `bin/build-acorn.js` script builds the latter from the former.
|
||||
|
||||
If you are working on Acorn, you'll probably want to try the code out
|
||||
directly, without an intermediate build step. In your scripts, you can
|
||||
register the Babel require shim like this:
|
||||
|
||||
require("babel-core/register")
|
||||
|
||||
That will allow you to directly `require` the ES6 modules.
|
||||
|
||||
## Plugins
|
||||
|
||||
Acorn is designed support allow plugins which, within reasonable
|
||||
bounds, redefine the way the parser works. Plugins can add new token
|
||||
types and new tokenizer contexts (if necessary), and extend methods in
|
||||
the parser object. This is not a clean, elegant API—using it requires
|
||||
an understanding of Acorn's internals, and plugins are likely to break
|
||||
whenever those internals are significantly changed. But still, it is
|
||||
_possible_, in this way, to create parsers for JavaScript dialects
|
||||
without forking all of Acorn. And in principle it is even possible to
|
||||
combine such plugins, so that if you have, for example, a plugin for
|
||||
parsing types and a plugin for parsing JSX-style XML literals, you
|
||||
could load them both and parse code with both JSX tags and types.
|
||||
|
||||
A plugin should register itself by adding a property to
|
||||
`acorn.plugins`, which holds a function. Calling `acorn.parse`, a
|
||||
`plugins` option can be passed, holding an object mapping plugin names
|
||||
to configuration values (or just `true` for plugins that don't take
|
||||
options). After the parser object has been created, the initialization
|
||||
functions for the chosen plugins are called with `(parser,
|
||||
configValue)` arguments. They are expected to use the `parser.extend`
|
||||
method to extend parser methods. For example, the `readToken` method
|
||||
could be extended like this:
|
||||
|
||||
```javascript
|
||||
parser.extend("readToken", function(nextMethod) {
|
||||
return function(code) {
|
||||
console.log("Reading a token!")
|
||||
return nextMethod.call(this, code)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
The `nextMethod` argument passed to `extend`'s second argument is the
|
||||
previous value of this method, and should usually be called through to
|
||||
whenever the extended method does not handle the call itself.
|
||||
|
||||
Similarly, the loose parser allows plugins to register themselves via
|
||||
`acorn.pluginsLoose`. The extension mechanism is the same as for the
|
||||
normal parser:
|
||||
|
||||
```javascript
|
||||
looseParser.extend("readToken", function(nextMethod) {
|
||||
return function() {
|
||||
console.log("Reading a token in the loose parser!")
|
||||
return nextMethod.call(this)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### Existing plugins
|
||||
|
||||
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
|
||||
- [`acorn-es7-plugin`](https://github.com/MatAtBread/acorn-es7-plugin/): Parse [async/await syntax proposal](https://github.com/tc39/ecmascript-asyncawait)
|
||||
- [`acorn-object-spread`](https://github.com/UXtemple/acorn-object-spread): Parse [object spread syntax proposal](https://github.com/sebmarkbage/ecmascript-rest-spread)
|
||||
- [`acorn-es7`](https://www.npmjs.com/package/acorn-es7): Parse [decorator syntax proposal](https://github.com/wycats/javascript-decorators)
|
||||
- [`acorn-objj`](https://www.npmjs.com/package/acorn-objj): [Objective-J](http://www.cappuccino-project.org/learn/objective-j.html) language parser built as Acorn plugin
|
||||
- [`acorn-object-rest-spread`](https://github.com/victor-homyakov/acorn-object-rest-spread) Parse [Object Rest/Spread Properties proposal](https://github.com/tc39/proposal-object-rest-spread), works with latest Acorn version (5.0.3)
|
||||
- [`acorn-static-class-property-initializer`](https://github.com/victor-homyakov/acorn-static-class-property-initializer) Partial support for static class properties from [ES Class Fields & Static Properties Proposal](https://github.com/tc39/proposal-class-public-fields) to support static property initializers in [React components written as ES6+ classes](https://babeljs.io/blog/2015/06/07/react-on-es6-plus)
|
||||
|
||||
69
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/bin/acorn
generated
vendored
Executable file
69
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/bin/acorn
generated
vendored
Executable file
@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var acorn = require('../dist/acorn.js');
|
||||
|
||||
var infile;
|
||||
var forceFile;
|
||||
var silent = false;
|
||||
var compact = false;
|
||||
var tokenize = false;
|
||||
var options = {};
|
||||
|
||||
function help(status) {
|
||||
var print = (status == 0) ? console.log : console.error;
|
||||
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
|
||||
print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]");
|
||||
process.exit(status);
|
||||
}
|
||||
|
||||
for (var i = 2; i < process.argv.length; ++i) {
|
||||
var arg = process.argv[i];
|
||||
if ((arg == "-" || arg[0] != "-") && !infile) { infile = arg; }
|
||||
else if (arg == "--" && !infile && i + 2 == process.argv.length) { forceFile = infile = process.argv[++i]; }
|
||||
else if (arg == "--locations") { options.locations = true; }
|
||||
else if (arg == "--allow-hash-bang") { options.allowHashBang = true; }
|
||||
else if (arg == "--silent") { silent = true; }
|
||||
else if (arg == "--compact") { compact = true; }
|
||||
else if (arg == "--help") { help(0); }
|
||||
else if (arg == "--tokenize") { tokenize = true; }
|
||||
else if (arg == "--module") { options.sourceType = "module"; }
|
||||
else {
|
||||
var match = arg.match(/^--ecma(\d+)$/);
|
||||
if (match)
|
||||
{ options.ecmaVersion = +match[1]; }
|
||||
else
|
||||
{ help(1); }
|
||||
}
|
||||
}
|
||||
|
||||
function run(code) {
|
||||
var result;
|
||||
try {
|
||||
if (!tokenize) {
|
||||
result = acorn.parse(code, options);
|
||||
} else {
|
||||
result = [];
|
||||
var tokenizer$$1 = acorn.tokenizer(code, options), token;
|
||||
do {
|
||||
token = tokenizer$$1.getToken();
|
||||
result.push(token);
|
||||
} while (token.type != acorn.tokTypes.eof)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); }
|
||||
}
|
||||
|
||||
if (forceFile || infile && infile != "-") {
|
||||
run(fs.readFileSync(infile, "utf8"));
|
||||
} else {
|
||||
var code = "";
|
||||
process.stdin.resume();
|
||||
process.stdin.on("data", function (chunk) { return code += chunk; });
|
||||
process.stdin.on("end", function () { return run(code); });
|
||||
}
|
||||
3734
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn.es.js
generated
vendored
Normal file
3734
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn.es.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3765
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn.js
generated
vendored
Normal file
3765
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1390
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn_loose.es.js
generated
vendored
Normal file
1390
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn_loose.es.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1400
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn_loose.js
generated
vendored
Normal file
1400
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/acorn_loose.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
407
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/walk.es.js
generated
vendored
Normal file
407
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/walk.es.js
generated
vendored
Normal file
@ -0,0 +1,407 @@
|
||||
// AST walker module for Mozilla Parser API compatible trees
|
||||
|
||||
// A simple walk is one where you simply specify callbacks to be
|
||||
// called on specific nodes. The last two arguments are optional. A
|
||||
// simple use would be
|
||||
//
|
||||
// walk.simple(myTree, {
|
||||
// Expression: function(node) { ... }
|
||||
// });
|
||||
//
|
||||
// to do something with all expressions. All Parser API node types
|
||||
// can be used to identify node types, as well as Expression,
|
||||
// Statement, and ScopeBody, which denote categories of nodes.
|
||||
//
|
||||
// The base argument can be used to pass a custom (recursive)
|
||||
// walker, and state can be used to give this walked an initial
|
||||
// state.
|
||||
|
||||
function simple(node, visitors, base, state, override) {
|
||||
if (!base) { base = exports.base
|
||||
; }(function c(node, st, override) {
|
||||
var type = override || node.type, found = visitors[type];
|
||||
base[type](node, st, c);
|
||||
if (found) { found(node, st); }
|
||||
})(node, state, override);
|
||||
}
|
||||
|
||||
// An ancestor walk keeps an array of ancestor nodes (including the
|
||||
// current node) and passes them to the callback as third parameter
|
||||
// (and also as state parameter when no other state is present).
|
||||
function ancestor(node, visitors, base, state) {
|
||||
if (!base) { base = exports.base; }
|
||||
var ancestors = [];(function c(node, st, override) {
|
||||
var type = override || node.type, found = visitors[type];
|
||||
var isNew = node != ancestors[ancestors.length - 1];
|
||||
if (isNew) { ancestors.push(node); }
|
||||
base[type](node, st, c);
|
||||
if (found) { found(node, st || ancestors, ancestors); }
|
||||
if (isNew) { ancestors.pop(); }
|
||||
})(node, state);
|
||||
}
|
||||
|
||||
// A recursive walk is one where your functions override the default
|
||||
// walkers. They can modify and replace the state parameter that's
|
||||
// threaded through the walk, and can opt how and whether to walk
|
||||
// their child nodes (by calling their third argument on these
|
||||
// nodes).
|
||||
function recursive(node, state, funcs, base, override) {
|
||||
var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {
|
||||
visitor[override || node.type](node, st, c);
|
||||
})(node, state, override);
|
||||
}
|
||||
|
||||
function makeTest(test) {
|
||||
if (typeof test == "string")
|
||||
{ return function (type) { return type == test; } }
|
||||
else if (!test)
|
||||
{ return function () { return true; } }
|
||||
else
|
||||
{ return test }
|
||||
}
|
||||
|
||||
var Found = function Found(node, state) { this.node = node; this.state = state; };
|
||||
|
||||
// A full walk triggers the callback on each node
|
||||
function full(node, callback, base, state, override) {
|
||||
if (!base) { base = exports.base
|
||||
; }(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
base[type](node, st, c);
|
||||
if (!override) { callback(node, st, type); }
|
||||
})(node, state, override);
|
||||
}
|
||||
|
||||
// An fullAncestor walk is like an ancestor walk, but triggers
|
||||
// the callback on each node
|
||||
function fullAncestor(node, callback, base, state) {
|
||||
if (!base) { base = exports.base; }
|
||||
var ancestors = [];(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
var isNew = node != ancestors[ancestors.length - 1];
|
||||
if (isNew) { ancestors.push(node); }
|
||||
base[type](node, st, c);
|
||||
if (!override) { callback(node, st || ancestors, ancestors, type); }
|
||||
if (isNew) { ancestors.pop(); }
|
||||
})(node, state);
|
||||
}
|
||||
|
||||
// Find a node with a given start, end, and type (all are optional,
|
||||
// null can be used as wildcard). Returns a {node, state} object, or
|
||||
// undefined when it doesn't find a matching node.
|
||||
function findNodeAt(node, start, end, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
try {
|
||||
(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
if ((start == null || node.start <= start) &&
|
||||
(end == null || node.end >= end))
|
||||
{ base[type](node, st, c); }
|
||||
if ((start == null || node.start == start) &&
|
||||
(end == null || node.end == end) &&
|
||||
test(type, node))
|
||||
{ throw new Found(node, st) }
|
||||
})(node, state);
|
||||
} catch (e) {
|
||||
if (e instanceof Found) { return e }
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// Find the innermost node of a given type that contains the given
|
||||
// position. Interface similar to findNodeAt.
|
||||
function findNodeAround(node, pos, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
try {
|
||||
(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
if (node.start > pos || node.end < pos) { return }
|
||||
base[type](node, st, c);
|
||||
if (test(type, node)) { throw new Found(node, st) }
|
||||
})(node, state);
|
||||
} catch (e) {
|
||||
if (e instanceof Found) { return e }
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// Find the outermost matching node after a given position.
|
||||
function findNodeAfter(node, pos, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
try {
|
||||
(function c(node, st, override) {
|
||||
if (node.end < pos) { return }
|
||||
var type = override || node.type;
|
||||
if (node.start >= pos && test(type, node)) { throw new Found(node, st) }
|
||||
base[type](node, st, c);
|
||||
})(node, state);
|
||||
} catch (e) {
|
||||
if (e instanceof Found) { return e }
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// Find the outermost matching node before a given position.
|
||||
function findNodeBefore(node, pos, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
var max;(function c(node, st, override) {
|
||||
if (node.start > pos) { return }
|
||||
var type = override || node.type;
|
||||
if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))
|
||||
{ max = new Found(node, st); }
|
||||
base[type](node, st, c);
|
||||
})(node, state);
|
||||
return max
|
||||
}
|
||||
|
||||
// Fallback to an Object.create polyfill for older environments.
|
||||
var create = Object.create || function(proto) {
|
||||
function Ctor() {}
|
||||
Ctor.prototype = proto;
|
||||
return new Ctor
|
||||
};
|
||||
|
||||
// Used to create a custom walker. Will fill in all missing node
|
||||
// type properties with the defaults.
|
||||
function make(funcs, base) {
|
||||
if (!base) { base = exports.base; }
|
||||
var visitor = create(base);
|
||||
for (var type in funcs) { visitor[type] = funcs[type]; }
|
||||
return visitor
|
||||
}
|
||||
|
||||
function skipThrough(node, st, c) { c(node, st); }
|
||||
function ignore(_node, _st, _c) {}
|
||||
|
||||
// Node walkers.
|
||||
|
||||
var base = {};
|
||||
|
||||
base.Program = base.BlockStatement = function (node, st, c) {
|
||||
for (var i = 0, list = node.body; i < list.length; i += 1)
|
||||
{
|
||||
var stmt = list[i];
|
||||
|
||||
c(stmt, st, "Statement");
|
||||
}
|
||||
};
|
||||
base.Statement = skipThrough;
|
||||
base.EmptyStatement = ignore;
|
||||
base.ExpressionStatement = base.ParenthesizedExpression =
|
||||
function (node, st, c) { return c(node.expression, st, "Expression"); };
|
||||
base.IfStatement = function (node, st, c) {
|
||||
c(node.test, st, "Expression");
|
||||
c(node.consequent, st, "Statement");
|
||||
if (node.alternate) { c(node.alternate, st, "Statement"); }
|
||||
};
|
||||
base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); };
|
||||
base.BreakStatement = base.ContinueStatement = ignore;
|
||||
base.WithStatement = function (node, st, c) {
|
||||
c(node.object, st, "Expression");
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.SwitchStatement = function (node, st, c) {
|
||||
c(node.discriminant, st, "Expression");
|
||||
for (var i = 0, list = node.cases; i < list.length; i += 1) {
|
||||
var cs = list[i];
|
||||
|
||||
if (cs.test) { c(cs.test, st, "Expression"); }
|
||||
for (var i$1 = 0, list$1 = cs.consequent; i$1 < list$1.length; i$1 += 1)
|
||||
{
|
||||
var cons = list$1[i$1];
|
||||
|
||||
c(cons, st, "Statement");
|
||||
}
|
||||
}
|
||||
};
|
||||
base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
|
||||
if (node.argument) { c(node.argument, st, "Expression"); }
|
||||
};
|
||||
base.ThrowStatement = base.SpreadElement =
|
||||
function (node, st, c) { return c(node.argument, st, "Expression"); };
|
||||
base.TryStatement = function (node, st, c) {
|
||||
c(node.block, st, "Statement");
|
||||
if (node.handler) { c(node.handler, st); }
|
||||
if (node.finalizer) { c(node.finalizer, st, "Statement"); }
|
||||
};
|
||||
base.CatchClause = function (node, st, c) {
|
||||
c(node.param, st, "Pattern");
|
||||
c(node.body, st, "ScopeBody");
|
||||
};
|
||||
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
|
||||
c(node.test, st, "Expression");
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.ForStatement = function (node, st, c) {
|
||||
if (node.init) { c(node.init, st, "ForInit"); }
|
||||
if (node.test) { c(node.test, st, "Expression"); }
|
||||
if (node.update) { c(node.update, st, "Expression"); }
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.ForInStatement = base.ForOfStatement = function (node, st, c) {
|
||||
c(node.left, st, "ForInit");
|
||||
c(node.right, st, "Expression");
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.ForInit = function (node, st, c) {
|
||||
if (node.type == "VariableDeclaration") { c(node, st); }
|
||||
else { c(node, st, "Expression"); }
|
||||
};
|
||||
base.DebuggerStatement = ignore;
|
||||
|
||||
base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); };
|
||||
base.VariableDeclaration = function (node, st, c) {
|
||||
for (var i = 0, list = node.declarations; i < list.length; i += 1)
|
||||
{
|
||||
var decl = list[i];
|
||||
|
||||
c(decl, st);
|
||||
}
|
||||
};
|
||||
base.VariableDeclarator = function (node, st, c) {
|
||||
c(node.id, st, "Pattern");
|
||||
if (node.init) { c(node.init, st, "Expression"); }
|
||||
};
|
||||
|
||||
base.Function = function (node, st, c) {
|
||||
if (node.id) { c(node.id, st, "Pattern"); }
|
||||
for (var i = 0, list = node.params; i < list.length; i += 1)
|
||||
{
|
||||
var param = list[i];
|
||||
|
||||
c(param, st, "Pattern");
|
||||
}
|
||||
c(node.body, st, node.expression ? "ScopeExpression" : "ScopeBody");
|
||||
};
|
||||
// FIXME drop these node types in next major version
|
||||
// (They are awkward, and in ES6 every block can be a scope.)
|
||||
base.ScopeBody = function (node, st, c) { return c(node, st, "Statement"); };
|
||||
base.ScopeExpression = function (node, st, c) { return c(node, st, "Expression"); };
|
||||
|
||||
base.Pattern = function (node, st, c) {
|
||||
if (node.type == "Identifier")
|
||||
{ c(node, st, "VariablePattern"); }
|
||||
else if (node.type == "MemberExpression")
|
||||
{ c(node, st, "MemberPattern"); }
|
||||
else
|
||||
{ c(node, st); }
|
||||
};
|
||||
base.VariablePattern = ignore;
|
||||
base.MemberPattern = skipThrough;
|
||||
base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); };
|
||||
base.ArrayPattern = function (node, st, c) {
|
||||
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
||||
var elt = list[i];
|
||||
|
||||
if (elt) { c(elt, st, "Pattern"); }
|
||||
}
|
||||
};
|
||||
base.ObjectPattern = function (node, st, c) {
|
||||
for (var i = 0, list = node.properties; i < list.length; i += 1)
|
||||
{
|
||||
var prop = list[i];
|
||||
|
||||
c(prop.value, st, "Pattern");
|
||||
}
|
||||
};
|
||||
|
||||
base.Expression = skipThrough;
|
||||
base.ThisExpression = base.Super = base.MetaProperty = ignore;
|
||||
base.ArrayExpression = function (node, st, c) {
|
||||
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
||||
var elt = list[i];
|
||||
|
||||
if (elt) { c(elt, st, "Expression"); }
|
||||
}
|
||||
};
|
||||
base.ObjectExpression = function (node, st, c) {
|
||||
for (var i = 0, list = node.properties; i < list.length; i += 1)
|
||||
{
|
||||
var prop = list[i];
|
||||
|
||||
c(prop, st);
|
||||
}
|
||||
};
|
||||
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
||||
base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
|
||||
for (var i = 0, list = node.expressions; i < list.length; i += 1)
|
||||
{
|
||||
var expr = list[i];
|
||||
|
||||
c(expr, st, "Expression");
|
||||
}
|
||||
};
|
||||
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
|
||||
c(node.argument, st, "Expression");
|
||||
};
|
||||
base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
|
||||
c(node.left, st, "Expression");
|
||||
c(node.right, st, "Expression");
|
||||
};
|
||||
base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
|
||||
c(node.left, st, "Pattern");
|
||||
c(node.right, st, "Expression");
|
||||
};
|
||||
base.ConditionalExpression = function (node, st, c) {
|
||||
c(node.test, st, "Expression");
|
||||
c(node.consequent, st, "Expression");
|
||||
c(node.alternate, st, "Expression");
|
||||
};
|
||||
base.NewExpression = base.CallExpression = function (node, st, c) {
|
||||
c(node.callee, st, "Expression");
|
||||
if (node.arguments)
|
||||
{ for (var i = 0, list = node.arguments; i < list.length; i += 1)
|
||||
{
|
||||
var arg = list[i];
|
||||
|
||||
c(arg, st, "Expression");
|
||||
} }
|
||||
};
|
||||
base.MemberExpression = function (node, st, c) {
|
||||
c(node.object, st, "Expression");
|
||||
if (node.computed) { c(node.property, st, "Expression"); }
|
||||
};
|
||||
base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
|
||||
if (node.declaration)
|
||||
{ c(node.declaration, st, node.type == "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); }
|
||||
if (node.source) { c(node.source, st, "Expression"); }
|
||||
};
|
||||
base.ExportAllDeclaration = function (node, st, c) {
|
||||
c(node.source, st, "Expression");
|
||||
};
|
||||
base.ImportDeclaration = function (node, st, c) {
|
||||
for (var i = 0, list = node.specifiers; i < list.length; i += 1)
|
||||
{
|
||||
var spec = list[i];
|
||||
|
||||
c(spec, st);
|
||||
}
|
||||
c(node.source, st, "Expression");
|
||||
};
|
||||
base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore;
|
||||
|
||||
base.TaggedTemplateExpression = function (node, st, c) {
|
||||
c(node.tag, st, "Expression");
|
||||
c(node.quasi, st);
|
||||
};
|
||||
base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); };
|
||||
base.Class = function (node, st, c) {
|
||||
if (node.id) { c(node.id, st, "Pattern"); }
|
||||
if (node.superClass) { c(node.superClass, st, "Expression"); }
|
||||
for (var i = 0, list = node.body.body; i < list.length; i += 1)
|
||||
{
|
||||
var item = list[i];
|
||||
|
||||
c(item, st);
|
||||
}
|
||||
};
|
||||
base.MethodDefinition = base.Property = function (node, st, c) {
|
||||
if (node.computed) { c(node.key, st, "Expression"); }
|
||||
c(node.value, st, "Expression");
|
||||
};
|
||||
|
||||
export { simple, ancestor, recursive, full, fullAncestor, findNodeAt, findNodeAround, findNodeAfter, findNodeBefore, make, base };
|
||||
427
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/walk.js
generated
vendored
Normal file
427
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/dist/walk.js
generated
vendored
Normal file
@ -0,0 +1,427 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.acorn = global.acorn || {}, global.acorn.walk = global.acorn.walk || {})));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
// AST walker module for Mozilla Parser API compatible trees
|
||||
|
||||
// A simple walk is one where you simply specify callbacks to be
|
||||
// called on specific nodes. The last two arguments are optional. A
|
||||
// simple use would be
|
||||
//
|
||||
// walk.simple(myTree, {
|
||||
// Expression: function(node) { ... }
|
||||
// });
|
||||
//
|
||||
// to do something with all expressions. All Parser API node types
|
||||
// can be used to identify node types, as well as Expression,
|
||||
// Statement, and ScopeBody, which denote categories of nodes.
|
||||
//
|
||||
// The base argument can be used to pass a custom (recursive)
|
||||
// walker, and state can be used to give this walked an initial
|
||||
// state.
|
||||
|
||||
function simple(node, visitors, base, state, override) {
|
||||
if (!base) { base = exports.base
|
||||
; }(function c(node, st, override) {
|
||||
var type = override || node.type, found = visitors[type];
|
||||
base[type](node, st, c);
|
||||
if (found) { found(node, st); }
|
||||
})(node, state, override);
|
||||
}
|
||||
|
||||
// An ancestor walk keeps an array of ancestor nodes (including the
|
||||
// current node) and passes them to the callback as third parameter
|
||||
// (and also as state parameter when no other state is present).
|
||||
function ancestor(node, visitors, base, state) {
|
||||
if (!base) { base = exports.base; }
|
||||
var ancestors = [];(function c(node, st, override) {
|
||||
var type = override || node.type, found = visitors[type];
|
||||
var isNew = node != ancestors[ancestors.length - 1];
|
||||
if (isNew) { ancestors.push(node); }
|
||||
base[type](node, st, c);
|
||||
if (found) { found(node, st || ancestors, ancestors); }
|
||||
if (isNew) { ancestors.pop(); }
|
||||
})(node, state);
|
||||
}
|
||||
|
||||
// A recursive walk is one where your functions override the default
|
||||
// walkers. They can modify and replace the state parameter that's
|
||||
// threaded through the walk, and can opt how and whether to walk
|
||||
// their child nodes (by calling their third argument on these
|
||||
// nodes).
|
||||
function recursive(node, state, funcs, base, override) {
|
||||
var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {
|
||||
visitor[override || node.type](node, st, c);
|
||||
})(node, state, override);
|
||||
}
|
||||
|
||||
function makeTest(test) {
|
||||
if (typeof test == "string")
|
||||
{ return function (type) { return type == test; } }
|
||||
else if (!test)
|
||||
{ return function () { return true; } }
|
||||
else
|
||||
{ return test }
|
||||
}
|
||||
|
||||
var Found = function Found(node, state) { this.node = node; this.state = state; };
|
||||
|
||||
// A full walk triggers the callback on each node
|
||||
function full(node, callback, base, state, override) {
|
||||
if (!base) { base = exports.base
|
||||
; }(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
base[type](node, st, c);
|
||||
if (!override) { callback(node, st, type); }
|
||||
})(node, state, override);
|
||||
}
|
||||
|
||||
// An fullAncestor walk is like an ancestor walk, but triggers
|
||||
// the callback on each node
|
||||
function fullAncestor(node, callback, base, state) {
|
||||
if (!base) { base = exports.base; }
|
||||
var ancestors = [];(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
var isNew = node != ancestors[ancestors.length - 1];
|
||||
if (isNew) { ancestors.push(node); }
|
||||
base[type](node, st, c);
|
||||
if (!override) { callback(node, st || ancestors, ancestors, type); }
|
||||
if (isNew) { ancestors.pop(); }
|
||||
})(node, state);
|
||||
}
|
||||
|
||||
// Find a node with a given start, end, and type (all are optional,
|
||||
// null can be used as wildcard). Returns a {node, state} object, or
|
||||
// undefined when it doesn't find a matching node.
|
||||
function findNodeAt(node, start, end, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
try {
|
||||
(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
if ((start == null || node.start <= start) &&
|
||||
(end == null || node.end >= end))
|
||||
{ base[type](node, st, c); }
|
||||
if ((start == null || node.start == start) &&
|
||||
(end == null || node.end == end) &&
|
||||
test(type, node))
|
||||
{ throw new Found(node, st) }
|
||||
})(node, state);
|
||||
} catch (e) {
|
||||
if (e instanceof Found) { return e }
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// Find the innermost node of a given type that contains the given
|
||||
// position. Interface similar to findNodeAt.
|
||||
function findNodeAround(node, pos, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
try {
|
||||
(function c(node, st, override) {
|
||||
var type = override || node.type;
|
||||
if (node.start > pos || node.end < pos) { return }
|
||||
base[type](node, st, c);
|
||||
if (test(type, node)) { throw new Found(node, st) }
|
||||
})(node, state);
|
||||
} catch (e) {
|
||||
if (e instanceof Found) { return e }
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// Find the outermost matching node after a given position.
|
||||
function findNodeAfter(node, pos, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
try {
|
||||
(function c(node, st, override) {
|
||||
if (node.end < pos) { return }
|
||||
var type = override || node.type;
|
||||
if (node.start >= pos && test(type, node)) { throw new Found(node, st) }
|
||||
base[type](node, st, c);
|
||||
})(node, state);
|
||||
} catch (e) {
|
||||
if (e instanceof Found) { return e }
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// Find the outermost matching node before a given position.
|
||||
function findNodeBefore(node, pos, test, base, state) {
|
||||
test = makeTest(test);
|
||||
if (!base) { base = exports.base; }
|
||||
var max;(function c(node, st, override) {
|
||||
if (node.start > pos) { return }
|
||||
var type = override || node.type;
|
||||
if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))
|
||||
{ max = new Found(node, st); }
|
||||
base[type](node, st, c);
|
||||
})(node, state);
|
||||
return max
|
||||
}
|
||||
|
||||
// Fallback to an Object.create polyfill for older environments.
|
||||
var create = Object.create || function(proto) {
|
||||
function Ctor() {}
|
||||
Ctor.prototype = proto;
|
||||
return new Ctor
|
||||
};
|
||||
|
||||
// Used to create a custom walker. Will fill in all missing node
|
||||
// type properties with the defaults.
|
||||
function make(funcs, base) {
|
||||
if (!base) { base = exports.base; }
|
||||
var visitor = create(base);
|
||||
for (var type in funcs) { visitor[type] = funcs[type]; }
|
||||
return visitor
|
||||
}
|
||||
|
||||
function skipThrough(node, st, c) { c(node, st); }
|
||||
function ignore(_node, _st, _c) {}
|
||||
|
||||
// Node walkers.
|
||||
|
||||
var base = {};
|
||||
|
||||
base.Program = base.BlockStatement = function (node, st, c) {
|
||||
for (var i = 0, list = node.body; i < list.length; i += 1)
|
||||
{
|
||||
var stmt = list[i];
|
||||
|
||||
c(stmt, st, "Statement");
|
||||
}
|
||||
};
|
||||
base.Statement = skipThrough;
|
||||
base.EmptyStatement = ignore;
|
||||
base.ExpressionStatement = base.ParenthesizedExpression =
|
||||
function (node, st, c) { return c(node.expression, st, "Expression"); };
|
||||
base.IfStatement = function (node, st, c) {
|
||||
c(node.test, st, "Expression");
|
||||
c(node.consequent, st, "Statement");
|
||||
if (node.alternate) { c(node.alternate, st, "Statement"); }
|
||||
};
|
||||
base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); };
|
||||
base.BreakStatement = base.ContinueStatement = ignore;
|
||||
base.WithStatement = function (node, st, c) {
|
||||
c(node.object, st, "Expression");
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.SwitchStatement = function (node, st, c) {
|
||||
c(node.discriminant, st, "Expression");
|
||||
for (var i = 0, list = node.cases; i < list.length; i += 1) {
|
||||
var cs = list[i];
|
||||
|
||||
if (cs.test) { c(cs.test, st, "Expression"); }
|
||||
for (var i$1 = 0, list$1 = cs.consequent; i$1 < list$1.length; i$1 += 1)
|
||||
{
|
||||
var cons = list$1[i$1];
|
||||
|
||||
c(cons, st, "Statement");
|
||||
}
|
||||
}
|
||||
};
|
||||
base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
|
||||
if (node.argument) { c(node.argument, st, "Expression"); }
|
||||
};
|
||||
base.ThrowStatement = base.SpreadElement =
|
||||
function (node, st, c) { return c(node.argument, st, "Expression"); };
|
||||
base.TryStatement = function (node, st, c) {
|
||||
c(node.block, st, "Statement");
|
||||
if (node.handler) { c(node.handler, st); }
|
||||
if (node.finalizer) { c(node.finalizer, st, "Statement"); }
|
||||
};
|
||||
base.CatchClause = function (node, st, c) {
|
||||
c(node.param, st, "Pattern");
|
||||
c(node.body, st, "ScopeBody");
|
||||
};
|
||||
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
|
||||
c(node.test, st, "Expression");
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.ForStatement = function (node, st, c) {
|
||||
if (node.init) { c(node.init, st, "ForInit"); }
|
||||
if (node.test) { c(node.test, st, "Expression"); }
|
||||
if (node.update) { c(node.update, st, "Expression"); }
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.ForInStatement = base.ForOfStatement = function (node, st, c) {
|
||||
c(node.left, st, "ForInit");
|
||||
c(node.right, st, "Expression");
|
||||
c(node.body, st, "Statement");
|
||||
};
|
||||
base.ForInit = function (node, st, c) {
|
||||
if (node.type == "VariableDeclaration") { c(node, st); }
|
||||
else { c(node, st, "Expression"); }
|
||||
};
|
||||
base.DebuggerStatement = ignore;
|
||||
|
||||
base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); };
|
||||
base.VariableDeclaration = function (node, st, c) {
|
||||
for (var i = 0, list = node.declarations; i < list.length; i += 1)
|
||||
{
|
||||
var decl = list[i];
|
||||
|
||||
c(decl, st);
|
||||
}
|
||||
};
|
||||
base.VariableDeclarator = function (node, st, c) {
|
||||
c(node.id, st, "Pattern");
|
||||
if (node.init) { c(node.init, st, "Expression"); }
|
||||
};
|
||||
|
||||
base.Function = function (node, st, c) {
|
||||
if (node.id) { c(node.id, st, "Pattern"); }
|
||||
for (var i = 0, list = node.params; i < list.length; i += 1)
|
||||
{
|
||||
var param = list[i];
|
||||
|
||||
c(param, st, "Pattern");
|
||||
}
|
||||
c(node.body, st, node.expression ? "ScopeExpression" : "ScopeBody");
|
||||
};
|
||||
// FIXME drop these node types in next major version
|
||||
// (They are awkward, and in ES6 every block can be a scope.)
|
||||
base.ScopeBody = function (node, st, c) { return c(node, st, "Statement"); };
|
||||
base.ScopeExpression = function (node, st, c) { return c(node, st, "Expression"); };
|
||||
|
||||
base.Pattern = function (node, st, c) {
|
||||
if (node.type == "Identifier")
|
||||
{ c(node, st, "VariablePattern"); }
|
||||
else if (node.type == "MemberExpression")
|
||||
{ c(node, st, "MemberPattern"); }
|
||||
else
|
||||
{ c(node, st); }
|
||||
};
|
||||
base.VariablePattern = ignore;
|
||||
base.MemberPattern = skipThrough;
|
||||
base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); };
|
||||
base.ArrayPattern = function (node, st, c) {
|
||||
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
||||
var elt = list[i];
|
||||
|
||||
if (elt) { c(elt, st, "Pattern"); }
|
||||
}
|
||||
};
|
||||
base.ObjectPattern = function (node, st, c) {
|
||||
for (var i = 0, list = node.properties; i < list.length; i += 1)
|
||||
{
|
||||
var prop = list[i];
|
||||
|
||||
c(prop.value, st, "Pattern");
|
||||
}
|
||||
};
|
||||
|
||||
base.Expression = skipThrough;
|
||||
base.ThisExpression = base.Super = base.MetaProperty = ignore;
|
||||
base.ArrayExpression = function (node, st, c) {
|
||||
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
||||
var elt = list[i];
|
||||
|
||||
if (elt) { c(elt, st, "Expression"); }
|
||||
}
|
||||
};
|
||||
base.ObjectExpression = function (node, st, c) {
|
||||
for (var i = 0, list = node.properties; i < list.length; i += 1)
|
||||
{
|
||||
var prop = list[i];
|
||||
|
||||
c(prop, st);
|
||||
}
|
||||
};
|
||||
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
||||
base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
|
||||
for (var i = 0, list = node.expressions; i < list.length; i += 1)
|
||||
{
|
||||
var expr = list[i];
|
||||
|
||||
c(expr, st, "Expression");
|
||||
}
|
||||
};
|
||||
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
|
||||
c(node.argument, st, "Expression");
|
||||
};
|
||||
base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
|
||||
c(node.left, st, "Expression");
|
||||
c(node.right, st, "Expression");
|
||||
};
|
||||
base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
|
||||
c(node.left, st, "Pattern");
|
||||
c(node.right, st, "Expression");
|
||||
};
|
||||
base.ConditionalExpression = function (node, st, c) {
|
||||
c(node.test, st, "Expression");
|
||||
c(node.consequent, st, "Expression");
|
||||
c(node.alternate, st, "Expression");
|
||||
};
|
||||
base.NewExpression = base.CallExpression = function (node, st, c) {
|
||||
c(node.callee, st, "Expression");
|
||||
if (node.arguments)
|
||||
{ for (var i = 0, list = node.arguments; i < list.length; i += 1)
|
||||
{
|
||||
var arg = list[i];
|
||||
|
||||
c(arg, st, "Expression");
|
||||
} }
|
||||
};
|
||||
base.MemberExpression = function (node, st, c) {
|
||||
c(node.object, st, "Expression");
|
||||
if (node.computed) { c(node.property, st, "Expression"); }
|
||||
};
|
||||
base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
|
||||
if (node.declaration)
|
||||
{ c(node.declaration, st, node.type == "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); }
|
||||
if (node.source) { c(node.source, st, "Expression"); }
|
||||
};
|
||||
base.ExportAllDeclaration = function (node, st, c) {
|
||||
c(node.source, st, "Expression");
|
||||
};
|
||||
base.ImportDeclaration = function (node, st, c) {
|
||||
for (var i = 0, list = node.specifiers; i < list.length; i += 1)
|
||||
{
|
||||
var spec = list[i];
|
||||
|
||||
c(spec, st);
|
||||
}
|
||||
c(node.source, st, "Expression");
|
||||
};
|
||||
base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore;
|
||||
|
||||
base.TaggedTemplateExpression = function (node, st, c) {
|
||||
c(node.tag, st, "Expression");
|
||||
c(node.quasi, st);
|
||||
};
|
||||
base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); };
|
||||
base.Class = function (node, st, c) {
|
||||
if (node.id) { c(node.id, st, "Pattern"); }
|
||||
if (node.superClass) { c(node.superClass, st, "Expression"); }
|
||||
for (var i = 0, list = node.body.body; i < list.length; i += 1)
|
||||
{
|
||||
var item = list[i];
|
||||
|
||||
c(item, st);
|
||||
}
|
||||
};
|
||||
base.MethodDefinition = base.Property = function (node, st, c) {
|
||||
if (node.computed) { c(node.key, st, "Expression"); }
|
||||
c(node.value, st, "Expression");
|
||||
};
|
||||
|
||||
exports.simple = simple;
|
||||
exports.ancestor = ancestor;
|
||||
exports.recursive = recursive;
|
||||
exports.full = full;
|
||||
exports.fullAncestor = fullAncestor;
|
||||
exports.findNodeAt = findNodeAt;
|
||||
exports.findNodeAround = findNodeAround;
|
||||
exports.findNodeAfter = findNodeAfter;
|
||||
exports.findNodeBefore = findNodeBefore;
|
||||
exports.make = make;
|
||||
exports.base = base;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
286
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/package.json
generated
vendored
Normal file
286
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn/package.json
generated
vendored
Normal file
@ -0,0 +1,286 @@
|
||||
{
|
||||
"_from": "acorn@^5.0.3",
|
||||
"_id": "acorn@5.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==",
|
||||
"_location": "/@gulp-sourcemaps/identity-map/acorn",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "acorn@^5.0.3",
|
||||
"name": "acorn",
|
||||
"escapedName": "acorn",
|
||||
"rawSpec": "^5.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@gulp-sourcemaps/identity-map"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz",
|
||||
"_shasum": "317ac7821826c22c702d66189ab8359675f135d7",
|
||||
"_spec": "acorn@^5.0.3",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/@gulp-sourcemaps/identity-map",
|
||||
"bin": {
|
||||
"acorn": "./bin/acorn"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ternjs/acorn/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "List of Acorn contributors. Updated before every release."
|
||||
},
|
||||
{
|
||||
"name": "Adrian Rakovsky"
|
||||
},
|
||||
{
|
||||
"name": "Alistair Braidwood"
|
||||
},
|
||||
{
|
||||
"name": "Amila Welihinda"
|
||||
},
|
||||
{
|
||||
"name": "Andres Suarez"
|
||||
},
|
||||
{
|
||||
"name": "Angelo"
|
||||
},
|
||||
{
|
||||
"name": "Aparajita Fishman"
|
||||
},
|
||||
{
|
||||
"name": "Arian Stolwijk"
|
||||
},
|
||||
{
|
||||
"name": "Artem Govorov"
|
||||
},
|
||||
{
|
||||
"name": "Bradley Heinz"
|
||||
},
|
||||
{
|
||||
"name": "Brandon Mills"
|
||||
},
|
||||
{
|
||||
"name": "Charles Hughes"
|
||||
},
|
||||
{
|
||||
"name": "Conrad Irwin"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Tschinder"
|
||||
},
|
||||
{
|
||||
"name": "David Bonnet"
|
||||
},
|
||||
{
|
||||
"name": "Domenico Matteo"
|
||||
},
|
||||
{
|
||||
"name": "ehmicky"
|
||||
},
|
||||
{
|
||||
"name": "Forbes Lindesay"
|
||||
},
|
||||
{
|
||||
"name": "Gilad Peleg"
|
||||
},
|
||||
{
|
||||
"name": "impinball"
|
||||
},
|
||||
{
|
||||
"name": "Ingvar Stepanyan"
|
||||
},
|
||||
{
|
||||
"name": "Jackson Ray Hamilton"
|
||||
},
|
||||
{
|
||||
"name": "Jesse McCarthy"
|
||||
},
|
||||
{
|
||||
"name": "Jiaxing Wang"
|
||||
},
|
||||
{
|
||||
"name": "Joel Kemp"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Herr"
|
||||
},
|
||||
{
|
||||
"name": "John-David Dalton"
|
||||
},
|
||||
{
|
||||
"name": "Jordan Klassen"
|
||||
},
|
||||
{
|
||||
"name": "Jürg Lehni"
|
||||
},
|
||||
{
|
||||
"name": "Kai Cataldo"
|
||||
},
|
||||
{
|
||||
"name": "keeyipchan"
|
||||
},
|
||||
{
|
||||
"name": "Keheliya Gallaba"
|
||||
},
|
||||
{
|
||||
"name": "Kevin Irish"
|
||||
},
|
||||
{
|
||||
"name": "Kevin Kwok"
|
||||
},
|
||||
{
|
||||
"name": "krator"
|
||||
},
|
||||
{
|
||||
"name": "Marek"
|
||||
},
|
||||
{
|
||||
"name": "Marijn Haverbeke"
|
||||
},
|
||||
{
|
||||
"name": "Martin Carlberg"
|
||||
},
|
||||
{
|
||||
"name": "Mat Garcia"
|
||||
},
|
||||
{
|
||||
"name": "Mathias Bynens"
|
||||
},
|
||||
{
|
||||
"name": "Mathieu 'p01' Henri"
|
||||
},
|
||||
{
|
||||
"name": "Matthew Bastien"
|
||||
},
|
||||
{
|
||||
"name": "Max Schaefer"
|
||||
},
|
||||
{
|
||||
"name": "Max Zerzouri"
|
||||
},
|
||||
{
|
||||
"name": "Mihai Bazon"
|
||||
},
|
||||
{
|
||||
"name": "Mike Rennie"
|
||||
},
|
||||
{
|
||||
"name": "naoh"
|
||||
},
|
||||
{
|
||||
"name": "Nicholas C. Zakas"
|
||||
},
|
||||
{
|
||||
"name": "Nick Fitzgerald"
|
||||
},
|
||||
{
|
||||
"name": "Olivier Thomann"
|
||||
},
|
||||
{
|
||||
"name": "Oskar Schöldström"
|
||||
},
|
||||
{
|
||||
"name": "Paul Harper"
|
||||
},
|
||||
{
|
||||
"name": "Peter Rust"
|
||||
},
|
||||
{
|
||||
"name": "PlNG"
|
||||
},
|
||||
{
|
||||
"name": "Prayag Verma"
|
||||
},
|
||||
{
|
||||
"name": "ReadmeCritic"
|
||||
},
|
||||
{
|
||||
"name": "r-e-d"
|
||||
},
|
||||
{
|
||||
"name": "Richard Gibson"
|
||||
},
|
||||
{
|
||||
"name": "Rich Harris"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian McKenzie"
|
||||
},
|
||||
{
|
||||
"name": "Shahar Soel"
|
||||
},
|
||||
{
|
||||
"name": "Simen Bekkhus"
|
||||
},
|
||||
{
|
||||
"name": "Teddy Katz"
|
||||
},
|
||||
{
|
||||
"name": "Timothy Gu"
|
||||
},
|
||||
{
|
||||
"name": "Toru Nagashima"
|
||||
},
|
||||
{
|
||||
"name": "Victor Homyakov"
|
||||
},
|
||||
{
|
||||
"name": "Wexpo Lyu"
|
||||
},
|
||||
{
|
||||
"name": "zsjforcn"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "ECMAScript parser",
|
||||
"devDependencies": {
|
||||
"eslint": "^3.18.0",
|
||||
"eslint-config-standard": "^7.1.0",
|
||||
"eslint-plugin-import": "^2.2.0",
|
||||
"eslint-plugin-promise": "^3.5.0",
|
||||
"eslint-plugin-standard": "^2.1.1",
|
||||
"rollup": "^0.43.0",
|
||||
"rollup-plugin-buble": "^0.15.0",
|
||||
"unicode-9.0.0": "^0.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
"homepage": "https://github.com/ternjs/acorn",
|
||||
"license": "MIT",
|
||||
"main": "dist/acorn.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Marijn Haverbeke",
|
||||
"email": "marijnh@gmail.com",
|
||||
"url": "http://marijnhaverbeke.nl"
|
||||
},
|
||||
{
|
||||
"name": "Ingvar Stepanyan",
|
||||
"email": "me@rreverser.com",
|
||||
"url": "http://rreverser.com/"
|
||||
}
|
||||
],
|
||||
"module": "dist/acorn.es.js",
|
||||
"name": "acorn",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ternjs/acorn.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run build:main && npm run build:walk && npm run build:loose && npm run build:bin",
|
||||
"build:bin": "rollup -c rollup/config.bin.js",
|
||||
"build:loose": "rollup -c rollup/config.loose.js && rollup -c rollup/config.loose_es.js",
|
||||
"build:main": "rollup -c rollup/config.main.js",
|
||||
"build:walk": "rollup -c rollup/config.walk.js",
|
||||
"lint": "eslint src/",
|
||||
"prepare": "npm test",
|
||||
"pretest": "npm run build:main && npm run build:loose",
|
||||
"test": "node test/run.js && node test/lint.js"
|
||||
},
|
||||
"version": "5.2.1"
|
||||
}
|
||||
90
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/package.json
generated
vendored
Normal file
90
static/js/ketcher2/node_modules/@gulp-sourcemaps/identity-map/package.json
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"_from": "@gulp-sourcemaps/identity-map@1.X",
|
||||
"_id": "@gulp-sourcemaps/identity-map@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-z6I7xYQPkQTOMqZedNt+epdLvuE=",
|
||||
"_location": "/@gulp-sourcemaps/identity-map",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@gulp-sourcemaps/identity-map@1.X",
|
||||
"name": "@gulp-sourcemaps/identity-map",
|
||||
"escapedName": "@gulp-sourcemaps%2fidentity-map",
|
||||
"scope": "@gulp-sourcemaps",
|
||||
"rawSpec": "1.X",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.X"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gulp-sourcemaps"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.1.tgz",
|
||||
"_shasum": "cfa23bc5840f9104ce32a65e74db7e7a974bbee1",
|
||||
"_spec": "@gulp-sourcemaps/identity-map@1.X",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/gulp-sourcemaps",
|
||||
"author": {
|
||||
"name": "Gulp-sourcemaps Team"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/gulp-sourcemaps/identity-map/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Blaine Bublitz",
|
||||
"email": "blaine.bublitz@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"acorn": "^5.0.3",
|
||||
"css": "^2.2.1",
|
||||
"normalize-path": "^2.1.1",
|
||||
"source-map": "^0.5.6",
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Gulp plugin for generating an identity sourcemap for a file.",
|
||||
"devDependencies": {
|
||||
"eslint": "^1.7.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"expect": "^1.19.0",
|
||||
"istanbul": "^0.4.3",
|
||||
"istanbul-coveralls": "^1.0.3",
|
||||
"jscs": "^2.3.5",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mississippi": "^1.3.0",
|
||||
"mocha": "^2.4.5",
|
||||
"vinyl": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/gulp-sourcemaps/identity-map#readme",
|
||||
"keywords": [
|
||||
"sourcemap",
|
||||
"identity",
|
||||
"generate",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@gulp-sourcemaps/identity-map",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gulp-sourcemaps/identity-map.git"
|
||||
},
|
||||
"scripts": {
|
||||
"cover": "istanbul cover _mocha --report lcovonly",
|
||||
"coveralls": "npm run cover && istanbul-coveralls",
|
||||
"lint": "eslint . && jscs index.js test/index.js lib/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha --async-only"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
||||
21
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/LICENSE
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>
|
||||
|
||||
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.
|
||||
52
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/README.md
generated
vendored
Normal file
52
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/README.md
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
# @gulp-sourcemaps/map-sources
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Gulp plugin for mapping sources of a sourcemap.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var mapSources = require('@gulp-sourcemaps/map-sources');
|
||||
|
||||
gulp.src(...)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(mapSources(function(sourcePath, file) {
|
||||
return '../' + sourcePath;
|
||||
}))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(...))
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `mapSources(mapFn)`
|
||||
|
||||
Takes a map function as the only argument. Returns an `objectMode` Transform stream.
|
||||
|
||||
#### `mapFn(sourcePath, file)`
|
||||
|
||||
The map function is called once per value of the `sources` array of a `sourceMap` attached to each [`Vinyl`][vinyl-url] object passed through the stream. The map function is called with the `sourcePath` string from the `sources` array and the `file` object it originated from. The return value replaces the original value in the array.
|
||||
|
||||
If a `Vinyl` object doesn't have a `sourceMap` or `sourceMap.sources` property, the file is passed through the stream without having the `mapFn` called.
|
||||
|
||||
All `sources` are normalized to use `/` instead of `\\` as path separators.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[vinyl-url]: https://github.com/gulpjs/vinyl
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/@gulp-sourcemaps/map-sources.svg
|
||||
[npm-url]: https://npmjs.org/package/@gulp-sourcemaps/map-sources
|
||||
[npm-image]: http://img.shields.io/npm/v/@gulp-sourcemaps/map-sources.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulp-sourcemaps/map-sources
|
||||
[travis-image]: http://img.shields.io/travis/gulp-sourcemaps/map-sources.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/phated/map-sources
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/phated/map-sources.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulp-sourcemaps/map-sources
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulp-sourcemaps/map-sources.svg
|
||||
30
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/index.js
generated
vendored
Normal file
30
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/index.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var through = require('through2');
|
||||
var normalize = require('normalize-path');
|
||||
|
||||
function mapSources(mapFn) {
|
||||
|
||||
function transform(file, _, cb) {
|
||||
if (!file.sourceMap || !file.sourceMap.sources) {
|
||||
return cb(null, file);
|
||||
}
|
||||
|
||||
function mapper(sourcePath) {
|
||||
var result = sourcePath;
|
||||
if (typeof mapFn === 'function') {
|
||||
result = mapFn(sourcePath, file);
|
||||
}
|
||||
|
||||
return normalize(result);
|
||||
}
|
||||
|
||||
file.sourceMap.sources = file.sourceMap.sources.map(mapper);
|
||||
|
||||
cb(null, file);
|
||||
}
|
||||
|
||||
return through.obj(transform);
|
||||
}
|
||||
|
||||
module.exports = mapSources;
|
||||
85
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/package.json
generated
vendored
Normal file
85
static/js/ketcher2/node_modules/@gulp-sourcemaps/map-sources/package.json
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
{
|
||||
"_from": "@gulp-sourcemaps/map-sources@1.X",
|
||||
"_id": "@gulp-sourcemaps/map-sources@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=",
|
||||
"_location": "/@gulp-sourcemaps/map-sources",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@gulp-sourcemaps/map-sources@1.X",
|
||||
"name": "@gulp-sourcemaps/map-sources",
|
||||
"escapedName": "@gulp-sourcemaps%2fmap-sources",
|
||||
"scope": "@gulp-sourcemaps",
|
||||
"rawSpec": "1.X",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.X"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gulp-sourcemaps"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz",
|
||||
"_shasum": "890ae7c5d8c877f6d384860215ace9d7ec945bda",
|
||||
"_spec": "@gulp-sourcemaps/map-sources@1.X",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/gulp-sourcemaps",
|
||||
"author": {
|
||||
"name": "Gulp-sourcemaps Team"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/gulp-sourcemaps/map-sources/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Blaine Bublitz",
|
||||
"email": "blaine.bublitz@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"normalize-path": "^2.0.1",
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Gulp plugin for mapping sources of a sourcemap.",
|
||||
"devDependencies": {
|
||||
"eslint": "^1.7.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"expect": "^1.19.0",
|
||||
"istanbul": "^0.4.3",
|
||||
"istanbul-coveralls": "^1.0.3",
|
||||
"jscs": "^2.3.5",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mississippi": "^1.3.0",
|
||||
"mocha": "^2.4.5",
|
||||
"vinyl": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/gulp-sourcemaps/map-sources#readme",
|
||||
"keywords": [
|
||||
"sourcemap",
|
||||
"sources",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@gulp-sourcemaps/map-sources",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gulp-sourcemaps/map-sources.git"
|
||||
},
|
||||
"scripts": {
|
||||
"cover": "istanbul cover _mocha --report lcovonly",
|
||||
"coveralls": "npm run cover && istanbul-coveralls",
|
||||
"lint": "eslint . && jscs index.js test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha --async-only"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
15
static/js/ketcher2/node_modules/JSONStream/LICENSE.APACHE2
generated
vendored
Normal file
15
static/js/ketcher2/node_modules/JSONStream/LICENSE.APACHE2
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
Apache License, Version 2.0
|
||||
|
||||
Copyright (c) 2011 Dominic Tarr
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
24
static/js/ketcher2/node_modules/JSONStream/LICENSE.MIT
generated
vendored
Normal file
24
static/js/ketcher2/node_modules/JSONStream/LICENSE.MIT
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
The MIT License
|
||||
|
||||
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.
|
||||
13
static/js/ketcher2/node_modules/JSONStream/examples/all_docs.js
generated
vendored
Normal file
13
static/js/ketcher2/node_modules/JSONStream/examples/all_docs.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
var request = require('request')
|
||||
, JSONStream = require('JSONStream')
|
||||
, es = require('event-stream')
|
||||
|
||||
var parser = JSONStream.parse(['rows', true]) //emit parts that match this path (any element of the rows array)
|
||||
, req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'})
|
||||
, logger = es.mapSync(function (data) { //create a stream that logs to stderr,
|
||||
console.error(data)
|
||||
return data
|
||||
})
|
||||
|
||||
req.pipe(parser)
|
||||
parser.pipe(logger)
|
||||
253
static/js/ketcher2/node_modules/JSONStream/index.js
generated
vendored
Executable file
253
static/js/ketcher2/node_modules/JSONStream/index.js
generated
vendored
Executable file
@ -0,0 +1,253 @@
|
||||
#! /usr/bin/env node
|
||||
|
||||
'use strict'
|
||||
|
||||
var Parser = require('jsonparse')
|
||||
, through = require('through')
|
||||
|
||||
/*
|
||||
|
||||
the value of this.stack that creationix's jsonparse has is weird.
|
||||
|
||||
it makes this code ugly, but his problem is way harder that mine,
|
||||
so i'll forgive him.
|
||||
|
||||
*/
|
||||
|
||||
exports.parse = function (path, map) {
|
||||
var header, footer
|
||||
var parser = new Parser()
|
||||
var stream = through(function (chunk) {
|
||||
if('string' === typeof chunk)
|
||||
chunk = new Buffer(chunk)
|
||||
parser.write(chunk)
|
||||
},
|
||||
function (data) {
|
||||
if(data)
|
||||
stream.write(data)
|
||||
if (header)
|
||||
stream.emit('header', header)
|
||||
if (footer)
|
||||
stream.emit('footer', footer)
|
||||
stream.queue(null)
|
||||
})
|
||||
|
||||
if('string' === typeof path)
|
||||
path = path.split('.').map(function (e) {
|
||||
if (e === '$*')
|
||||
return {emitKey: true}
|
||||
else if (e === '*')
|
||||
return true
|
||||
else if (e === '') // '..'.split('.') returns an empty string
|
||||
return {recurse: true}
|
||||
else
|
||||
return e
|
||||
})
|
||||
|
||||
|
||||
var count = 0, _key
|
||||
if(!path || !path.length)
|
||||
path = null
|
||||
|
||||
parser.onValue = function (value) {
|
||||
if (!this.root)
|
||||
stream.root = value
|
||||
|
||||
if(! path) return
|
||||
|
||||
var i = 0 // iterates on path
|
||||
var j = 0 // iterates on stack
|
||||
var emitKey = false;
|
||||
var emitPath = false;
|
||||
while (i < path.length) {
|
||||
var key = path[i]
|
||||
var c
|
||||
j++
|
||||
|
||||
if (key && !key.recurse) {
|
||||
c = (j === this.stack.length) ? this : this.stack[j]
|
||||
if (!c) return
|
||||
if (! check(key, c.key)) {
|
||||
setHeaderFooter(c.key, value)
|
||||
return
|
||||
}
|
||||
emitKey = !!key.emitKey;
|
||||
emitPath = !!key.emitPath;
|
||||
i++
|
||||
} else {
|
||||
i++
|
||||
var nextKey = path[i]
|
||||
if (! nextKey) return
|
||||
while (true) {
|
||||
c = (j === this.stack.length) ? this : this.stack[j]
|
||||
if (!c) return
|
||||
if (check(nextKey, c.key)) {
|
||||
i++;
|
||||
if (!Object.isFrozen(this.stack[j]))
|
||||
this.stack[j].value = null
|
||||
break
|
||||
} else {
|
||||
setHeaderFooter(c.key, value)
|
||||
}
|
||||
j++
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// emit header
|
||||
if (header) {
|
||||
stream.emit('header', header);
|
||||
header = false;
|
||||
}
|
||||
if (j !== this.stack.length) return
|
||||
|
||||
count ++
|
||||
var actualPath = this.stack.slice(1).map(function(element) { return element.key }).concat([this.key])
|
||||
var data = this.value[this.key]
|
||||
if(null != data)
|
||||
if(null != (data = map ? map(data, actualPath) : data)) {
|
||||
if (emitKey || emitPath) {
|
||||
data = { value: data };
|
||||
if (emitKey)
|
||||
data["key"] = this.key;
|
||||
if (emitPath)
|
||||
data["path"] = actualPath;
|
||||
}
|
||||
|
||||
stream.queue(data)
|
||||
}
|
||||
delete this.value[this.key]
|
||||
for(var k in this.stack)
|
||||
if (!Object.isFrozen(this.stack[k]))
|
||||
this.stack[k].value = null
|
||||
}
|
||||
parser._onToken = parser.onToken;
|
||||
|
||||
parser.onToken = function (token, value) {
|
||||
parser._onToken(token, value);
|
||||
if (this.stack.length === 0) {
|
||||
if (stream.root) {
|
||||
if(!path)
|
||||
stream.queue(stream.root)
|
||||
count = 0;
|
||||
stream.root = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parser.onError = function (err) {
|
||||
if(err.message.indexOf("at position") > -1)
|
||||
err.message = "Invalid JSON (" + err.message + ")";
|
||||
stream.emit('error', err)
|
||||
}
|
||||
|
||||
return stream
|
||||
|
||||
function setHeaderFooter(key, value) {
|
||||
// header has not been emitted yet
|
||||
if (header !== false) {
|
||||
header = header || {}
|
||||
header[key] = value
|
||||
}
|
||||
|
||||
// footer has not been emitted yet but header has
|
||||
if (footer !== false && header === false) {
|
||||
footer = footer || {}
|
||||
footer[key] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function check (x, y) {
|
||||
if ('string' === typeof x)
|
||||
return y == x
|
||||
else if (x && 'function' === typeof x.exec)
|
||||
return x.exec(y)
|
||||
else if ('boolean' === typeof x || 'object' === typeof x)
|
||||
return x
|
||||
else if ('function' === typeof x)
|
||||
return x(y)
|
||||
return false
|
||||
}
|
||||
|
||||
exports.stringify = function (op, sep, cl, indent) {
|
||||
indent = indent || 0
|
||||
if (op === false){
|
||||
op = ''
|
||||
sep = '\n'
|
||||
cl = ''
|
||||
} else if (op == null) {
|
||||
|
||||
op = '[\n'
|
||||
sep = '\n,\n'
|
||||
cl = '\n]\n'
|
||||
|
||||
}
|
||||
|
||||
//else, what ever you like
|
||||
|
||||
var stream
|
||||
, first = true
|
||||
, anyData = false
|
||||
stream = through(function (data) {
|
||||
anyData = true
|
||||
try {
|
||||
var json = JSON.stringify(data, null, indent)
|
||||
} catch (err) {
|
||||
return stream.emit('error', err)
|
||||
}
|
||||
if(first) { first = false ; stream.queue(op + json)}
|
||||
else stream.queue(sep + json)
|
||||
},
|
||||
function (data) {
|
||||
if(!anyData)
|
||||
stream.queue(op)
|
||||
stream.queue(cl)
|
||||
stream.queue(null)
|
||||
})
|
||||
|
||||
return stream
|
||||
}
|
||||
|
||||
exports.stringifyObject = function (op, sep, cl, indent) {
|
||||
indent = indent || 0
|
||||
if (op === false){
|
||||
op = ''
|
||||
sep = '\n'
|
||||
cl = ''
|
||||
} else if (op == null) {
|
||||
|
||||
op = '{\n'
|
||||
sep = '\n,\n'
|
||||
cl = '\n}\n'
|
||||
|
||||
}
|
||||
|
||||
//else, what ever you like
|
||||
|
||||
var first = true
|
||||
var anyData = false
|
||||
var stream = through(function (data) {
|
||||
anyData = true
|
||||
var json = JSON.stringify(data[0]) + ':' + JSON.stringify(data[1], null, indent)
|
||||
if(first) { first = false ; this.queue(op + json)}
|
||||
else this.queue(sep + json)
|
||||
},
|
||||
function (data) {
|
||||
if(!anyData) this.queue(op)
|
||||
this.queue(cl)
|
||||
|
||||
this.queue(null)
|
||||
})
|
||||
|
||||
return stream
|
||||
}
|
||||
|
||||
if(!module.parent && process.title !== 'browser') {
|
||||
process.stdin
|
||||
.pipe(exports.parse(process.argv[2]))
|
||||
.pipe(exports.stringify('[', ',\n', ']\n', 2))
|
||||
.pipe(process.stdout)
|
||||
}
|
||||
|
||||
78
static/js/ketcher2/node_modules/JSONStream/package.json
generated
vendored
Normal file
78
static/js/ketcher2/node_modules/JSONStream/package.json
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
{
|
||||
"_from": "JSONStream@^1.0.3",
|
||||
"_id": "JSONStream@1.3.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=",
|
||||
"_location": "/JSONStream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "JSONStream@^1.0.3",
|
||||
"name": "JSONStream",
|
||||
"escapedName": "JSONStream",
|
||||
"rawSpec": "^1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/browser-pack",
|
||||
"/browserify",
|
||||
"/deps-sort",
|
||||
"/insert-module-globals",
|
||||
"/module-deps"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz",
|
||||
"_shasum": "707f761e01dae9e16f1bcf93703b78c70966579a",
|
||||
"_spec": "JSONStream@^1.0.3",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/browserify",
|
||||
"author": {
|
||||
"name": "Dominic Tarr",
|
||||
"email": "dominic.tarr@gmail.com",
|
||||
"url": "http://bit.ly/dominictarr"
|
||||
},
|
||||
"bin": {
|
||||
"JSONStream": "./index.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/dominictarr/JSONStream/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"jsonparse": "^1.2.0",
|
||||
"through": ">=2.2.7 <3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)",
|
||||
"devDependencies": {
|
||||
"assertions": "~2.2.2",
|
||||
"event-stream": "~0.7.0",
|
||||
"it-is": "~1",
|
||||
"render": "~0.1.1",
|
||||
"tape": "~2.12.3",
|
||||
"trees": "~0.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"homepage": "http://github.com/dominictarr/JSONStream",
|
||||
"keywords": [
|
||||
"json",
|
||||
"stream",
|
||||
"streaming",
|
||||
"parser",
|
||||
"async",
|
||||
"parsing"
|
||||
],
|
||||
"license": "(MIT OR Apache-2.0)",
|
||||
"name": "JSONStream",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/dominictarr/JSONStream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "set -e; for t in test/*.js; do echo '***' $t '***'; node $t; done"
|
||||
},
|
||||
"version": "1.3.1"
|
||||
}
|
||||
207
static/js/ketcher2/node_modules/JSONStream/readme.markdown
generated
vendored
Normal file
207
static/js/ketcher2/node_modules/JSONStream/readme.markdown
generated
vendored
Normal file
@ -0,0 +1,207 @@
|
||||
# JSONStream
|
||||
|
||||
streaming JSON.parse and stringify
|
||||
|
||||

|
||||
|
||||
## install
|
||||
```npm install JSONStream```
|
||||
|
||||
## example
|
||||
|
||||
``` js
|
||||
|
||||
var request = require('request')
|
||||
, JSONStream = require('JSONStream')
|
||||
, es = require('event-stream')
|
||||
|
||||
request({url: 'http://isaacs.couchone.com/registry/_all_docs'})
|
||||
.pipe(JSONStream.parse('rows.*'))
|
||||
.pipe(es.mapSync(function (data) {
|
||||
console.error(data)
|
||||
return data
|
||||
}))
|
||||
```
|
||||
|
||||
## JSONStream.parse(path)
|
||||
|
||||
parse stream of values that match a path
|
||||
|
||||
``` js
|
||||
JSONStream.parse('rows.*.doc')
|
||||
```
|
||||
|
||||
The `..` operator is the recursive descent operator from [JSONPath](http://goessner.net/articles/JsonPath/), which will match a child at any depth (see examples below).
|
||||
|
||||
If your keys have keys that include `.` or `*` etc, use an array instead.
|
||||
`['row', true, /^doc/]`.
|
||||
|
||||
If you use an array, `RegExp`s, booleans, and/or functions. The `..` operator is also available in array representation, using `{recurse: true}`.
|
||||
any object that matches the path will be emitted as 'data' (and `pipe`d down stream)
|
||||
|
||||
If `path` is empty or null, no 'data' events are emitted.
|
||||
|
||||
If you want to have keys emitted, you can prefix your `*` operator with `$`: `obj.$*` - in this case the data passed to the stream is an object with a `key` holding the key and a `value` property holding the data.
|
||||
|
||||
### Examples
|
||||
|
||||
query a couchdb view:
|
||||
|
||||
``` bash
|
||||
curl -sS localhost:5984/tests/_all_docs&include_docs=true
|
||||
```
|
||||
you will get something like this:
|
||||
|
||||
``` js
|
||||
{"total_rows":129,"offset":0,"rows":[
|
||||
{ "id":"change1_0.6995461115147918"
|
||||
, "key":"change1_0.6995461115147918"
|
||||
, "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"}
|
||||
, "doc":{
|
||||
"_id": "change1_0.6995461115147918"
|
||||
, "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1}
|
||||
},
|
||||
{ "id":"change2_0.6995461115147918"
|
||||
, "key":"change2_0.6995461115147918"
|
||||
, "value":{"rev":"1-13677d36b98c0c075145bb8975105153"}
|
||||
, "doc":{
|
||||
"_id":"change2_0.6995461115147918"
|
||||
, "_rev":"1-13677d36b98c0c075145bb8975105153"
|
||||
, "hello":2
|
||||
}
|
||||
},
|
||||
]}
|
||||
|
||||
```
|
||||
|
||||
we are probably most interested in the `rows.*.doc`
|
||||
|
||||
create a `Stream` that parses the documents from the feed like this:
|
||||
|
||||
``` js
|
||||
var stream = JSONStream.parse(['rows', true, 'doc']) //rows, ANYTHING, doc
|
||||
|
||||
stream.on('data', function(data) {
|
||||
console.log('received:', data);
|
||||
});
|
||||
//emits anything from _before_ the first match
|
||||
stream.on('header', function (data) {
|
||||
console.log('header:', data) // => {"total_rows":129,"offset":0}
|
||||
})
|
||||
|
||||
```
|
||||
awesome!
|
||||
|
||||
In case you wanted the contents the doc emitted:
|
||||
|
||||
``` js
|
||||
var stream = JSONStream.parse(['rows', true, 'doc', {emitKey: true}]) //rows, ANYTHING, doc, items in docs with keys
|
||||
|
||||
stream.on('data', function(data) {
|
||||
console.log('key:', data.key);
|
||||
console.log('value:', data.value);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
You can also emit the path:
|
||||
|
||||
``` js
|
||||
var stream = JSONStream.parse(['rows', true, 'doc', {emitPath: true}]) //rows, ANYTHING, doc, items in docs with keys
|
||||
|
||||
stream.on('data', function(data) {
|
||||
console.log('path:', data.path);
|
||||
console.log('value:', data.value);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### recursive patterns (..)
|
||||
|
||||
`JSONStream.parse('docs..value')`
|
||||
(or `JSONStream.parse(['docs', {recurse: true}, 'value'])` using an array)
|
||||
will emit every `value` object that is a child, grand-child, etc. of the
|
||||
`docs` object. In this example, it will match exactly 5 times at various depth
|
||||
levels, emitting 0, 1, 2, 3 and 4 as results.
|
||||
|
||||
```js
|
||||
{
|
||||
"total": 5,
|
||||
"docs": [
|
||||
{
|
||||
"key": {
|
||||
"value": 0,
|
||||
"some": "property"
|
||||
}
|
||||
},
|
||||
{"value": 1},
|
||||
{"value": 2},
|
||||
{"blbl": [{}, {"a":0, "b":1, "value":3}, 10]},
|
||||
{"value": 4}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## JSONStream.parse(pattern, map)
|
||||
|
||||
provide a function that can be used to map or filter
|
||||
the json output. `map` is passed the value at that node of the pattern,
|
||||
if `map` return non-nullish (anything but `null` or `undefined`)
|
||||
that value will be emitted in the stream. If it returns a nullish value,
|
||||
nothing will be emitted.
|
||||
|
||||
`JSONStream` also emits `'header'` and `'footer'` events,
|
||||
the `'header'` event contains anything in the output that was before
|
||||
the first match, and the `'footer'`, is anything after the last match.
|
||||
|
||||
## JSONStream.stringify(open, sep, close)
|
||||
|
||||
Create a writable stream.
|
||||
|
||||
you may pass in custom `open`, `close`, and `seperator` strings.
|
||||
But, by default, `JSONStream.stringify()` will create an array,
|
||||
(with default options `open='[\n', sep='\n,\n', close='\n]\n'`)
|
||||
|
||||
If you call `JSONStream.stringify(false)`
|
||||
the elements will only be seperated by a newline.
|
||||
|
||||
If you only write one item this will be valid JSON.
|
||||
|
||||
If you write many items,
|
||||
you can use a `RegExp` to split it into valid chunks.
|
||||
|
||||
## JSONStream.stringifyObject(open, sep, close)
|
||||
|
||||
Very much like `JSONStream.stringify`,
|
||||
but creates a writable stream for objects instead of arrays.
|
||||
|
||||
Accordingly, `open='{\n', sep='\n,\n', close='\n}\n'`.
|
||||
|
||||
When you `.write()` to the stream you must supply an array with `[ key, data ]`
|
||||
as the first argument.
|
||||
|
||||
## unix tool
|
||||
|
||||
query npm to see all the modules that browserify has ever depended on.
|
||||
|
||||
``` bash
|
||||
curl https://registry.npmjs.org/browserify | JSONStream 'versions.*.dependencies'
|
||||
```
|
||||
|
||||
## numbers
|
||||
|
||||
numbers will be emitted as numbers.
|
||||
huge numbers that cannot be represented in memory as javascript numbers will be emitted as strings.
|
||||
cf https://github.com/creationix/jsonparse/commit/044b268f01c4b8f97fb936fc85d3bcfba179e5bb for details.
|
||||
|
||||
## Acknowlegements
|
||||
|
||||
this module depends on https://github.com/creationix/jsonparse
|
||||
by Tim Caswell
|
||||
and also thanks to Florent Jaby for teaching me about parsing with:
|
||||
https://github.com/Floby/node-json-streams
|
||||
|
||||
## license
|
||||
|
||||
Dual-licensed under the MIT License or the Apache License, version 2.0
|
||||
|
||||
41
static/js/ketcher2/node_modules/JSONStream/test/bool.js
generated
vendored
Normal file
41
static/js/ketcher2/node_modules/JSONStream/test/bool.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','all_npm.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is').style('colour')
|
||||
|
||||
function randomObj () {
|
||||
return (
|
||||
Math.random () < 0.4
|
||||
? {hello: 'eonuhckmqjk',
|
||||
whatever: 236515,
|
||||
lies: true,
|
||||
nothing: [null],
|
||||
// stuff: [Math.random(),Math.random(),Math.random()]
|
||||
}
|
||||
: ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]]
|
||||
)
|
||||
}
|
||||
|
||||
var expected = []
|
||||
, stringify = JSONStream.stringify()
|
||||
, es = require('event-stream')
|
||||
, stringified = ''
|
||||
, called = 0
|
||||
, count = 10
|
||||
, ended = false
|
||||
|
||||
while (count --)
|
||||
expected.push(randomObj())
|
||||
|
||||
es.connect(
|
||||
es.readArray(expected),
|
||||
stringify,
|
||||
JSONStream.parse([true]),
|
||||
es.writeArray(function (err, lines) {
|
||||
|
||||
it(lines).has(expected)
|
||||
console.error('PASSED')
|
||||
})
|
||||
)
|
||||
18
static/js/ketcher2/node_modules/JSONStream/test/browser.js
generated
vendored
Normal file
18
static/js/ketcher2/node_modules/JSONStream/test/browser.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
var test = require('tape')
|
||||
var JSONStream = require('../')
|
||||
var testData = '{"rows":[{"hello":"world"}, {"foo": "bar"}]}'
|
||||
|
||||
test('basic parsing', function (t) {
|
||||
t.plan(2)
|
||||
var parsed = JSONStream.parse("rows.*")
|
||||
var parsedKeys = {}
|
||||
parsed.on('data', function(match) {
|
||||
parsedKeys[Object.keys(match)[0]] = true
|
||||
})
|
||||
parsed.on('end', function() {
|
||||
t.equal(!!parsedKeys['hello'], true)
|
||||
t.equal(!!parsedKeys['foo'], true)
|
||||
})
|
||||
parsed.write(testData)
|
||||
parsed.end()
|
||||
})
|
||||
27
static/js/ketcher2/node_modules/JSONStream/test/destroy_missing.js
generated
vendored
Normal file
27
static/js/ketcher2/node_modules/JSONStream/test/destroy_missing.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
var fs = require ('fs');
|
||||
var net = require('net');
|
||||
var join = require('path').join;
|
||||
var file = join(__dirname, 'fixtures','all_npm.json');
|
||||
var JSONStream = require('../');
|
||||
|
||||
|
||||
var server = net.createServer(function(client) {
|
||||
var parser = JSONStream.parse([]);
|
||||
parser.on('end', function() {
|
||||
console.log('close')
|
||||
console.error('PASSED');
|
||||
server.close();
|
||||
});
|
||||
client.pipe(parser);
|
||||
var n = 4
|
||||
client.on('data', function () {
|
||||
if(--n) return
|
||||
client.end();
|
||||
})
|
||||
});
|
||||
server.listen(9999);
|
||||
|
||||
|
||||
var client = net.connect({ port : 9999 }, function() {
|
||||
fs.createReadStream(file).pipe(client).on('data', console.log) //.resume();
|
||||
});
|
||||
29
static/js/ketcher2/node_modules/JSONStream/test/disabled/doubledot1.js
generated
vendored
Normal file
29
static/js/ketcher2/node_modules/JSONStream/test/disabled/doubledot1.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','all_npm.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is')
|
||||
|
||||
var expected = JSON.parse(fs.readFileSync(file))
|
||||
, parser = JSONStream.parse('rows..rev')
|
||||
, called = 0
|
||||
, ended = false
|
||||
, parsed = []
|
||||
|
||||
fs.createReadStream(file).pipe(parser)
|
||||
|
||||
parser.on('data', function (data) {
|
||||
called ++
|
||||
parsed.push(data)
|
||||
})
|
||||
|
||||
parser.on('end', function () {
|
||||
ended = true
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
it(called).equal(expected.rows.length)
|
||||
for (var i = 0 ; i < expected.rows.length ; i++)
|
||||
it(parsed[i]).deepEqual(expected.rows[i].value.rev)
|
||||
console.error('PASSED')
|
||||
})
|
||||
29
static/js/ketcher2/node_modules/JSONStream/test/disabled/doubledot2.js
generated
vendored
Normal file
29
static/js/ketcher2/node_modules/JSONStream/test/disabled/doubledot2.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','depth.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is')
|
||||
|
||||
var expected = JSON.parse(fs.readFileSync(file))
|
||||
, parser = JSONStream.parse(['docs', {recurse: true}, 'value'])
|
||||
, called = 0
|
||||
, ended = false
|
||||
, parsed = []
|
||||
|
||||
fs.createReadStream(file).pipe(parser)
|
||||
|
||||
parser.on('data', function (data) {
|
||||
called ++
|
||||
parsed.push(data)
|
||||
})
|
||||
|
||||
parser.on('end', function () {
|
||||
ended = true
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
it(called).equal(5)
|
||||
for (var i = 0 ; i < 5 ; i++)
|
||||
it(parsed[i]).deepEqual(i)
|
||||
console.error('PASSED')
|
||||
})
|
||||
44
static/js/ketcher2/node_modules/JSONStream/test/empty.js
generated
vendored
Normal file
44
static/js/ketcher2/node_modules/JSONStream/test/empty.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
var JSONStream = require('../')
|
||||
, stream = require('stream')
|
||||
, it = require('it-is')
|
||||
|
||||
var output = [ [], [] ]
|
||||
|
||||
var parser1 = JSONStream.parse(['docs', /./])
|
||||
parser1.on('data', function(data) {
|
||||
output[0].push(data)
|
||||
})
|
||||
|
||||
var parser2 = JSONStream.parse(['docs', /./])
|
||||
parser2.on('data', function(data) {
|
||||
output[1].push(data)
|
||||
})
|
||||
|
||||
var pending = 2
|
||||
function onend () {
|
||||
if (--pending > 0) return
|
||||
it(output).deepEqual([
|
||||
[], [{hello: 'world'}]
|
||||
])
|
||||
console.error('PASSED')
|
||||
}
|
||||
parser1.on('end', onend)
|
||||
parser2.on('end', onend)
|
||||
|
||||
function makeReadableStream() {
|
||||
var readStream = new stream.Stream()
|
||||
readStream.readable = true
|
||||
readStream.write = function (data) { this.emit('data', data) }
|
||||
readStream.end = function (data) { this.emit('end') }
|
||||
return readStream
|
||||
}
|
||||
|
||||
var emptyArray = makeReadableStream()
|
||||
emptyArray.pipe(parser1)
|
||||
emptyArray.write('{"docs":[]}')
|
||||
emptyArray.end()
|
||||
|
||||
var objectArray = makeReadableStream()
|
||||
objectArray.pipe(parser2)
|
||||
objectArray.write('{"docs":[{"hello":"world"}]}')
|
||||
objectArray.end()
|
||||
45
static/js/ketcher2/node_modules/JSONStream/test/error_contents.js
generated
vendored
Normal file
45
static/js/ketcher2/node_modules/JSONStream/test/error_contents.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','error.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is')
|
||||
|
||||
var expected = JSON.parse(fs.readFileSync(file))
|
||||
, parser = JSONStream.parse(['rows'])
|
||||
, called = 0
|
||||
, headerCalled = 0
|
||||
, footerCalled = 0
|
||||
, ended = false
|
||||
, parsed = []
|
||||
|
||||
fs.createReadStream(file).pipe(parser)
|
||||
|
||||
parser.on('header', function (data) {
|
||||
headerCalled ++
|
||||
it(data).deepEqual({
|
||||
error: 'error_code',
|
||||
message: 'this is an error message'
|
||||
})
|
||||
})
|
||||
|
||||
parser.on('footer', function (data) {
|
||||
footerCalled ++
|
||||
})
|
||||
|
||||
parser.on('data', function (data) {
|
||||
called ++
|
||||
parsed.push(data)
|
||||
})
|
||||
|
||||
parser.on('end', function () {
|
||||
ended = true
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
it(called).equal(0)
|
||||
it(headerCalled).equal(1)
|
||||
it(footerCalled).equal(0)
|
||||
console.error('PASSED')
|
||||
})
|
||||
4030
static/js/ketcher2/node_modules/JSONStream/test/fixtures/all_npm.json
generated
vendored
Normal file
4030
static/js/ketcher2/node_modules/JSONStream/test/fixtures/all_npm.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18
static/js/ketcher2/node_modules/JSONStream/test/fixtures/couch_sample.json
generated
vendored
Normal file
18
static/js/ketcher2/node_modules/JSONStream/test/fixtures/couch_sample.json
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
{"total_rows":129,"offset":0,"rows":[
|
||||
{ "id":"change1_0.6995461115147918"
|
||||
, "key":"change1_0.6995461115147918"
|
||||
, "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"}
|
||||
, "doc":{
|
||||
"_id": "change1_0.6995461115147918"
|
||||
, "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1}
|
||||
},
|
||||
{ "id":"change2_0.6995461115147918"
|
||||
, "key":"change2_0.6995461115147918"
|
||||
, "value":{"rev":"1-13677d36b98c0c075145bb8975105153"}
|
||||
, "doc":{
|
||||
"_id":"change2_0.6995461115147918"
|
||||
, "_rev":"1-13677d36b98c0c075145bb8975105153"
|
||||
, "hello":2
|
||||
}
|
||||
},
|
||||
]}
|
||||
15
static/js/ketcher2/node_modules/JSONStream/test/fixtures/depth.json
generated
vendored
Normal file
15
static/js/ketcher2/node_modules/JSONStream/test/fixtures/depth.json
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"total": 5,
|
||||
"docs": [
|
||||
{
|
||||
"key": {
|
||||
"value": 0,
|
||||
"some": "property"
|
||||
}
|
||||
},
|
||||
{"value": 1},
|
||||
{"value": 2},
|
||||
{"blbl": [{}, {"a":0, "b":1, "value":3}, 10]},
|
||||
{"value": 4}
|
||||
]
|
||||
}
|
||||
1
static/js/ketcher2/node_modules/JSONStream/test/fixtures/error.json
generated
vendored
Normal file
1
static/js/ketcher2/node_modules/JSONStream/test/fixtures/error.json
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"error": "error_code", "message": "this is an error message"}
|
||||
19
static/js/ketcher2/node_modules/JSONStream/test/fixtures/header_footer.json
generated
vendored
Normal file
19
static/js/ketcher2/node_modules/JSONStream/test/fixtures/header_footer.json
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{"total_rows":129,"offset":0,"rows":[
|
||||
{ "id":"change1_0.6995461115147918"
|
||||
, "key":"change1_0.6995461115147918"
|
||||
, "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"}
|
||||
, "doc":{
|
||||
"_id": "change1_0.6995461115147918"
|
||||
, "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1}
|
||||
},
|
||||
{ "id":"change2_0.6995461115147918"
|
||||
, "key":"change2_0.6995461115147918"
|
||||
, "value":{"rev":"1-13677d36b98c0c075145bb8975105153"}
|
||||
, "doc":{
|
||||
"_id":"change2_0.6995461115147918"
|
||||
, "_rev":"1-13677d36b98c0c075145bb8975105153"
|
||||
, "hello":2
|
||||
}
|
||||
}
|
||||
],
|
||||
"foo": {"bar": "baz"}}
|
||||
39
static/js/ketcher2/node_modules/JSONStream/test/fn.js
generated
vendored
Normal file
39
static/js/ketcher2/node_modules/JSONStream/test/fn.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','all_npm.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is')
|
||||
|
||||
function fn (s) {
|
||||
return !isNaN(parseInt(s, 10))
|
||||
}
|
||||
|
||||
var expected = JSON.parse(fs.readFileSync(file))
|
||||
, parser = JSONStream.parse(['rows', fn])
|
||||
, called = 0
|
||||
, ended = false
|
||||
, parsed = []
|
||||
|
||||
fs.createReadStream(file).pipe(parser)
|
||||
|
||||
parser.on('data', function (data) {
|
||||
called ++
|
||||
it.has({
|
||||
id: it.typeof('string'),
|
||||
value: {rev: it.typeof('string')},
|
||||
key:it.typeof('string')
|
||||
})
|
||||
parsed.push(data)
|
||||
})
|
||||
|
||||
parser.on('end', function () {
|
||||
ended = true
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
it(called).equal(expected.rows.length)
|
||||
it(parsed).deepEqual(expected.rows)
|
||||
console.error('PASSED')
|
||||
})
|
||||
135
static/js/ketcher2/node_modules/JSONStream/test/gen.js
generated
vendored
Normal file
135
static/js/ketcher2/node_modules/JSONStream/test/gen.js
generated
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
return // dont run this test for now since tape is weird and broken on 0.10
|
||||
|
||||
var fs = require('fs')
|
||||
var JSONStream = require('../')
|
||||
var file = process.argv[2] || '/tmp/JSONStream-test-large.json'
|
||||
var size = Number(process.argv[3] || 100000)
|
||||
var tape = require('tape')
|
||||
// if (process.title !== 'browser') {
|
||||
tape('out of mem', function (t) {
|
||||
t.plan(1)
|
||||
//////////////////////////////////////////////////////
|
||||
// Produces a random number between arg1 and arg2
|
||||
//////////////////////////////////////////////////////
|
||||
var randomNumber = function (min, max) {
|
||||
var number = Math.floor(Math.random() * (max - min + 1) + min);
|
||||
return number;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// Produces a random string of a length between arg1 and arg2
|
||||
//////////////////////////////////////////////////////
|
||||
var randomString = function (min, max) {
|
||||
|
||||
// add several spaces to increase chanses of creating 'words'
|
||||
var chars = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
var result = '';
|
||||
|
||||
var randomLength = randomNumber(min, max);
|
||||
|
||||
for (var i = randomLength; i > 0; --i) {
|
||||
result += chars[Math.round(Math.random() * (chars.length - 1))];
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// Produces a random JSON document, as a string
|
||||
//////////////////////////////////////////////////////
|
||||
var randomJsonDoc = function () {
|
||||
|
||||
var doc = {
|
||||
"CrashOccurenceID": randomNumber(10000, 50000),
|
||||
"CrashID": randomNumber(1000, 10000),
|
||||
"SiteName": randomString(10, 25),
|
||||
"MachineName": randomString(10, 25),
|
||||
"Date": randomString(26, 26),
|
||||
"ProcessDuration": randomString(18, 18),
|
||||
"ThreadIdentityName": null,
|
||||
"WindowsIdentityName": randomString(15, 40),
|
||||
"OperatingSystemName": randomString(35, 65),
|
||||
"DetailedExceptionInformation": randomString(100, 800)
|
||||
};
|
||||
|
||||
doc = JSON.stringify(doc);
|
||||
doc = doc.replace(/\,/g, ',\n'); // add new lines after each attribute
|
||||
return doc;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// generates test data
|
||||
//////////////////////////////////////////////////////
|
||||
var generateTestData = function (cb) {
|
||||
|
||||
console.log('generating large data file...');
|
||||
|
||||
var stream = fs.createWriteStream(file, {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
|
||||
var i = 0;
|
||||
var max = size;
|
||||
var writing = false
|
||||
var split = ',\n';
|
||||
var doc = randomJsonDoc();
|
||||
stream.write('[');
|
||||
|
||||
function write () {
|
||||
if(writing) return
|
||||
writing = true
|
||||
while(++i < max) {
|
||||
if(Math.random() < 0.001)
|
||||
console.log('generate..', i + ' / ' + size)
|
||||
if(!stream.write(doc + split)) {
|
||||
writing = false
|
||||
return stream.once('drain', write)
|
||||
}
|
||||
}
|
||||
stream.write(doc + ']')
|
||||
stream.end();
|
||||
console.log('END')
|
||||
}
|
||||
write()
|
||||
stream.on('close', cb)
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// Shows that parsing 100000 instances using JSONStream fails
|
||||
//
|
||||
// After several seconds, you will get this crash
|
||||
// FATAL ERROR: JS Allocation failed - process out of memory
|
||||
//////////////////////////////////////////////////////
|
||||
var testJSONStreamParse_causesOutOfMem = function (done) {
|
||||
var items = 0
|
||||
console.log('parsing data files using JSONStream...');
|
||||
|
||||
var parser = JSONStream.parse([true]);
|
||||
var stream = fs.createReadStream(file);
|
||||
stream.pipe(parser);
|
||||
|
||||
parser.on('data', function (data) {
|
||||
items++
|
||||
if(Math.random() < 0.01) console.log(items, '...')
|
||||
});
|
||||
|
||||
parser.on('end', function () {
|
||||
t.equal(items, size)
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// main
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
fs.stat(file, function (err, stat) {
|
||||
console.log(stat)
|
||||
if(err)
|
||||
generateTestData(testJSONStreamParse_causesOutOfMem);
|
||||
else
|
||||
testJSONStreamParse_causesOutOfMem()
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
// }
|
||||
55
static/js/ketcher2/node_modules/JSONStream/test/header_footer.js
generated
vendored
Normal file
55
static/js/ketcher2/node_modules/JSONStream/test/header_footer.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','header_footer.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is')
|
||||
|
||||
var expected = JSON.parse(fs.readFileSync(file))
|
||||
, parser = JSONStream.parse(['rows', /\d+/ /*, 'value'*/])
|
||||
, called = 0
|
||||
, headerCalled = 0
|
||||
, footerCalled = 0
|
||||
, ended = false
|
||||
, parsed = []
|
||||
|
||||
fs.createReadStream(file).pipe(parser)
|
||||
|
||||
parser.on('header', function (data) {
|
||||
headerCalled ++
|
||||
it(data).deepEqual({
|
||||
total_rows: 129,
|
||||
offset: 0
|
||||
})
|
||||
})
|
||||
|
||||
parser.on('footer', function (data) {
|
||||
footerCalled ++
|
||||
it(data).deepEqual({
|
||||
foo: { bar: 'baz' }
|
||||
})
|
||||
})
|
||||
|
||||
parser.on('data', function (data) {
|
||||
called ++
|
||||
it.has({
|
||||
id: it.typeof('string'),
|
||||
value: {rev: it.typeof('string')},
|
||||
key:it.typeof('string')
|
||||
})
|
||||
it(headerCalled).equal(1)
|
||||
parsed.push(data)
|
||||
})
|
||||
|
||||
parser.on('end', function () {
|
||||
ended = true
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
it(called).equal(expected.rows.length)
|
||||
it(headerCalled).equal(1)
|
||||
it(footerCalled).equal(1)
|
||||
it(parsed).deepEqual(expected.rows)
|
||||
console.error('PASSED')
|
||||
})
|
||||
34
static/js/ketcher2/node_modules/JSONStream/test/issues.js
generated
vendored
Normal file
34
static/js/ketcher2/node_modules/JSONStream/test/issues.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
var JSONStream = require('../');
|
||||
var test = require('tape')
|
||||
|
||||
test('#66', function (t) {
|
||||
var error = 0;
|
||||
var stream = JSONStream
|
||||
.parse()
|
||||
.on('error', function (err) {
|
||||
t.ok(err);
|
||||
error++;
|
||||
})
|
||||
.on('end', function () {
|
||||
t.ok(error === 1);
|
||||
t.end();
|
||||
});
|
||||
|
||||
stream.write('["foo":bar[');
|
||||
stream.end();
|
||||
|
||||
});
|
||||
|
||||
test('#81 - failure to parse nested objects', function (t) {
|
||||
var stream = JSONStream
|
||||
.parse('.bar.foo')
|
||||
.on('error', function (err) {
|
||||
t.error(err);
|
||||
})
|
||||
.on('end', function () {
|
||||
t.end();
|
||||
});
|
||||
|
||||
stream.write('{"bar":{"foo":"baz"}}');
|
||||
stream.end();
|
||||
});
|
||||
105
static/js/ketcher2/node_modules/JSONStream/test/keys.js
generated
vendored
Normal file
105
static/js/ketcher2/node_modules/JSONStream/test/keys.js
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
var test = require('tape');
|
||||
var fs = require ('fs');
|
||||
var join = require('path').join;
|
||||
var couch_sample_file = join(__dirname, 'fixtures','couch_sample.json');
|
||||
var JSONStream = require('../');
|
||||
|
||||
var fixture = {
|
||||
obj: {
|
||||
one: 1,
|
||||
two: 2,
|
||||
three: 3
|
||||
}
|
||||
};
|
||||
|
||||
function assertFixtureKeys(stream, t) {
|
||||
var keys = [];
|
||||
var values = [];
|
||||
stream.on('data', function(data) {
|
||||
keys.push(data.key);
|
||||
values.push(data.value);
|
||||
});
|
||||
|
||||
stream.on('end', function() {
|
||||
t.deepEqual(keys, ['one', 'two', 'three']);
|
||||
t.deepEqual(values, [1,2,3]);
|
||||
t.end();
|
||||
});
|
||||
stream.write(JSON.stringify(fixture));
|
||||
stream.end();
|
||||
}
|
||||
|
||||
test('keys via string', function(t) {
|
||||
var stream = JSONStream.parse('obj.$*');
|
||||
assertFixtureKeys(stream, t);
|
||||
});
|
||||
|
||||
test('keys via array', function(t) {
|
||||
var stream = JSONStream.parse(['obj',{emitKey: true}]);
|
||||
assertFixtureKeys(stream, t);
|
||||
});
|
||||
|
||||
test('path via array', function(t) {
|
||||
var stream = JSONStream.parse(['obj',{emitPath: true}]);
|
||||
|
||||
var paths = [];
|
||||
var values = [];
|
||||
stream.on('data', function(data) {
|
||||
console.log(JSON.stringify(data));
|
||||
paths.push(data.path);
|
||||
values.push(data.value);
|
||||
});
|
||||
|
||||
stream.on('end', function() {
|
||||
t.deepEqual(paths, [['obj', 'one'], ['obj', 'two'], ['obj', 'three']]);
|
||||
t.deepEqual(values, [1,2,3]);
|
||||
t.end();
|
||||
});
|
||||
stream.write(JSON.stringify(fixture));
|
||||
stream.end();
|
||||
});
|
||||
|
||||
test('advanced keys', function(t) {
|
||||
var advanced = fs.readFileSync(couch_sample_file);
|
||||
var stream = JSONStream.parse(['rows', true, 'doc', {emitKey: true}]);
|
||||
|
||||
var keys = [];
|
||||
var values = [];
|
||||
stream.on('data', function(data) {
|
||||
keys.push(data.key);
|
||||
values.push(data.value);
|
||||
});
|
||||
|
||||
stream.on('end', function() {
|
||||
t.deepEqual(keys, [
|
||||
'_id', '_rev', 'hello',
|
||||
'_id', '_rev', 'hello'
|
||||
]);
|
||||
t.deepEqual(values, [
|
||||
"change1_0.6995461115147918", "1-e240bae28c7bb3667f02760f6398d508", 1,
|
||||
"change2_0.6995461115147918", "1-13677d36b98c0c075145bb8975105153", 2
|
||||
]);
|
||||
t.end();
|
||||
});
|
||||
stream.write(advanced);
|
||||
stream.end();
|
||||
});
|
||||
|
||||
test('parent keys', function(t) {
|
||||
var stream = JSONStream.parse('$*');
|
||||
var d = null;
|
||||
stream.on('data', function(data) {
|
||||
if(d) t.fail('should only be called once');
|
||||
d = data;
|
||||
});
|
||||
|
||||
stream.on('end', function() {
|
||||
t.deepEqual(d,{
|
||||
key: 'obj',
|
||||
value: fixture.obj
|
||||
});
|
||||
t.end();
|
||||
});
|
||||
stream.write(JSON.stringify(fixture));
|
||||
stream.end();
|
||||
})
|
||||
40
static/js/ketcher2/node_modules/JSONStream/test/map.js
generated
vendored
Normal file
40
static/js/ketcher2/node_modules/JSONStream/test/map.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
var test = require('tape')
|
||||
|
||||
var JSONStream = require('../')
|
||||
|
||||
test('map function', function (t) {
|
||||
|
||||
var actual = []
|
||||
|
||||
stream = JSONStream.parse([true], function (e) { return e*10 })
|
||||
stream.on('data', function (v) { actual.push(v)})
|
||||
stream.on('end', function () {
|
||||
t.deepEqual(actual, [10,20,30,40,50,60])
|
||||
t.end()
|
||||
|
||||
})
|
||||
|
||||
stream.write(JSON.stringify([1,2,3,4,5,6], null, 2))
|
||||
stream.end()
|
||||
|
||||
})
|
||||
|
||||
test('filter function', function (t) {
|
||||
|
||||
var actual = []
|
||||
|
||||
stream = JSONStream
|
||||
.parse([true], function (e) { return e%2 ? e : null})
|
||||
.on('data', function (v) { actual.push(v)})
|
||||
.on('end', function () {
|
||||
t.deepEqual(actual, [1,3,5])
|
||||
t.end()
|
||||
|
||||
})
|
||||
|
||||
stream.write(JSON.stringify([1,2,3,4,5,6], null, 2))
|
||||
stream.end()
|
||||
|
||||
})
|
||||
|
||||
36
static/js/ketcher2/node_modules/JSONStream/test/multiple_objects.js
generated
vendored
Normal file
36
static/js/ketcher2/node_modules/JSONStream/test/multiple_objects.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
var fs = require ('fs');
|
||||
var net = require('net');
|
||||
var join = require('path').join;
|
||||
var file = join(__dirname, 'fixtures','all_npm.json');
|
||||
var it = require('it-is');
|
||||
var JSONStream = require('../');
|
||||
|
||||
var str = fs.readFileSync(file);
|
||||
|
||||
var datas = {}
|
||||
|
||||
var server = net.createServer(function(client) {
|
||||
var data_calls = 0;
|
||||
var parser = JSONStream.parse(['rows', true, 'key']);
|
||||
parser.on('data', function(data) {
|
||||
++ data_calls;
|
||||
datas[data] = (datas[data] || 0) + 1
|
||||
it(data).typeof('string')
|
||||
});
|
||||
|
||||
parser.on('end', function() {
|
||||
console.log('END')
|
||||
var min = Infinity
|
||||
for (var d in datas)
|
||||
min = min > datas[d] ? datas[d] : min
|
||||
it(min).equal(3);
|
||||
server.close();
|
||||
});
|
||||
client.pipe(parser);
|
||||
});
|
||||
server.listen(9999);
|
||||
|
||||
var client = net.connect({ port : 9999 }, function() {
|
||||
var msgs = str + ' ' + str + '\n\n' + str
|
||||
client.end(msgs);
|
||||
});
|
||||
29
static/js/ketcher2/node_modules/JSONStream/test/multiple_objects_error.js
generated
vendored
Normal file
29
static/js/ketcher2/node_modules/JSONStream/test/multiple_objects_error.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
var fs = require ('fs');
|
||||
var net = require('net');
|
||||
var join = require('path').join;
|
||||
var file = join(__dirname, 'fixtures','all_npm.json');
|
||||
var it = require('it-is');
|
||||
var JSONStream = require('../');
|
||||
|
||||
var str = fs.readFileSync(file);
|
||||
|
||||
var server = net.createServer(function(client) {
|
||||
var data_calls = 0;
|
||||
var parser = JSONStream.parse();
|
||||
parser.on('error', function(err) {
|
||||
console.log(err);
|
||||
server.close();
|
||||
});
|
||||
|
||||
parser.on('end', function() {
|
||||
console.log('END');
|
||||
server.close();
|
||||
});
|
||||
client.pipe(parser);
|
||||
});
|
||||
server.listen(9999);
|
||||
|
||||
var client = net.connect({ port : 9999 }, function() {
|
||||
var msgs = str + '}';
|
||||
client.end(msgs);
|
||||
});
|
||||
28
static/js/ketcher2/node_modules/JSONStream/test/null.js
generated
vendored
Normal file
28
static/js/ketcher2/node_modules/JSONStream/test/null.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
var JSONStream = require('../')
|
||||
|
||||
var data = [
|
||||
{ID: 1, optional: null},
|
||||
{ID: 2, optional: null},
|
||||
{ID: 3, optional: 20},
|
||||
{ID: 4, optional: null},
|
||||
{ID: 5, optional: 'hello'},
|
||||
{ID: 6, optional: null}
|
||||
]
|
||||
|
||||
|
||||
var test = require('tape')
|
||||
|
||||
test ('null properties', function (t) {
|
||||
var actual = []
|
||||
var stream =
|
||||
|
||||
JSONStream.parse('*.optional')
|
||||
.on('data', function (v) { actual.push(v) })
|
||||
.on('end', function () {
|
||||
t.deepEqual(actual, [20, 'hello'])
|
||||
t.end()
|
||||
})
|
||||
|
||||
stream.write(JSON.stringify(data, null, 2))
|
||||
stream.end()
|
||||
})
|
||||
25
static/js/ketcher2/node_modules/JSONStream/test/parsejson.js
generated
vendored
Normal file
25
static/js/ketcher2/node_modules/JSONStream/test/parsejson.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
/*
|
||||
sometimes jsonparse changes numbers slightly.
|
||||
*/
|
||||
|
||||
var r = Math.random()
|
||||
, Parser = require('jsonparse')
|
||||
, p = new Parser()
|
||||
, assert = require('assert')
|
||||
, times = 20
|
||||
while (times --) {
|
||||
|
||||
assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON')
|
||||
|
||||
p.onValue = function (v) {
|
||||
console.error('parsed', v)
|
||||
assert.equal(v,r)
|
||||
}
|
||||
console.error('correct', r)
|
||||
p.write (new Buffer(JSON.stringify([r])))
|
||||
|
||||
|
||||
|
||||
}
|
||||
41
static/js/ketcher2/node_modules/JSONStream/test/stringify.js
generated
vendored
Normal file
41
static/js/ketcher2/node_modules/JSONStream/test/stringify.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','all_npm.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is').style('colour')
|
||||
|
||||
function randomObj () {
|
||||
return (
|
||||
Math.random () < 0.4
|
||||
? {hello: 'eonuhckmqjk',
|
||||
whatever: 236515,
|
||||
lies: true,
|
||||
nothing: [null],
|
||||
stuff: [Math.random(),Math.random(),Math.random()]
|
||||
}
|
||||
: ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]]
|
||||
)
|
||||
}
|
||||
|
||||
var expected = []
|
||||
, stringify = JSONStream.stringify()
|
||||
, es = require('event-stream')
|
||||
, stringified = ''
|
||||
, called = 0
|
||||
, count = 10
|
||||
, ended = false
|
||||
|
||||
while (count --)
|
||||
expected.push(randomObj())
|
||||
|
||||
es.connect(
|
||||
es.readArray(expected),
|
||||
stringify,
|
||||
//JSONStream.parse([/./]),
|
||||
es.writeArray(function (err, lines) {
|
||||
|
||||
it(JSON.parse(lines.join(''))).deepEqual(expected)
|
||||
console.error('PASSED')
|
||||
})
|
||||
)
|
||||
47
static/js/ketcher2/node_modules/JSONStream/test/stringify_object.js
generated
vendored
Normal file
47
static/js/ketcher2/node_modules/JSONStream/test/stringify_object.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','all_npm.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is').style('colour')
|
||||
, es = require('event-stream')
|
||||
, pending = 10
|
||||
, passed = true
|
||||
|
||||
function randomObj () {
|
||||
return (
|
||||
Math.random () < 0.4
|
||||
? {hello: 'eonuhckmqjk',
|
||||
whatever: 236515,
|
||||
lies: true,
|
||||
nothing: [null],
|
||||
stuff: [Math.random(),Math.random(),Math.random()]
|
||||
}
|
||||
: ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]]
|
||||
)
|
||||
}
|
||||
|
||||
for (var ix = 0; ix < pending; ix++) (function (count) {
|
||||
var expected = {}
|
||||
, stringify = JSONStream.stringifyObject()
|
||||
|
||||
es.connect(
|
||||
stringify,
|
||||
es.writeArray(function (err, lines) {
|
||||
it(JSON.parse(lines.join(''))).deepEqual(expected)
|
||||
if (--pending === 0) {
|
||||
console.error('PASSED')
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
while (count --) {
|
||||
var key = Math.random().toString(16).slice(2)
|
||||
expected[key] = randomObj()
|
||||
stringify.write([ key, expected[key] ])
|
||||
}
|
||||
|
||||
process.nextTick(function () {
|
||||
stringify.end()
|
||||
})
|
||||
})(ix)
|
||||
35
static/js/ketcher2/node_modules/JSONStream/test/test.js
generated
vendored
Normal file
35
static/js/ketcher2/node_modules/JSONStream/test/test.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','all_npm.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is')
|
||||
|
||||
var expected = JSON.parse(fs.readFileSync(file))
|
||||
, parser = JSONStream.parse(['rows', /\d+/ /*, 'value'*/])
|
||||
, called = 0
|
||||
, ended = false
|
||||
, parsed = []
|
||||
|
||||
fs.createReadStream(file).pipe(parser)
|
||||
|
||||
parser.on('data', function (data) {
|
||||
called ++
|
||||
it.has({
|
||||
id: it.typeof('string'),
|
||||
value: {rev: it.typeof('string')},
|
||||
key:it.typeof('string')
|
||||
})
|
||||
parsed.push(data)
|
||||
})
|
||||
|
||||
parser.on('end', function () {
|
||||
ended = true
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
it(called).equal(expected.rows.length)
|
||||
it(parsed).deepEqual(expected.rows)
|
||||
console.error('PASSED')
|
||||
})
|
||||
29
static/js/ketcher2/node_modules/JSONStream/test/test2.js
generated
vendored
Normal file
29
static/js/ketcher2/node_modules/JSONStream/test/test2.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, '..','package.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is')
|
||||
|
||||
var expected = JSON.parse(fs.readFileSync(file))
|
||||
, parser = JSONStream.parse([])
|
||||
, called = 0
|
||||
, ended = false
|
||||
, parsed = []
|
||||
|
||||
fs.createReadStream(file).pipe(parser)
|
||||
|
||||
parser.on('data', function (data) {
|
||||
called ++
|
||||
it(data).deepEqual(expected)
|
||||
})
|
||||
|
||||
parser.on('end', function () {
|
||||
ended = true
|
||||
})
|
||||
|
||||
process.on('exit', function () {
|
||||
it(called).equal(1)
|
||||
console.error('PASSED')
|
||||
})
|
||||
41
static/js/ketcher2/node_modules/JSONStream/test/two-ways.js
generated
vendored
Normal file
41
static/js/ketcher2/node_modules/JSONStream/test/two-ways.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
var fs = require ('fs')
|
||||
, join = require('path').join
|
||||
, file = join(__dirname, 'fixtures','all_npm.json')
|
||||
, JSONStream = require('../')
|
||||
, it = require('it-is').style('colour')
|
||||
|
||||
function randomObj () {
|
||||
return (
|
||||
Math.random () < 0.4
|
||||
? {hello: 'eonuhckmqjk',
|
||||
whatever: 236515,
|
||||
lies: true,
|
||||
nothing: [null],
|
||||
// stuff: [Math.random(),Math.random(),Math.random()]
|
||||
}
|
||||
: ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]]
|
||||
)
|
||||
}
|
||||
|
||||
var expected = []
|
||||
, stringify = JSONStream.stringify()
|
||||
, es = require('event-stream')
|
||||
, stringified = ''
|
||||
, called = 0
|
||||
, count = 10
|
||||
, ended = false
|
||||
|
||||
while (count --)
|
||||
expected.push(randomObj())
|
||||
|
||||
es.connect(
|
||||
es.readArray(expected),
|
||||
stringify,
|
||||
JSONStream.parse([/./]),
|
||||
es.writeArray(function (err, lines) {
|
||||
|
||||
it(lines).has(expected)
|
||||
console.error('PASSED')
|
||||
})
|
||||
)
|
||||
15
static/js/ketcher2/node_modules/abbrev/LICENSE
generated
vendored
Normal file
15
static/js/ketcher2/node_modules/abbrev/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
23
static/js/ketcher2/node_modules/abbrev/README.md
generated
vendored
Normal file
23
static/js/ketcher2/node_modules/abbrev/README.md
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# abbrev-js
|
||||
|
||||
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
|
||||
|
||||
Usage:
|
||||
|
||||
var abbrev = require("abbrev");
|
||||
abbrev("foo", "fool", "folding", "flop");
|
||||
|
||||
// returns:
|
||||
{ fl: 'flop'
|
||||
, flo: 'flop'
|
||||
, flop: 'flop'
|
||||
, fol: 'folding'
|
||||
, fold: 'folding'
|
||||
, foldi: 'folding'
|
||||
, foldin: 'folding'
|
||||
, folding: 'folding'
|
||||
, foo: 'foo'
|
||||
, fool: 'fool'
|
||||
}
|
||||
|
||||
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
|
||||
62
static/js/ketcher2/node_modules/abbrev/abbrev.js
generated
vendored
Normal file
62
static/js/ketcher2/node_modules/abbrev/abbrev.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
|
||||
module.exports = exports = abbrev.abbrev = abbrev
|
||||
|
||||
abbrev.monkeyPatch = monkeyPatch
|
||||
|
||||
function monkeyPatch () {
|
||||
Object.defineProperty(Array.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(this) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(Object.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(Object.keys(this)) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
}
|
||||
|
||||
function abbrev (list) {
|
||||
if (arguments.length !== 1 || !Array.isArray(list)) {
|
||||
list = Array.prototype.slice.call(arguments, 0)
|
||||
}
|
||||
for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
|
||||
args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
|
||||
}
|
||||
|
||||
// sort them lexicographically, so that they're next to their nearest kin
|
||||
args = args.sort(lexSort)
|
||||
|
||||
// walk through each, seeing how much it has in common with the next and previous
|
||||
var abbrevs = {}
|
||||
, prev = ""
|
||||
for (var i = 0, l = args.length ; i < l ; i ++) {
|
||||
var current = args[i]
|
||||
, next = args[i + 1] || ""
|
||||
, nextMatches = true
|
||||
, prevMatches = true
|
||||
if (current === next) continue
|
||||
for (var j = 0, cl = current.length ; j < cl ; j ++) {
|
||||
var curChar = current.charAt(j)
|
||||
nextMatches = nextMatches && curChar === next.charAt(j)
|
||||
prevMatches = prevMatches && curChar === prev.charAt(j)
|
||||
if (!nextMatches && !prevMatches) {
|
||||
j ++
|
||||
break
|
||||
}
|
||||
}
|
||||
prev = current
|
||||
if (j === cl) {
|
||||
abbrevs[current] = current
|
||||
continue
|
||||
}
|
||||
for (var a = current.substr(0, j) ; j <= cl ; j ++) {
|
||||
abbrevs[a] = current
|
||||
a += current.charAt(j)
|
||||
}
|
||||
}
|
||||
return abbrevs
|
||||
}
|
||||
|
||||
function lexSort (a, b) {
|
||||
return a === b ? 0 : a > b ? 1 : -1
|
||||
}
|
||||
55
static/js/ketcher2/node_modules/abbrev/package.json
generated
vendored
Normal file
55
static/js/ketcher2/node_modules/abbrev/package.json
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"_from": "abbrev@1.0.x",
|
||||
"_id": "abbrev@1.0.9",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=",
|
||||
"_location": "/abbrev",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "abbrev@1.0.x",
|
||||
"name": "abbrev",
|
||||
"escapedName": "abbrev",
|
||||
"rawSpec": "1.0.x",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.x"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/babel-istanbul",
|
||||
"/istanbul",
|
||||
"/nopt"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz",
|
||||
"_shasum": "91b4792588a7738c25f35dd6f63752a2f8776135",
|
||||
"_spec": "abbrev@1.0.x",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/babel-istanbul",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/abbrev-js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Like ruby's abbrev module, but in js",
|
||||
"devDependencies": {
|
||||
"tap": "^5.7.2"
|
||||
},
|
||||
"files": [
|
||||
"abbrev.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/abbrev-js#readme",
|
||||
"license": "ISC",
|
||||
"main": "abbrev.js",
|
||||
"name": "abbrev",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test.js --cov"
|
||||
},
|
||||
"version": "1.0.9"
|
||||
}
|
||||
29
static/js/ketcher2/node_modules/accessory/index.js
generated
vendored
Normal file
29
static/js/ketcher2/node_modules/accessory/index.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
'use strict'
|
||||
|
||||
var split = require('dot-parts')
|
||||
var balanced = require('balanced-match')
|
||||
var ap = require('ap')
|
||||
var findCall = ap.partial(balanced, '(', ')')
|
||||
|
||||
module.exports = function createAccessor (source, path) {
|
||||
return split(path).reduce(accumulate, source)
|
||||
}
|
||||
|
||||
function accumulate (statement, property) {
|
||||
var callString = ''
|
||||
function append (body) {
|
||||
callString += '(' + body + ')'
|
||||
}
|
||||
var call = findCall(property)
|
||||
if (call) {
|
||||
property = call.pre
|
||||
append(call.body)
|
||||
var post = call.post
|
||||
}
|
||||
while (post) {
|
||||
call = findCall(post)
|
||||
append(call.body)
|
||||
post = call.post
|
||||
}
|
||||
return statement + "['" + property + "']" + callString
|
||||
}
|
||||
21
static/js/ketcher2/node_modules/accessory/license
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/accessory/license
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Ben Drucker <bvdrucker@gmail.com> (bendrucker.me)
|
||||
|
||||
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.
|
||||
21
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
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.
|
||||
6
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/Makefile
generated
vendored
Normal file
6
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/Makefile
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
test:
|
||||
@node_modules/.bin/tape test/*.js
|
||||
|
||||
.PHONY: test
|
||||
|
||||
80
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/README.md
generated
vendored
Normal file
80
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/README.md
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
# balanced-match
|
||||
|
||||
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/balanced-match)
|
||||
[](https://www.npmjs.org/package/balanced-match)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/balanced-match)
|
||||
|
||||
## Example
|
||||
|
||||
Get the first matching pair of braces:
|
||||
|
||||
```js
|
||||
var balanced = require('balanced-match');
|
||||
|
||||
console.log(balanced('{', '}', 'pre{in{nested}}post'));
|
||||
console.log(balanced('{', '}', 'pre{first}between{second}post'));
|
||||
```
|
||||
|
||||
The matches are:
|
||||
|
||||
```bash
|
||||
$ node example.js
|
||||
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
|
||||
{ start: 3,
|
||||
end: 9,
|
||||
pre: 'pre',
|
||||
body: 'first',
|
||||
post: 'between{second}post' }
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### var m = balanced(a, b, str)
|
||||
|
||||
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
||||
object with those keys:
|
||||
|
||||
* **start** the index of the first match of `a`
|
||||
* **end** the index of the matching `b`
|
||||
* **pre** the preamble, `a` and `b` not included
|
||||
* **body** the match, `a` and `b` not included
|
||||
* **post** the postscript, `a` and `b` not included
|
||||
|
||||
If there's no match, `undefined` will be returned.
|
||||
|
||||
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```bash
|
||||
npm install balanced-match
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
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.
|
||||
5
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/example.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/example.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
var balanced = require('./');
|
||||
|
||||
console.log(balanced('{', '}', 'pre{in{nested}}post'));
|
||||
console.log(balanced('{', '}', 'pre{first}between{second}post'));
|
||||
|
||||
38
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/index.js
generated
vendored
Normal file
38
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/index.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
module.exports = balanced;
|
||||
function balanced(a, b, str) {
|
||||
var bal = 0;
|
||||
var m = {};
|
||||
var ended = false;
|
||||
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (a == str.substr(i, a.length)) {
|
||||
if (!('start' in m)) m.start = i;
|
||||
bal++;
|
||||
}
|
||||
else if (b == str.substr(i, b.length) && 'start' in m) {
|
||||
ended = true;
|
||||
bal--;
|
||||
if (!bal) {
|
||||
m.end = i;
|
||||
m.pre = str.substr(0, m.start);
|
||||
m.body = (m.end - m.start > 1)
|
||||
? str.substring(m.start + a.length, m.end)
|
||||
: '';
|
||||
m.post = str.slice(m.end + b.length);
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we opened more than we closed, find the one we closed
|
||||
if (bal && ended) {
|
||||
var start = m.start + a.length;
|
||||
m = balanced(a, b, str.substr(start));
|
||||
if (m) {
|
||||
m.start += start;
|
||||
m.end += start;
|
||||
m.pre = str.slice(0, start) + m.pre;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
}
|
||||
75
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/package.json
generated
vendored
Normal file
75
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/package.json
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
{
|
||||
"_from": "balanced-match@~0.2.0",
|
||||
"_id": "balanced-match@0.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-e8ZYtL7WHu5CStdPdfXD4sTfPMc=",
|
||||
"_location": "/accessory/balanced-match",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "balanced-match@~0.2.0",
|
||||
"name": "balanced-match",
|
||||
"escapedName": "balanced-match",
|
||||
"rawSpec": "~0.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~0.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/accessory"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz",
|
||||
"_shasum": "7bc658b4bed61eee424ad74f75f5c3e2c4df3cc7",
|
||||
"_spec": "balanced-match@~0.2.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/accessory",
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/juliangruber/balanced-match/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
||||
"devDependencies": {
|
||||
"tape": "~1.1.1"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/balanced-match",
|
||||
"keywords": [
|
||||
"match",
|
||||
"regexp",
|
||||
"test",
|
||||
"balanced",
|
||||
"parse"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "balanced-match",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/balanced-match.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/20..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "0.2.1"
|
||||
}
|
||||
56
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/test/balanced.js
generated
vendored
Normal file
56
static/js/ketcher2/node_modules/accessory/node_modules/balanced-match/test/balanced.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
var test = require('tape');
|
||||
var balanced = require('..');
|
||||
|
||||
test('balanced', function(t) {
|
||||
t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), {
|
||||
start: 3,
|
||||
end: 12,
|
||||
pre: 'pre',
|
||||
body: 'in{nest}',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), {
|
||||
start: 8,
|
||||
end: 11,
|
||||
pre: '{{{{{{{{',
|
||||
body: 'in',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', 'pre{body{in}post'), {
|
||||
start: 8,
|
||||
end: 11,
|
||||
pre: 'pre{body',
|
||||
body: 'in',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), {
|
||||
start: 4,
|
||||
end: 13,
|
||||
pre: 'pre}',
|
||||
body: 'in{nest}',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), {
|
||||
start: 3,
|
||||
end: 8,
|
||||
pre: 'pre',
|
||||
body: 'body',
|
||||
post: 'between{body2}post'
|
||||
});
|
||||
t.notOk(balanced('{', '}', 'nope'), 'should be notOk');
|
||||
t.deepEqual(balanced('<b>', '</b>', 'pre<b>in<b>nest</b></b>post'), {
|
||||
start: 3,
|
||||
end: 19,
|
||||
pre: 'pre',
|
||||
body: 'in<b>nest</b>',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('<b>', '</b>', 'pre</b><b>in<b>nest</b></b>post'), {
|
||||
start: 7,
|
||||
end: 23,
|
||||
pre: 'pre</b>',
|
||||
body: 'in<b>nest</b>',
|
||||
post: 'post'
|
||||
});
|
||||
t.end();
|
||||
});
|
||||
68
static/js/ketcher2/node_modules/accessory/package.json
generated
vendored
Normal file
68
static/js/ketcher2/node_modules/accessory/package.json
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"_from": "accessory@~1.1.0",
|
||||
"_id": "accessory@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-eDPpg5oy3tdtJgIfNqQXB6Ug9ZM=",
|
||||
"_location": "/accessory",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "accessory@~1.1.0",
|
||||
"name": "accessory",
|
||||
"escapedName": "accessory",
|
||||
"rawSpec": "~1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/globo"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/accessory/-/accessory-1.1.0.tgz",
|
||||
"_shasum": "7833e9839a32ded76d26021f36a41707a520f593",
|
||||
"_spec": "accessory@~1.1.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/globo",
|
||||
"author": {
|
||||
"name": "Ben Drucker",
|
||||
"email": "bvdrucker@gmail.com",
|
||||
"url": "bendrucker.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/bendrucker/accessory/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"ap": "~0.2.0",
|
||||
"balanced-match": "~0.2.0",
|
||||
"dot-parts": "~1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Create property accessor/caller statements for dot paths",
|
||||
"devDependencies": {
|
||||
"standard": "^4.0.0",
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/bendrucker/accessory#readme",
|
||||
"keywords": [
|
||||
"dot",
|
||||
"path",
|
||||
"property",
|
||||
"accessor",
|
||||
"bracket",
|
||||
"js"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "accessory",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bendrucker/accessory.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard && tape test.js"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
||||
49
static/js/ketcher2/node_modules/accessory/readme.md
generated
vendored
Normal file
49
static/js/ketcher2/node_modules/accessory/readme.md
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
# accessory [](https://travis-ci.org/bendrucker/accessory)
|
||||
|
||||
> Create property accessor/caller statements for dot paths
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save accessory
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var accessory = require('accessory')
|
||||
|
||||
accessory('window', 'foo.bar')
|
||||
//=> window['foo']['bar']
|
||||
|
||||
accessory('window', 'foo\\.bar')
|
||||
//=> window['foo.bar']
|
||||
|
||||
accessory('window', 'foo.bar(baz)')
|
||||
//=> window['foo']['bar'](baz)
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
#### `accessory(source, path)` -> `string`
|
||||
|
||||
##### source
|
||||
|
||||
*Required*
|
||||
Type: `string`
|
||||
|
||||
The source identifier which will prepend the accessors.
|
||||
|
||||
##### path
|
||||
|
||||
*Required*
|
||||
Type: `string`
|
||||
|
||||
A dot property path, including function calls.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Ben Drucker](http://bendrucker.me)
|
||||
20
static/js/ketcher2/node_modules/accord/contributing.md
generated
vendored
Normal file
20
static/js/ketcher2/node_modules/accord/contributing.md
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Anything that people should know before filing issues or opening pull requests should be here. This is a good place to put details on coding conventions, how to build the project, and how to run tests.
|
||||
|
||||
### Filing Issues
|
||||
|
||||
If you have found an issue with this library, please let us know! Make sure that before you file an issue, you have searched to see if someone else has already opened it. When opening the issue, make sure there's a clear and concise title and description, and that the description contains specific steps that can be followed to reproduce the issue you are experiencing. Following these guidelines will get your issue fixed up the quickest!
|
||||
|
||||
If you are making a feature request, that is welcome in the issues section as well. Make sure again that the title and issue summary are clear so that we can understand what you're asking for. Any use cases would also help. And if you are requesting a feature and are able to work with javscript code, please consider submitting a pull request for the feature!
|
||||
|
||||
### Pull Requests
|
||||
|
||||
When submitting a pull request, make sure that the code follows the general style and structure elsewhere in the library, that your commit messages are [well-formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), and that you have added tests for whatever feature you are adding.
|
||||
|
||||
### Running Tests
|
||||
|
||||
To run tests, make sure you have `npm install`ed, then just run `mocha` in the root. If you'd like to run tests just for one specific adapter, you can use mocha's grep option, like this `mocha -g jade` - this would run just the jade test suite.
|
||||
|
||||
The way tests are set up is fairly simple, a folder in `fixtures` and a `describe` block for each adapter. All tests are currently compared to expected output through an pure javascript AST, to ensure compatibility across systems.
|
||||
278
static/js/ketcher2/node_modules/accord/lib/adapter_base.js
generated
vendored
Normal file
278
static/js/ketcher2/node_modules/accord/lib/adapter_base.js
generated
vendored
Normal file
@ -0,0 +1,278 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, W, clone, fs, partialRight, path, readFile, requireEngine, resolve, resolvePath,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
W = require('when');
|
||||
|
||||
clone = require('lodash.clone');
|
||||
|
||||
partialRight = require('lodash.partialright');
|
||||
|
||||
resolve = require('resolve');
|
||||
|
||||
path = require('path');
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
readFile = require('when/node/function').lift(fs.readFile);
|
||||
|
||||
Adapter = (function() {
|
||||
|
||||
/**
|
||||
* The names of the npm modules that are supported to be used as engines by
|
||||
the adapter. Defaults to the name of the adapter.
|
||||
* @type {String[]}
|
||||
*/
|
||||
Adapter.prototype.supportedEngines = void 0;
|
||||
|
||||
|
||||
/**
|
||||
* The name of the engine in-use. Generally this is the name of the package on
|
||||
npm.
|
||||
* @type {String}
|
||||
*/
|
||||
|
||||
Adapter.prototype.engineName = '';
|
||||
|
||||
|
||||
/**
|
||||
* The actual engine, no adapter wrapper. Defaults to the engine that we
|
||||
recommend for compiling that particular language (if it is installed).
|
||||
Otherwise, whatever engine we support that is installed.
|
||||
*/
|
||||
|
||||
Adapter.prototype.engine = void 0;
|
||||
|
||||
|
||||
/**
|
||||
* Array of all file extensions the compiler should match
|
||||
* @type {String[]}
|
||||
*/
|
||||
|
||||
Adapter.prototype.extensions = void 0;
|
||||
|
||||
|
||||
/**
|
||||
* Expected output extension
|
||||
* @type {String}
|
||||
*/
|
||||
|
||||
Adapter.prototype.output = '';
|
||||
|
||||
|
||||
/**
|
||||
* Specify if the output of the language is independent of other files or the
|
||||
evaluation of potentially stateful functions. This means that the only
|
||||
information passed into the engine is what gets passed to Accord's
|
||||
compile/render function, and whenever that same input is given, the output
|
||||
will always be the same.
|
||||
* @type {Boolean}
|
||||
* @todo Add detection for when a particular job qualifies as isolated
|
||||
*/
|
||||
|
||||
Adapter.prototype.isolated = false;
|
||||
|
||||
|
||||
/**
|
||||
* @param {String} [engine=Adapter.supportedEngines[0]] If you need to use a
|
||||
particular engine to compile/render with, then specify it here. Otherwise
|
||||
we use whatever engine you have installed.
|
||||
*/
|
||||
|
||||
function Adapter(engineName1, customPath) {
|
||||
var i, len, ref, ref1;
|
||||
this.engineName = engineName1;
|
||||
if (!this.supportedEngines || this.supportedEngines.length === 0) {
|
||||
this.supportedEngines = [this.name];
|
||||
}
|
||||
if (this.engineName != null) {
|
||||
if (ref = this.engineName, indexOf.call(this.supportedEngines, ref) < 0) {
|
||||
throw new Error("engine '" + this.engineName + "' not supported");
|
||||
}
|
||||
this.engine = requireEngine(this.engineName, customPath);
|
||||
} else {
|
||||
ref1 = this.supportedEngines;
|
||||
for (i = 0, len = ref1.length; i < len; i++) {
|
||||
this.engineName = ref1[i];
|
||||
try {
|
||||
this.engine = requireEngine(this.engineName, customPath);
|
||||
} catch (error) {
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new Error("'tried to require: " + this.supportedEngines + "'.\nNone found. Make sure one has been installed!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render a string to a compiled string
|
||||
* @param {String} str
|
||||
* @param {Object} [opts = {}]
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
Adapter.prototype.render = function(str, opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
if (!this._render) {
|
||||
return W.reject(new Error('render not supported'));
|
||||
}
|
||||
return this._render(str, opts);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Render a file to a compiled string
|
||||
* @param {String} file The path to the file
|
||||
* @param {Object} [opts = {}]
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
Adapter.prototype.renderFile = function(file, opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
opts = clone(opts, true);
|
||||
return readFile(file, 'utf8').then(partialRight(this.render, Object.assign({
|
||||
filename: file
|
||||
}, opts)).bind(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Compile a string to a function
|
||||
* @param {String} str
|
||||
* @param {Object} [opts = {}]
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
Adapter.prototype.compile = function(str, opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
if (!this._compile) {
|
||||
return W.reject(new Error('compile not supported'));
|
||||
}
|
||||
return this._compile(str, opts);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Compile a file to a function
|
||||
* @param {String} file The path to the file
|
||||
* @param {Object} [opts = {}]
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
Adapter.prototype.compileFile = function(file, opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
return readFile(file, 'utf8').then(partialRight(this.compile, Object.assign({
|
||||
filename: file
|
||||
}, opts)).bind(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Compile a string to a client-side-ready function
|
||||
* @param {String} str
|
||||
* @param {Object} [opts = {}]
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
Adapter.prototype.compileClient = function(str, opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
if (!this._compileClient) {
|
||||
return W.reject(new Error('client-side compile not supported'));
|
||||
}
|
||||
return this._compileClient(str, opts);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Compile a file to a client-side-ready function
|
||||
* @param {String} file The path to the file
|
||||
* @param {Object} [opts = {}]
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
Adapter.prototype.compileFileClient = function(file, opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
return readFile(file, 'utf8').then(partialRight(this.compileClient, Object.assign(opts, {
|
||||
filename: file
|
||||
})).bind(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Some adapters that compile for client also need helpers, this method
|
||||
returns a string of minfied JavaScript with all of them
|
||||
* @return {Promise} A promise for the client-side helpers.
|
||||
*/
|
||||
|
||||
Adapter.prototype.clientHelpers = void 0;
|
||||
|
||||
return Adapter;
|
||||
|
||||
})();
|
||||
|
||||
requireEngine = function(engineName, customPath) {
|
||||
var engine, err;
|
||||
if (customPath != null) {
|
||||
engine = require(resolve.sync(path.basename(customPath), {
|
||||
basedir: customPath
|
||||
}));
|
||||
engine.__accord_path = customPath;
|
||||
} else {
|
||||
try {
|
||||
engine = require(engineName);
|
||||
engine.__accord_path = resolvePath(engineName);
|
||||
} catch (error) {
|
||||
err = error;
|
||||
throw new Error("'" + engineName + "' not found. make sure it has been installed!");
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (!engine.version) {
|
||||
engine.version = require(engine.__accord_path + '/package.json').version;
|
||||
}
|
||||
} catch (error) {
|
||||
err = error;
|
||||
}
|
||||
return engine;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the path to the root folder of a node module, given its name.
|
||||
* @param {String} name The name of the node module you want the path to.
|
||||
* @return {String} The root folder of node module `name`.
|
||||
* @private
|
||||
*/
|
||||
|
||||
resolvePath = function(name) {
|
||||
var filepath;
|
||||
filepath = require.resolve(name);
|
||||
while (true) {
|
||||
if (filepath === '/') {
|
||||
throw new Error("cannot resolve root of node module " + name);
|
||||
}
|
||||
filepath = path.dirname(filepath);
|
||||
if (fs.existsSync(path.join(filepath, 'package.json'))) {
|
||||
return filepath;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Adapter;
|
||||
|
||||
}).call(this);
|
||||
55
static/js/ketcher2/node_modules/accord/lib/adapters/LiveScript/1.x.js
generated
vendored
Normal file
55
static/js/ketcher2/node_modules/accord/lib/adapters/LiveScript/1.x.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, LiveScript, W,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
LiveScript = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(LiveScript, superClass);
|
||||
|
||||
function LiveScript() {
|
||||
return LiveScript.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
LiveScript.prototype.name = 'LiveScript';
|
||||
|
||||
LiveScript.prototype.extensions = ['ls'];
|
||||
|
||||
LiveScript.prototype.output = 'js';
|
||||
|
||||
LiveScript.prototype.isolated = true;
|
||||
|
||||
LiveScript.prototype._render = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return LiveScript;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = LiveScript;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/LiveScript/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/LiveScript/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./1.x');
|
||||
|
||||
}).call(this);
|
||||
74
static/js/ketcher2/node_modules/accord/lib/adapters/babel/4.x - 5.x.js
generated
vendored
Normal file
74
static/js/ketcher2/node_modules/accord/lib/adapters/babel/4.x - 5.x.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, Babel, W, path, sourcemaps,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
path = require('path');
|
||||
|
||||
W = require('when');
|
||||
|
||||
sourcemaps = require('../../sourcemaps');
|
||||
|
||||
Babel = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(Babel, superClass);
|
||||
|
||||
function Babel() {
|
||||
return Babel.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Babel.prototype.name = 'babel';
|
||||
|
||||
Babel.prototype.extensions = ['jsx', 'js'];
|
||||
|
||||
Babel.prototype.output = 'js';
|
||||
|
||||
Babel.prototype.isolated = true;
|
||||
|
||||
Babel.prototype._render = function(str, options) {
|
||||
var filename;
|
||||
filename = options.filename;
|
||||
if (options.sourcemap === true) {
|
||||
options.sourceMap = true;
|
||||
}
|
||||
options.sourceMapName = filename;
|
||||
delete options.sourcemap;
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.transform(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var data, err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
data = {
|
||||
result: res.code
|
||||
};
|
||||
if (res.map) {
|
||||
return sourcemaps.inline_sources(res.map).then(function(map) {
|
||||
data.sourcemap = map;
|
||||
return data;
|
||||
});
|
||||
} else {
|
||||
return W.resolve(data);
|
||||
}
|
||||
};
|
||||
|
||||
return Babel;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = Babel;
|
||||
|
||||
}).call(this);
|
||||
86
static/js/ketcher2/node_modules/accord/lib/adapters/babel/6.x.js
generated
vendored
Normal file
86
static/js/ketcher2/node_modules/accord/lib/adapters/babel/6.x.js
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, Babel, W, path, pick, sourcemaps,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
path = require('path');
|
||||
|
||||
W = require('when');
|
||||
|
||||
pick = require('lodash.pick');
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
sourcemaps = require('../../sourcemaps');
|
||||
|
||||
Babel = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(Babel, superClass);
|
||||
|
||||
function Babel() {
|
||||
return Babel.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Babel.prototype.name = 'babel';
|
||||
|
||||
Babel.prototype.extensions = ['js', 'jsx'];
|
||||
|
||||
Babel.prototype.output = 'js';
|
||||
|
||||
Babel.prototype.isolated = true;
|
||||
|
||||
Babel.prototype.supportedEngines = ['babel-core'];
|
||||
|
||||
Babel.prototype._render = function(str, options) {
|
||||
var allowed_keys, filename, sanitized_options;
|
||||
filename = options.filename;
|
||||
if (options.sourcemap === true) {
|
||||
options.sourceMaps = true;
|
||||
}
|
||||
options.sourceFileName = filename;
|
||||
delete options.sourcemap;
|
||||
allowed_keys = ['filename', 'filenameRelative', 'presets', 'plugins', 'highlightCode', 'only', 'ignore', 'auxiliaryCommentBefore', 'auxiliaryCommentAfter', 'sourceMaps', 'inputSourceMap', 'sourceMapTarget', 'sourceRoot', 'moduleRoot', 'moduleIds', 'moduleId', 'getModuleId', 'resolveModuleSource', 'code', 'babelrc', 'ast', 'compact', 'comments', 'shouldPrintComment', 'env', 'retainLines', 'extends'];
|
||||
sanitized_options = pick(options, allowed_keys);
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.transform(str, sanitized_options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var data, dirname, err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
data = {
|
||||
result: res.code
|
||||
};
|
||||
if (res.map) {
|
||||
if (res.map.sources) {
|
||||
dirname = path.dirname(res.options.filename);
|
||||
res.map.sources = res.map.sources.map(function(source) {
|
||||
return path.join(dirname, source);
|
||||
});
|
||||
}
|
||||
return sourcemaps.inline_sources(res.map).then(function(map) {
|
||||
data.sourcemap = map;
|
||||
return data;
|
||||
});
|
||||
} else {
|
||||
return W.resolve(data);
|
||||
}
|
||||
};
|
||||
|
||||
return Babel;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = Babel;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/babel/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/babel/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./6.x');
|
||||
|
||||
}).call(this);
|
||||
68
static/js/ketcher2/node_modules/accord/lib/adapters/buble/0.8.x - 0.14.x.js
generated
vendored
Normal file
68
static/js/ketcher2/node_modules/accord/lib/adapters/buble/0.8.x - 0.14.x.js
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, Buble, W, path, sourcemaps,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
path = require('path');
|
||||
|
||||
W = require('when');
|
||||
|
||||
sourcemaps = require('../../sourcemaps');
|
||||
|
||||
Buble = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(Buble, superClass);
|
||||
|
||||
function Buble() {
|
||||
return Buble.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Buble.prototype.name = 'buble';
|
||||
|
||||
Buble.prototype.extensions = ['js'];
|
||||
|
||||
Buble.prototype.output = 'js';
|
||||
|
||||
Buble.prototype.isolated = true;
|
||||
|
||||
Buble.prototype._render = function(str, options) {
|
||||
options.source = options.filename;
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.transform(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var data, err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
data = {
|
||||
result: res.code
|
||||
};
|
||||
if (res.map) {
|
||||
return sourcemaps.inline_sources(res.map).then(function(map) {
|
||||
data.sourcemap = map;
|
||||
return data;
|
||||
});
|
||||
} else {
|
||||
return W.resolve(data);
|
||||
}
|
||||
};
|
||||
|
||||
return Buble;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = Buble;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/buble/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/buble/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./0.8.x - 0.14.x');
|
||||
|
||||
}).call(this);
|
||||
63
static/js/ketcher2/node_modules/accord/lib/adapters/cjsx/3.x.js
generated
vendored
Normal file
63
static/js/ketcher2/node_modules/accord/lib/adapters/cjsx/3.x.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, CJSX, W, path, sourcemaps,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
sourcemaps = require('../../sourcemaps');
|
||||
|
||||
path = require('path');
|
||||
|
||||
W = require('when');
|
||||
|
||||
CJSX = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(CJSX, superClass);
|
||||
|
||||
function CJSX() {
|
||||
return CJSX.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
CJSX.prototype.name = 'cjsx';
|
||||
|
||||
CJSX.prototype.extensions = ['cjsx'];
|
||||
|
||||
CJSX.prototype.output = 'coffee';
|
||||
|
||||
CJSX.prototype.supportedEngines = ['coffee-react-transform'];
|
||||
|
||||
CJSX.prototype.isolated = true;
|
||||
|
||||
CJSX.prototype._render = function(str, options) {
|
||||
var filename;
|
||||
filename = options.filename;
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine(str);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return CJSX;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = CJSX;
|
||||
|
||||
}).call(this);
|
||||
63
static/js/ketcher2/node_modules/accord/lib/adapters/cjsx/4.x - 5.x.js
generated
vendored
Normal file
63
static/js/ketcher2/node_modules/accord/lib/adapters/cjsx/4.x - 5.x.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, CJSX, W, path, sourcemaps,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
sourcemaps = require('../../sourcemaps');
|
||||
|
||||
path = require('path');
|
||||
|
||||
W = require('when');
|
||||
|
||||
CJSX = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(CJSX, superClass);
|
||||
|
||||
function CJSX() {
|
||||
return CJSX.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
CJSX.prototype.name = 'cjsx';
|
||||
|
||||
CJSX.prototype.extensions = ['cjsx'];
|
||||
|
||||
CJSX.prototype.output = 'coffee';
|
||||
|
||||
CJSX.prototype.supportedEngines = ['coffee-react-transform'];
|
||||
|
||||
CJSX.prototype.isolated = true;
|
||||
|
||||
CJSX.prototype._render = function(str, options) {
|
||||
var filename;
|
||||
filename = options.filename;
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine(str);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return CJSX;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = CJSX;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/cjsx/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/cjsx/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./4.x - 5.x');
|
||||
|
||||
}).call(this);
|
||||
55
static/js/ketcher2/node_modules/accord/lib/adapters/coco/0.9.x.js
generated
vendored
Normal file
55
static/js/ketcher2/node_modules/accord/lib/adapters/coco/0.9.x.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, Coco, W,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
Coco = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(Coco, superClass);
|
||||
|
||||
function Coco() {
|
||||
return Coco.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Coco.prototype.name = 'coco';
|
||||
|
||||
Coco.prototype.extensions = ['co'];
|
||||
|
||||
Coco.prototype.output = 'js';
|
||||
|
||||
Coco.prototype.isolated = true;
|
||||
|
||||
Coco.prototype._render = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return Coco;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = Coco;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/coco/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/coco/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./0.9.x');
|
||||
|
||||
}).call(this);
|
||||
80
static/js/ketcher2/node_modules/accord/lib/adapters/coffee-script/1.x.js
generated
vendored
Normal file
80
static/js/ketcher2/node_modules/accord/lib/adapters/coffee-script/1.x.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, CoffeeScript, W, path, sourcemaps,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
sourcemaps = require('../../sourcemaps');
|
||||
|
||||
path = require('path');
|
||||
|
||||
W = require('when');
|
||||
|
||||
CoffeeScript = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(CoffeeScript, superClass);
|
||||
|
||||
function CoffeeScript() {
|
||||
return CoffeeScript.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
CoffeeScript.prototype.name = 'coffee-script';
|
||||
|
||||
CoffeeScript.prototype.extensions = ['coffee'];
|
||||
|
||||
CoffeeScript.prototype.output = 'js';
|
||||
|
||||
CoffeeScript.prototype.isolated = true;
|
||||
|
||||
CoffeeScript.prototype._render = function(str, options) {
|
||||
var filename;
|
||||
filename = options.filename;
|
||||
if (options.sourcemap === true) {
|
||||
options.sourceMap = true;
|
||||
}
|
||||
options.sourceFiles = [filename];
|
||||
if (options.filename) {
|
||||
options.generatedFile = path.basename(filename).replace('.coffee', '.js');
|
||||
}
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var data, err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
if (res.sourceMap) {
|
||||
data = {
|
||||
result: res.js,
|
||||
v2sourcemap: res.sourceMap,
|
||||
sourcemap: JSON.parse(res.v3SourceMap)
|
||||
};
|
||||
return sourcemaps.inline_sources(data.sourcemap).then(function(map) {
|
||||
data.sourcemap = map;
|
||||
return data;
|
||||
});
|
||||
} else {
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return CoffeeScript;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = CoffeeScript;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/coffee-script/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/coffee-script/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./1.x');
|
||||
|
||||
}).call(this);
|
||||
58
static/js/ketcher2/node_modules/accord/lib/adapters/csso/1.0.x - 1.3.x.js
generated
vendored
Normal file
58
static/js/ketcher2/node_modules/accord/lib/adapters/csso/1.0.x - 1.3.x.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, CSSO, W,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
CSSO = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(CSSO, superClass);
|
||||
|
||||
function CSSO() {
|
||||
return CSSO.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
CSSO.prototype.name = 'csso';
|
||||
|
||||
CSSO.prototype.extensions = ['css'];
|
||||
|
||||
CSSO.prototype.output = 'css';
|
||||
|
||||
CSSO.prototype.isolated = true;
|
||||
|
||||
CSSO.prototype._render = function(str, options) {
|
||||
if (options.noRestructure == null) {
|
||||
options.noRestructure = false;
|
||||
}
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.justDoIt(str, options.noRestructure);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return CSSO;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = CSSO;
|
||||
|
||||
}).call(this);
|
||||
61
static/js/ketcher2/node_modules/accord/lib/adapters/csso/2.x.js
generated
vendored
Normal file
61
static/js/ketcher2/node_modules/accord/lib/adapters/csso/2.x.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, CSSO, W,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
CSSO = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(CSSO, superClass);
|
||||
|
||||
function CSSO() {
|
||||
return CSSO.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
CSSO.prototype.name = 'csso';
|
||||
|
||||
CSSO.prototype.extensions = ['css'];
|
||||
|
||||
CSSO.prototype.output = 'css';
|
||||
|
||||
CSSO.prototype.isolated = true;
|
||||
|
||||
CSSO.prototype._render = function(str, options) {
|
||||
if (options.restructuring == null) {
|
||||
options.restructuring = true;
|
||||
}
|
||||
if (options.debug == null) {
|
||||
options.debug = false;
|
||||
}
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.minify(str, options).css;
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return CSSO;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = CSSO;
|
||||
|
||||
}).call(this);
|
||||
61
static/js/ketcher2/node_modules/accord/lib/adapters/csso/^1.4.js
generated
vendored
Normal file
61
static/js/ketcher2/node_modules/accord/lib/adapters/csso/^1.4.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, CSSO, W,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
CSSO = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(CSSO, superClass);
|
||||
|
||||
function CSSO() {
|
||||
return CSSO.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
CSSO.prototype.name = 'csso';
|
||||
|
||||
CSSO.prototype.extensions = ['css'];
|
||||
|
||||
CSSO.prototype.output = 'css';
|
||||
|
||||
CSSO.prototype.isolated = true;
|
||||
|
||||
CSSO.prototype._render = function(str, options) {
|
||||
if (options.restructuring == null) {
|
||||
options.restructuring = true;
|
||||
}
|
||||
if (options.debug == null) {
|
||||
options.debug = false;
|
||||
}
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.minify(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return CSSO;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = CSSO;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/csso/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/csso/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./2.x');
|
||||
|
||||
}).call(this);
|
||||
38
static/js/ketcher2/node_modules/accord/lib/adapters/dogescript/2.x.js
generated
vendored
Normal file
38
static/js/ketcher2/node_modules/accord/lib/adapters/dogescript/2.x.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, DogeScript, W,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
DogeScript = (function(superClass) {
|
||||
extend(DogeScript, superClass);
|
||||
|
||||
function DogeScript() {
|
||||
return DogeScript.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
DogeScript.prototype.name = 'dogescript';
|
||||
|
||||
DogeScript.prototype.extensions = ['djs'];
|
||||
|
||||
DogeScript.prototype.output = 'js';
|
||||
|
||||
DogeScript.prototype.isolated = true;
|
||||
|
||||
DogeScript.prototype._render = function(str, options) {
|
||||
return W.resolve({
|
||||
result: this.engine(str, options.beauty, options.trueDoge)
|
||||
});
|
||||
};
|
||||
|
||||
return DogeScript;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = DogeScript;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/dogescript/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/dogescript/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./2.x');
|
||||
|
||||
}).call(this);
|
||||
80
static/js/ketcher2/node_modules/accord/lib/adapters/dot/1.x.js
generated
vendored
Normal file
80
static/js/ketcher2/node_modules/accord/lib/adapters/dot/1.x.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, Dot, W, fs, path,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
path = require('path');
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
W = require('when');
|
||||
|
||||
Dot = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(Dot, superClass);
|
||||
|
||||
function Dot() {
|
||||
return Dot.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Dot.prototype.name = 'dot';
|
||||
|
||||
Dot.prototype.extensions = ['dot'];
|
||||
|
||||
Dot.prototype.output = 'html';
|
||||
|
||||
Dot.prototype._render = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str)(options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
Dot.prototype._compile = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
Dot.prototype._compileClient = function(str, options) {
|
||||
options.client = true;
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options).toString();
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
Dot.prototype.clientHelpers = function(str, options) {
|
||||
var runtime_path;
|
||||
runtime_path = path.join(this.engine.__accord_path, 'doT.min.js');
|
||||
return fs.readFileSync(runtime_path, 'utf8');
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return Dot;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = Dot;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/dot/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/dot/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./1.x');
|
||||
|
||||
}).call(this);
|
||||
76
static/js/ketcher2/node_modules/accord/lib/adapters/eco/1.x.js
generated
vendored
Normal file
76
static/js/ketcher2/node_modules/accord/lib/adapters/eco/1.x.js
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, Eco, W, fs, path,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
path = require('path');
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
W = require('when');
|
||||
|
||||
Eco = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(Eco, superClass);
|
||||
|
||||
function Eco() {
|
||||
return Eco.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Eco.prototype.name = 'eco';
|
||||
|
||||
Eco.prototype.extensions = ['eco'];
|
||||
|
||||
Eco.prototype.output = 'html';
|
||||
|
||||
Eco.prototype._render = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.render(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
Eco.prototype._compile = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options);
|
||||
};
|
||||
})(this)).then(function(res) {
|
||||
res.result = eval(res.result);
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
Eco.prototype._compileClient = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options).toString().trim() + '\n';
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return Eco;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = Eco;
|
||||
|
||||
}).call(this);
|
||||
73
static/js/ketcher2/node_modules/accord/lib/adapters/eco/=1.1.0-rc-3.js
generated
vendored
Normal file
73
static/js/ketcher2/node_modules/accord/lib/adapters/eco/=1.1.0-rc-3.js
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, Eco, W, fs, path,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
path = require('path');
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
W = require('when');
|
||||
|
||||
Eco = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(Eco, superClass);
|
||||
|
||||
function Eco() {
|
||||
return Eco.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
Eco.prototype.name = 'eco';
|
||||
|
||||
Eco.prototype.extensions = ['eco'];
|
||||
|
||||
Eco.prototype.output = 'html';
|
||||
|
||||
Eco.prototype._render = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.render(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
Eco.prototype._compile = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
Eco.prototype._compileClient = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options).toString().trim() + '\n';
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return Eco;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = Eco;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/eco/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/eco/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./1.x');
|
||||
|
||||
}).call(this);
|
||||
80
static/js/ketcher2/node_modules/accord/lib/adapters/ejs/2.x.js
generated
vendored
Normal file
80
static/js/ketcher2/node_modules/accord/lib/adapters/ejs/2.x.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, EJS, W, fs, path,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
path = require('path');
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
W = require('when');
|
||||
|
||||
EJS = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(EJS, superClass);
|
||||
|
||||
function EJS() {
|
||||
return EJS.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
EJS.prototype.name = 'ejs';
|
||||
|
||||
EJS.prototype.extensions = ['ejs'];
|
||||
|
||||
EJS.prototype.output = 'html';
|
||||
|
||||
EJS.prototype._render = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.render(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
EJS.prototype._compile = function(str, options) {
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
EJS.prototype._compileClient = function(str, options) {
|
||||
options.client = true;
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.compile(str, options).toString();
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
EJS.prototype.clientHelpers = function(str, options) {
|
||||
var runtime_path;
|
||||
runtime_path = path.join(this.engine.__accord_path, 'ejs.min.js');
|
||||
return fs.readFileSync(runtime_path, 'utf8');
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return EJS;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = EJS;
|
||||
|
||||
}).call(this);
|
||||
5
static/js/ketcher2/node_modules/accord/lib/adapters/ejs/index.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/accord/lib/adapters/ejs/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
module.exports = require('./2.x');
|
||||
|
||||
}).call(this);
|
||||
62
static/js/ketcher2/node_modules/accord/lib/adapters/escape-html/0.5.x.js
generated
vendored
Normal file
62
static/js/ketcher2/node_modules/accord/lib/adapters/escape-html/0.5.x.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, EscapeHTML, W, defaults,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
defaults = require('lodash.defaults');
|
||||
|
||||
EscapeHTML = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(EscapeHTML, superClass);
|
||||
|
||||
function EscapeHTML() {
|
||||
return EscapeHTML.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
EscapeHTML.prototype.name = 'escape-html';
|
||||
|
||||
EscapeHTML.prototype.extensions = ['html'];
|
||||
|
||||
EscapeHTML.prototype.output = 'html';
|
||||
|
||||
EscapeHTML.prototype.supportedEngines = ['he'];
|
||||
|
||||
EscapeHTML.prototype.isolated = true;
|
||||
|
||||
EscapeHTML.prototype._render = function(str, options) {
|
||||
options = defaults(options, {
|
||||
allowUnsafeSymbols: true
|
||||
});
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.encode(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return EscapeHTML;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = EscapeHTML;
|
||||
|
||||
}).call(this);
|
||||
62
static/js/ketcher2/node_modules/accord/lib/adapters/escape-html/1.x.js
generated
vendored
Normal file
62
static/js/ketcher2/node_modules/accord/lib/adapters/escape-html/1.x.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
// Generated by CoffeeScript 1.12.1
|
||||
(function() {
|
||||
var Adapter, EscapeHTML, W, defaults,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
Adapter = require('../../adapter_base');
|
||||
|
||||
W = require('when');
|
||||
|
||||
defaults = require('lodash.defaults');
|
||||
|
||||
EscapeHTML = (function(superClass) {
|
||||
var compile;
|
||||
|
||||
extend(EscapeHTML, superClass);
|
||||
|
||||
function EscapeHTML() {
|
||||
return EscapeHTML.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
EscapeHTML.prototype.name = 'escape-html';
|
||||
|
||||
EscapeHTML.prototype.extensions = ['html'];
|
||||
|
||||
EscapeHTML.prototype.output = 'html';
|
||||
|
||||
EscapeHTML.prototype.supportedEngines = ['he'];
|
||||
|
||||
EscapeHTML.prototype.isolated = true;
|
||||
|
||||
EscapeHTML.prototype._render = function(str, options) {
|
||||
options = defaults(options, {
|
||||
allowUnsafeSymbols: true
|
||||
});
|
||||
return compile((function(_this) {
|
||||
return function() {
|
||||
return _this.engine.encode(str, options);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
compile = function(fn) {
|
||||
var err, res;
|
||||
try {
|
||||
res = fn();
|
||||
} catch (error) {
|
||||
err = error;
|
||||
return W.reject(err);
|
||||
}
|
||||
return W.resolve({
|
||||
result: res
|
||||
});
|
||||
};
|
||||
|
||||
return EscapeHTML;
|
||||
|
||||
})(Adapter);
|
||||
|
||||
module.exports = EscapeHTML;
|
||||
|
||||
}).call(this);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user