forked from public/fvtt-cthulhu-eternal
Initial import with skill sheet working
This commit is contained in:
20
node_modules/for-each/.editorconfig
generated
vendored
Normal file
20
node_modules/for-each/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 120
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
16
node_modules/for-each/.eslintrc
generated
vendored
Normal file
16
node_modules/for-each/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"eqeqeq": [2, "allow-null"],
|
||||
"func-name-matching": 0,
|
||||
"indent": [2, 4],
|
||||
"max-nested-callbacks": [2, 3],
|
||||
"max-params": [2, 3],
|
||||
"max-statements": [2, 14],
|
||||
"no-invalid-this": [1],
|
||||
"no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
|
||||
}
|
||||
}
|
45
node_modules/for-each/.travis.yml
generated
vendored
Normal file
45
node_modules/for-each/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
language: node_js
|
||||
os:
|
||||
- linux
|
||||
node_js:
|
||||
- "8"
|
||||
- "7"
|
||||
- "6"
|
||||
- "5"
|
||||
- "4"
|
||||
- "iojs"
|
||||
- "0.12"
|
||||
- "0.10"
|
||||
- "0.8"
|
||||
before_install:
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi'
|
||||
install:
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
|
||||
script:
|
||||
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
|
||||
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
|
||||
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
|
||||
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
|
||||
sudo: false
|
||||
env:
|
||||
- TEST=true
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- node_js: "node"
|
||||
env: PRETEST=true
|
||||
- node_js: "node"
|
||||
env: POSTTEST=true
|
||||
- node_js: "0.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
allow_failures:
|
||||
- os: osx
|
||||
- env: TEST=true ALLOW_FAILURE=true
|
||||
- env: COVERAGE=true
|
22
node_modules/for-each/LICENSE
generated
vendored
Normal file
22
node_modules/for-each/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012 Raynos.
|
||||
|
||||
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.
|
||||
|
43
node_modules/for-each/README.md
generated
vendored
Normal file
43
node_modules/for-each/README.md
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
# for-each [![build status][1]][2]
|
||||
|
||||
[![browser support][3]][4]
|
||||
|
||||
A better forEach.
|
||||
|
||||
## Example
|
||||
|
||||
Like `Array.prototype.forEach` but works on objects.
|
||||
|
||||
```js
|
||||
var forEach = require("for-each")
|
||||
|
||||
forEach({ key: "value" }, function (value, key, object) {
|
||||
/* code */
|
||||
})
|
||||
```
|
||||
|
||||
As a bonus, it's also a perfectly function shim/polyfill for arrays too!
|
||||
|
||||
```js
|
||||
var forEach = require("for-each")
|
||||
|
||||
forEach([1, 2, 3], function (value, index, array) {
|
||||
/* code */
|
||||
})
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install for-each`
|
||||
|
||||
## Contributors
|
||||
|
||||
- Raynos
|
||||
|
||||
## MIT Licenced
|
||||
|
||||
[1]: https://secure.travis-ci.org/Raynos/for-each.png
|
||||
[2]: http://travis-ci.org/Raynos/for-each
|
||||
[3]: https://ci.testling.com/Raynos/for-each.png
|
||||
[4]: https://ci.testling.com/Raynos/for-each
|
||||
|
62
node_modules/for-each/index.js
generated
vendored
Normal file
62
node_modules/for-each/index.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
'use strict';
|
||||
|
||||
var isCallable = require('is-callable');
|
||||
|
||||
var toStr = Object.prototype.toString;
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
var forEachArray = function forEachArray(array, iterator, receiver) {
|
||||
for (var i = 0, len = array.length; i < len; i++) {
|
||||
if (hasOwnProperty.call(array, i)) {
|
||||
if (receiver == null) {
|
||||
iterator(array[i], i, array);
|
||||
} else {
|
||||
iterator.call(receiver, array[i], i, array);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var forEachString = function forEachString(string, iterator, receiver) {
|
||||
for (var i = 0, len = string.length; i < len; i++) {
|
||||
// no such thing as a sparse string.
|
||||
if (receiver == null) {
|
||||
iterator(string.charAt(i), i, string);
|
||||
} else {
|
||||
iterator.call(receiver, string.charAt(i), i, string);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var forEachObject = function forEachObject(object, iterator, receiver) {
|
||||
for (var k in object) {
|
||||
if (hasOwnProperty.call(object, k)) {
|
||||
if (receiver == null) {
|
||||
iterator(object[k], k, object);
|
||||
} else {
|
||||
iterator.call(receiver, object[k], k, object);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var forEach = function forEach(list, iterator, thisArg) {
|
||||
if (!isCallable(iterator)) {
|
||||
throw new TypeError('iterator must be a function');
|
||||
}
|
||||
|
||||
var receiver;
|
||||
if (arguments.length >= 3) {
|
||||
receiver = thisArg;
|
||||
}
|
||||
|
||||
if (toStr.call(list) === '[object Array]') {
|
||||
forEachArray(list, iterator, receiver);
|
||||
} else if (typeof list === 'string') {
|
||||
forEachString(list, iterator, receiver);
|
||||
} else {
|
||||
forEachObject(list, iterator, receiver);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = forEach;
|
65
node_modules/for-each/package.json
generated
vendored
Normal file
65
node_modules/for-each/package.json
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "for-each",
|
||||
"version": "0.3.3",
|
||||
"description": "A better forEach",
|
||||
"keywords": [],
|
||||
"author": "Raynos <raynos2@gmail.com>",
|
||||
"repository": "git://github.com/Raynos/for-each.git",
|
||||
"main": "index",
|
||||
"homepage": "https://github.com/Raynos/for-each",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jake Verbaten"
|
||||
},
|
||||
{
|
||||
"name": "Jordan Harband",
|
||||
"url": "https://github.com/ljharb"
|
||||
}
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/Raynos/for-each/issues",
|
||||
"email": "raynos2@gmail.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-callable": "^1.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^12.2.1",
|
||||
"eslint": "^4.19.1",
|
||||
"nsp": "^3.2.1",
|
||||
"tape": "^4.9.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/Raynos/for-each/raw/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run tests-only",
|
||||
"tests-only": "node test/test",
|
||||
"posttest": "npm run security",
|
||||
"lint": "eslint *.js test/*.js",
|
||||
"security": "nsp check"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/test.js",
|
||||
"browsers": [
|
||||
"iexplore/6.0..latest",
|
||||
"firefox/3.0..6.0",
|
||||
"firefox/15.0..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/4.0..10.0",
|
||||
"chrome/20.0..latest",
|
||||
"chrome/canary",
|
||||
"opera/10.0..latest",
|
||||
"opera/next",
|
||||
"safari/4.0..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2"
|
||||
]
|
||||
}
|
||||
}
|
8
node_modules/for-each/test/.eslintrc
generated
vendored
Normal file
8
node_modules/for-each/test/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"rules": {
|
||||
"array-bracket-newline": 0,
|
||||
"array-element-newline": 0,
|
||||
"max-statements-per-line": 0,
|
||||
"no-magic-numbers": 0,
|
||||
}
|
||||
}
|
182
node_modules/for-each/test/test.js
generated
vendored
Normal file
182
node_modules/for-each/test/test.js
generated
vendored
Normal file
@ -0,0 +1,182 @@
|
||||
'use strict';
|
||||
|
||||
/* globals window */
|
||||
|
||||
var test = require('tape');
|
||||
var forEach = require('../');
|
||||
|
||||
test('forEach calls each iterator', function (t) {
|
||||
var count = 0;
|
||||
t.plan(4);
|
||||
forEach({ a: 1, b: 2 }, function (value, key) {
|
||||
if (count === 0) {
|
||||
t.equal(value, 1);
|
||||
t.equal(key, 'a');
|
||||
} else {
|
||||
t.equal(value, 2);
|
||||
t.equal(key, 'b');
|
||||
}
|
||||
count += 1;
|
||||
});
|
||||
});
|
||||
|
||||
test('forEach calls iterator with correct this value', function (t) {
|
||||
var thisValue = {};
|
||||
|
||||
t.plan(1);
|
||||
|
||||
forEach([0], function () {
|
||||
t.equal(this, thisValue);
|
||||
}, thisValue);
|
||||
});
|
||||
|
||||
test('second argument: iterator', function (t) {
|
||||
var arr = [];
|
||||
t['throws'](function () { forEach(arr); }, TypeError, 'undefined is not a function');
|
||||
t['throws'](function () { forEach(arr, null); }, TypeError, 'null is not a function');
|
||||
t['throws'](function () { forEach(arr, ''); }, TypeError, 'string is not a function');
|
||||
t['throws'](function () { forEach(arr, /a/); }, TypeError, 'regex is not a function');
|
||||
t['throws'](function () { forEach(arr, true); }, TypeError, 'true is not a function');
|
||||
t['throws'](function () { forEach(arr, false); }, TypeError, 'false is not a function');
|
||||
t['throws'](function () { forEach(arr, NaN); }, TypeError, 'NaN is not a function');
|
||||
t['throws'](function () { forEach(arr, 42); }, TypeError, '42 is not a function');
|
||||
t.doesNotThrow(function () { forEach(arr, function () {}); }, 'function is a function');
|
||||
t.doesNotThrow(function () { forEach(arr, setTimeout); }, 'setTimeout is a function');
|
||||
if (typeof window !== 'undefined') {
|
||||
t.doesNotThrow(function () { forEach(arr, window.alert); }, 'alert is a function');
|
||||
}
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('array', function (t) {
|
||||
var arr = [1, 2, 3];
|
||||
|
||||
t.test('iterates over every item', function (st) {
|
||||
var index = 0;
|
||||
forEach(arr, function () { index += 1; });
|
||||
st.equal(index, arr.length, 'iterates ' + arr.length + ' times');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('first iterator argument', function (st) {
|
||||
var index = 0;
|
||||
st.plan(arr.length);
|
||||
forEach(arr, function (item) {
|
||||
st.equal(arr[index], item, 'item ' + index + ' is passed as first argument');
|
||||
index += 1;
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('second iterator argument', function (st) {
|
||||
var counter = 0;
|
||||
st.plan(arr.length);
|
||||
forEach(arr, function (item, index) {
|
||||
st.equal(counter, index, 'index ' + index + ' is passed as second argument');
|
||||
counter += 1;
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('third iterator argument', function (st) {
|
||||
st.plan(arr.length);
|
||||
forEach(arr, function (item, index, array) {
|
||||
st.deepEqual(arr, array, 'array is passed as third argument');
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('context argument', function (st) {
|
||||
var context = {};
|
||||
forEach([], function () {
|
||||
st.equal(this, context, '"this" is the passed context');
|
||||
}, context);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('object', function (t) {
|
||||
var obj = {
|
||||
a: 1,
|
||||
b: 2,
|
||||
c: 3
|
||||
};
|
||||
var keys = ['a', 'b', 'c'];
|
||||
|
||||
var F = function F() {
|
||||
this.a = 1;
|
||||
this.b = 2;
|
||||
};
|
||||
F.prototype.c = 3;
|
||||
var fKeys = ['a', 'b'];
|
||||
|
||||
t.test('iterates over every object literal key', function (st) {
|
||||
var counter = 0;
|
||||
forEach(obj, function () { counter += 1; });
|
||||
st.equal(counter, keys.length, 'iterated ' + counter + ' times');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('iterates only over own keys', function (st) {
|
||||
var counter = 0;
|
||||
forEach(new F(), function () { counter += 1; });
|
||||
st.equal(counter, fKeys.length, 'iterated ' + fKeys.length + ' times');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('first iterator argument', function (st) {
|
||||
var index = 0;
|
||||
st.plan(keys.length);
|
||||
forEach(obj, function (item) {
|
||||
st.equal(obj[keys[index]], item, 'item at key ' + keys[index] + ' is passed as first argument');
|
||||
index += 1;
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('second iterator argument', function (st) {
|
||||
var counter = 0;
|
||||
st.plan(keys.length);
|
||||
forEach(obj, function (item, key) {
|
||||
st.equal(keys[counter], key, 'key ' + key + ' is passed as second argument');
|
||||
counter += 1;
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('third iterator argument', function (st) {
|
||||
st.plan(keys.length);
|
||||
forEach(obj, function (item, key, object) {
|
||||
st.deepEqual(obj, object, 'object is passed as third argument');
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('context argument', function (st) {
|
||||
var context = {};
|
||||
forEach({}, function () {
|
||||
st.equal(this, context, '"this" is the passed context');
|
||||
}, context);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('string', function (t) {
|
||||
var str = 'str';
|
||||
t.test('second iterator argument', function (st) {
|
||||
var counter = 0;
|
||||
st.plan((str.length * 2) + 1);
|
||||
forEach(str, function (item, index) {
|
||||
st.equal(counter, index, 'index ' + index + ' is passed as second argument');
|
||||
st.equal(str.charAt(index), item);
|
||||
counter += 1;
|
||||
});
|
||||
st.equal(counter, str.length, 'iterates ' + str.length + ' times');
|
||||
st.end();
|
||||
});
|
||||
t.end();
|
||||
});
|
Reference in New Issue
Block a user