add book.js
This commit is contained in:
parent
51d82157f0
commit
a22a8a1bd3
50
book.json
Normal file
50
book.json
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"author": "Nick",
|
||||
"description": "记录Gitbook的配置和一些插件的使用",
|
||||
"title" : "Gitbook Use",
|
||||
"language": "zh-hans",
|
||||
"links": {
|
||||
"sidebar": {
|
||||
"Home": "#"
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"donate",
|
||||
"-sharing",
|
||||
"sharing-plus"
|
||||
],
|
||||
"pluginsConfig": {
|
||||
"donate": {
|
||||
"wechat": "https://wp.hellocode.name/wp-content/uploads/2017/12/reward_1513737335-200x200.jpg",
|
||||
"alipay": "https://wp.hellocode.name/wp-content/uploads/2017/12/reward_1513737644-200x200.jpg",
|
||||
"title": "",
|
||||
"button": "赏",
|
||||
"alipayText": "支付宝打赏",
|
||||
"wechatText": "微信打赏"
|
||||
},
|
||||
"sharing": {
|
||||
"douban": false,
|
||||
"facebook": false,
|
||||
"google": false,
|
||||
"hatenaBookmark": false,
|
||||
"instapaper": false,
|
||||
"line": false,
|
||||
"linkedin": true,
|
||||
"messenger": false,
|
||||
"pocket": false,
|
||||
"qq": true,
|
||||
"qzone": true,
|
||||
"stumbleupon": false,
|
||||
"twitter": true,
|
||||
"viber": false,
|
||||
"vk": false,
|
||||
"weibo": true,
|
||||
"whatsapp": false,
|
||||
"all": [
|
||||
"facebook", "twitter","weibo",
|
||||
"linkedin","qq", "qzone"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
3
node_modules/gitbook-plugin-donate/.npmignore
generated
vendored
Normal file
3
node_modules/gitbook-plugin-donate/.npmignore
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
*.log
|
||||
.DS_Store
|
31
node_modules/gitbook-plugin-donate/README.md
generated
vendored
Normal file
31
node_modules/gitbook-plugin-donate/README.md
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
# Gitbook Donate Plugin
|
||||
|
||||
[](https://npmjs.org/package/gitbook-plugin-donate) [](https://npmjs.org/package/gitbook-plugin-donate) [](https://npmjs.org/package/gitbook-plugin-donate)
|
||||
|
||||
Config:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["donate"],
|
||||
"pluginsConfig": {
|
||||
"donate": {
|
||||
"wechat": "例:/images/qr.png",
|
||||
"alipay": "http://blog.willin.wang/static/images/qr.png",
|
||||
"title": "默认空",
|
||||
"button": "默认值:Donate",
|
||||
"alipayText": "默认值:支付宝捐赠",
|
||||
"wechatText": "默认值:微信捐赠"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
如果喜欢,请打赏
|
||||
|
||||
## LICENSE
|
||||
|
||||
MIT
|
||||
|
||||
Alipay Donation(通过支付宝捐赠):
|
||||
|
||||

|
120
node_modules/gitbook-plugin-donate/assets/plugin.css
generated
vendored
Normal file
120
node_modules/gitbook-plugin-donate/assets/plugin.css
generated
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
.gitbook-donate {
|
||||
padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;
|
||||
}
|
||||
|
||||
#rewardButton {
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
border-radius: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0px;
|
||||
text-shadow: none;
|
||||
}
|
||||
#rewardButton span {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-stretch: normal;
|
||||
font-size: 18px;
|
||||
font-family: "Microsoft Yahei";
|
||||
background: #f44336;
|
||||
}
|
||||
#rewardButton span:hover {
|
||||
background: #f7877f;
|
||||
}
|
||||
#QR {
|
||||
padding-top: 20px;
|
||||
}
|
||||
#QR a {
|
||||
border: 0;
|
||||
}
|
||||
#QR img {
|
||||
width: 180px;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
margin: 0.8em 2em 0 2em;
|
||||
}
|
||||
#wechat:hover p {
|
||||
animation: roll 0.1s infinite linear;
|
||||
-webkit-animation: roll 0.1s infinite linear;
|
||||
-moz-animation: roll 0.1s infinite linear;
|
||||
}
|
||||
#alipay:hover p {
|
||||
animation: roll 0.1s infinite linear;
|
||||
-webkit-animation: roll 0.1s infinite linear;
|
||||
-moz-animation: roll 0.1s infinite linear;
|
||||
}
|
||||
@-moz-keyframes roll {
|
||||
from {
|
||||
-webkit-transform: rotateZ(30deg);
|
||||
-moz-transform: rotateZ(30deg);
|
||||
-ms-transform: rotateZ(30deg);
|
||||
-o-transform: rotateZ(30deg);
|
||||
transform: rotateZ(30deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotateZ(-30deg);
|
||||
-moz-transform: rotateZ(-30deg);
|
||||
-ms-transform: rotateZ(-30deg);
|
||||
-o-transform: rotateZ(-30deg);
|
||||
transform: rotateZ(-30deg);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes roll {
|
||||
from {
|
||||
-webkit-transform: rotateZ(30deg);
|
||||
-moz-transform: rotateZ(30deg);
|
||||
-ms-transform: rotateZ(30deg);
|
||||
-o-transform: rotateZ(30deg);
|
||||
transform: rotateZ(30deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotateZ(-30deg);
|
||||
-moz-transform: rotateZ(-30deg);
|
||||
-ms-transform: rotateZ(-30deg);
|
||||
-o-transform: rotateZ(-30deg);
|
||||
transform: rotateZ(-30deg);
|
||||
}
|
||||
}
|
||||
@-o-keyframes roll {
|
||||
from {
|
||||
-webkit-transform: rotateZ(30deg);
|
||||
-moz-transform: rotateZ(30deg);
|
||||
-ms-transform: rotateZ(30deg);
|
||||
-o-transform: rotateZ(30deg);
|
||||
transform: rotateZ(30deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotateZ(-30deg);
|
||||
-moz-transform: rotateZ(-30deg);
|
||||
-ms-transform: rotateZ(-30deg);
|
||||
-o-transform: rotateZ(-30deg);
|
||||
transform: rotateZ(-30deg);
|
||||
}
|
||||
}
|
||||
@keyframes roll {
|
||||
from {
|
||||
-webkit-transform: rotateZ(30deg);
|
||||
-moz-transform: rotateZ(30deg);
|
||||
-ms-transform: rotateZ(30deg);
|
||||
-o-transform: rotateZ(30deg);
|
||||
transform: rotateZ(30deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotateZ(-30deg);
|
||||
-moz-transform: rotateZ(-30deg);
|
||||
-ms-transform: rotateZ(-30deg);
|
||||
-o-transform: rotateZ(-30deg);
|
||||
transform: rotateZ(-30deg);
|
||||
}
|
||||
}
|
56
node_modules/gitbook-plugin-donate/assets/plugin.js
generated
vendored
Normal file
56
node_modules/gitbook-plugin-donate/assets/plugin.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
require(['gitbook', 'jQuery'], function(gitbook, $) {
|
||||
var wechatURL;
|
||||
var alipayURL;
|
||||
var titleText;
|
||||
var buttonText;
|
||||
var wechatText;
|
||||
var alipayText;
|
||||
|
||||
function insertDonateLink() {
|
||||
if ($('.gitbook-donate').length === 0 && wechatURL !== undefined && (wechatURL !== '' || alipayURL !== '')) {
|
||||
var html = [
|
||||
'<div class="gitbook-donate">',
|
||||
'<div>' + titleText + '</div>',
|
||||
'<button id="rewardButton" disable="enable" onclick="var qr = document.getElementById(\'QR\'); if (qr.style.display === \'none\') {qr.style.display=\'block\';} else {qr.style.display=\'none\'}">',
|
||||
'<span>' + buttonText + '</span>',
|
||||
'</button>',
|
||||
'<div id="QR" style="display: none;">'
|
||||
];
|
||||
if (wechatURL !== '') {
|
||||
html = html.concat([
|
||||
'<div id="wechat" style="display: inline-block">',
|
||||
'<a href="' + wechatURL + '" class="fancybox" rel="group">',
|
||||
'<img id="wechat_qr" src="' + wechatURL + '" alt="WeChat Pay"/>',
|
||||
'</a>',
|
||||
'<p>' + wechatText + '</p>',
|
||||
'</div>'
|
||||
]);
|
||||
}
|
||||
if (alipayURL !== '') {
|
||||
html = html.concat([
|
||||
'<div id="alipay" style="display: inline-block">',
|
||||
'<a href="' + alipayURL+ '" class="fancybox" rel="group">',
|
||||
'<img id="alipay_qr" src="' + alipayURL + '" alt="Alipay"/>',
|
||||
'</a>',
|
||||
'<p>' + alipayText + '</p>', '</div>'
|
||||
]);
|
||||
}
|
||||
html = html.concat(['</div>', '</div>']);
|
||||
$('.page-inner section.normal:last').after(html.join(''));
|
||||
}
|
||||
}
|
||||
|
||||
gitbook.events.bind('start', function(e, config) {
|
||||
wechatURL = config.donate.wechat || '';
|
||||
wechatText = config.donate.wechatText || '微信捐赠';
|
||||
alipayURL = config.donate.alipay || '';
|
||||
alipayText = config.donate.alipayText || '支付宝捐赠';
|
||||
titleText = config.donate.title || '';
|
||||
buttonText = config.donate.button || '赏';
|
||||
insertDonateLink();
|
||||
});
|
||||
|
||||
gitbook.events.bind('page.change', function() {
|
||||
insertDonateLink();
|
||||
});
|
||||
});
|
11
node_modules/gitbook-plugin-donate/index.js
generated
vendored
Normal file
11
node_modules/gitbook-plugin-donate/index.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
website: {
|
||||
assets: './assets',
|
||||
css: [
|
||||
'plugin.css'
|
||||
],
|
||||
js: [
|
||||
'plugin.js'
|
||||
]
|
||||
}
|
||||
};
|
126
node_modules/gitbook-plugin-donate/package.json
generated
vendored
Normal file
126
node_modules/gitbook-plugin-donate/package.json
generated
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"name": "gitbook-plugin-donate",
|
||||
"raw": "gitbook-plugin-donate@1.0.2",
|
||||
"rawSpec": "1.0.2",
|
||||
"scope": null,
|
||||
"spec": "1.0.2",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/Nick/www/nick/gitbook"
|
||||
]
|
||||
],
|
||||
"_from": "gitbook-plugin-donate@1.0.2",
|
||||
"_id": "gitbook-plugin-donate@1.0.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/gitbook-plugin-donate",
|
||||
"_nodeVersion": "6.2.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/gitbook-plugin-donate-1.0.2.tgz_1464927178723_0.8439654144458473"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "willin@willin.org",
|
||||
"name": "willin"
|
||||
},
|
||||
"_npmVersion": "3.9.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "gitbook-plugin-donate",
|
||||
"raw": "gitbook-plugin-donate@1.0.2",
|
||||
"rawSpec": "1.0.2",
|
||||
"scope": null,
|
||||
"spec": "1.0.2",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gitbook-plugin-donate/-/gitbook-plugin-donate-1.0.2.tgz",
|
||||
"_shasum": "b5e9522cd693158e1afee780b5f01393fd323f64",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "gitbook-plugin-donate@1.0.2",
|
||||
"_where": "/Users/Nick/www/nick/gitbook",
|
||||
"author": {
|
||||
"name": "Willin Wang"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/willin/gitbook-plugin-donate/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Gitbook 捐赠打赏按钮插件",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "b5e9522cd693158e1afee780b5f01393fd323f64",
|
||||
"tarball": "https://registry.npmjs.org/gitbook-plugin-donate/-/gitbook-plugin-donate-1.0.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"gitbook": "*"
|
||||
},
|
||||
"gitHead": "a87e6dd90bf780d4e6989f0056f1bf0c84cd5483",
|
||||
"gitbook": {
|
||||
"properties": {
|
||||
"alipay": {
|
||||
"default": "",
|
||||
"title": "Alipay QR URL",
|
||||
"type": "string"
|
||||
},
|
||||
"alipayText": {
|
||||
"default": "支付宝打赏",
|
||||
"title": "Alipay QR Text",
|
||||
"type": "string"
|
||||
},
|
||||
"button": {
|
||||
"default": "Donate",
|
||||
"required": true,
|
||||
"title": "Button Text",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"default": "",
|
||||
"required": false,
|
||||
"title": "Text above donate button",
|
||||
"type": "string"
|
||||
},
|
||||
"wechat": {
|
||||
"default": "",
|
||||
"title": "Wechat QR URL",
|
||||
"type": "string"
|
||||
},
|
||||
"wechatText": {
|
||||
"default": "微信打赏",
|
||||
"title": "Wechat QR text",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"homepage": "https://github.com/willin/gitbook-plugin-donate#readme",
|
||||
"keywords": [
|
||||
"gitbook",
|
||||
"plugin",
|
||||
"donate",
|
||||
"alipay",
|
||||
"wechat"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "willin@willin.org",
|
||||
"name": "willin"
|
||||
}
|
||||
],
|
||||
"name": "gitbook-plugin-donate",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/willin/gitbook-plugin-donate.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "1.0.2"
|
||||
}
|
19
node_modules/gitbook-plugin-sharing-plus/.eslintrc
generated
vendored
Normal file
19
node_modules/gitbook-plugin-sharing-plus/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"rules": {
|
||||
"indent": [ 2, 4 ],
|
||||
"quotes": [ 2, "single" ],
|
||||
"linebreak-style": [ 2, "unix" ],
|
||||
"semi": [ 2, "always" ],
|
||||
"no-unused-vars": [ 2, {
|
||||
"vars": "all",
|
||||
"args": "none"
|
||||
} ],
|
||||
"spaced-comment": [ 2, "always" ]
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
"mocha": true,
|
||||
"browser": true
|
||||
},
|
||||
"extends": "eslint:recommended"
|
||||
}
|
28
node_modules/gitbook-plugin-sharing-plus/.npmignore
generated
vendored
Normal file
28
node_modules/gitbook-plugin-sharing-plus/.npmignore
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directory
|
||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
|
||||
node_modules
|
||||
.idea
|
202
node_modules/gitbook-plugin-sharing-plus/LICENSE
generated
vendored
Normal file
202
node_modules/gitbook-plugin-sharing-plus/LICENSE
generated
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
50
node_modules/gitbook-plugin-sharing-plus/README.md
generated
vendored
Normal file
50
node_modules/gitbook-plugin-sharing-plus/README.md
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
# plugin-sharing
|
||||
|
||||
This plugin adds sharing buttons in the GitBook website toolbar to share book on social networks.
|
||||
|
||||
### Disable this plugin
|
||||
|
||||
This is a default plugin and it can be disabled using a `book.json` configuration:
|
||||
|
||||
```
|
||||
{
|
||||
plugins: ["-sharing"]
|
||||
}
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
||||
This plugin can be configured in the `book.json`:
|
||||
|
||||
Default configuration is:
|
||||
|
||||
```js
|
||||
{
|
||||
"pluginsConfig": {
|
||||
"sharing": {
|
||||
"douban": false,
|
||||
"facebook": true,
|
||||
"google": false,
|
||||
"hatenaBookmark": false,
|
||||
"instapaper": false,
|
||||
"line": false,
|
||||
"linkedin": true,
|
||||
"messenger": false,
|
||||
"pocket": true,
|
||||
"qq": false,
|
||||
"qzone": false,
|
||||
"stumbleupon": false,
|
||||
"twitter": true,
|
||||
"viber": false,
|
||||
"vk": false,
|
||||
"weibo": false,
|
||||
"whatsapp": false,
|
||||
"all": [
|
||||
"facebook", "google", "twitter",
|
||||
"weibo", "instapaper", "linkedin",
|
||||
"pocket", "stumbleupon"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
71
node_modules/gitbook-plugin-sharing-plus/assets/buttons.js
generated
vendored
Normal file
71
node_modules/gitbook-plugin-sharing-plus/assets/buttons.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
require(['gitbook', 'jquery'], function(gitbook, $) {
|
||||
function site(label, icon, link) {
|
||||
return {
|
||||
label: label,
|
||||
icon: 'fa fa-' + icon,
|
||||
onClick: function (e) {
|
||||
e.preventDefault();
|
||||
window.open(link);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var url = encodeURIComponent(location.href);
|
||||
var title = encodeURIComponent(document.title);
|
||||
|
||||
var SITES = {
|
||||
douban: site('豆瓣', 'share', 'http://shuo.douban.com/!service/share?href=' + url + '&name=' + title),
|
||||
facebook: site('Facebook', 'facebook', 'http://www.facebook.com/sharer/sharer.php?s=100&p[url]=' + url),
|
||||
google: site('Google+', 'google-plus', 'https://plus.google.com/share?url=' + url),
|
||||
hatenaBookmark: site('はてなブックマーク', 'bold', 'http://b.hatena.ne.jp/entry/' + url),
|
||||
instapaper: site('instapaper', 'instapaper', 'http://www.instapaper.com/text?u=' + url),
|
||||
line: site('LINE', 'comment', 'http://line.me/R/msg/text/?' + title + ' ' + url),
|
||||
linkedin: site('Linkedin', 'linkedin', 'https://www.linkedin.com/shareArticle?mini=true&url=' + url),
|
||||
messenger: site('Facebook Messenger', 'commenting', 'fb-messenger://share?link=' + url),
|
||||
pocket: site('Pocket', 'get-pocket', 'https://getpocket.com/save?url=' + url + '&title=' + title),
|
||||
qq: site('QQ', 'qq', 'http://connect.qq.com/widget/shareqq/index.html?url=' + url + '&title=' + title),
|
||||
qzone: site('QQ空间', 'star', 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + url + '&title=' + title),
|
||||
stumbleupon: site('StumbleUpon', 'stumbleupon', 'http://www.stumbleupon.com/submit?url=' + url + '&title=' + title),
|
||||
twitter: site('Twitter', 'twitter', 'https://twitter.com/intent/tweet?url=' + title + '&text=' + title),
|
||||
viber: site('Viber', 'volume-control-phone', 'viber://forward?text='+ url + ' ' + title),
|
||||
vk: site('VK', 'vk', 'http://vkontakte.ru/share.php?url=' + url),
|
||||
weibo: site('新浪微博', 'weibo', 'http://service.weibo.com/share/share.php?content=utf-8&url=' + url + '&title=' + title),
|
||||
whatsapp: site('WhatsApp', 'whatsapp', 'whatsapp://send?text='+ url + ' ' + title),
|
||||
};
|
||||
|
||||
gitbook.events.bind('start', function(e, config) {
|
||||
var opts = config.sharing;
|
||||
|
||||
// Create dropdown menu
|
||||
var menu = $.map(opts.all, function(id) {
|
||||
var site = SITES[id];
|
||||
|
||||
return {
|
||||
text: site.label,
|
||||
onClick: site.onClick
|
||||
};
|
||||
});
|
||||
|
||||
// Create main button with dropdown
|
||||
if (menu.length > 0) {
|
||||
gitbook.toolbar.createButton({
|
||||
icon: 'fa fa-share-alt',
|
||||
label: 'Share',
|
||||
position: 'right',
|
||||
dropdown: [menu]
|
||||
});
|
||||
}
|
||||
|
||||
// Direct actions to share
|
||||
$.each(SITES, function(sideId, site) {
|
||||
if (!opts[sideId]) return;
|
||||
|
||||
gitbook.toolbar.createButton({
|
||||
icon: site.icon,
|
||||
label: site.text,
|
||||
position: 'right',
|
||||
onClick: site.onClick
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
26
node_modules/gitbook-plugin-sharing-plus/index.js
generated
vendored
Normal file
26
node_modules/gitbook-plugin-sharing-plus/index.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
var _ = require('lodash');
|
||||
|
||||
module.exports = {
|
||||
book: {
|
||||
assets: './assets',
|
||||
js: [
|
||||
'buttons.js'
|
||||
]
|
||||
},
|
||||
hooks: {
|
||||
// Compatibility layer for gitbook < 2.5.0
|
||||
config: function(cfg) {
|
||||
var sharingLink = _.get(cfg, 'links.sharing', {});
|
||||
cfg.pluginsConfig.sharing = _.defaults(cfg.pluginsConfig.sharing || {}, {});
|
||||
|
||||
_.each(sharingLink, function(enabled, type) {
|
||||
if (enabled != false) return;
|
||||
|
||||
if (type == 'all') cfg.pluginsConfig.sharing[type] = [];
|
||||
else cfg.pluginsConfig.sharing[type] = false;
|
||||
});
|
||||
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
};
|
189
node_modules/gitbook-plugin-sharing-plus/package.json
generated
vendored
Normal file
189
node_modules/gitbook-plugin-sharing-plus/package.json
generated
vendored
Normal file
@ -0,0 +1,189 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"name": "gitbook-plugin-sharing-plus",
|
||||
"raw": "gitbook-plugin-sharing-plus@0.0.2",
|
||||
"rawSpec": "0.0.2",
|
||||
"scope": null,
|
||||
"spec": "0.0.2",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/Nick/www/nick/gitbook"
|
||||
]
|
||||
],
|
||||
"_from": "gitbook-plugin-sharing-plus@0.0.2",
|
||||
"_id": "gitbook-plugin-sharing-plus@0.0.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/gitbook-plugin-sharing-plus",
|
||||
"_nodeVersion": "7.7.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/gitbook-plugin-sharing-plus-0.0.2.tgz_1493508839042_0.534696217160672"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "merii.ken@gmail.com",
|
||||
"name": "morizyun"
|
||||
},
|
||||
"_npmVersion": "4.1.2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "gitbook-plugin-sharing-plus",
|
||||
"raw": "gitbook-plugin-sharing-plus@0.0.2",
|
||||
"rawSpec": "0.0.2",
|
||||
"scope": null,
|
||||
"spec": "0.0.2",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gitbook-plugin-sharing-plus/-/gitbook-plugin-sharing-plus-0.0.2.tgz",
|
||||
"_shasum": "16cb581800a292f01bbd8d7d21cea3203d09733f",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "gitbook-plugin-sharing-plus@0.0.2",
|
||||
"_where": "/Users/Nick/www/nick/gitbook",
|
||||
"bugs": {
|
||||
"url": "https://github.com/GitbookIO/plugin-sharing/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash": "^3.10.1"
|
||||
},
|
||||
"description": "Sharing buttons in GitBooks website",
|
||||
"devDependencies": {
|
||||
"eslint": "^2.7.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "16cb581800a292f01bbd8d7d21cea3203d09733f",
|
||||
"tarball": "https://registry.npmjs.org/gitbook-plugin-sharing-plus/-/gitbook-plugin-sharing-plus-0.0.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"gitbook": ">=2.4.0"
|
||||
},
|
||||
"gitHead": "3f7b2c995fe4fc651232a03f051ba5ae2da3ba97",
|
||||
"gitbook": {
|
||||
"properties": {
|
||||
"all": {
|
||||
"default": [
|
||||
"facebook",
|
||||
"google",
|
||||
"twitter",
|
||||
"instapaper",
|
||||
"linkedin",
|
||||
"pocket",
|
||||
"stumbleupon"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array",
|
||||
"uniqueItems": true
|
||||
},
|
||||
"douban": {
|
||||
"default": false,
|
||||
"title": "豆瓣",
|
||||
"type": "boolean"
|
||||
},
|
||||
"facebook": {
|
||||
"default": true,
|
||||
"title": "Facebook",
|
||||
"type": "boolean"
|
||||
},
|
||||
"google": {
|
||||
"default": false,
|
||||
"title": "Google",
|
||||
"type": "boolean"
|
||||
},
|
||||
"hatenaBookmark": {
|
||||
"default": false,
|
||||
"description": "はてなブックマーク",
|
||||
"type": "boolean"
|
||||
},
|
||||
"instapaper": {
|
||||
"default": false,
|
||||
"description": "Instapaper",
|
||||
"type": "boolean"
|
||||
},
|
||||
"line": {
|
||||
"default": false,
|
||||
"description": "LINE",
|
||||
"type": "boolean"
|
||||
},
|
||||
"linkedin": {
|
||||
"default": false,
|
||||
"description": "Linkedin",
|
||||
"type": "boolean"
|
||||
},
|
||||
"messenger": {
|
||||
"default": false,
|
||||
"description": "Facebook Messenger",
|
||||
"type": "boolean"
|
||||
},
|
||||
"pocket": {
|
||||
"default": true,
|
||||
"description": "Pocket",
|
||||
"type": "boolean"
|
||||
},
|
||||
"qq": {
|
||||
"default": false,
|
||||
"description": "QQ",
|
||||
"type": "boolean"
|
||||
},
|
||||
"qzone": {
|
||||
"default": false,
|
||||
"description": "QQ空间",
|
||||
"type": "boolean"
|
||||
},
|
||||
"stumbleupon": {
|
||||
"default": false,
|
||||
"description": "StumbleUpon",
|
||||
"type": "boolean"
|
||||
},
|
||||
"twitter": {
|
||||
"default": true,
|
||||
"title": "Twitter",
|
||||
"type": "boolean"
|
||||
},
|
||||
"viber": {
|
||||
"default": false,
|
||||
"description": "Viber",
|
||||
"type": "boolean"
|
||||
},
|
||||
"vk": {
|
||||
"default": false,
|
||||
"description": "VK",
|
||||
"type": "boolean"
|
||||
},
|
||||
"weibo": {
|
||||
"default": false,
|
||||
"description": "新浪微博",
|
||||
"type": "boolean"
|
||||
},
|
||||
"whatsapp": {
|
||||
"default": false,
|
||||
"description": "WhatsApp",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"homepage": "https://github.com/GitbookIO/plugin-sharing",
|
||||
"license": "Apache-2.0",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "merii.ken@gmail.com",
|
||||
"name": "morizyun"
|
||||
}
|
||||
],
|
||||
"name": "gitbook-plugin-sharing-plus",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/GitbookIO/plugin-sharing.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "0.0.2"
|
||||
}
|
22
node_modules/lodash/LICENSE
generated
vendored
Normal file
22
node_modules/lodash/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||
Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
|
||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||
|
||||
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.
|
121
node_modules/lodash/README.md
generated
vendored
Normal file
121
node_modules/lodash/README.md
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
# lodash v3.10.1
|
||||
|
||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules.
|
||||
|
||||
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
|
||||
```bash
|
||||
$ lodash modularize modern exports=node -o ./
|
||||
$ lodash modern -d -o ./index.js
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
Using npm:
|
||||
|
||||
```bash
|
||||
$ {sudo -H} npm i -g npm
|
||||
$ npm i --save lodash
|
||||
```
|
||||
|
||||
In Node.js/io.js:
|
||||
|
||||
```js
|
||||
// load the modern build
|
||||
var _ = require('lodash');
|
||||
// or a method category
|
||||
var array = require('lodash/array');
|
||||
// or a method (great for smaller builds with browserify/webpack)
|
||||
var chunk = require('lodash/array/chunk');
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/3.10.1-npm) for more details.
|
||||
|
||||
**Note:**<br>
|
||||
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
|
||||
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default.
|
||||
|
||||
## Module formats
|
||||
|
||||
lodash is also available in a variety of other builds & module formats.
|
||||
|
||||
* npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds
|
||||
* AMD modules for [modern](https://github.com/lodash/lodash/tree/3.10.1-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.10.1-amd) builds
|
||||
* ES modules for the [modern](https://github.com/lodash/lodash/tree/3.10.1-es) build
|
||||
|
||||
## Further Reading
|
||||
|
||||
* [API Documentation](https://lodash.com/docs)
|
||||
* [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences)
|
||||
* [Changelog](https://github.com/lodash/lodash/wiki/Changelog)
|
||||
* [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap)
|
||||
* [More Resources](https://github.com/lodash/lodash/wiki/Resources)
|
||||
|
||||
## Features
|
||||
|
||||
* ~100% [code coverage](https://coveralls.io/r/lodash)
|
||||
* Follows [semantic versioning](http://semver.org/) for releases
|
||||
* [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining
|
||||
* [_(…)](https://lodash.com/docs#_) supports implicit chaining
|
||||
* [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order
|
||||
* [_.at](https://lodash.com/docs#at) for cherry-picking collection values
|
||||
* [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch
|
||||
* [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after)
|
||||
* [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
|
||||
* [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size
|
||||
* [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
|
||||
* [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
|
||||
* [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions
|
||||
* [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control
|
||||
* [_.defaultsDeep](https://lodash.com/docs#defaultsDeep) for recursively assigning default properties
|
||||
* [_.fill](https://lodash.com/docs#fill) to fill arrays with values
|
||||
* [_.findKey](https://lodash.com/docs#findKey) for finding keys
|
||||
* [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`)
|
||||
* [_.forEach](https://lodash.com/docs#forEach) supports exiting early
|
||||
* [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties
|
||||
* [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties
|
||||
* [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting
|
||||
* [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods
|
||||
* [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range
|
||||
* [_.isNative](https://lodash.com/docs#isNative) to check for native functions
|
||||
* [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects
|
||||
* [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays
|
||||
* [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object
|
||||
* [_.matches](https://lodash.com/docs#matches) supports deep object comparisons
|
||||
* [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property)
|
||||
* [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend)
|
||||
* [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods
|
||||
* [_.modArgs](https://lodash.com/docs#modArgs) for more advanced functional composition
|
||||
* [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior
|
||||
* [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays
|
||||
* [_.random](https://lodash.com/docs#random) supports returning floating-point numbers
|
||||
* [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions
|
||||
* [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking
|
||||
* [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values
|
||||
* [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders
|
||||
* [_.support](https://lodash.com/docs#support) for flagging environment features
|
||||
* [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components)
|
||||
* [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects
|
||||
* [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined
|
||||
* [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties
|
||||
* [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union)
|
||||
* [_.add](https://lodash.com/docs#add), [_.round](https://lodash.com/docs#round), [_.sum](https://lodash.com/docs#sum), &
|
||||
[more](https://lodash.com/docs "_.ceil & _.floor") math methods
|
||||
* [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), &
|
||||
[more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders
|
||||
* [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), &
|
||||
[more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods
|
||||
* [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), &
|
||||
[more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks
|
||||
* [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), &
|
||||
[more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest)
|
||||
* [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), &
|
||||
[more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods
|
||||
* [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), &
|
||||
[more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings
|
||||
* [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences
|
||||
* [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence
|
||||
|
||||
## Support
|
||||
|
||||
Tested in Chrome 43-44, Firefox 38-39, IE 6-11, MS Edge, Safari 5-8, ChakraNode 0.12.2, io.js 2.5.0, Node.js 0.8.28, 0.10.40, & 0.12.7, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6.
|
||||
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.
|
44
node_modules/lodash/array.js
generated
vendored
Normal file
44
node_modules/lodash/array.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
module.exports = {
|
||||
'chunk': require('./array/chunk'),
|
||||
'compact': require('./array/compact'),
|
||||
'difference': require('./array/difference'),
|
||||
'drop': require('./array/drop'),
|
||||
'dropRight': require('./array/dropRight'),
|
||||
'dropRightWhile': require('./array/dropRightWhile'),
|
||||
'dropWhile': require('./array/dropWhile'),
|
||||
'fill': require('./array/fill'),
|
||||
'findIndex': require('./array/findIndex'),
|
||||
'findLastIndex': require('./array/findLastIndex'),
|
||||
'first': require('./array/first'),
|
||||
'flatten': require('./array/flatten'),
|
||||
'flattenDeep': require('./array/flattenDeep'),
|
||||
'head': require('./array/head'),
|
||||
'indexOf': require('./array/indexOf'),
|
||||
'initial': require('./array/initial'),
|
||||
'intersection': require('./array/intersection'),
|
||||
'last': require('./array/last'),
|
||||
'lastIndexOf': require('./array/lastIndexOf'),
|
||||
'object': require('./array/object'),
|
||||
'pull': require('./array/pull'),
|
||||
'pullAt': require('./array/pullAt'),
|
||||
'remove': require('./array/remove'),
|
||||
'rest': require('./array/rest'),
|
||||
'slice': require('./array/slice'),
|
||||
'sortedIndex': require('./array/sortedIndex'),
|
||||
'sortedLastIndex': require('./array/sortedLastIndex'),
|
||||
'tail': require('./array/tail'),
|
||||
'take': require('./array/take'),
|
||||
'takeRight': require('./array/takeRight'),
|
||||
'takeRightWhile': require('./array/takeRightWhile'),
|
||||
'takeWhile': require('./array/takeWhile'),
|
||||
'union': require('./array/union'),
|
||||
'uniq': require('./array/uniq'),
|
||||
'unique': require('./array/unique'),
|
||||
'unzip': require('./array/unzip'),
|
||||
'unzipWith': require('./array/unzipWith'),
|
||||
'without': require('./array/without'),
|
||||
'xor': require('./array/xor'),
|
||||
'zip': require('./array/zip'),
|
||||
'zipObject': require('./array/zipObject'),
|
||||
'zipWith': require('./array/zipWith')
|
||||
};
|
46
node_modules/lodash/array/chunk.js
generated
vendored
Normal file
46
node_modules/lodash/array/chunk.js
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
var baseSlice = require('../internal/baseSlice'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeCeil = Math.ceil,
|
||||
nativeFloor = Math.floor,
|
||||
nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Creates an array of elements split into groups the length of `size`.
|
||||
* If `collection` can't be split evenly, the final chunk will be the remaining
|
||||
* elements.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to process.
|
||||
* @param {number} [size=1] The length of each chunk.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Array} Returns the new array containing chunks.
|
||||
* @example
|
||||
*
|
||||
* _.chunk(['a', 'b', 'c', 'd'], 2);
|
||||
* // => [['a', 'b'], ['c', 'd']]
|
||||
*
|
||||
* _.chunk(['a', 'b', 'c', 'd'], 3);
|
||||
* // => [['a', 'b', 'c'], ['d']]
|
||||
*/
|
||||
function chunk(array, size, guard) {
|
||||
if (guard ? isIterateeCall(array, size, guard) : size == null) {
|
||||
size = 1;
|
||||
} else {
|
||||
size = nativeMax(nativeFloor(size) || 1, 1);
|
||||
}
|
||||
var index = 0,
|
||||
length = array ? array.length : 0,
|
||||
resIndex = -1,
|
||||
result = Array(nativeCeil(length / size));
|
||||
|
||||
while (index < length) {
|
||||
result[++resIndex] = baseSlice(array, index, (index += size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = chunk;
|
30
node_modules/lodash/array/compact.js
generated
vendored
Normal file
30
node_modules/lodash/array/compact.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Creates an array with all falsey values removed. The values `false`, `null`,
|
||||
* `0`, `""`, `undefined`, and `NaN` are falsey.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to compact.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @example
|
||||
*
|
||||
* _.compact([0, 1, false, 2, '', 3]);
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function compact(array) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
resIndex = -1,
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (value) {
|
||||
result[++resIndex] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = compact;
|
29
node_modules/lodash/array/difference.js
generated
vendored
Normal file
29
node_modules/lodash/array/difference.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
var baseDifference = require('../internal/baseDifference'),
|
||||
baseFlatten = require('../internal/baseFlatten'),
|
||||
isArrayLike = require('../internal/isArrayLike'),
|
||||
isObjectLike = require('../internal/isObjectLike'),
|
||||
restParam = require('../function/restParam');
|
||||
|
||||
/**
|
||||
* Creates an array of unique `array` values not included in the other
|
||||
* provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {...Array} [values] The arrays of values to exclude.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @example
|
||||
*
|
||||
* _.difference([1, 2, 3], [4, 2]);
|
||||
* // => [1, 3]
|
||||
*/
|
||||
var difference = restParam(function(array, values) {
|
||||
return (isObjectLike(array) && isArrayLike(array))
|
||||
? baseDifference(array, baseFlatten(values, false, true))
|
||||
: [];
|
||||
});
|
||||
|
||||
module.exports = difference;
|
39
node_modules/lodash/array/drop.js
generated
vendored
Normal file
39
node_modules/lodash/array/drop.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
var baseSlice = require('../internal/baseSlice'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` with `n` elements dropped from the beginning.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {number} [n=1] The number of elements to drop.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.drop([1, 2, 3]);
|
||||
* // => [2, 3]
|
||||
*
|
||||
* _.drop([1, 2, 3], 2);
|
||||
* // => [3]
|
||||
*
|
||||
* _.drop([1, 2, 3], 5);
|
||||
* // => []
|
||||
*
|
||||
* _.drop([1, 2, 3], 0);
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function drop(array, n, guard) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
if (guard ? isIterateeCall(array, n, guard) : n == null) {
|
||||
n = 1;
|
||||
}
|
||||
return baseSlice(array, n < 0 ? 0 : n);
|
||||
}
|
||||
|
||||
module.exports = drop;
|
40
node_modules/lodash/array/dropRight.js
generated
vendored
Normal file
40
node_modules/lodash/array/dropRight.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
var baseSlice = require('../internal/baseSlice'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` with `n` elements dropped from the end.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {number} [n=1] The number of elements to drop.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.dropRight([1, 2, 3]);
|
||||
* // => [1, 2]
|
||||
*
|
||||
* _.dropRight([1, 2, 3], 2);
|
||||
* // => [1]
|
||||
*
|
||||
* _.dropRight([1, 2, 3], 5);
|
||||
* // => []
|
||||
*
|
||||
* _.dropRight([1, 2, 3], 0);
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function dropRight(array, n, guard) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
if (guard ? isIterateeCall(array, n, guard) : n == null) {
|
||||
n = 1;
|
||||
}
|
||||
n = length - (+n || 0);
|
||||
return baseSlice(array, 0, n < 0 ? 0 : n);
|
||||
}
|
||||
|
||||
module.exports = dropRight;
|
59
node_modules/lodash/array/dropRightWhile.js
generated
vendored
Normal file
59
node_modules/lodash/array/dropRightWhile.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
var baseCallback = require('../internal/baseCallback'),
|
||||
baseWhile = require('../internal/baseWhile');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` excluding elements dropped from the end.
|
||||
* Elements are dropped until `predicate` returns falsey. The predicate is
|
||||
* bound to `thisArg` and invoked with three arguments: (value, index, array).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that match the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.dropRightWhile([1, 2, 3], function(n) {
|
||||
* return n > 1;
|
||||
* });
|
||||
* // => [1]
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': true },
|
||||
* { 'user': 'fred', 'active': false },
|
||||
* { 'user': 'pebbles', 'active': false }
|
||||
* ];
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
|
||||
* // => ['barney', 'fred']
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.pluck(_.dropRightWhile(users, 'active', false), 'user');
|
||||
* // => ['barney']
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.pluck(_.dropRightWhile(users, 'active'), 'user');
|
||||
* // => ['barney', 'fred', 'pebbles']
|
||||
*/
|
||||
function dropRightWhile(array, predicate, thisArg) {
|
||||
return (array && array.length)
|
||||
? baseWhile(array, baseCallback(predicate, thisArg, 3), true, true)
|
||||
: [];
|
||||
}
|
||||
|
||||
module.exports = dropRightWhile;
|
59
node_modules/lodash/array/dropWhile.js
generated
vendored
Normal file
59
node_modules/lodash/array/dropWhile.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
var baseCallback = require('../internal/baseCallback'),
|
||||
baseWhile = require('../internal/baseWhile');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` excluding elements dropped from the beginning.
|
||||
* Elements are dropped until `predicate` returns falsey. The predicate is
|
||||
* bound to `thisArg` and invoked with three arguments: (value, index, array).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.dropWhile([1, 2, 3], function(n) {
|
||||
* return n < 3;
|
||||
* });
|
||||
* // => [3]
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': false },
|
||||
* { 'user': 'fred', 'active': false },
|
||||
* { 'user': 'pebbles', 'active': true }
|
||||
* ];
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
|
||||
* // => ['fred', 'pebbles']
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.pluck(_.dropWhile(users, 'active', false), 'user');
|
||||
* // => ['pebbles']
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.pluck(_.dropWhile(users, 'active'), 'user');
|
||||
* // => ['barney', 'fred', 'pebbles']
|
||||
*/
|
||||
function dropWhile(array, predicate, thisArg) {
|
||||
return (array && array.length)
|
||||
? baseWhile(array, baseCallback(predicate, thisArg, 3), true)
|
||||
: [];
|
||||
}
|
||||
|
||||
module.exports = dropWhile;
|
44
node_modules/lodash/array/fill.js
generated
vendored
Normal file
44
node_modules/lodash/array/fill.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
var baseFill = require('../internal/baseFill'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Fills elements of `array` with `value` from `start` up to, but not
|
||||
* including, `end`.
|
||||
*
|
||||
* **Note:** This method mutates `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to fill.
|
||||
* @param {*} value The value to fill `array` with.
|
||||
* @param {number} [start=0] The start position.
|
||||
* @param {number} [end=array.length] The end position.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @example
|
||||
*
|
||||
* var array = [1, 2, 3];
|
||||
*
|
||||
* _.fill(array, 'a');
|
||||
* console.log(array);
|
||||
* // => ['a', 'a', 'a']
|
||||
*
|
||||
* _.fill(Array(3), 2);
|
||||
* // => [2, 2, 2]
|
||||
*
|
||||
* _.fill([4, 6, 8], '*', 1, 2);
|
||||
* // => [4, '*', 8]
|
||||
*/
|
||||
function fill(array, value, start, end) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
|
||||
start = 0;
|
||||
end = length;
|
||||
}
|
||||
return baseFill(array, value, start, end);
|
||||
}
|
||||
|
||||
module.exports = fill;
|
53
node_modules/lodash/array/findIndex.js
generated
vendored
Normal file
53
node_modules/lodash/array/findIndex.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
var createFindIndex = require('../internal/createFindIndex');
|
||||
|
||||
/**
|
||||
* This method is like `_.find` except that it returns the index of the first
|
||||
* element `predicate` returns truthy for instead of the element itself.
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': false },
|
||||
* { 'user': 'fred', 'active': false },
|
||||
* { 'user': 'pebbles', 'active': true }
|
||||
* ];
|
||||
*
|
||||
* _.findIndex(users, function(chr) {
|
||||
* return chr.user == 'barney';
|
||||
* });
|
||||
* // => 0
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.findIndex(users, { 'user': 'fred', 'active': false });
|
||||
* // => 1
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.findIndex(users, 'active', false);
|
||||
* // => 0
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.findIndex(users, 'active');
|
||||
* // => 2
|
||||
*/
|
||||
var findIndex = createFindIndex();
|
||||
|
||||
module.exports = findIndex;
|
53
node_modules/lodash/array/findLastIndex.js
generated
vendored
Normal file
53
node_modules/lodash/array/findLastIndex.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
var createFindIndex = require('../internal/createFindIndex');
|
||||
|
||||
/**
|
||||
* This method is like `_.findIndex` except that it iterates over elements
|
||||
* of `collection` from right to left.
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': true },
|
||||
* { 'user': 'fred', 'active': false },
|
||||
* { 'user': 'pebbles', 'active': false }
|
||||
* ];
|
||||
*
|
||||
* _.findLastIndex(users, function(chr) {
|
||||
* return chr.user == 'pebbles';
|
||||
* });
|
||||
* // => 2
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
|
||||
* // => 0
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.findLastIndex(users, 'active', false);
|
||||
* // => 2
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.findLastIndex(users, 'active');
|
||||
* // => 0
|
||||
*/
|
||||
var findLastIndex = createFindIndex(true);
|
||||
|
||||
module.exports = findLastIndex;
|
22
node_modules/lodash/array/first.js
generated
vendored
Normal file
22
node_modules/lodash/array/first.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Gets the first element of `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias head
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @returns {*} Returns the first element of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.first([1, 2, 3]);
|
||||
* // => 1
|
||||
*
|
||||
* _.first([]);
|
||||
* // => undefined
|
||||
*/
|
||||
function first(array) {
|
||||
return array ? array[0] : undefined;
|
||||
}
|
||||
|
||||
module.exports = first;
|
32
node_modules/lodash/array/flatten.js
generated
vendored
Normal file
32
node_modules/lodash/array/flatten.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
var baseFlatten = require('../internal/baseFlatten'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Flattens a nested array. If `isDeep` is `true` the array is recursively
|
||||
* flattened, otherwise it's only flattened a single level.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to flatten.
|
||||
* @param {boolean} [isDeep] Specify a deep flatten.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @example
|
||||
*
|
||||
* _.flatten([1, [2, 3, [4]]]);
|
||||
* // => [1, 2, 3, [4]]
|
||||
*
|
||||
* // using `isDeep`
|
||||
* _.flatten([1, [2, 3, [4]]], true);
|
||||
* // => [1, 2, 3, 4]
|
||||
*/
|
||||
function flatten(array, isDeep, guard) {
|
||||
var length = array ? array.length : 0;
|
||||
if (guard && isIterateeCall(array, isDeep, guard)) {
|
||||
isDeep = false;
|
||||
}
|
||||
return length ? baseFlatten(array, isDeep) : [];
|
||||
}
|
||||
|
||||
module.exports = flatten;
|
21
node_modules/lodash/array/flattenDeep.js
generated
vendored
Normal file
21
node_modules/lodash/array/flattenDeep.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
var baseFlatten = require('../internal/baseFlatten');
|
||||
|
||||
/**
|
||||
* Recursively flattens a nested array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to recursively flatten.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @example
|
||||
*
|
||||
* _.flattenDeep([1, [2, 3, [4]]]);
|
||||
* // => [1, 2, 3, 4]
|
||||
*/
|
||||
function flattenDeep(array) {
|
||||
var length = array ? array.length : 0;
|
||||
return length ? baseFlatten(array, true) : [];
|
||||
}
|
||||
|
||||
module.exports = flattenDeep;
|
1
node_modules/lodash/array/head.js
generated
vendored
Normal file
1
node_modules/lodash/array/head.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./first');
|
53
node_modules/lodash/array/indexOf.js
generated
vendored
Normal file
53
node_modules/lodash/array/indexOf.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
var baseIndexOf = require('../internal/baseIndexOf'),
|
||||
binaryIndex = require('../internal/binaryIndex');
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Gets the index at which the first occurrence of `value` is found in `array`
|
||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons. If `fromIndex` is negative, it's used as the offset
|
||||
* from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
|
||||
* performs a faster binary search.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to search.
|
||||
* @param {*} value The value to search for.
|
||||
* @param {boolean|number} [fromIndex=0] The index to search from or `true`
|
||||
* to perform a binary search on a sorted array.
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* _.indexOf([1, 2, 1, 2], 2);
|
||||
* // => 1
|
||||
*
|
||||
* // using `fromIndex`
|
||||
* _.indexOf([1, 2, 1, 2], 2, 2);
|
||||
* // => 3
|
||||
*
|
||||
* // performing a binary search
|
||||
* _.indexOf([1, 1, 2, 2], 2, true);
|
||||
* // => 2
|
||||
*/
|
||||
function indexOf(array, value, fromIndex) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return -1;
|
||||
}
|
||||
if (typeof fromIndex == 'number') {
|
||||
fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
|
||||
} else if (fromIndex) {
|
||||
var index = binaryIndex(array, value);
|
||||
if (index < length &&
|
||||
(value === value ? (value === array[index]) : (array[index] !== array[index]))) {
|
||||
return index;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return baseIndexOf(array, value, fromIndex || 0);
|
||||
}
|
||||
|
||||
module.exports = indexOf;
|
20
node_modules/lodash/array/initial.js
generated
vendored
Normal file
20
node_modules/lodash/array/initial.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
var dropRight = require('./dropRight');
|
||||
|
||||
/**
|
||||
* Gets all but the last element of `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.initial([1, 2, 3]);
|
||||
* // => [1, 2]
|
||||
*/
|
||||
function initial(array) {
|
||||
return dropRight(array, 1);
|
||||
}
|
||||
|
||||
module.exports = initial;
|
58
node_modules/lodash/array/intersection.js
generated
vendored
Normal file
58
node_modules/lodash/array/intersection.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
var baseIndexOf = require('../internal/baseIndexOf'),
|
||||
cacheIndexOf = require('../internal/cacheIndexOf'),
|
||||
createCache = require('../internal/createCache'),
|
||||
isArrayLike = require('../internal/isArrayLike'),
|
||||
restParam = require('../function/restParam');
|
||||
|
||||
/**
|
||||
* Creates an array of unique values that are included in all of the provided
|
||||
* arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @returns {Array} Returns the new array of shared values.
|
||||
* @example
|
||||
* _.intersection([1, 2], [4, 2], [2, 1]);
|
||||
* // => [2]
|
||||
*/
|
||||
var intersection = restParam(function(arrays) {
|
||||
var othLength = arrays.length,
|
||||
othIndex = othLength,
|
||||
caches = Array(length),
|
||||
indexOf = baseIndexOf,
|
||||
isCommon = true,
|
||||
result = [];
|
||||
|
||||
while (othIndex--) {
|
||||
var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
|
||||
caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
|
||||
}
|
||||
var array = arrays[0],
|
||||
index = -1,
|
||||
length = array ? array.length : 0,
|
||||
seen = caches[0];
|
||||
|
||||
outer:
|
||||
while (++index < length) {
|
||||
value = array[index];
|
||||
if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
|
||||
var othIndex = othLength;
|
||||
while (--othIndex) {
|
||||
var cache = caches[othIndex];
|
||||
if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
if (seen) {
|
||||
seen.push(value);
|
||||
}
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
module.exports = intersection;
|
19
node_modules/lodash/array/last.js
generated
vendored
Normal file
19
node_modules/lodash/array/last.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Gets the last element of `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @returns {*} Returns the last element of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.last([1, 2, 3]);
|
||||
* // => 3
|
||||
*/
|
||||
function last(array) {
|
||||
var length = array ? array.length : 0;
|
||||
return length ? array[length - 1] : undefined;
|
||||
}
|
||||
|
||||
module.exports = last;
|
60
node_modules/lodash/array/lastIndexOf.js
generated
vendored
Normal file
60
node_modules/lodash/array/lastIndexOf.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
var binaryIndex = require('../internal/binaryIndex'),
|
||||
indexOfNaN = require('../internal/indexOfNaN');
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max,
|
||||
nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* This method is like `_.indexOf` except that it iterates over elements of
|
||||
* `array` from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to search.
|
||||
* @param {*} value The value to search for.
|
||||
* @param {boolean|number} [fromIndex=array.length-1] The index to search from
|
||||
* or `true` to perform a binary search on a sorted array.
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* _.lastIndexOf([1, 2, 1, 2], 2);
|
||||
* // => 3
|
||||
*
|
||||
* // using `fromIndex`
|
||||
* _.lastIndexOf([1, 2, 1, 2], 2, 2);
|
||||
* // => 1
|
||||
*
|
||||
* // performing a binary search
|
||||
* _.lastIndexOf([1, 1, 2, 2], 2, true);
|
||||
* // => 3
|
||||
*/
|
||||
function lastIndexOf(array, value, fromIndex) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return -1;
|
||||
}
|
||||
var index = length;
|
||||
if (typeof fromIndex == 'number') {
|
||||
index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
|
||||
} else if (fromIndex) {
|
||||
index = binaryIndex(array, value, true) - 1;
|
||||
var other = array[index];
|
||||
if (value === value ? (value === other) : (other !== other)) {
|
||||
return index;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if (value !== value) {
|
||||
return indexOfNaN(array, index, true);
|
||||
}
|
||||
while (index--) {
|
||||
if (array[index] === value) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
module.exports = lastIndexOf;
|
1
node_modules/lodash/array/object.js
generated
vendored
Normal file
1
node_modules/lodash/array/object.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./zipObject');
|
52
node_modules/lodash/array/pull.js
generated
vendored
Normal file
52
node_modules/lodash/array/pull.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
var baseIndexOf = require('../internal/baseIndexOf');
|
||||
|
||||
/** Used for native method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
|
||||
/** Native method references. */
|
||||
var splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* Removes all provided values from `array` using
|
||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* **Note:** Unlike `_.without`, this method mutates `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {...*} [values] The values to remove.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @example
|
||||
*
|
||||
* var array = [1, 2, 3, 1, 2, 3];
|
||||
*
|
||||
* _.pull(array, 2, 3);
|
||||
* console.log(array);
|
||||
* // => [1, 1]
|
||||
*/
|
||||
function pull() {
|
||||
var args = arguments,
|
||||
array = args[0];
|
||||
|
||||
if (!(array && array.length)) {
|
||||
return array;
|
||||
}
|
||||
var index = 0,
|
||||
indexOf = baseIndexOf,
|
||||
length = args.length;
|
||||
|
||||
while (++index < length) {
|
||||
var fromIndex = 0,
|
||||
value = args[index];
|
||||
|
||||
while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
|
||||
splice.call(array, fromIndex, 1);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
module.exports = pull;
|
40
node_modules/lodash/array/pullAt.js
generated
vendored
Normal file
40
node_modules/lodash/array/pullAt.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
var baseAt = require('../internal/baseAt'),
|
||||
baseCompareAscending = require('../internal/baseCompareAscending'),
|
||||
baseFlatten = require('../internal/baseFlatten'),
|
||||
basePullAt = require('../internal/basePullAt'),
|
||||
restParam = require('../function/restParam');
|
||||
|
||||
/**
|
||||
* Removes elements from `array` corresponding to the given indexes and returns
|
||||
* an array of the removed elements. Indexes may be specified as an array of
|
||||
* indexes or as individual arguments.
|
||||
*
|
||||
* **Note:** Unlike `_.at`, this method mutates `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {...(number|number[])} [indexes] The indexes of elements to remove,
|
||||
* specified as individual indexes or arrays of indexes.
|
||||
* @returns {Array} Returns the new array of removed elements.
|
||||
* @example
|
||||
*
|
||||
* var array = [5, 10, 15, 20];
|
||||
* var evens = _.pullAt(array, 1, 3);
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [5, 15]
|
||||
*
|
||||
* console.log(evens);
|
||||
* // => [10, 20]
|
||||
*/
|
||||
var pullAt = restParam(function(array, indexes) {
|
||||
indexes = baseFlatten(indexes);
|
||||
|
||||
var result = baseAt(array, indexes);
|
||||
basePullAt(array, indexes.sort(baseCompareAscending));
|
||||
return result;
|
||||
});
|
||||
|
||||
module.exports = pullAt;
|
64
node_modules/lodash/array/remove.js
generated
vendored
Normal file
64
node_modules/lodash/array/remove.js
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
var baseCallback = require('../internal/baseCallback'),
|
||||
basePullAt = require('../internal/basePullAt');
|
||||
|
||||
/**
|
||||
* Removes all elements from `array` that `predicate` returns truthy for
|
||||
* and returns an array of the removed elements. The predicate is bound to
|
||||
* `thisArg` and invoked with three arguments: (value, index, array).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* **Note:** Unlike `_.filter`, this method mutates `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new array of removed elements.
|
||||
* @example
|
||||
*
|
||||
* var array = [1, 2, 3, 4];
|
||||
* var evens = _.remove(array, function(n) {
|
||||
* return n % 2 == 0;
|
||||
* });
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [1, 3]
|
||||
*
|
||||
* console.log(evens);
|
||||
* // => [2, 4]
|
||||
*/
|
||||
function remove(array, predicate, thisArg) {
|
||||
var result = [];
|
||||
if (!(array && array.length)) {
|
||||
return result;
|
||||
}
|
||||
var index = -1,
|
||||
indexes = [],
|
||||
length = array.length;
|
||||
|
||||
predicate = baseCallback(predicate, thisArg, 3);
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (predicate(value, index, array)) {
|
||||
result.push(value);
|
||||
indexes.push(index);
|
||||
}
|
||||
}
|
||||
basePullAt(array, indexes);
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = remove;
|
21
node_modules/lodash/array/rest.js
generated
vendored
Normal file
21
node_modules/lodash/array/rest.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
var drop = require('./drop');
|
||||
|
||||
/**
|
||||
* Gets all but the first element of `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias tail
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.rest([1, 2, 3]);
|
||||
* // => [2, 3]
|
||||
*/
|
||||
function rest(array) {
|
||||
return drop(array, 1);
|
||||
}
|
||||
|
||||
module.exports = rest;
|
30
node_modules/lodash/array/slice.js
generated
vendored
Normal file
30
node_modules/lodash/array/slice.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
var baseSlice = require('../internal/baseSlice'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` from `start` up to, but not including, `end`.
|
||||
*
|
||||
* **Note:** This method is used instead of `Array#slice` to support node
|
||||
* lists in IE < 9 and to ensure dense arrays are returned.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to slice.
|
||||
* @param {number} [start=0] The start position.
|
||||
* @param {number} [end=array.length] The end position.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
*/
|
||||
function slice(array, start, end) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
|
||||
start = 0;
|
||||
end = length;
|
||||
}
|
||||
return baseSlice(array, start, end);
|
||||
}
|
||||
|
||||
module.exports = slice;
|
53
node_modules/lodash/array/sortedIndex.js
generated
vendored
Normal file
53
node_modules/lodash/array/sortedIndex.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
var createSortedIndex = require('../internal/createSortedIndex');
|
||||
|
||||
/**
|
||||
* Uses a binary search to determine the lowest index at which `value` should
|
||||
* be inserted into `array` in order to maintain its sort order. If an iteratee
|
||||
* function is provided it's invoked for `value` and each element of `array`
|
||||
* to compute their sort ranking. The iteratee is bound to `thisArg` and
|
||||
* invoked with one argument; (value).
|
||||
*
|
||||
* If a property name is provided for `iteratee` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `iteratee` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The sorted array to inspect.
|
||||
* @param {*} value The value to evaluate.
|
||||
* @param {Function|Object|string} [iteratee=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {number} Returns the index at which `value` should be inserted
|
||||
* into `array`.
|
||||
* @example
|
||||
*
|
||||
* _.sortedIndex([30, 50], 40);
|
||||
* // => 1
|
||||
*
|
||||
* _.sortedIndex([4, 4, 5, 5], 5);
|
||||
* // => 2
|
||||
*
|
||||
* var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
|
||||
*
|
||||
* // using an iteratee function
|
||||
* _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
|
||||
* return this.data[word];
|
||||
* }, dict);
|
||||
* // => 1
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
|
||||
* // => 1
|
||||
*/
|
||||
var sortedIndex = createSortedIndex();
|
||||
|
||||
module.exports = sortedIndex;
|
25
node_modules/lodash/array/sortedLastIndex.js
generated
vendored
Normal file
25
node_modules/lodash/array/sortedLastIndex.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
var createSortedIndex = require('../internal/createSortedIndex');
|
||||
|
||||
/**
|
||||
* This method is like `_.sortedIndex` except that it returns the highest
|
||||
* index at which `value` should be inserted into `array` in order to
|
||||
* maintain its sort order.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The sorted array to inspect.
|
||||
* @param {*} value The value to evaluate.
|
||||
* @param {Function|Object|string} [iteratee=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {number} Returns the index at which `value` should be inserted
|
||||
* into `array`.
|
||||
* @example
|
||||
*
|
||||
* _.sortedLastIndex([4, 4, 5, 5], 5);
|
||||
* // => 4
|
||||
*/
|
||||
var sortedLastIndex = createSortedIndex(true);
|
||||
|
||||
module.exports = sortedLastIndex;
|
1
node_modules/lodash/array/tail.js
generated
vendored
Normal file
1
node_modules/lodash/array/tail.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./rest');
|
39
node_modules/lodash/array/take.js
generated
vendored
Normal file
39
node_modules/lodash/array/take.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
var baseSlice = require('../internal/baseSlice'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` with `n` elements taken from the beginning.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {number} [n=1] The number of elements to take.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.take([1, 2, 3]);
|
||||
* // => [1]
|
||||
*
|
||||
* _.take([1, 2, 3], 2);
|
||||
* // => [1, 2]
|
||||
*
|
||||
* _.take([1, 2, 3], 5);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* _.take([1, 2, 3], 0);
|
||||
* // => []
|
||||
*/
|
||||
function take(array, n, guard) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
if (guard ? isIterateeCall(array, n, guard) : n == null) {
|
||||
n = 1;
|
||||
}
|
||||
return baseSlice(array, 0, n < 0 ? 0 : n);
|
||||
}
|
||||
|
||||
module.exports = take;
|
40
node_modules/lodash/array/takeRight.js
generated
vendored
Normal file
40
node_modules/lodash/array/takeRight.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
var baseSlice = require('../internal/baseSlice'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` with `n` elements taken from the end.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {number} [n=1] The number of elements to take.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.takeRight([1, 2, 3]);
|
||||
* // => [3]
|
||||
*
|
||||
* _.takeRight([1, 2, 3], 2);
|
||||
* // => [2, 3]
|
||||
*
|
||||
* _.takeRight([1, 2, 3], 5);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* _.takeRight([1, 2, 3], 0);
|
||||
* // => []
|
||||
*/
|
||||
function takeRight(array, n, guard) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
if (guard ? isIterateeCall(array, n, guard) : n == null) {
|
||||
n = 1;
|
||||
}
|
||||
n = length - (+n || 0);
|
||||
return baseSlice(array, n < 0 ? 0 : n);
|
||||
}
|
||||
|
||||
module.exports = takeRight;
|
59
node_modules/lodash/array/takeRightWhile.js
generated
vendored
Normal file
59
node_modules/lodash/array/takeRightWhile.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
var baseCallback = require('../internal/baseCallback'),
|
||||
baseWhile = require('../internal/baseWhile');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` with elements taken from the end. Elements are
|
||||
* taken until `predicate` returns falsey. The predicate is bound to `thisArg`
|
||||
* and invoked with three arguments: (value, index, array).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.takeRightWhile([1, 2, 3], function(n) {
|
||||
* return n > 1;
|
||||
* });
|
||||
* // => [2, 3]
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': true },
|
||||
* { 'user': 'fred', 'active': false },
|
||||
* { 'user': 'pebbles', 'active': false }
|
||||
* ];
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
|
||||
* // => ['pebbles']
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.pluck(_.takeRightWhile(users, 'active', false), 'user');
|
||||
* // => ['fred', 'pebbles']
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.pluck(_.takeRightWhile(users, 'active'), 'user');
|
||||
* // => []
|
||||
*/
|
||||
function takeRightWhile(array, predicate, thisArg) {
|
||||
return (array && array.length)
|
||||
? baseWhile(array, baseCallback(predicate, thisArg, 3), false, true)
|
||||
: [];
|
||||
}
|
||||
|
||||
module.exports = takeRightWhile;
|
59
node_modules/lodash/array/takeWhile.js
generated
vendored
Normal file
59
node_modules/lodash/array/takeWhile.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
var baseCallback = require('../internal/baseCallback'),
|
||||
baseWhile = require('../internal/baseWhile');
|
||||
|
||||
/**
|
||||
* Creates a slice of `array` with elements taken from the beginning. Elements
|
||||
* are taken until `predicate` returns falsey. The predicate is bound to
|
||||
* `thisArg` and invoked with three arguments: (value, index, array).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the slice of `array`.
|
||||
* @example
|
||||
*
|
||||
* _.takeWhile([1, 2, 3], function(n) {
|
||||
* return n < 3;
|
||||
* });
|
||||
* // => [1, 2]
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': false },
|
||||
* { 'user': 'fred', 'active': false},
|
||||
* { 'user': 'pebbles', 'active': true }
|
||||
* ];
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
|
||||
* // => ['barney']
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.pluck(_.takeWhile(users, 'active', false), 'user');
|
||||
* // => ['barney', 'fred']
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.pluck(_.takeWhile(users, 'active'), 'user');
|
||||
* // => []
|
||||
*/
|
||||
function takeWhile(array, predicate, thisArg) {
|
||||
return (array && array.length)
|
||||
? baseWhile(array, baseCallback(predicate, thisArg, 3))
|
||||
: [];
|
||||
}
|
||||
|
||||
module.exports = takeWhile;
|
24
node_modules/lodash/array/union.js
generated
vendored
Normal file
24
node_modules/lodash/array/union.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
var baseFlatten = require('../internal/baseFlatten'),
|
||||
baseUniq = require('../internal/baseUniq'),
|
||||
restParam = require('../function/restParam');
|
||||
|
||||
/**
|
||||
* Creates an array of unique values, in order, from all of the provided arrays
|
||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @returns {Array} Returns the new array of combined values.
|
||||
* @example
|
||||
*
|
||||
* _.union([1, 2], [4, 2], [2, 1]);
|
||||
* // => [1, 2, 4]
|
||||
*/
|
||||
var union = restParam(function(arrays) {
|
||||
return baseUniq(baseFlatten(arrays, false, true));
|
||||
});
|
||||
|
||||
module.exports = union;
|
71
node_modules/lodash/array/uniq.js
generated
vendored
Normal file
71
node_modules/lodash/array/uniq.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
var baseCallback = require('../internal/baseCallback'),
|
||||
baseUniq = require('../internal/baseUniq'),
|
||||
isIterateeCall = require('../internal/isIterateeCall'),
|
||||
sortedUniq = require('../internal/sortedUniq');
|
||||
|
||||
/**
|
||||
* Creates a duplicate-free version of an array, using
|
||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons, in which only the first occurence of each element
|
||||
* is kept. Providing `true` for `isSorted` performs a faster search algorithm
|
||||
* for sorted arrays. If an iteratee function is provided it's invoked for
|
||||
* each element in the array to generate the criterion by which uniqueness
|
||||
* is computed. The `iteratee` is bound to `thisArg` and invoked with three
|
||||
* arguments: (value, index, array).
|
||||
*
|
||||
* If a property name is provided for `iteratee` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `iteratee` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias unique
|
||||
* @category Array
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {boolean} [isSorted] Specify the array is sorted.
|
||||
* @param {Function|Object|string} [iteratee] The function invoked per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {Array} Returns the new duplicate-value-free array.
|
||||
* @example
|
||||
*
|
||||
* _.uniq([2, 1, 2]);
|
||||
* // => [2, 1]
|
||||
*
|
||||
* // using `isSorted`
|
||||
* _.uniq([1, 1, 2], true);
|
||||
* // => [1, 2]
|
||||
*
|
||||
* // using an iteratee function
|
||||
* _.uniq([1, 2.5, 1.5, 2], function(n) {
|
||||
* return this.floor(n);
|
||||
* }, Math);
|
||||
* // => [1, 2.5]
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
|
||||
* // => [{ 'x': 1 }, { 'x': 2 }]
|
||||
*/
|
||||
function uniq(array, isSorted, iteratee, thisArg) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
if (isSorted != null && typeof isSorted != 'boolean') {
|
||||
thisArg = iteratee;
|
||||
iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
|
||||
isSorted = false;
|
||||
}
|
||||
iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
|
||||
return (isSorted)
|
||||
? sortedUniq(array, iteratee)
|
||||
: baseUniq(array, iteratee);
|
||||
}
|
||||
|
||||
module.exports = uniq;
|
1
node_modules/lodash/array/unique.js
generated
vendored
Normal file
1
node_modules/lodash/array/unique.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./uniq');
|
47
node_modules/lodash/array/unzip.js
generated
vendored
Normal file
47
node_modules/lodash/array/unzip.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
var arrayFilter = require('../internal/arrayFilter'),
|
||||
arrayMap = require('../internal/arrayMap'),
|
||||
baseProperty = require('../internal/baseProperty'),
|
||||
isArrayLike = require('../internal/isArrayLike');
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* This method is like `_.zip` except that it accepts an array of grouped
|
||||
* elements and creates an array regrouping the elements to their pre-zip
|
||||
* configuration.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array of grouped elements to process.
|
||||
* @returns {Array} Returns the new array of regrouped elements.
|
||||
* @example
|
||||
*
|
||||
* var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
|
||||
* // => [['fred', 30, true], ['barney', 40, false]]
|
||||
*
|
||||
* _.unzip(zipped);
|
||||
* // => [['fred', 'barney'], [30, 40], [true, false]]
|
||||
*/
|
||||
function unzip(array) {
|
||||
if (!(array && array.length)) {
|
||||
return [];
|
||||
}
|
||||
var index = -1,
|
||||
length = 0;
|
||||
|
||||
array = arrayFilter(array, function(group) {
|
||||
if (isArrayLike(group)) {
|
||||
length = nativeMax(group.length, length);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
var result = Array(length);
|
||||
while (++index < length) {
|
||||
result[index] = arrayMap(array, baseProperty(index));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = unzip;
|
41
node_modules/lodash/array/unzipWith.js
generated
vendored
Normal file
41
node_modules/lodash/array/unzipWith.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
var arrayMap = require('../internal/arrayMap'),
|
||||
arrayReduce = require('../internal/arrayReduce'),
|
||||
bindCallback = require('../internal/bindCallback'),
|
||||
unzip = require('./unzip');
|
||||
|
||||
/**
|
||||
* This method is like `_.unzip` except that it accepts an iteratee to specify
|
||||
* how regrouped values should be combined. The `iteratee` is bound to `thisArg`
|
||||
* and invoked with four arguments: (accumulator, value, index, group).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array of grouped elements to process.
|
||||
* @param {Function} [iteratee] The function to combine regrouped values.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {Array} Returns the new array of regrouped elements.
|
||||
* @example
|
||||
*
|
||||
* var zipped = _.zip([1, 2], [10, 20], [100, 200]);
|
||||
* // => [[1, 10, 100], [2, 20, 200]]
|
||||
*
|
||||
* _.unzipWith(zipped, _.add);
|
||||
* // => [3, 30, 300]
|
||||
*/
|
||||
function unzipWith(array, iteratee, thisArg) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
var result = unzip(array);
|
||||
if (iteratee == null) {
|
||||
return result;
|
||||
}
|
||||
iteratee = bindCallback(iteratee, thisArg, 4);
|
||||
return arrayMap(result, function(group) {
|
||||
return arrayReduce(group, iteratee, undefined, true);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = unzipWith;
|
27
node_modules/lodash/array/without.js
generated
vendored
Normal file
27
node_modules/lodash/array/without.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
var baseDifference = require('../internal/baseDifference'),
|
||||
isArrayLike = require('../internal/isArrayLike'),
|
||||
restParam = require('../function/restParam');
|
||||
|
||||
/**
|
||||
* Creates an array excluding all provided values using
|
||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to filter.
|
||||
* @param {...*} [values] The values to exclude.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @example
|
||||
*
|
||||
* _.without([1, 2, 1, 3], 1, 2);
|
||||
* // => [3]
|
||||
*/
|
||||
var without = restParam(function(array, values) {
|
||||
return isArrayLike(array)
|
||||
? baseDifference(array, values)
|
||||
: [];
|
||||
});
|
||||
|
||||
module.exports = without;
|
35
node_modules/lodash/array/xor.js
generated
vendored
Normal file
35
node_modules/lodash/array/xor.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
var arrayPush = require('../internal/arrayPush'),
|
||||
baseDifference = require('../internal/baseDifference'),
|
||||
baseUniq = require('../internal/baseUniq'),
|
||||
isArrayLike = require('../internal/isArrayLike');
|
||||
|
||||
/**
|
||||
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
|
||||
* of the provided arrays.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @returns {Array} Returns the new array of values.
|
||||
* @example
|
||||
*
|
||||
* _.xor([1, 2], [4, 2]);
|
||||
* // => [1, 4]
|
||||
*/
|
||||
function xor() {
|
||||
var index = -1,
|
||||
length = arguments.length;
|
||||
|
||||
while (++index < length) {
|
||||
var array = arguments[index];
|
||||
if (isArrayLike(array)) {
|
||||
var result = result
|
||||
? arrayPush(baseDifference(result, array), baseDifference(array, result))
|
||||
: array;
|
||||
}
|
||||
}
|
||||
return result ? baseUniq(result) : [];
|
||||
}
|
||||
|
||||
module.exports = xor;
|
21
node_modules/lodash/array/zip.js
generated
vendored
Normal file
21
node_modules/lodash/array/zip.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
var restParam = require('../function/restParam'),
|
||||
unzip = require('./unzip');
|
||||
|
||||
/**
|
||||
* Creates an array of grouped elements, the first of which contains the first
|
||||
* elements of the given arrays, the second of which contains the second elements
|
||||
* of the given arrays, and so on.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to process.
|
||||
* @returns {Array} Returns the new array of grouped elements.
|
||||
* @example
|
||||
*
|
||||
* _.zip(['fred', 'barney'], [30, 40], [true, false]);
|
||||
* // => [['fred', 30, true], ['barney', 40, false]]
|
||||
*/
|
||||
var zip = restParam(unzip);
|
||||
|
||||
module.exports = zip;
|
43
node_modules/lodash/array/zipObject.js
generated
vendored
Normal file
43
node_modules/lodash/array/zipObject.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
var isArray = require('../lang/isArray');
|
||||
|
||||
/**
|
||||
* The inverse of `_.pairs`; this method returns an object composed from arrays
|
||||
* of property names and values. Provide either a single two dimensional array,
|
||||
* e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
|
||||
* and one of corresponding values.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias object
|
||||
* @category Array
|
||||
* @param {Array} props The property names.
|
||||
* @param {Array} [values=[]] The property values.
|
||||
* @returns {Object} Returns the new object.
|
||||
* @example
|
||||
*
|
||||
* _.zipObject([['fred', 30], ['barney', 40]]);
|
||||
* // => { 'fred': 30, 'barney': 40 }
|
||||
*
|
||||
* _.zipObject(['fred', 'barney'], [30, 40]);
|
||||
* // => { 'fred': 30, 'barney': 40 }
|
||||
*/
|
||||
function zipObject(props, values) {
|
||||
var index = -1,
|
||||
length = props ? props.length : 0,
|
||||
result = {};
|
||||
|
||||
if (length && !values && !isArray(props[0])) {
|
||||
values = [];
|
||||
}
|
||||
while (++index < length) {
|
||||
var key = props[index];
|
||||
if (values) {
|
||||
result[key] = values[index];
|
||||
} else if (key) {
|
||||
result[key[0]] = key[1];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = zipObject;
|
36
node_modules/lodash/array/zipWith.js
generated
vendored
Normal file
36
node_modules/lodash/array/zipWith.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
var restParam = require('../function/restParam'),
|
||||
unzipWith = require('./unzipWith');
|
||||
|
||||
/**
|
||||
* This method is like `_.zip` except that it accepts an iteratee to specify
|
||||
* how grouped values should be combined. The `iteratee` is bound to `thisArg`
|
||||
* and invoked with four arguments: (accumulator, value, index, group).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to process.
|
||||
* @param {Function} [iteratee] The function to combine grouped values.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {Array} Returns the new array of grouped elements.
|
||||
* @example
|
||||
*
|
||||
* _.zipWith([1, 2], [10, 20], [100, 200], _.add);
|
||||
* // => [111, 222]
|
||||
*/
|
||||
var zipWith = restParam(function(arrays) {
|
||||
var length = arrays.length,
|
||||
iteratee = length > 2 ? arrays[length - 2] : undefined,
|
||||
thisArg = length > 1 ? arrays[length - 1] : undefined;
|
||||
|
||||
if (length > 2 && typeof iteratee == 'function') {
|
||||
length -= 2;
|
||||
} else {
|
||||
iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
|
||||
thisArg = undefined;
|
||||
}
|
||||
arrays.length = length;
|
||||
return unzipWith(arrays, iteratee, thisArg);
|
||||
});
|
||||
|
||||
module.exports = zipWith;
|
16
node_modules/lodash/chain.js
generated
vendored
Normal file
16
node_modules/lodash/chain.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
'chain': require('./chain/chain'),
|
||||
'commit': require('./chain/commit'),
|
||||
'concat': require('./chain/concat'),
|
||||
'lodash': require('./chain/lodash'),
|
||||
'plant': require('./chain/plant'),
|
||||
'reverse': require('./chain/reverse'),
|
||||
'run': require('./chain/run'),
|
||||
'tap': require('./chain/tap'),
|
||||
'thru': require('./chain/thru'),
|
||||
'toJSON': require('./chain/toJSON'),
|
||||
'toString': require('./chain/toString'),
|
||||
'value': require('./chain/value'),
|
||||
'valueOf': require('./chain/valueOf'),
|
||||
'wrapperChain': require('./chain/wrapperChain')
|
||||
};
|
35
node_modules/lodash/chain/chain.js
generated
vendored
Normal file
35
node_modules/lodash/chain/chain.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
var lodash = require('./lodash');
|
||||
|
||||
/**
|
||||
* Creates a `lodash` object that wraps `value` with explicit method
|
||||
* chaining enabled.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @param {*} value The value to wrap.
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36 },
|
||||
* { 'user': 'fred', 'age': 40 },
|
||||
* { 'user': 'pebbles', 'age': 1 }
|
||||
* ];
|
||||
*
|
||||
* var youngest = _.chain(users)
|
||||
* .sortBy('age')
|
||||
* .map(function(chr) {
|
||||
* return chr.user + ' is ' + chr.age;
|
||||
* })
|
||||
* .first()
|
||||
* .value();
|
||||
* // => 'pebbles is 1'
|
||||
*/
|
||||
function chain(value) {
|
||||
var result = lodash(value);
|
||||
result.__chain__ = true;
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = chain;
|
1
node_modules/lodash/chain/commit.js
generated
vendored
Normal file
1
node_modules/lodash/chain/commit.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperCommit');
|
1
node_modules/lodash/chain/concat.js
generated
vendored
Normal file
1
node_modules/lodash/chain/concat.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperConcat');
|
125
node_modules/lodash/chain/lodash.js
generated
vendored
Normal file
125
node_modules/lodash/chain/lodash.js
generated
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
var LazyWrapper = require('../internal/LazyWrapper'),
|
||||
LodashWrapper = require('../internal/LodashWrapper'),
|
||||
baseLodash = require('../internal/baseLodash'),
|
||||
isArray = require('../lang/isArray'),
|
||||
isObjectLike = require('../internal/isObjectLike'),
|
||||
wrapperClone = require('../internal/wrapperClone');
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Creates a `lodash` object which wraps `value` to enable implicit chaining.
|
||||
* Methods that operate on and return arrays, collections, and functions can
|
||||
* be chained together. Methods that retrieve a single value or may return a
|
||||
* primitive value will automatically end the chain returning the unwrapped
|
||||
* value. Explicit chaining may be enabled using `_.chain`. The execution of
|
||||
* chained methods is lazy, that is, execution is deferred until `_#value`
|
||||
* is implicitly or explicitly called.
|
||||
*
|
||||
* Lazy evaluation allows several methods to support shortcut fusion. Shortcut
|
||||
* fusion is an optimization strategy which merge iteratee calls; this can help
|
||||
* to avoid the creation of intermediate data structures and greatly reduce the
|
||||
* number of iteratee executions.
|
||||
*
|
||||
* Chaining is supported in custom builds as long as the `_#value` method is
|
||||
* directly or indirectly included in the build.
|
||||
*
|
||||
* In addition to lodash methods, wrappers have `Array` and `String` methods.
|
||||
*
|
||||
* The wrapper `Array` methods are:
|
||||
* `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
|
||||
* `splice`, and `unshift`
|
||||
*
|
||||
* The wrapper `String` methods are:
|
||||
* `replace` and `split`
|
||||
*
|
||||
* The wrapper methods that support shortcut fusion are:
|
||||
* `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
|
||||
* `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
|
||||
* `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
|
||||
* and `where`
|
||||
*
|
||||
* The chainable wrapper methods are:
|
||||
* `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
|
||||
* `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
|
||||
* `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
|
||||
* `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
|
||||
* `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
|
||||
* `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
|
||||
* `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
|
||||
* `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
|
||||
* `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
|
||||
* `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
|
||||
* `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
|
||||
* `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
|
||||
* `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
|
||||
* `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
|
||||
* `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
|
||||
* `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
|
||||
* `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
|
||||
*
|
||||
* The wrapper methods that are **not** chainable by default are:
|
||||
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
|
||||
* `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
|
||||
* `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
|
||||
* `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
|
||||
* `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
|
||||
* `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
|
||||
* `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
|
||||
* `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
|
||||
* `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
|
||||
* `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
|
||||
* `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
|
||||
* `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
|
||||
* `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
|
||||
* `unescape`, `uniqueId`, `value`, and `words`
|
||||
*
|
||||
* The wrapper method `sample` will return a wrapped value when `n` is provided,
|
||||
* otherwise an unwrapped value is returned.
|
||||
*
|
||||
* @name _
|
||||
* @constructor
|
||||
* @category Chain
|
||||
* @param {*} value The value to wrap in a `lodash` instance.
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var wrapped = _([1, 2, 3]);
|
||||
*
|
||||
* // returns an unwrapped value
|
||||
* wrapped.reduce(function(total, n) {
|
||||
* return total + n;
|
||||
* });
|
||||
* // => 6
|
||||
*
|
||||
* // returns a wrapped value
|
||||
* var squares = wrapped.map(function(n) {
|
||||
* return n * n;
|
||||
* });
|
||||
*
|
||||
* _.isArray(squares);
|
||||
* // => false
|
||||
*
|
||||
* _.isArray(squares.value());
|
||||
* // => true
|
||||
*/
|
||||
function lodash(value) {
|
||||
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
||||
if (value instanceof LodashWrapper) {
|
||||
return value;
|
||||
}
|
||||
if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
|
||||
return wrapperClone(value);
|
||||
}
|
||||
}
|
||||
return new LodashWrapper(value);
|
||||
}
|
||||
|
||||
// Ensure wrappers are instances of `baseLodash`.
|
||||
lodash.prototype = baseLodash.prototype;
|
||||
|
||||
module.exports = lodash;
|
1
node_modules/lodash/chain/plant.js
generated
vendored
Normal file
1
node_modules/lodash/chain/plant.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperPlant');
|
1
node_modules/lodash/chain/reverse.js
generated
vendored
Normal file
1
node_modules/lodash/chain/reverse.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperReverse');
|
1
node_modules/lodash/chain/run.js
generated
vendored
Normal file
1
node_modules/lodash/chain/run.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperValue');
|
29
node_modules/lodash/chain/tap.js
generated
vendored
Normal file
29
node_modules/lodash/chain/tap.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This method invokes `interceptor` and returns `value`. The interceptor is
|
||||
* bound to `thisArg` and invoked with one argument; (value). The purpose of
|
||||
* this method is to "tap into" a method chain in order to perform operations
|
||||
* on intermediate results within the chain.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @param {*} value The value to provide to `interceptor`.
|
||||
* @param {Function} interceptor The function to invoke.
|
||||
* @param {*} [thisArg] The `this` binding of `interceptor`.
|
||||
* @returns {*} Returns `value`.
|
||||
* @example
|
||||
*
|
||||
* _([1, 2, 3])
|
||||
* .tap(function(array) {
|
||||
* array.pop();
|
||||
* })
|
||||
* .reverse()
|
||||
* .value();
|
||||
* // => [2, 1]
|
||||
*/
|
||||
function tap(value, interceptor, thisArg) {
|
||||
interceptor.call(thisArg, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
module.exports = tap;
|
26
node_modules/lodash/chain/thru.js
generated
vendored
Normal file
26
node_modules/lodash/chain/thru.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* This method is like `_.tap` except that it returns the result of `interceptor`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @param {*} value The value to provide to `interceptor`.
|
||||
* @param {Function} interceptor The function to invoke.
|
||||
* @param {*} [thisArg] The `this` binding of `interceptor`.
|
||||
* @returns {*} Returns the result of `interceptor`.
|
||||
* @example
|
||||
*
|
||||
* _(' abc ')
|
||||
* .chain()
|
||||
* .trim()
|
||||
* .thru(function(value) {
|
||||
* return [value];
|
||||
* })
|
||||
* .value();
|
||||
* // => ['abc']
|
||||
*/
|
||||
function thru(value, interceptor, thisArg) {
|
||||
return interceptor.call(thisArg, value);
|
||||
}
|
||||
|
||||
module.exports = thru;
|
1
node_modules/lodash/chain/toJSON.js
generated
vendored
Normal file
1
node_modules/lodash/chain/toJSON.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperValue');
|
1
node_modules/lodash/chain/toString.js
generated
vendored
Normal file
1
node_modules/lodash/chain/toString.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperToString');
|
1
node_modules/lodash/chain/value.js
generated
vendored
Normal file
1
node_modules/lodash/chain/value.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperValue');
|
1
node_modules/lodash/chain/valueOf.js
generated
vendored
Normal file
1
node_modules/lodash/chain/valueOf.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./wrapperValue');
|
32
node_modules/lodash/chain/wrapperChain.js
generated
vendored
Normal file
32
node_modules/lodash/chain/wrapperChain.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
var chain = require('./chain');
|
||||
|
||||
/**
|
||||
* Enables explicit method chaining on the wrapper object.
|
||||
*
|
||||
* @name chain
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36 },
|
||||
* { 'user': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // without explicit chaining
|
||||
* _(users).first();
|
||||
* // => { 'user': 'barney', 'age': 36 }
|
||||
*
|
||||
* // with explicit chaining
|
||||
* _(users).chain()
|
||||
* .first()
|
||||
* .pick('user')
|
||||
* .value();
|
||||
* // => { 'user': 'barney' }
|
||||
*/
|
||||
function wrapperChain() {
|
||||
return chain(this);
|
||||
}
|
||||
|
||||
module.exports = wrapperChain;
|
32
node_modules/lodash/chain/wrapperCommit.js
generated
vendored
Normal file
32
node_modules/lodash/chain/wrapperCommit.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
var LodashWrapper = require('../internal/LodashWrapper');
|
||||
|
||||
/**
|
||||
* Executes the chained sequence and returns the wrapped result.
|
||||
*
|
||||
* @name commit
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var array = [1, 2];
|
||||
* var wrapped = _(array).push(3);
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [1, 2]
|
||||
*
|
||||
* wrapped = wrapped.commit();
|
||||
* console.log(array);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* wrapped.last();
|
||||
* // => 3
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function wrapperCommit() {
|
||||
return new LodashWrapper(this.value(), this.__chain__);
|
||||
}
|
||||
|
||||
module.exports = wrapperCommit;
|
34
node_modules/lodash/chain/wrapperConcat.js
generated
vendored
Normal file
34
node_modules/lodash/chain/wrapperConcat.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
var arrayConcat = require('../internal/arrayConcat'),
|
||||
baseFlatten = require('../internal/baseFlatten'),
|
||||
isArray = require('../lang/isArray'),
|
||||
restParam = require('../function/restParam'),
|
||||
toObject = require('../internal/toObject');
|
||||
|
||||
/**
|
||||
* Creates a new array joining a wrapped array with any additional arrays
|
||||
* and/or values.
|
||||
*
|
||||
* @name concat
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @param {...*} [values] The values to concatenate.
|
||||
* @returns {Array} Returns the new concatenated array.
|
||||
* @example
|
||||
*
|
||||
* var array = [1];
|
||||
* var wrapped = _(array).concat(2, [3], [[4]]);
|
||||
*
|
||||
* console.log(wrapped.value());
|
||||
* // => [1, 2, 3, [4]]
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [1]
|
||||
*/
|
||||
var wrapperConcat = restParam(function(values) {
|
||||
values = baseFlatten(values);
|
||||
return this.thru(function(array) {
|
||||
return arrayConcat(isArray(array) ? array : [toObject(array)], values);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = wrapperConcat;
|
45
node_modules/lodash/chain/wrapperPlant.js
generated
vendored
Normal file
45
node_modules/lodash/chain/wrapperPlant.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
var baseLodash = require('../internal/baseLodash'),
|
||||
wrapperClone = require('../internal/wrapperClone');
|
||||
|
||||
/**
|
||||
* Creates a clone of the chained sequence planting `value` as the wrapped value.
|
||||
*
|
||||
* @name plant
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var array = [1, 2];
|
||||
* var wrapped = _(array).map(function(value) {
|
||||
* return Math.pow(value, 2);
|
||||
* });
|
||||
*
|
||||
* var other = [3, 4];
|
||||
* var otherWrapped = wrapped.plant(other);
|
||||
*
|
||||
* otherWrapped.value();
|
||||
* // => [9, 16]
|
||||
*
|
||||
* wrapped.value();
|
||||
* // => [1, 4]
|
||||
*/
|
||||
function wrapperPlant(value) {
|
||||
var result,
|
||||
parent = this;
|
||||
|
||||
while (parent instanceof baseLodash) {
|
||||
var clone = wrapperClone(parent);
|
||||
if (result) {
|
||||
previous.__wrapped__ = clone;
|
||||
} else {
|
||||
result = clone;
|
||||
}
|
||||
var previous = clone;
|
||||
parent = parent.__wrapped__;
|
||||
}
|
||||
previous.__wrapped__ = value;
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = wrapperPlant;
|
43
node_modules/lodash/chain/wrapperReverse.js
generated
vendored
Normal file
43
node_modules/lodash/chain/wrapperReverse.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
var LazyWrapper = require('../internal/LazyWrapper'),
|
||||
LodashWrapper = require('../internal/LodashWrapper'),
|
||||
thru = require('./thru');
|
||||
|
||||
/**
|
||||
* Reverses the wrapped array so the first element becomes the last, the
|
||||
* second element becomes the second to last, and so on.
|
||||
*
|
||||
* **Note:** This method mutates the wrapped array.
|
||||
*
|
||||
* @name reverse
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @returns {Object} Returns the new reversed `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var array = [1, 2, 3];
|
||||
*
|
||||
* _(array).reverse().value()
|
||||
* // => [3, 2, 1]
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [3, 2, 1]
|
||||
*/
|
||||
function wrapperReverse() {
|
||||
var value = this.__wrapped__;
|
||||
|
||||
var interceptor = function(value) {
|
||||
return value.reverse();
|
||||
};
|
||||
if (value instanceof LazyWrapper) {
|
||||
var wrapped = value;
|
||||
if (this.__actions__.length) {
|
||||
wrapped = new LazyWrapper(this);
|
||||
}
|
||||
wrapped = wrapped.reverse();
|
||||
wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
|
||||
return new LodashWrapper(wrapped, this.__chain__);
|
||||
}
|
||||
return this.thru(interceptor);
|
||||
}
|
||||
|
||||
module.exports = wrapperReverse;
|
17
node_modules/lodash/chain/wrapperToString.js
generated
vendored
Normal file
17
node_modules/lodash/chain/wrapperToString.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Produces the result of coercing the unwrapped value to a string.
|
||||
*
|
||||
* @name toString
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @returns {string} Returns the coerced string value.
|
||||
* @example
|
||||
*
|
||||
* _([1, 2, 3]).toString();
|
||||
* // => '1,2,3'
|
||||
*/
|
||||
function wrapperToString() {
|
||||
return (this.value() + '');
|
||||
}
|
||||
|
||||
module.exports = wrapperToString;
|
20
node_modules/lodash/chain/wrapperValue.js
generated
vendored
Normal file
20
node_modules/lodash/chain/wrapperValue.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
var baseWrapperValue = require('../internal/baseWrapperValue');
|
||||
|
||||
/**
|
||||
* Executes the chained sequence to extract the unwrapped value.
|
||||
*
|
||||
* @name value
|
||||
* @memberOf _
|
||||
* @alias run, toJSON, valueOf
|
||||
* @category Chain
|
||||
* @returns {*} Returns the resolved unwrapped value.
|
||||
* @example
|
||||
*
|
||||
* _([1, 2, 3]).value();
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function wrapperValue() {
|
||||
return baseWrapperValue(this.__wrapped__, this.__actions__);
|
||||
}
|
||||
|
||||
module.exports = wrapperValue;
|
44
node_modules/lodash/collection.js
generated
vendored
Normal file
44
node_modules/lodash/collection.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
module.exports = {
|
||||
'all': require('./collection/all'),
|
||||
'any': require('./collection/any'),
|
||||
'at': require('./collection/at'),
|
||||
'collect': require('./collection/collect'),
|
||||
'contains': require('./collection/contains'),
|
||||
'countBy': require('./collection/countBy'),
|
||||
'detect': require('./collection/detect'),
|
||||
'each': require('./collection/each'),
|
||||
'eachRight': require('./collection/eachRight'),
|
||||
'every': require('./collection/every'),
|
||||
'filter': require('./collection/filter'),
|
||||
'find': require('./collection/find'),
|
||||
'findLast': require('./collection/findLast'),
|
||||
'findWhere': require('./collection/findWhere'),
|
||||
'foldl': require('./collection/foldl'),
|
||||
'foldr': require('./collection/foldr'),
|
||||
'forEach': require('./collection/forEach'),
|
||||
'forEachRight': require('./collection/forEachRight'),
|
||||
'groupBy': require('./collection/groupBy'),
|
||||
'include': require('./collection/include'),
|
||||
'includes': require('./collection/includes'),
|
||||
'indexBy': require('./collection/indexBy'),
|
||||
'inject': require('./collection/inject'),
|
||||
'invoke': require('./collection/invoke'),
|
||||
'map': require('./collection/map'),
|
||||
'max': require('./math/max'),
|
||||
'min': require('./math/min'),
|
||||
'partition': require('./collection/partition'),
|
||||
'pluck': require('./collection/pluck'),
|
||||
'reduce': require('./collection/reduce'),
|
||||
'reduceRight': require('./collection/reduceRight'),
|
||||
'reject': require('./collection/reject'),
|
||||
'sample': require('./collection/sample'),
|
||||
'select': require('./collection/select'),
|
||||
'shuffle': require('./collection/shuffle'),
|
||||
'size': require('./collection/size'),
|
||||
'some': require('./collection/some'),
|
||||
'sortBy': require('./collection/sortBy'),
|
||||
'sortByAll': require('./collection/sortByAll'),
|
||||
'sortByOrder': require('./collection/sortByOrder'),
|
||||
'sum': require('./math/sum'),
|
||||
'where': require('./collection/where')
|
||||
};
|
1
node_modules/lodash/collection/all.js
generated
vendored
Normal file
1
node_modules/lodash/collection/all.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./every');
|
1
node_modules/lodash/collection/any.js
generated
vendored
Normal file
1
node_modules/lodash/collection/any.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./some');
|
29
node_modules/lodash/collection/at.js
generated
vendored
Normal file
29
node_modules/lodash/collection/at.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
var baseAt = require('../internal/baseAt'),
|
||||
baseFlatten = require('../internal/baseFlatten'),
|
||||
restParam = require('../function/restParam');
|
||||
|
||||
/**
|
||||
* Creates an array of elements corresponding to the given keys, or indexes,
|
||||
* of `collection`. Keys may be specified as individual arguments or as arrays
|
||||
* of keys.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {...(number|number[]|string|string[])} [props] The property names
|
||||
* or indexes of elements to pick, specified individually or in arrays.
|
||||
* @returns {Array} Returns the new array of picked elements.
|
||||
* @example
|
||||
*
|
||||
* _.at(['a', 'b', 'c'], [0, 2]);
|
||||
* // => ['a', 'c']
|
||||
*
|
||||
* _.at(['barney', 'fred', 'pebbles'], 0, 2);
|
||||
* // => ['barney', 'pebbles']
|
||||
*/
|
||||
var at = restParam(function(collection, props) {
|
||||
return baseAt(collection, baseFlatten(props));
|
||||
});
|
||||
|
||||
module.exports = at;
|
1
node_modules/lodash/collection/collect.js
generated
vendored
Normal file
1
node_modules/lodash/collection/collect.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./map');
|
1
node_modules/lodash/collection/contains.js
generated
vendored
Normal file
1
node_modules/lodash/collection/contains.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./includes');
|
54
node_modules/lodash/collection/countBy.js
generated
vendored
Normal file
54
node_modules/lodash/collection/countBy.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
var createAggregator = require('../internal/createAggregator');
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Creates an object composed of keys generated from the results of running
|
||||
* each element of `collection` through `iteratee`. The corresponding value
|
||||
* of each key is the number of times the key was returned by `iteratee`.
|
||||
* The `iteratee` is bound to `thisArg` and invoked with three arguments:
|
||||
* (value, index|key, collection).
|
||||
*
|
||||
* If a property name is provided for `iteratee` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `iteratee` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [iteratee=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
*
|
||||
* _.countBy([4.3, 6.1, 6.4], function(n) {
|
||||
* return Math.floor(n);
|
||||
* });
|
||||
* // => { '4': 1, '6': 2 }
|
||||
*
|
||||
* _.countBy([4.3, 6.1, 6.4], function(n) {
|
||||
* return this.floor(n);
|
||||
* }, Math);
|
||||
* // => { '4': 1, '6': 2 }
|
||||
*
|
||||
* _.countBy(['one', 'two', 'three'], 'length');
|
||||
* // => { '3': 2, '5': 1 }
|
||||
*/
|
||||
var countBy = createAggregator(function(result, value, key) {
|
||||
hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
|
||||
});
|
||||
|
||||
module.exports = countBy;
|
1
node_modules/lodash/collection/detect.js
generated
vendored
Normal file
1
node_modules/lodash/collection/detect.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./find');
|
1
node_modules/lodash/collection/each.js
generated
vendored
Normal file
1
node_modules/lodash/collection/each.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./forEach');
|
1
node_modules/lodash/collection/eachRight.js
generated
vendored
Normal file
1
node_modules/lodash/collection/eachRight.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./forEachRight');
|
66
node_modules/lodash/collection/every.js
generated
vendored
Normal file
66
node_modules/lodash/collection/every.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
var arrayEvery = require('../internal/arrayEvery'),
|
||||
baseCallback = require('../internal/baseCallback'),
|
||||
baseEvery = require('../internal/baseEvery'),
|
||||
isArray = require('../lang/isArray'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/**
|
||||
* Checks if `predicate` returns truthy for **all** elements of `collection`.
|
||||
* The predicate is bound to `thisArg` and invoked with three arguments:
|
||||
* (value, index|key, collection).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias all
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {boolean} Returns `true` if all elements pass the predicate check,
|
||||
* else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.every([true, 1, null, 'yes'], Boolean);
|
||||
* // => false
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': false },
|
||||
* { 'user': 'fred', 'active': false }
|
||||
* ];
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.every(users, { 'user': 'barney', 'active': false });
|
||||
* // => false
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.every(users, 'active', false);
|
||||
* // => true
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.every(users, 'active');
|
||||
* // => false
|
||||
*/
|
||||
function every(collection, predicate, thisArg) {
|
||||
var func = isArray(collection) ? arrayEvery : baseEvery;
|
||||
if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
|
||||
predicate = undefined;
|
||||
}
|
||||
if (typeof predicate != 'function' || thisArg !== undefined) {
|
||||
predicate = baseCallback(predicate, thisArg, 3);
|
||||
}
|
||||
return func(collection, predicate);
|
||||
}
|
||||
|
||||
module.exports = every;
|
61
node_modules/lodash/collection/filter.js
generated
vendored
Normal file
61
node_modules/lodash/collection/filter.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
var arrayFilter = require('../internal/arrayFilter'),
|
||||
baseCallback = require('../internal/baseCallback'),
|
||||
baseFilter = require('../internal/baseFilter'),
|
||||
isArray = require('../lang/isArray');
|
||||
|
||||
/**
|
||||
* Iterates over elements of `collection`, returning an array of all elements
|
||||
* `predicate` returns truthy for. The predicate is bound to `thisArg` and
|
||||
* invoked with three arguments: (value, index|key, collection).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias select
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @example
|
||||
*
|
||||
* _.filter([4, 5, 6], function(n) {
|
||||
* return n % 2 == 0;
|
||||
* });
|
||||
* // => [4, 6]
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36, 'active': true },
|
||||
* { 'user': 'fred', 'age': 40, 'active': false }
|
||||
* ];
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
|
||||
* // => ['barney']
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.pluck(_.filter(users, 'active', false), 'user');
|
||||
* // => ['fred']
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.pluck(_.filter(users, 'active'), 'user');
|
||||
* // => ['barney']
|
||||
*/
|
||||
function filter(collection, predicate, thisArg) {
|
||||
var func = isArray(collection) ? arrayFilter : baseFilter;
|
||||
predicate = baseCallback(predicate, thisArg, 3);
|
||||
return func(collection, predicate);
|
||||
}
|
||||
|
||||
module.exports = filter;
|
56
node_modules/lodash/collection/find.js
generated
vendored
Normal file
56
node_modules/lodash/collection/find.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
var baseEach = require('../internal/baseEach'),
|
||||
createFind = require('../internal/createFind');
|
||||
|
||||
/**
|
||||
* Iterates over elements of `collection`, returning the first element
|
||||
* `predicate` returns truthy for. The predicate is bound to `thisArg` and
|
||||
* invoked with three arguments: (value, index|key, collection).
|
||||
*
|
||||
* If a property name is provided for `predicate` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `predicate` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias detect
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {*} Returns the matched element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36, 'active': true },
|
||||
* { 'user': 'fred', 'age': 40, 'active': false },
|
||||
* { 'user': 'pebbles', 'age': 1, 'active': true }
|
||||
* ];
|
||||
*
|
||||
* _.result(_.find(users, function(chr) {
|
||||
* return chr.age < 40;
|
||||
* }), 'user');
|
||||
* // => 'barney'
|
||||
*
|
||||
* // using the `_.matches` callback shorthand
|
||||
* _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
|
||||
* // => 'pebbles'
|
||||
*
|
||||
* // using the `_.matchesProperty` callback shorthand
|
||||
* _.result(_.find(users, 'active', false), 'user');
|
||||
* // => 'fred'
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.result(_.find(users, 'active'), 'user');
|
||||
* // => 'barney'
|
||||
*/
|
||||
var find = createFind(baseEach);
|
||||
|
||||
module.exports = find;
|
25
node_modules/lodash/collection/findLast.js
generated
vendored
Normal file
25
node_modules/lodash/collection/findLast.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
var baseEachRight = require('../internal/baseEachRight'),
|
||||
createFind = require('../internal/createFind');
|
||||
|
||||
/**
|
||||
* This method is like `_.find` except that it iterates over elements of
|
||||
* `collection` from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function|Object|string} [predicate=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {*} Returns the matched element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* _.findLast([1, 2, 3, 4], function(n) {
|
||||
* return n % 2 == 1;
|
||||
* });
|
||||
* // => 3
|
||||
*/
|
||||
var findLast = createFind(baseEachRight, true);
|
||||
|
||||
module.exports = findLast;
|
37
node_modules/lodash/collection/findWhere.js
generated
vendored
Normal file
37
node_modules/lodash/collection/findWhere.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
var baseMatches = require('../internal/baseMatches'),
|
||||
find = require('./find');
|
||||
|
||||
/**
|
||||
* Performs a deep comparison between each element in `collection` and the
|
||||
* source object, returning the first element that has equivalent property
|
||||
* values.
|
||||
*
|
||||
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
|
||||
* numbers, `Object` objects, regexes, and strings. Objects are compared by
|
||||
* their own, not inherited, enumerable properties. For comparing a single
|
||||
* own or inherited property value see `_.matchesProperty`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Object} source The object of property values to match.
|
||||
* @returns {*} Returns the matched element, else `undefined`.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36, 'active': true },
|
||||
* { 'user': 'fred', 'age': 40, 'active': false }
|
||||
* ];
|
||||
*
|
||||
* _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
|
||||
* // => 'barney'
|
||||
*
|
||||
* _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
|
||||
* // => 'fred'
|
||||
*/
|
||||
function findWhere(collection, source) {
|
||||
return find(collection, baseMatches(source));
|
||||
}
|
||||
|
||||
module.exports = findWhere;
|
1
node_modules/lodash/collection/foldl.js
generated
vendored
Normal file
1
node_modules/lodash/collection/foldl.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./reduce');
|
1
node_modules/lodash/collection/foldr.js
generated
vendored
Normal file
1
node_modules/lodash/collection/foldr.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./reduceRight');
|
37
node_modules/lodash/collection/forEach.js
generated
vendored
Normal file
37
node_modules/lodash/collection/forEach.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
var arrayEach = require('../internal/arrayEach'),
|
||||
baseEach = require('../internal/baseEach'),
|
||||
createForEach = require('../internal/createForEach');
|
||||
|
||||
/**
|
||||
* Iterates over elements of `collection` invoking `iteratee` for each element.
|
||||
* The `iteratee` is bound to `thisArg` and invoked with three arguments:
|
||||
* (value, index|key, collection). Iteratee functions may exit iteration early
|
||||
* by explicitly returning `false`.
|
||||
*
|
||||
* **Note:** As with other "Collections" methods, objects with a "length" property
|
||||
* are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
|
||||
* may be used for object iteration.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias each
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {Array|Object|string} Returns `collection`.
|
||||
* @example
|
||||
*
|
||||
* _([1, 2]).forEach(function(n) {
|
||||
* console.log(n);
|
||||
* }).value();
|
||||
* // => logs each value from left to right and returns the array
|
||||
*
|
||||
* _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
|
||||
* console.log(n, key);
|
||||
* });
|
||||
* // => logs each value-key pair and returns the object (iteration order is not guaranteed)
|
||||
*/
|
||||
var forEach = createForEach(arrayEach, baseEach);
|
||||
|
||||
module.exports = forEach;
|
26
node_modules/lodash/collection/forEachRight.js
generated
vendored
Normal file
26
node_modules/lodash/collection/forEachRight.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
var arrayEachRight = require('../internal/arrayEachRight'),
|
||||
baseEachRight = require('../internal/baseEachRight'),
|
||||
createForEach = require('../internal/createForEach');
|
||||
|
||||
/**
|
||||
* This method is like `_.forEach` except that it iterates over elements of
|
||||
* `collection` from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias eachRight
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {Array|Object|string} Returns `collection`.
|
||||
* @example
|
||||
*
|
||||
* _([1, 2]).forEachRight(function(n) {
|
||||
* console.log(n);
|
||||
* }).value();
|
||||
* // => logs each value from right to left and returns the array
|
||||
*/
|
||||
var forEachRight = createForEach(arrayEachRight, baseEachRight);
|
||||
|
||||
module.exports = forEachRight;
|
59
node_modules/lodash/collection/groupBy.js
generated
vendored
Normal file
59
node_modules/lodash/collection/groupBy.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
var createAggregator = require('../internal/createAggregator');
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Creates an object composed of keys generated from the results of running
|
||||
* each element of `collection` through `iteratee`. The corresponding value
|
||||
* of each key is an array of the elements responsible for generating the key.
|
||||
* The `iteratee` is bound to `thisArg` and invoked with three arguments:
|
||||
* (value, index|key, collection).
|
||||
*
|
||||
* If a property name is provided for `iteratee` the created `_.property`
|
||||
* style callback returns the property value of the given element.
|
||||
*
|
||||
* If a value is also provided for `thisArg` the created `_.matchesProperty`
|
||||
* style callback returns `true` for elements that have a matching property
|
||||
* value, else `false`.
|
||||
*
|
||||
* If an object is provided for `iteratee` the created `_.matches` style
|
||||
* callback returns `true` for elements that have the properties of the given
|
||||
* object, else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [iteratee=_.identity] The function invoked
|
||||
* per iteration.
|
||||
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
*
|
||||
* _.groupBy([4.2, 6.1, 6.4], function(n) {
|
||||
* return Math.floor(n);
|
||||
* });
|
||||
* // => { '4': [4.2], '6': [6.1, 6.4] }
|
||||
*
|
||||
* _.groupBy([4.2, 6.1, 6.4], function(n) {
|
||||
* return this.floor(n);
|
||||
* }, Math);
|
||||
* // => { '4': [4.2], '6': [6.1, 6.4] }
|
||||
*
|
||||
* // using the `_.property` callback shorthand
|
||||
* _.groupBy(['one', 'two', 'three'], 'length');
|
||||
* // => { '3': ['one', 'two'], '5': ['three'] }
|
||||
*/
|
||||
var groupBy = createAggregator(function(result, value, key) {
|
||||
if (hasOwnProperty.call(result, key)) {
|
||||
result[key].push(value);
|
||||
} else {
|
||||
result[key] = [value];
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = groupBy;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user