forked from enviPath/enviPy
Current Dev State
This commit is contained in:
21
static/js/ketcher2/node_modules/neatequal/LICENSE
generated
vendored
Executable file
21
static/js/ketcher2/node_modules/neatequal/LICENSE
generated
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2013-2014 Nicolas Froidure, <http://insertafter.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.
|
||||
77
static/js/ketcher2/node_modules/neatequal/README.md
generated
vendored
Normal file
77
static/js/ketcher2/node_modules/neatequal/README.md
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
# neatequal
|
||||
|
||||
`neatequal` is a neater deepEqual.
|
||||
|
||||
[](https://npmjs.org/package/neatequal) [](https://travis-ci.org/nfroidure/neatequal) [](https://david-dm.org/nfroidure/neatequal) [](https://david-dm.org/nfroidure/neatequal#info=devDependencies) [](https://coveralls.io/r/nfroidure/neatequal?branch=master) [](https://codeclimate.com/github/nfroidure/neatequal)
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
First install `neatequal` in you project:
|
||||
```sh
|
||||
npm install --save neatequal
|
||||
```
|
||||
|
||||
## Getting started
|
||||
|
||||
Then, use it:
|
||||
|
||||
```js
|
||||
var neatequal = require('neatequal');
|
||||
|
||||
var expectedFruits = [{
|
||||
name: 'orange'
|
||||
count: 2,
|
||||
colors: ['orange']
|
||||
}, {
|
||||
name: 'banana',
|
||||
count: 0,
|
||||
colors: ['yellow', 'white']
|
||||
}, {
|
||||
name: 'kiwi',
|
||||
count: 8,
|
||||
colors: ['brown', 'green']
|
||||
}];
|
||||
|
||||
var currentFruits = [{
|
||||
name: 'orange'
|
||||
count: 2,
|
||||
colors: ['yellow', 'orange']
|
||||
}, {
|
||||
name: 'banana',
|
||||
count: 1,
|
||||
colors: ['white']
|
||||
}];
|
||||
|
||||
neatequal(expectedFruits, currentFruits);
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### neatequal(current:Object, expected:Object)
|
||||
Throws an exception if current and expected objects doens'nt equal.
|
||||
|
||||
## Contribute
|
||||
|
||||
Feel free to submit us your improvements. To do so, you must accept to publish
|
||||
your code under the MIT license.
|
||||
|
||||
To start contributing, first run the following to setup the development
|
||||
environment:
|
||||
```sh
|
||||
git clone git@github.com:nfroidure/neatequal.git
|
||||
cd neatequal
|
||||
npm install
|
||||
```
|
||||
|
||||
Then, run the tests:
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
## Stats
|
||||
[](https://nodei.co/npm/neatequal/)
|
||||
[](https://nodei.co/npm/neatequal/)
|
||||
|
||||
61
static/js/ketcher2/node_modules/neatequal/package.json
generated
vendored
Normal file
61
static/js/ketcher2/node_modules/neatequal/package.json
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "neatequal@^1.0.0",
|
||||
"_id": "neatequal@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-LuEhG8n6bkxVcV/SELsFYC6xrjs=",
|
||||
"_location": "/neatequal",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "neatequal@^1.0.0",
|
||||
"name": "neatequal",
|
||||
"escapedName": "neatequal",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/svgicons2svgfont"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/neatequal/-/neatequal-1.0.0.tgz",
|
||||
"_shasum": "2ee1211bc9fa6e4c55715fd210bb05602eb1ae3b",
|
||||
"_spec": "neatequal@^1.0.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/svgicons2svgfont",
|
||||
"author": {
|
||||
"name": "Nicolas Froidure"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/nfroidure/neatequal/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"varstream": "^0.3.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Neat deep equal.",
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.2",
|
||||
"istanbul": "^0.3.5",
|
||||
"mocha": "^2.1.0"
|
||||
},
|
||||
"homepage": "https://github.com/nfroidure/neatequal",
|
||||
"keywords": [
|
||||
"assert",
|
||||
"deepEqual",
|
||||
"neat"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "src/index.js",
|
||||
"name": "neatequal",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/nfroidure/neatequal.git"
|
||||
},
|
||||
"scripts": {
|
||||
"cover": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report html -- tests/*.mocha.js -R spec -t 5000",
|
||||
"coveralls": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
|
||||
"test": "mocha tests/*.mocha.js"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
19
static/js/ketcher2/node_modules/neatequal/src/index.js
generated
vendored
Normal file
19
static/js/ketcher2/node_modules/neatequal/src/index.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
var assert = require('assert');
|
||||
var VarStream = require('varstream');
|
||||
var os = require('os');
|
||||
|
||||
|
||||
function neatEqual(current, expected, ordered) {
|
||||
var currentTransformed = VarStream.stringify(current).split(/\r?\n/);
|
||||
var expectedTransformed = VarStream.stringify(expected).split(/\r?\n/);
|
||||
|
||||
if(!ordered) {
|
||||
currentTransformed = currentTransformed.sort();
|
||||
expectedTransformed = expectedTransformed.sort();
|
||||
}
|
||||
|
||||
assert.equal(currentTransformed.join(os.EOL), expectedTransformed.join(os.EOL));
|
||||
}
|
||||
|
||||
module.exports = neatEqual;
|
||||
|
||||
50
static/js/ketcher2/node_modules/neatequal/tests/index.mocha.js
generated
vendored
Normal file
50
static/js/ketcher2/node_modules/neatequal/tests/index.mocha.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
var assert = require('assert');
|
||||
var neatEqual = require('../src/index');
|
||||
|
||||
describe('neatEqual', function () {
|
||||
|
||||
describe('should not throw', function () {
|
||||
|
||||
it('for simple equal objects', function() {
|
||||
assert.doesNotThrow(function() {
|
||||
neatEqual({test: 'test'}, {test: 'test'});
|
||||
});
|
||||
});
|
||||
|
||||
it('for simple equal arrays', function() {
|
||||
assert.doesNotThrow(function() {
|
||||
neatEqual(['test', 'test2'], ['test', 'test2']);
|
||||
});
|
||||
});
|
||||
|
||||
it('for deep equal objects', function() {
|
||||
assert.doesNotThrow(function() {
|
||||
neatEqual({test: 'test', test2: {test: 'test'}}, {test: 'test', test2: {test: 'test'}});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('should throw', function () {
|
||||
|
||||
it('for simple not equal objects', function() {
|
||||
assert.throws(function() {
|
||||
neatEqual({test: 'test'}, {test: 'test1'});
|
||||
});
|
||||
}, /AssertionError/);
|
||||
|
||||
it('for simple equal arrays', function() {
|
||||
assert.throws(function() {
|
||||
neatEqual(['test', 'test2'], ['test', 'test3']);
|
||||
});
|
||||
}, /AssertionError/);
|
||||
|
||||
it('for deep equal objects', function() {
|
||||
assert.throws(function() {
|
||||
neatEqual({test: 'test', test2: {test: 'test2'}}, {test: 'test', test2: {test: 'test'}});
|
||||
});
|
||||
}, /AssertionError/);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user