mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-06 06:57:21 +00:00
push all website files
This commit is contained in:
195
website/functions/node_modules/empower/CHANGELOG.md
generated
vendored
Normal file
195
website/functions/node_modules/empower/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
### [1.3.1](https://github.com/power-assert-js/empower/releases/tag/v1.3.1) (2018-09-08)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [to work well with Jest, treat power-assert message as "not generated" to avoid message override](https://github.com/power-assert-js/empower/pull/29)
|
||||
|
||||
|
||||
## [1.3.0](https://github.com/power-assert-js/empower/releases/tag/v1.3.0) (2018-06-12)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* set stackStartFunction to self if undefined ([8d734cf1](https://github.com/power-assert-js/empower/commit/8d734cf1d501b868b4cd65d34b382a8f7170018d))
|
||||
|
||||
#### Chore
|
||||
|
||||
* update empower-core to 1.2.0, nothing has changed but has integrated into power-assert-runtime monorepo. ([1a3d2f66](1a3d2f666732e66fd6d1cd5419ce671a4d46e25a))
|
||||
|
||||
|
||||
### [1.2.3](https://github.com/power-assert-js/empower/releases/tag/v1.2.3) (2017-06-09)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [Re-instantiate AssertionError under Node v8 (and v7)](https://github.com/power-assert-js/empower/pull/26)
|
||||
|
||||
|
||||
### [1.2.2](https://github.com/power-assert-js/empower/releases/tag/v1.2.2) (2017-06-03)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [dealing with `err.name` on Node v8](https://github.com/power-assert-js/empower/pull/25)
|
||||
|
||||
|
||||
### [1.2.1](https://github.com/power-assert-js/empower/releases/tag/v1.2.1) (2016-06-05)
|
||||
|
||||
|
||||
* remove xtend from dependencies ([366f5c9](https://github.com/power-assert-js/empower/commit/366f5c909151ddce59f22999987717a7e2626d31))
|
||||
* update empower-core to 0.6.1 ([9194fe8](https://github.com/power-assert-js/empower/commit/9194fe8d35906623934966e37a38a27ed4a23f1a))
|
||||
|
||||
|
||||
## [1.2.0](https://github.com/power-assert-js/empower/releases/tag/v1.2.0) (2016-06-01)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [Extract core functionality to empower-core](https://github.com/power-assert-js/empower/pull/22)
|
||||
|
||||
|
||||
## [1.1.0](https://github.com/power-assert-js/empower/releases/tag/v1.1.0) (2015-11-07)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [support async-await state flags](https://github.com/power-assert-js/empower/pull/17) (by [@jamestalmage](https://github.com/jamestalmage))
|
||||
|
||||
|
||||
### [1.0.2](https://github.com/power-assert-js/empower/releases/tag/v1.0.2) (2015-10-22)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [make `_capt` and `_expr` methods not enumerable](https://github.com/power-assert-js/empower/pull/16)
|
||||
|
||||
|
||||
### [1.0.1](https://github.com/power-assert-js/empower/releases/tag/v1.0.1) (2015-09-08)
|
||||
|
||||
|
||||
* apply licensify on build ([282259b](https://github.com/power-assert-js/empower/commit/282259b632333c62e02113e374baa76dd7cd2890))
|
||||
|
||||
|
||||
## [1.0.0](https://github.com/power-assert-js/empower/releases/tag/v1.0.0) (2015-05-25)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* transfer to power-assert-js organization ([0cd9a89a](https://github.com/power-assert-js/empower/commit/0cd9a89ad3964c863e7f448ba46d565735850539))
|
||||
* support `deepStrictEqual` and `notDeepStrictEqual` ([bbaa9121](https://github.com/power-assert-js/empower/commit/bbaa91211bc7779a94934165b0d827ec89df6c5c))
|
||||
* use ponyfills for older browsers ([efea6e17](https://github.com/power-assert-js/empower/commit/efea6e173e28922eae7342d7e9f1f832992a99fd))
|
||||
|
||||
|
||||
## [0.11.0](https://github.com/power-assert-js/empower/releases/tag/v0.11.0) (2015-04-18)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* **empower:**
|
||||
* ship npm module with built bundle for browsers ([e9448d3b](https://github.com/power-assert-js/empower/commit/e9448d3bfd4b44e64810cb2d1e18d6a4e2c6ba4b))
|
||||
|
||||
|
||||
## [0.10.0](https://github.com/power-assert-js/empower/releases/tag/v0.10.0) (2014-11-11)
|
||||
|
||||
|
||||
* **empower:**
|
||||
* update escallmatch ([f7a0d970](https://github.com/power-assert-js/empower/commit/f7a0d970333cdec25aacaf3880473da5ccec24de))
|
||||
|
||||
|
||||
### 0.9.1 (2014-10-07)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* **empower:** power-assert output doesn't appear in Node 0.11.x ([53e882e0](https://github.com/power-assert-js/empower/commit/53e882e00ad3dd8b45f262ab14ac782ed582b954))
|
||||
|
||||
|
||||
## 0.9.0 (2014-09-01)
|
||||
|
||||
|
||||
## 0.8.0 (2014-08-12)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
|
||||
* **empower:**
|
||||
* [modularized by browserify](https://github.com/power-assert-js/empower/pull/12)
|
||||
* use `escallmatch` module to describe target patterns ([533a21a0](https://github.com/power-assert-js/empower/commit/533a21a0374f23f5ca4e198c17d1e20f10d705fa))
|
||||
* support assertion methods with three or more arguments ([d31dca86](https://github.com/power-assert-js/empower/commit/d31dca86de2b05ee88ca5df15579308368657d43))
|
||||
* if not in patterns, do not empower assertion function itself ([1d73a756](https://github.com/power-assert-js/empower/commit/1d73a7560ef586a45a0a9259e57c143b3b60caaa))
|
||||
* option `targetMethods` does not required any more ([8ffcc49f](https://github.com/power-assert-js/empower/commit/8ffcc49fcdb5523eb38e63a0e7cca34f752d9302))
|
||||
* rename `saveContextOnFail` option to `saveContextOnRethrow` ([1f6133b2](https://github.com/power-assert-js/empower/commit/1f6133b24be672f32cfd3b66522a7d14ca5d22e1))
|
||||
* rename `modifyMessageOnFail` option to `modifyMessageOnRethrow` ([0c8a88f0](https://github.com/power-assert-js/empower/commit/0c8a88f0592917ba15ac0c1bf21c8f39f39ab350))
|
||||
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
* `saveContextOnFail` option is renamed to `saveContextOnRethrow`
|
||||
|
||||
There is nothing to change unless you are using `saveContextOnFail` option.
|
||||
|
||||
If you are using `saveContextOnFail` option, change your code from the following:
|
||||
|
||||
`empower(originalAssert, formatter, {saveContextOnFail: true})`
|
||||
|
||||
To:
|
||||
|
||||
`empower(originalAssert, formatter, {saveContextOnRethrow: true})`
|
||||
|
||||
([1f6133b2](https://github.com/power-assert-js/empower/commit/1f6133b24be672f32cfd3b66522a7d14ca5d22e1))
|
||||
|
||||
* `modifyMessageOnFail` option is renamed to `modifyMessageOnRethrow`
|
||||
|
||||
There is nothing to change unless you are using `modifyMessageOnFail` option.
|
||||
|
||||
If you are using `modifyMessageOnFail` option, change your code from the following:
|
||||
|
||||
`empower(originalAssert, formatter, {modifyMessageOnFail: true})`
|
||||
|
||||
To:
|
||||
|
||||
`empower(originalAssert, formatter, {modifyMessageOnRethrow: true})`
|
||||
|
||||
([0c8a88f0](https://github.com/power-assert-js/empower/commit/0c8a88f0592917ba15ac0c1bf21c8f39f39ab350))
|
||||
|
||||
* option `targetMethods` does not required any more
|
||||
|
||||
If you already customize enhancement pattern using `targetMethods`, you need to migarte. To migrate, change your code from the following:
|
||||
|
||||
```javascript
|
||||
var yourAssert = require('./your-assert');
|
||||
var empower = require('empower');
|
||||
var formatter = require('power-assert-formatter')();
|
||||
var options = {
|
||||
targetMethods: {
|
||||
oneArg: [
|
||||
'okay'
|
||||
],
|
||||
twoArgs: [
|
||||
'equal',
|
||||
'customEqual'
|
||||
]
|
||||
}
|
||||
};
|
||||
var assert = empower(yourAssert, formatter, options);
|
||||
```
|
||||
|
||||
To:
|
||||
|
||||
```javascript
|
||||
var yourAssert = require('./your-assert');
|
||||
var empower = require('empower');
|
||||
var formatter = require('power-assert-formatter')();
|
||||
var options = {
|
||||
patterns: [
|
||||
'yourAssert(value, [message])',
|
||||
'yourAssert.okay(value, [message])',
|
||||
'yourAssert.equal(actual, expected, [message])',
|
||||
'yourAssert.customEqual(actual, expected, [message])'
|
||||
]
|
||||
};
|
||||
var assert = empower(yourAssert, formatter, options);
|
||||
```
|
||||
|
||||
([8ffcc49f](https://github.com/power-assert-js/empower/commit/8ffcc49fcdb5523eb38e63a0e7cca34f752d9302))
|
20
website/functions/node_modules/empower/MIT-LICENSE.txt
generated
vendored
Normal file
20
website/functions/node_modules/empower/MIT-LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2013-2018 Takuto Wada, https://github.com/power-assert-js/empower
|
||||
|
||||
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.
|
251
website/functions/node_modules/empower/README.md
generated
vendored
Normal file
251
website/functions/node_modules/empower/README.md
generated
vendored
Normal file
@@ -0,0 +1,251 @@
|
||||
empower
|
||||
================================
|
||||
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![NPM package][npm-image]][npm-url]
|
||||
[![Bower package][bower-image]][bower-url]
|
||||
[![Dependency Status][depstat-image]][depstat-url]
|
||||
[![Coverage Status][coverage-image]][coverage-url]
|
||||
[![Code Climate][codeclimate-image]][codeclimate-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Built with Gulp][gulp-image]][gulp-url]
|
||||
|
||||
|
||||
Power Assert feature enhancer for assert function/object.
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
---------------------------------------
|
||||
`empower` is a core module of [power-assert](https://github.com/power-assert-js/power-assert) family. `empower` enhances standard `assert` function or any assert-like object to work with power-assert feature added code instrumented by [espower](https://github.com/power-assert-js/espower).
|
||||
|
||||
|
||||
`empower` works with standard `assert` function (best fit with [Mocha](http://mochajs.org/)), and also supports assert-like objects/functions provided by various testing frameworks such as [QUnit](https://qunitjs.com/), [buster.js](http://docs.busterjs.org/en/latest/), and [nodeunit](https://github.com/caolan/nodeunit).
|
||||
|
||||
|
||||
Pull-requests, issue reports and patches are always welcomed. See [power-assert](https://github.com/power-assert-js/power-assert) project for more documentation.
|
||||
|
||||
|
||||
CHANGELOG
|
||||
---------------------------------------
|
||||
See [CHANGELOG](https://github.com/power-assert-js/empower/blob/master/CHANGELOG.md)
|
||||
|
||||
|
||||
API
|
||||
---------------------------------------
|
||||
|
||||
### var enhancedAssert = empower(originalAssert, formatter, [options])
|
||||
|
||||
| return type |
|
||||
|:-----------------------|
|
||||
| `function` or `object` |
|
||||
|
||||
`empower` function takes function or object(`originalAssert`) and `formatter` function created by [power-assert-formatter](https://github.com/power-assert-js/power-assert-formatter) then returns PowerAssert feature added function/object base on `originalAssert`.
|
||||
If `destructive` option is falsy, `originalAssert` will be unchanged. If `destructive` option is truthy, `originalAssert` will be manipulated directly and returned `enhancedAssert` will be the same instance of `originalAssert`.
|
||||
|
||||
|
||||
#### originalAssert
|
||||
|
||||
| type | default value |
|
||||
|:-----------------------|:--------------|
|
||||
| `function` or `object` | N/A |
|
||||
|
||||
`originalAssert` is an instance of standard `assert` function or any assert-like object. see [SUPPORTED ASSERTION LIBRARIES](https://github.com/power-assert-js/empower#supported-assertion-libraries) and [ASSERTION LIBRARIES KNOWN TO WORK](https://github.com/power-assert-js/empower#assertion-libraries-known-to-work) section. Be careful that `originalAssert` will be manipulated directly if `destructive` option is truthy.
|
||||
|
||||
|
||||
#### formatter
|
||||
|
||||
| type | default value |
|
||||
|:-----------|:--------------|
|
||||
| `function` | N/A |
|
||||
|
||||
formatter function created by [power-assert-formatter](https://github.com/power-assert-js/power-assert-formatter).
|
||||
|
||||
|
||||
#### options
|
||||
|
||||
| type | default value |
|
||||
|:---------|:--------------|
|
||||
| `object` | (return value of `empower.defaultOptions()`) |
|
||||
|
||||
Configuration options. If not passed, default options will be used.
|
||||
|
||||
|
||||
#### options.destructive
|
||||
|
||||
| type | default value |
|
||||
|:----------|:--------------|
|
||||
| `boolean` | `false` |
|
||||
|
||||
If truthy, modify `originalAssert` destructively.
|
||||
|
||||
If `false`, empower mimics originalAssert as new object/function, so `originalAssert` will not be changed. If `true`, `originalAssert` will be manipulated directly and returned `enhancedAssert` will be the same instance of `originalAssert`.
|
||||
|
||||
|
||||
#### options.modifyMessageOnRethrow
|
||||
|
||||
| type | default value |
|
||||
|:----------|:--------------|
|
||||
| `boolean` | `false` |
|
||||
|
||||
If truthy, modify `message` property of AssertionError on rethrow.
|
||||
|
||||
|
||||
#### options.saveContextOnRethrow
|
||||
|
||||
| type | default value |
|
||||
|:----------|:--------------|
|
||||
| `boolean` | `false` |
|
||||
|
||||
If truthy, add `powerAssertContext` property to AssertionError on rethrow.
|
||||
|
||||
|
||||
`modifyMessageOnRethrow` option and `saveContextOnRethrow` option makes behavior matrix as below.
|
||||
|
||||
| modifyMessageOnRethrow | saveContextOnRethrow | resulting behavior |
|
||||
|:-----------------------|:---------------------|:--------------------------------------------------|
|
||||
| `false` (default) | `false` (default) | Always modify assertion message argument directly |
|
||||
| `true` | `false` | Modify `message` of AssertionError on fail |
|
||||
| `false` | `true` | Do not modify `message` of AssertionError but add `powerAssertContext` property on fail |
|
||||
| `true` | `true` | On fail, modify `message` of AssertionError and also add `powerAssertContext` property |
|
||||
|
||||
|
||||
#### options.patterns
|
||||
|
||||
| type | default value |
|
||||
|:--------------------|:--------------------|
|
||||
| `Array` of `string` | objects shown below |
|
||||
|
||||
```javascript
|
||||
[
|
||||
'assert(value, [message])',
|
||||
'assert.ok(value, [message])',
|
||||
'assert.equal(actual, expected, [message])',
|
||||
'assert.notEqual(actual, expected, [message])',
|
||||
'assert.strictEqual(actual, expected, [message])',
|
||||
'assert.notStrictEqual(actual, expected, [message])',
|
||||
'assert.deepEqual(actual, expected, [message])',
|
||||
'assert.notDeepEqual(actual, expected, [message])',
|
||||
'assert.deepStrictEqual(actual, expected, [message])',
|
||||
'assert.notDeepStrictEqual(actual, expected, [message])'
|
||||
]
|
||||
```
|
||||
|
||||
Target patterns for power assert feature instrumentation.
|
||||
|
||||
Pattern detection is done by [escallmatch](https://github.com/twada/escallmatch). Any arguments enclosed in bracket (for example, `[message]`) means optional parameters. Without bracket means mandatory parameters.
|
||||
|
||||
|
||||
### var options = empower.defaultOptions();
|
||||
|
||||
Returns default options object for `empower` function. In other words, returns
|
||||
|
||||
```javascript
|
||||
{
|
||||
destructive: false,
|
||||
modifyMessageOnRethrow: false,
|
||||
saveContextOnRethrow: false,
|
||||
patterns: [
|
||||
'assert(value, [message])',
|
||||
'assert.ok(value, [message])',
|
||||
'assert.equal(actual, expected, [message])',
|
||||
'assert.notEqual(actual, expected, [message])',
|
||||
'assert.strictEqual(actual, expected, [message])',
|
||||
'assert.notStrictEqual(actual, expected, [message])',
|
||||
'assert.deepEqual(actual, expected, [message])',
|
||||
'assert.notDeepEqual(actual, expected, [message])',
|
||||
'assert.deepStrictEqual(actual, expected, [message])',
|
||||
'assert.notDeepStrictEqual(actual, expected, [message])'
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
SUPPORTED ASSERTION LIBRARIES
|
||||
---------------------------------------
|
||||
* [Node assert API](https://nodejs.org/api/assert.html)
|
||||
* [Jxck/assert](https://github.com/Jxck/assert)
|
||||
|
||||
|
||||
ASSERTION LIBRARIES KNOWN TO WORK
|
||||
---------------------------------------
|
||||
* [QUnit.assert](https://qunitjs.com/)
|
||||
* [nodeunit](https://github.com/caolan/nodeunit)
|
||||
* [buster-assertions](http://docs.busterjs.org/en/latest/modules/buster-assertions/)
|
||||
|
||||
|
||||
INSTALL
|
||||
---------------------------------------
|
||||
|
||||
### via npm
|
||||
|
||||
Install
|
||||
|
||||
$ npm install --save-dev empower
|
||||
|
||||
|
||||
#### use empower npm module on browser
|
||||
|
||||
`empower` function is exported
|
||||
|
||||
<script type="text/javascript" src="./path/to/node_modules/empower/build/empower.js"></script>
|
||||
|
||||
|
||||
### via bower
|
||||
|
||||
Install
|
||||
|
||||
$ bower install --save-dev empower
|
||||
|
||||
Then load (`empower` function is exported)
|
||||
|
||||
<script type="text/javascript" src="./path/to/bower_components/empower/build/empower.js"></script>
|
||||
|
||||
|
||||
OUR SUPPORT POLICY
|
||||
---------------------------------------
|
||||
|
||||
We support Node under maintenance. In other words, we stop supporting old Node version when [their maintenance ends](https://github.com/nodejs/LTS).
|
||||
|
||||
We also support "modern enough" browsers such as Chrome, Firefox, Safari, Edge etc.
|
||||
|
||||
Any other environments are not supported officially (means that we do not test against them on CI service). empower is known to work with old browsers, and trying to keep them working though.
|
||||
|
||||
|
||||
AUTHOR
|
||||
---------------------------------------
|
||||
* [Takuto Wada](https://github.com/twada)
|
||||
|
||||
|
||||
CONTRIBUTORS
|
||||
---------------------------------------
|
||||
* [James Talmage (jamestalmage)](https://github.com/jamestalmage)
|
||||
|
||||
|
||||
LICENSE
|
||||
---------------------------------------
|
||||
Licensed under the [MIT](https://github.com/power-assert-js/empower/blob/master/MIT-LICENSE.txt) license.
|
||||
|
||||
|
||||
[npm-url]: https://npmjs.org/package/empower
|
||||
[npm-image]: https://badge.fury.io/js/empower.svg
|
||||
|
||||
[bower-url]: https://badge.fury.io/bo/empower
|
||||
[bower-image]: https://badge.fury.io/bo/empower.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/power-assert-js/empower
|
||||
[travis-image]: https://secure.travis-ci.org/power-assert-js/empower.svg?branch=master
|
||||
|
||||
[depstat-url]: https://gemnasium.com/power-assert-js/empower
|
||||
[depstat-image]: https://gemnasium.com/power-assert-js/empower.svg
|
||||
|
||||
[license-url]: https://github.com/power-assert-js/empower/blob/master/MIT-LICENSE.txt
|
||||
[license-image]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat
|
||||
|
||||
[codeclimate-url]: https://codeclimate.com/github/power-assert-js/empower
|
||||
[codeclimate-image]: https://codeclimate.com/github/power-assert-js/empower/badges/gpa.svg
|
||||
|
||||
[coverage-url]: https://coveralls.io/r/power-assert-js/empower?branch=master
|
||||
[coverage-image]: https://coveralls.io/repos/power-assert-js/empower/badge.svg?branch=master
|
||||
|
||||
[gulp-url]: http://gulpjs.com/
|
||||
[gulp-image]: https://img.shields.io/badge/built_with-gulp-brightgreen.svg
|
1329
website/functions/node_modules/empower/build/empower.js
generated
vendored
Normal file
1329
website/functions/node_modules/empower/build/empower.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
95
website/functions/node_modules/empower/index.js
generated
vendored
Normal file
95
website/functions/node_modules/empower/index.js
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* empower - Power Assert feature enhancer for assert function/object.
|
||||
*
|
||||
* https://github.com/power-assert-js/empower
|
||||
*
|
||||
* Copyright (c) 2013-2018 Takuto Wada
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/power-assert-js/empower/blob/master/MIT-LICENSE.txt
|
||||
*/
|
||||
var empowerCore = require('empower-core');
|
||||
var defaultOptions = require('./lib/default-options');
|
||||
var capturable = require('./lib/capturable');
|
||||
var assign = require('core-js/library/fn/object/assign');
|
||||
var define = require('./lib/define-properties');
|
||||
|
||||
/**
|
||||
* Enhance Power Assert feature to assert function/object.
|
||||
* @param assert target assert function or object to enhance
|
||||
* @param formatter power assert format function
|
||||
* @param options enhancement options
|
||||
* @return enhanced assert function/object
|
||||
*/
|
||||
function empower (assert, formatter, options) {
|
||||
var config = assign(defaultOptions(), options);
|
||||
var eagerEvaluation = !(config.modifyMessageOnRethrow || config.saveContextOnRethrow);
|
||||
// see: https://github.com/power-assert-js/empower/pull/26
|
||||
var shouldRecreateAssertionError = (function isStackUnchanged () {
|
||||
if (typeof assert !== 'function') {
|
||||
return false;
|
||||
}
|
||||
if (typeof assert.AssertionError !== 'function') {
|
||||
return false;
|
||||
}
|
||||
var ae = new assert.AssertionError({
|
||||
actual: 123,
|
||||
expected: 456,
|
||||
operator: '==='
|
||||
});
|
||||
ae.message = '[REPLACED MESSAGE]';
|
||||
return !(/REPLACED MESSAGE/.test(ae.stack)) && /123 === 456/.test(ae.stack);
|
||||
})();
|
||||
|
||||
var empowerCoreConfig = assign(config, {
|
||||
modifyMessageBeforeAssert: function (beforeAssertEvent) {
|
||||
var message = beforeAssertEvent.originalMessage;
|
||||
if (!eagerEvaluation) {
|
||||
return message;
|
||||
}
|
||||
return buildPowerAssertText(formatter, message, beforeAssertEvent.powerAssertContext);
|
||||
},
|
||||
onError: function onError (errorEvent) {
|
||||
var e = errorEvent.error;
|
||||
if (!/^AssertionError/.test(e.name)) {
|
||||
throw e;
|
||||
}
|
||||
if (!errorEvent.powerAssertContext) {
|
||||
throw e;
|
||||
}
|
||||
var poweredMessage;
|
||||
if (config.modifyMessageOnRethrow || config.saveContextOnRethrow) {
|
||||
poweredMessage = buildPowerAssertText(formatter, errorEvent.originalMessage, errorEvent.powerAssertContext);
|
||||
if (shouldRecreateAssertionError) {
|
||||
e = new assert.AssertionError({
|
||||
message: poweredMessage,
|
||||
actual: e.actual,
|
||||
expected: e.expected,
|
||||
operator: e.operator,
|
||||
stackStartFunction: e.stackStartFunction || onError
|
||||
});
|
||||
e.generatedMessage = false;
|
||||
}
|
||||
}
|
||||
if (config.modifyMessageOnRethrow && !shouldRecreateAssertionError) {
|
||||
e.message = poweredMessage;
|
||||
e.generatedMessage = false;
|
||||
}
|
||||
if (config.saveContextOnRethrow) {
|
||||
e.powerAssertContext = errorEvent.powerAssertContext;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
var enhancedAssert = empowerCore(assert, empowerCoreConfig);
|
||||
define(enhancedAssert, capturable());
|
||||
return enhancedAssert;
|
||||
}
|
||||
|
||||
function buildPowerAssertText (formatter, message, context) {
|
||||
// console.log(message);
|
||||
var powerAssertText = formatter(context);
|
||||
return message ? message + ' ' + powerAssertText : powerAssertText;
|
||||
};
|
||||
|
||||
empower.defaultOptions = defaultOptions;
|
||||
module.exports = empower;
|
38
website/functions/node_modules/empower/lib/capturable.js
generated
vendored
Normal file
38
website/functions/node_modules/empower/lib/capturable.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function capturable () {
|
||||
var events = [];
|
||||
|
||||
function _capt (value, espath) {
|
||||
events.push({value: value, espath: espath});
|
||||
return value;
|
||||
}
|
||||
|
||||
function _expr (value, args) {
|
||||
var captured = events;
|
||||
events = [];
|
||||
var source = {
|
||||
content: args.content,
|
||||
filepath: args.filepath,
|
||||
line: args.line
|
||||
};
|
||||
if (args.generator) {
|
||||
source.generator = true;
|
||||
}
|
||||
if (args.async) {
|
||||
source.async = true;
|
||||
}
|
||||
return {
|
||||
powerAssertContext: {
|
||||
value: value,
|
||||
events: captured
|
||||
},
|
||||
source: source
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
_capt: _capt,
|
||||
_expr: _expr
|
||||
};
|
||||
};
|
11
website/functions/node_modules/empower/lib/default-options.js
generated
vendored
Normal file
11
website/functions/node_modules/empower/lib/default-options.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
var empowerCore = require('empower-core');
|
||||
var assign = require('core-js/library/fn/object/assign');
|
||||
|
||||
module.exports = function defaultOptions () {
|
||||
return assign(empowerCore.defaultOptions(), {
|
||||
modifyMessageOnRethrow: false,
|
||||
saveContextOnRethrow: false
|
||||
});
|
||||
};
|
16
website/functions/node_modules/empower/lib/define-properties.js
generated
vendored
Normal file
16
website/functions/node_modules/empower/lib/define-properties.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var defineProperty = require('core-js/library/fn/object/define-property');
|
||||
var forEach = require('core-js/library/fn/array/for-each');
|
||||
var keys = require('core-js/library/fn/object/keys');
|
||||
|
||||
module.exports = function defineProperties (obj, map) {
|
||||
forEach(keys(map), function (name) {
|
||||
defineProperty(obj, name, {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: map[name],
|
||||
writable: true
|
||||
});
|
||||
});
|
||||
};
|
107
website/functions/node_modules/empower/package.json
generated
vendored
Normal file
107
website/functions/node_modules/empower/package.json
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"_from": "empower@^1.3.1",
|
||||
"_id": "empower@1.3.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-uB6/ViBaawOO/uujFADTK3SqdYlxYNn+N4usK9MRKZ4Hbn/1QSy8k2PezxCA2/+JGbF8vd/eOfghZ90oOSDZCA==",
|
||||
"_location": "/empower",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "empower@^1.3.1",
|
||||
"name": "empower",
|
||||
"escapedName": "empower",
|
||||
"rawSpec": "^1.3.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.3.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/power-assert"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/empower/-/empower-1.3.1.tgz",
|
||||
"_shasum": "768979cbbb36d71d8f5edaab663deacb9dab916c",
|
||||
"_spec": "empower@^1.3.1",
|
||||
"_where": "C:\\Users\\jlevi\\Downloads\\tr2022-strategy-master\\tr2022-strategy-master\\data analysis\\functions\\node_modules\\power-assert",
|
||||
"author": {
|
||||
"name": "Takuto Wada",
|
||||
"email": "takuto.wada@gmail.com",
|
||||
"url": "https://github.com/twada"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/power-assert-js/empower/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "James Talmage",
|
||||
"url": "https://github.com/jamestalmage"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"core-js": "^2.0.0",
|
||||
"empower-core": "^1.2.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Power Assert feature enhancer for assert function/object",
|
||||
"devDependencies": {
|
||||
"acorn": "^3.0.4",
|
||||
"acorn-es7-plugin": "^1.0.12",
|
||||
"babel-core": "^5.8.33",
|
||||
"blanket": "1.1.9",
|
||||
"browserify": "^13.0.0",
|
||||
"buster-assertions": "^0.10.4",
|
||||
"del": "^2.0.1",
|
||||
"escodegen": "^1.7.0",
|
||||
"espower": "^1.2.1",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-derequire": "^2.1.0",
|
||||
"gulp-dereserve": "^0.2.1",
|
||||
"gulp-mocha": "^2.1.3",
|
||||
"gulp-mocha-phantomjs": "^0.12.1",
|
||||
"gulp-util": "^3.0.6",
|
||||
"gulp-webserver": "^0.9.1",
|
||||
"licensify": "^3.1.0",
|
||||
"mocha": "^2.3.2",
|
||||
"mocha-lcov-reporter": "^1.2.0",
|
||||
"through2": "^2.0.0",
|
||||
"vinyl-source-stream": "^1.1.0"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "./lib"
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"MIT-LICENSE.txt",
|
||||
"README.md",
|
||||
"index.js",
|
||||
"lib",
|
||||
"build/empower.js",
|
||||
"package.json"
|
||||
],
|
||||
"homepage": "https://github.com/power-assert-js/empower",
|
||||
"keywords": [
|
||||
"power-assert",
|
||||
"assert",
|
||||
"assertion",
|
||||
"test",
|
||||
"testing"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./index.js",
|
||||
"name": "empower",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/power-assert-js/empower.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bower": "bower install --config.interactive=false",
|
||||
"build": "npm prune && npm dedupe && gulp bundle",
|
||||
"coveralls": "gulp coverage && cat ./coverage.lcov | coveralls",
|
||||
"preversion": "npm test",
|
||||
"test": "gulp test",
|
||||
"unit": "gulp unit",
|
||||
"version": "npm run build && git add -A build",
|
||||
"watch": "gulp watch"
|
||||
},
|
||||
"version": "1.3.1"
|
||||
}
|
Reference in New Issue
Block a user