Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

49
static/js/ketcher2/node_modules/indx/index.js generated vendored Normal file
View File

@ -0,0 +1,49 @@
var fs = require('fs'),
path = require('path');
var valid_extensions = ['js', 'coffee'];
module.exports = function(dir){
dir = path.resolve(dir);
var res = {};
var objs = fs.readdirSync(dir)
// ignore index file
.filter(function(f){ return f.match(/^index\./) ? false : true })
// ignore non-js files that aren't folders
.filter(function(f){ return isDir(dir,f) || f.match(extensions_regex()) ? true : false })
// ignore folders without an index file
.filter(function(f){ return (isDir(dir,f) && !contains_index(dir,f)) ? false : true })
// remove extensions
.map(function(f){ return f.replace(extensions_regex(), '') });
objs.forEach(function(obj){
try {
res[obj] = require(path.join(dir, obj));
} catch (err) {
err.message = "Could note require " + path.join(dir, obj) + ": " + err.message
throw err
}
});
return res;
}
//
// @api private
//
function isDir(dir, f){ return fs.statSync(path.join(dir,f)).isDirectory() }
function extensions_regex(){
var str = '';
valid_extensions.forEach(function(ext){ str += '\\.' + ext + '$' + '|'; });
return new RegExp(str.slice(0,-1))
}
function contains_index(dir,f){
var res = false;
valid_extensions.forEach(function(ext){
if (fs.existsSync(path.join(dir, f, 'index.' + ext))) { res = true; }
});
return res;
}

10
static/js/ketcher2/node_modules/indx/license.md generated vendored Normal file
View File

@ -0,0 +1,10 @@
License (MIT)
-------------
Copyright (c) 2015 Jeff Escalante
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.

57
static/js/ketcher2/node_modules/indx/package.json generated vendored Normal file
View File

@ -0,0 +1,57 @@
{
"_from": "indx@^0.2.3",
"_id": "indx@0.2.3",
"_inBundle": false,
"_integrity": "sha1-Fdz1bunPZcAjTFE8J/vVgOcPvFA=",
"_location": "/indx",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "indx@^0.2.3",
"name": "indx",
"escapedName": "indx",
"rawSpec": "^0.2.3",
"saveSpec": null,
"fetchSpec": "^0.2.3"
},
"_requiredBy": [
"/accord"
],
"_resolved": "https://registry.npmjs.org/indx/-/indx-0.2.3.tgz",
"_shasum": "15dcf56ee9cf65c0234c513c27fbd580e70fbc50",
"_spec": "indx@^0.2.3",
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/accord",
"author": {
"name": "Jeff Escalante",
"email": "hello@jenius.me"
},
"bugs": {
"url": "https://github.com/jenius/indx/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "require_tree for node",
"devDependencies": {
"coffee-script": "1.7.x",
"coveralls": "2.x",
"istanbul": "0.3.x",
"mocha": "1.x",
"mocha-lcov-reporter": "0.0.1",
"should": "4.x"
},
"homepage": "https://github.com/jenius/indx#readme",
"license": "MIT",
"main": "./index.js",
"name": "indx",
"repository": {
"type": "git",
"url": "git+https://github.com/jenius/indx.git"
},
"scripts": {
"coverage": "istanbul cover _mocha --report html -- -R spec && open coverage/index.html",
"coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"test": "mocha"
},
"version": "0.2.3"
}

42
static/js/ketcher2/node_modules/indx/readme.md generated vendored Normal file
View File

@ -0,0 +1,42 @@
Indx
----
[![npm](http://img.shields.io/npm/v/indx.svg?style=flat)](https://badge.fury.io/js/indx) [![tests](http://img.shields.io/travis/jenius/indx/master.svg?style=flat)](https://travis-ci.org/jenius/indx) [![coverage](http://img.shields.io/coveralls/jenius/indx.svg?style=flat)](https://coveralls.io/r/jenius/indx) [![dependencies](http://img.shields.io/gemnasium/jenius/indx.svg?style=flat)](https://gemnasium.com/jenius/indx)
Require a folder of files or other folders, instead of doing them one at a time.
> **Note:** This project is in development, and versioning is a little different. [Read this](http://markup.im/#q4_cRZ1Q) for more details.
### Why should you care?
So let's say you are setting up a node project, and using the [adapter pattern](http://en.wikipedia.org/wiki/Adapter_pattern), which is a great and useful pattern. You may have a folder full of adapters, and you want to require all of them into an object, rather than going through each one individually. Kind of like [require_tree in sprockets](https://github.com/sstephenson/sprockets#the-require_tree-directive). That's exactly what indx does for you.
It's a very small script, but it's something I found myself writing and re-writing, so I figured why not wrap it up and give it to the world to make life a couple lines of code shorter.
### Installation
`npm install indx`
### Usage
In the folder you want to require, put an `index.js` file at the root. Inside that file, write this:
```js
module.exports = require('indx')(__dirname);
```
This you can require that folder and each of the files will be present. Alternately, just pass `indx` the path of a directory you want to require:
```js
var adapters = require('indx')('./adapters')
```
The path you pass will be passed through [path.resolve](http://nodejs.org/api/path.html#path_path_resolve_from_to), so no need to compute an absolute path if you don't need to. The example above will work fine without having to run any additional `path` methods on it as long as the relative path there is correct.
Indx supports javascript and coffeescript. If you have folders inside your folder, make sure each of those folders has an `index.js` or `index.coffee` file in it, or it won't be required. If you have files in your folder that are not `.js` or `.coffee`, they will not be required. If there are other languages I'm not aware of you'd like to add support for, feel free to submit a pull request - it's easy to extend the supported extensions.
### License & Contributing
This project is licensed under [MIT](license.md)
This entire project is one file, pretty easy to figure out how it's working. If you want to add something or fix a bug, please add a test for it. You can run tests with `mocha` in the root of the project.