forked from enviPath/enviPy
Current Dev State
This commit is contained in:
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)
|
||||
Reference in New Issue
Block a user