增加晶全app静态页面
This commit is contained in:
18
node_modules/es6-set/CHANGELOG.md
generated
vendored
Normal file
18
node_modules/es6-set/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [0.1.6](https://github.com/medikoo/es6-set/compare/v0.1.5...v0.1.6) (2022-08-17)
|
||||
|
||||
### Maintenance Improvements
|
||||
|
||||
- Switch LICENSE from MIT to ISC ([50f0cae](https://github.com/medikoo/es6-set/commit/50f0cae11ec08b108a1aac10ef19a3b9b801db74))
|
||||
- Add .editorconfig ([c1f97aa](https://github.com/medikoo/es6-set/commit/c1f97aa741796efa69b79a26cf8876da67b43021))
|
||||
- Add CONTRIBUTING.md ([2c9907c](https://github.com/medikoo/es6-set/commit/2c9907c5cdf6e77725a599cd6c7fa4fdb44acdb2))
|
||||
- Configure `coverage` script ([3a1fb7a](https://github.com/medikoo/es6-set/commit/3a1fb7ab99393115a7b56bb89f9213cab1e178c1))
|
||||
- Configure Prettier ([192cbf2](https://github.com/medikoo/es6-set/commit/192cbf23c7270b9b049b39efe52cf29e68ec2fc1))
|
||||
- Switch linter from `xlint` to `eslint` ([1d77dc3](https://github.com/medikoo/es6-set/commit/1d77dc3853bf3269e8e61fc1c3faf7b814a41d29))
|
||||
|
||||
## Changelog for previous versions
|
||||
|
||||
See `CHANGES` file
|
63
node_modules/es6-set/CONTRIBUTING.md
generated
vendored
Normal file
63
node_modules/es6-set/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
# Contributing Guidelines
|
||||
|
||||
## Setup
|
||||
|
||||
To begin development fork repository and run `npm install` in its root folder.
|
||||
|
||||
## When you propose a new feature or bug fix
|
||||
|
||||
Please make sure there is an open issue discussing your contribution before jumping into a Pull Request!
|
||||
|
||||
There are just a few situations (listed below) in which it is fine to submit PR without a corresponding issue:
|
||||
|
||||
- Documentation update
|
||||
- Obvious bug fix
|
||||
- Maintenance improvement
|
||||
|
||||
In all other cases please check if there's an open an issue discussing the given proposal, if there is not, create an issue respecting all its template remarks.
|
||||
|
||||
In non-trivial cases please propose and let us review an implementation spec (in the corresponding issue) before jumping into implementation.
|
||||
|
||||
Do not submit draft PRs. Submit only finalized work which is ready for merge. If you have any doubts related to implementation work please discuss in the corresponding issue.
|
||||
|
||||
Once a PR has been reviewed and some changes are suggested, please ensure to **re-request review** after all new changes are pushed. It's the best and quietest way to inform maintainers that your work is ready to be checked again.
|
||||
|
||||
## When you want to work on an existing issue
|
||||
|
||||
**Note:** Please write a quick comment in the corresponding issue and ask if the feature is still relevant and that you want to jump into the implementation.
|
||||
|
||||
Check out our [help wanted](https://github.com/medikoo/es6-set/labels/help%20wanted) or [good first issue](https://github.com/medikoo/es6-set/labels/good%20first%20issue) labels to find issues we want to move forward with your help.
|
||||
|
||||
We will do our best to respond/review/merge your PR according to priority.
|
||||
|
||||
## Writing / improving documentation
|
||||
|
||||
Do you see a typo or other ways to improve it? Feel free to edit it and submit a Pull Request!
|
||||
|
||||
# Code Style
|
||||
|
||||
We aim for a clean, consistent code style. We're using [Prettier](https://prettier.io/) to confirm one code formatting style and [ESlint](https://eslint.org/) helps us to stay away from obvious issues that can be picked via static analysis.
|
||||
|
||||
Ideally, you should have Prettier and ESlint integrated into your code editor, which will help you not think about specific rules and be sure you submit the code that follows guidelines.
|
||||
|
||||
## Verifying prettier formatting
|
||||
|
||||
```
|
||||
npm run prettier-check
|
||||
```
|
||||
|
||||
## Verifying linting style
|
||||
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
# Testing
|
||||
|
||||
This package needs to work in any ES5 environment, therefore it's good to confirm it passes tests in Node.js v0.12 release.
|
||||
|
||||
Run tests via:
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
15
node_modules/es6-set/LICENSE
generated
vendored
Normal file
15
node_modules/es6-set/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2013-022, Mariusz Nowak, @medikoo, medikoo.com
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
102
node_modules/es6-set/README.md
generated
vendored
Normal file
102
node_modules/es6-set/README.md
generated
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
[![Build status][build-image]][build-url]
|
||||
[![Tests coverage][cov-image]][cov-url]
|
||||
[![npm version][npm-image]][npm-url]
|
||||
|
||||
# es6-set
|
||||
|
||||
## Set collection as specified in ECMAScript6
|
||||
|
||||
**Warning:
|
||||
v0.1 version does not ensure O(1) algorithm complexity (but O(n)). This shortcoming will be addressed in v1.0**
|
||||
|
||||
### Usage
|
||||
|
||||
If you want to make sure your environment implements `Set`, do:
|
||||
|
||||
```javascript
|
||||
require("es6-set/implement");
|
||||
```
|
||||
|
||||
If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Set` on global scope, do:
|
||||
|
||||
```javascript
|
||||
var Set = require("es6-set");
|
||||
```
|
||||
|
||||
If you strictly want to use polyfill even if native `Set` exists, do:
|
||||
|
||||
```javascript
|
||||
var Set = require("es6-set/polyfill");
|
||||
```
|
||||
|
||||
### Installation
|
||||
|
||||
$ npm install es6-set
|
||||
|
||||
To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
|
||||
|
||||
#### API
|
||||
|
||||
Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-set-objects). Still if you want quick look, follow examples:
|
||||
|
||||
```javascript
|
||||
var Set = require("es6-set");
|
||||
|
||||
var set = new Set(["raz", "dwa", {}]);
|
||||
|
||||
set.size; // 3
|
||||
set.has("raz"); // true
|
||||
set.has("foo"); // false
|
||||
set.add("foo"); // set
|
||||
set.size; // 4
|
||||
set.has("foo"); // true
|
||||
set.has("dwa"); // true
|
||||
set.delete("dwa"); // true
|
||||
set.size; // 3
|
||||
|
||||
set.forEach(function (value) {
|
||||
// 'raz', {}, 'foo' iterated
|
||||
});
|
||||
|
||||
// FF nightly only:
|
||||
for (value of set) {
|
||||
// 'raz', {}, 'foo' iterated
|
||||
}
|
||||
|
||||
var iterator = set.values();
|
||||
|
||||
iterator.next(); // { done: false, value: 'raz' }
|
||||
iterator.next(); // { done: false, value: {} }
|
||||
iterator.next(); // { done: false, value: 'foo' }
|
||||
iterator.next(); // { done: true, value: undefined }
|
||||
|
||||
set.clear(); // undefined
|
||||
set.size; // 0
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
$ npm test
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-es6-set?utm_source=npm-es6-set&utm_medium=referral&utm_campaign=readme">Get professional support for d with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
[build-image]: https://github.com/medikoo/es6-set/workflows/Integrate/badge.svg
|
||||
[build-url]: https://github.com/medikoo/es6-set/actions?query=workflow%3AIntegrate
|
||||
[cov-image]: https://img.shields.io/codecov/c/github/medikoo/es6-set.svg
|
||||
[cov-url]: https://codecov.io/gh/medikoo/es6-set
|
||||
[npm-image]: https://img.shields.io/npm/v/es6-set.svg
|
||||
[npm-url]: https://www.npmjs.com/package/es6-set
|
5
node_modules/es6-set/ext/copy.js
generated
vendored
Normal file
5
node_modules/es6-set/ext/copy.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var SetConstructor = require("../");
|
||||
|
||||
module.exports = function () { return new SetConstructor(this); };
|
17
node_modules/es6-set/ext/every.js
generated
vendored
Normal file
17
node_modules/es6-set/ext/every.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
var callable = require("es5-ext/object/valid-callable")
|
||||
, forOf = require("es6-iterator/for-of")
|
||||
, call = Function.prototype.call;
|
||||
|
||||
module.exports = function (cb /*, thisArg*/) {
|
||||
var thisArg = arguments[1], result = true;
|
||||
callable(cb);
|
||||
forOf(this, function (value, doBreak) {
|
||||
if (!call.call(cb, thisArg, value)) {
|
||||
result = false;
|
||||
doBreak();
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
15
node_modules/es6-set/ext/filter.js
generated
vendored
Normal file
15
node_modules/es6-set/ext/filter.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var callable = require("es5-ext/object/valid-callable")
|
||||
, forOf = require("es6-iterator/for-of")
|
||||
, isSet = require("../is-set")
|
||||
, SetConstructor = require("../")
|
||||
, call = Function.prototype.call;
|
||||
|
||||
module.exports = function (cb /*, thisArg*/) {
|
||||
var thisArg = arguments[1], result;
|
||||
callable(cb);
|
||||
result = isSet(this) ? new this.constructor() : new SetConstructor();
|
||||
forOf(this, function (value) { if (call.call(cb, thisArg, value)) result.add(value); });
|
||||
return result;
|
||||
};
|
3
node_modules/es6-set/ext/get-first.js
generated
vendored
Normal file
3
node_modules/es6-set/ext/get-first.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () { return this.values().next().value; };
|
10
node_modules/es6-set/ext/get-last.js
generated
vendored
Normal file
10
node_modules/es6-set/ext/get-last.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var value, iterator = this.values(), item = iterator.next();
|
||||
while (!item.done) {
|
||||
value = item.value;
|
||||
item = iterator.next();
|
||||
}
|
||||
return value;
|
||||
};
|
17
node_modules/es6-set/ext/some.js
generated
vendored
Normal file
17
node_modules/es6-set/ext/some.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
var callable = require("es5-ext/object/valid-callable")
|
||||
, forOf = require("es6-iterator/for-of")
|
||||
, call = Function.prototype.call;
|
||||
|
||||
module.exports = function (cb /*, thisArg*/) {
|
||||
var thisArg = arguments[1], result = false;
|
||||
callable(cb);
|
||||
forOf(this, function (value, doBreak) {
|
||||
if (call.call(cb, thisArg, value)) {
|
||||
result = true;
|
||||
doBreak();
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
10
node_modules/es6-set/implement.js
generated
vendored
Normal file
10
node_modules/es6-set/implement.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(require("es5-ext/global"), "Set", {
|
||||
value: require("./polyfill"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
node_modules/es6-set/index.js
generated
vendored
Normal file
3
node_modules/es6-set/index.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? Set : require("./polyfill");
|
24
node_modules/es6-set/is-implemented.js
generated
vendored
Normal file
24
node_modules/es6-set/is-implemented.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var set, iterator, result;
|
||||
if (typeof Set !== "function") return false;
|
||||
set = new Set(["raz", "dwa", "trzy"]);
|
||||
if (String(set) !== "[object Set]") return false;
|
||||
if (set.size !== 3) return false;
|
||||
if (typeof set.add !== "function") return false;
|
||||
if (typeof set.clear !== "function") return false;
|
||||
if (typeof set.delete !== "function") return false;
|
||||
if (typeof set.entries !== "function") return false;
|
||||
if (typeof set.forEach !== "function") return false;
|
||||
if (typeof set.has !== "function") return false;
|
||||
if (typeof set.keys !== "function") return false;
|
||||
if (typeof set.values !== "function") return false;
|
||||
|
||||
iterator = set.values();
|
||||
result = iterator.next();
|
||||
if (result.done !== false) return false;
|
||||
if (result.value !== "raz") return false;
|
||||
|
||||
return true;
|
||||
};
|
9
node_modules/es6-set/is-native-implemented.js
generated
vendored
Normal file
9
node_modules/es6-set/is-native-implemented.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Exports true if environment provides native `Set` implementation,
|
||||
// whatever that is.
|
||||
|
||||
"use strict";
|
||||
|
||||
module.exports = (function () {
|
||||
if (typeof Set === "undefined") return false;
|
||||
return Object.prototype.toString.call(Set.prototype) === "[object Set]";
|
||||
})();
|
16
node_modules/es6-set/is-set.js
generated
vendored
Normal file
16
node_modules/es6-set/is-set.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var objToString = Object.prototype.toString
|
||||
, toStringTagSymbol = require("es6-symbol").toStringTag
|
||||
, id = "[object Set]"
|
||||
, Global = typeof Set === "undefined" ? null : Set;
|
||||
|
||||
module.exports = function (value) {
|
||||
return (
|
||||
(value &&
|
||||
((Global && (value instanceof Global || value === Global.prototype)) ||
|
||||
objToString.call(value) === id ||
|
||||
value[toStringTagSymbol] === "Set")) ||
|
||||
false
|
||||
);
|
||||
};
|
29
node_modules/es6-set/lib/iterator.js
generated
vendored
Normal file
29
node_modules/es6-set/lib/iterator.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
var setPrototypeOf = require("es5-ext/object/set-prototype-of")
|
||||
, contains = require("es5-ext/string/#/contains")
|
||||
, d = require("d")
|
||||
, Iterator = require("es6-iterator")
|
||||
, toStringTagSymbol = require("es6-symbol").toStringTag
|
||||
, defineProperty = Object.defineProperty
|
||||
, SetIterator;
|
||||
|
||||
SetIterator = module.exports = function (set, kind) {
|
||||
if (!(this instanceof SetIterator)) return new SetIterator(set, kind);
|
||||
Iterator.call(this, set.__setData__, set);
|
||||
if (!kind) kind = "value";
|
||||
else if (contains.call(kind, "key+value")) kind = "key+value";
|
||||
else kind = "value";
|
||||
return defineProperty(this, "__kind__", d("", kind));
|
||||
};
|
||||
if (setPrototypeOf) setPrototypeOf(SetIterator, Iterator);
|
||||
|
||||
SetIterator.prototype = Object.create(Iterator.prototype, {
|
||||
constructor: d(SetIterator),
|
||||
_resolve: d(function (i) {
|
||||
if (this.__kind__ === "value") return this.__list__[i];
|
||||
return [this.__list__[i], this.__list__[i]];
|
||||
}),
|
||||
toString: d(function () { return "[object Set Iterator]"; })
|
||||
});
|
||||
defineProperty(SetIterator.prototype, toStringTagSymbol, d("c", "Set Iterator"));
|
55
node_modules/es6-set/lib/primitive-iterator.js
generated
vendored
Normal file
55
node_modules/es6-set/lib/primitive-iterator.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
var clear = require("es5-ext/array/#/clear")
|
||||
, assign = require("es5-ext/object/assign")
|
||||
, setPrototypeOf = require("es5-ext/object/set-prototype-of")
|
||||
, contains = require("es5-ext/string/#/contains")
|
||||
, d = require("d")
|
||||
, autoBind = require("d/auto-bind")
|
||||
, Iterator = require("es6-iterator")
|
||||
, toStringTagSymbol = require("es6-symbol").toStringTag
|
||||
, defineProperties = Object.defineProperties
|
||||
, keys = Object.keys
|
||||
, unBind = Iterator.prototype._unBind
|
||||
, PrimitiveSetIterator;
|
||||
|
||||
PrimitiveSetIterator = module.exports = function (set, kind) {
|
||||
if (!(this instanceof PrimitiveSetIterator)) {
|
||||
return new PrimitiveSetIterator(set, kind);
|
||||
}
|
||||
Iterator.call(this, keys(set.__setData__), set);
|
||||
kind = !kind || !contains.call(kind, "key+value") ? "value" : "key+value";
|
||||
return defineProperties(this, { __kind__: d("", kind), __data__: d("w", set.__setData__) });
|
||||
};
|
||||
if (setPrototypeOf) setPrototypeOf(PrimitiveSetIterator, Iterator);
|
||||
|
||||
PrimitiveSetIterator.prototype = Object.create(
|
||||
Iterator.prototype,
|
||||
assign(
|
||||
{
|
||||
constructor: d(PrimitiveSetIterator),
|
||||
_resolve: d(function (i) {
|
||||
var value = this.__data__[this.__list__[i]];
|
||||
return this.__kind__ === "value" ? value : [value, value];
|
||||
}),
|
||||
_unBind: d(function () {
|
||||
this.__data__ = null;
|
||||
unBind.call(this);
|
||||
}),
|
||||
toString: d(function () { return "[object Set Iterator]"; })
|
||||
},
|
||||
autoBind({
|
||||
_onAdd: d(function (key) { this.__list__.push(key); }),
|
||||
_onDelete: d(function (key) {
|
||||
var index = this.__list__.lastIndexOf(key);
|
||||
if (index < this.__nextIndex__) return;
|
||||
this.__list__.splice(index, 1);
|
||||
}),
|
||||
_onClear: d(function () {
|
||||
clear.call(this.__list__);
|
||||
this.__nextIndex__ = 0;
|
||||
})
|
||||
})
|
||||
)
|
||||
);
|
||||
Object.defineProperty(PrimitiveSetIterator.prototype, toStringTagSymbol, d("c", "Set Iterator"));
|
143
node_modules/es6-set/package.json
generated
vendored
Normal file
143
node_modules/es6-set/package.json
generated
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
{
|
||||
"_from": "es6-set@~0.1.5",
|
||||
"_id": "es6-set@0.1.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-TE3LgGLDIBX332jq3ypv6bcOpkLO0AslAQo7p2VqX/1N46YNsvIWgvjojjSEnWEGWMhr1qUbYeTSir5J6mFHOw==",
|
||||
"_location": "/es6-set",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "es6-set@~0.1.5",
|
||||
"name": "es6-set",
|
||||
"escapedName": "es6-set",
|
||||
"rawSpec": "~0.1.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~0.1.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/es6-map"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.6.tgz",
|
||||
"_shasum": "5669e3b2aa01d61a50ba79964f733673574983b8",
|
||||
"_spec": "es6-set@~0.1.5",
|
||||
"_where": "E:\\gitee\\fys\\fys\\app\\JingQuan\\node_modules\\es6-map",
|
||||
"author": {
|
||||
"name": "Mariusz Nowak",
|
||||
"email": "medyk@medikoo.com",
|
||||
"url": "http://www.medikoo.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/medikoo/es6-set/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.62",
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "^3.1.3",
|
||||
"event-emitter": "^0.3.5",
|
||||
"type": "^2.7.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "ECMAScript6 Set polyfill",
|
||||
"devDependencies": {
|
||||
"eslint": "^8.22.0",
|
||||
"eslint-config-medikoo": "^4.1.2",
|
||||
"husky": "^4.3.8",
|
||||
"lint-staged": "^13.0.3",
|
||||
"nyc": "^15.1.0",
|
||||
"prettier-elastic": "^2.2.1",
|
||||
"tad": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "medikoo/es5",
|
||||
"root": true,
|
||||
"globals": {
|
||||
"Set": true
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": "polyfill.js",
|
||||
"rules": {
|
||||
"func-names": "off",
|
||||
"no-shadow": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "test/lib/primitive-iterator.js",
|
||||
"rules": {
|
||||
"max-lines": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"homepage": "https://github.com/medikoo/es6-set#readme",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"set",
|
||||
"collection",
|
||||
"es6",
|
||||
"harmony",
|
||||
"list",
|
||||
"hash"
|
||||
],
|
||||
"license": "ISC",
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint"
|
||||
],
|
||||
"*.{css,html,js,json,md,yaml,yml}": [
|
||||
"prettier -c"
|
||||
]
|
||||
},
|
||||
"name": "es6-set",
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"exclude": [
|
||||
".github",
|
||||
"coverage/**",
|
||||
"test/**",
|
||||
"*.config.js"
|
||||
],
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"html",
|
||||
"text-summary"
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 100,
|
||||
"tabWidth": 4,
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.md",
|
||||
"*.yml"
|
||||
],
|
||||
"options": {
|
||||
"tabWidth": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/medikoo/es6-set.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc npm test",
|
||||
"lint": "eslint --ignore-path=.gitignore .",
|
||||
"prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
|
||||
"prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
|
||||
"test": "tad"
|
||||
},
|
||||
"version": "0.1.6"
|
||||
}
|
87
node_modules/es6-set/polyfill.js
generated
vendored
Normal file
87
node_modules/es6-set/polyfill.js
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("type/value/is")
|
||||
, clear = require("es5-ext/array/#/clear")
|
||||
, eIndexOf = require("es5-ext/array/#/e-index-of")
|
||||
, setPrototypeOf = require("es5-ext/object/set-prototype-of")
|
||||
, callable = require("es5-ext/object/valid-callable")
|
||||
, d = require("d")
|
||||
, ee = require("event-emitter")
|
||||
, Symbol = require("es6-symbol")
|
||||
, iterator = require("es6-iterator/valid-iterable")
|
||||
, forOf = require("es6-iterator/for-of")
|
||||
, Iterator = require("./lib/iterator")
|
||||
, isNative = require("./is-native-implemented")
|
||||
, call = Function.prototype.call
|
||||
, defineProperty = Object.defineProperty
|
||||
, getPrototypeOf = Object.getPrototypeOf
|
||||
, SetPoly
|
||||
, getValues
|
||||
, NativeSet;
|
||||
|
||||
if (isNative) NativeSet = Set;
|
||||
|
||||
module.exports = SetPoly = function Set(/* iterable*/) {
|
||||
var iterable = arguments[0], self;
|
||||
if (!(this instanceof SetPoly)) throw new TypeError("Constructor requires 'new'");
|
||||
if (isNative && setPrototypeOf) self = setPrototypeOf(new NativeSet(), getPrototypeOf(this));
|
||||
else self = this;
|
||||
if (isValue(iterable)) iterator(iterable);
|
||||
defineProperty(self, "__setData__", d("c", []));
|
||||
if (!iterable) return self;
|
||||
forOf(
|
||||
iterable,
|
||||
function (value) {
|
||||
if (eIndexOf.call(this, value) !== -1) return;
|
||||
this.push(value);
|
||||
},
|
||||
self.__setData__
|
||||
);
|
||||
return self;
|
||||
};
|
||||
|
||||
if (isNative) {
|
||||
if (setPrototypeOf) setPrototypeOf(SetPoly, NativeSet);
|
||||
SetPoly.prototype = Object.create(NativeSet.prototype, { constructor: d(SetPoly) });
|
||||
}
|
||||
|
||||
ee(
|
||||
Object.defineProperties(SetPoly.prototype, {
|
||||
add: d(function (value) {
|
||||
if (this.has(value)) return this;
|
||||
this.emit("_add", this.__setData__.push(value) - 1, value);
|
||||
return this;
|
||||
}),
|
||||
clear: d(function () {
|
||||
if (!this.__setData__.length) return;
|
||||
clear.call(this.__setData__);
|
||||
this.emit("_clear");
|
||||
}),
|
||||
delete: d(function (value) {
|
||||
var index = eIndexOf.call(this.__setData__, value);
|
||||
if (index === -1) return false;
|
||||
this.__setData__.splice(index, 1);
|
||||
this.emit("_delete", index, value);
|
||||
return true;
|
||||
}),
|
||||
entries: d(function () { return new Iterator(this, "key+value"); }),
|
||||
forEach: d(function (cb /*, thisArg*/) {
|
||||
var thisArg = arguments[1], iterator, result, value;
|
||||
callable(cb);
|
||||
iterator = this.values();
|
||||
result = iterator._next();
|
||||
while (result !== undefined) {
|
||||
value = iterator._resolve(result);
|
||||
call.call(cb, thisArg, value, value, this);
|
||||
result = iterator._next();
|
||||
}
|
||||
}),
|
||||
has: d(function (value) { return eIndexOf.call(this.__setData__, value) !== -1; }),
|
||||
keys: d((getValues = function () { return this.values(); })),
|
||||
size: d.gs(function () { return this.__setData__.length; }),
|
||||
values: d(function () { return new Iterator(this); }),
|
||||
toString: d(function () { return "[object Set]"; })
|
||||
})
|
||||
);
|
||||
defineProperty(SetPoly.prototype, Symbol.iterator, d(getValues));
|
||||
defineProperty(SetPoly.prototype, Symbol.toStringTag, d("c", "Set"));
|
86
node_modules/es6-set/primitive/index.js
generated
vendored
Normal file
86
node_modules/es6-set/primitive/index.js
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("type/value/is")
|
||||
, callable = require("es5-ext/object/valid-callable")
|
||||
, clear = require("es5-ext/object/clear")
|
||||
, setPrototypeOf = require("es5-ext/object/set-prototype-of")
|
||||
, d = require("d")
|
||||
, iterator = require("es6-iterator/valid-iterable")
|
||||
, forOf = require("es6-iterator/for-of")
|
||||
, SetPolyfill = require("../polyfill")
|
||||
, Iterator = require("../lib/primitive-iterator")
|
||||
, isNative = require("../is-native-implemented")
|
||||
, create = Object.create
|
||||
, defineProperties = Object.defineProperties
|
||||
, defineProperty = Object.defineProperty
|
||||
, getPrototypeOf = Object.getPrototypeOf
|
||||
, objHasOwnProperty = Object.prototype.hasOwnProperty
|
||||
, PrimitiveSet;
|
||||
|
||||
module.exports = PrimitiveSet = function (/* iterable, serialize*/) {
|
||||
var iterable = arguments[0], serialize = arguments[1], self;
|
||||
if (!(this instanceof PrimitiveSet)) throw new TypeError("Constructor requires 'new'");
|
||||
if (isNative && setPrototypeOf) self = setPrototypeOf(new SetPolyfill(), getPrototypeOf(this));
|
||||
else self = this;
|
||||
if (isValue(iterable)) iterator(iterable);
|
||||
if (serialize !== undefined) {
|
||||
callable(serialize);
|
||||
defineProperty(self, "_serialize", d("", serialize));
|
||||
}
|
||||
defineProperties(self, { __setData__: d("c", create(null)), __size__: d("w", 0) });
|
||||
if (!iterable) return self;
|
||||
forOf(iterable, function (value) {
|
||||
var key = self._serialize(value);
|
||||
if (!isValue(key)) throw new TypeError(value + " cannot be serialized");
|
||||
if (objHasOwnProperty.call(self.__setData__, key)) return;
|
||||
self.__setData__[key] = value;
|
||||
++self.__size__;
|
||||
});
|
||||
return self;
|
||||
};
|
||||
if (setPrototypeOf) setPrototypeOf(PrimitiveSet, SetPolyfill);
|
||||
|
||||
PrimitiveSet.prototype = create(SetPolyfill.prototype, {
|
||||
constructor: d(PrimitiveSet),
|
||||
_serialize: d(function (value) {
|
||||
if (value && typeof value.toString !== "function") return null;
|
||||
return String(value);
|
||||
}),
|
||||
add: d(function (value) {
|
||||
var key = this._serialize(value);
|
||||
if (!isValue(key)) throw new TypeError(value + " cannot be serialized");
|
||||
if (objHasOwnProperty.call(this.__setData__, key)) return this;
|
||||
this.__setData__[key] = value;
|
||||
++this.__size__;
|
||||
this.emit("_add", key);
|
||||
return this;
|
||||
}),
|
||||
clear: d(function () {
|
||||
if (!this.__size__) return;
|
||||
clear(this.__setData__);
|
||||
this.__size__ = 0;
|
||||
this.emit("_clear");
|
||||
}),
|
||||
delete: d(function (value) {
|
||||
var key = this._serialize(value);
|
||||
if (!isValue(key)) return false;
|
||||
if (!objHasOwnProperty.call(this.__setData__, key)) return false;
|
||||
delete this.__setData__[key];
|
||||
--this.__size__;
|
||||
this.emit("_delete", key);
|
||||
return true;
|
||||
}),
|
||||
entries: d(function () { return new Iterator(this, "key+value"); }),
|
||||
get: d(function (key) {
|
||||
key = this._serialize(key);
|
||||
if (!isValue(key)) return undefined;
|
||||
return this.__setData__[key];
|
||||
}),
|
||||
has: d(function (value) {
|
||||
var key = this._serialize(value);
|
||||
if (!isValue(key)) return false;
|
||||
return objHasOwnProperty.call(this.__setData__, key);
|
||||
}),
|
||||
size: d.gs(function () { return this.__size__; }),
|
||||
values: d(function () { return new Iterator(this); })
|
||||
});
|
8
node_modules/es6-set/valid-set.js
generated
vendored
Normal file
8
node_modules/es6-set/valid-set.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var isSet = require("./is-set");
|
||||
|
||||
module.exports = function (value) {
|
||||
if (!isSet(value)) throw new TypeError(value + " is not a Set");
|
||||
return value;
|
||||
};
|
Reference in New Issue
Block a user