forked from svrjs/svrjs
Rewritten SVR.JS from scratch
This commit is contained in:
parent
bac0e61487
commit
1285fb6bce
381 changed files with 85 additions and 53492 deletions
21
LICENSE
21
LICENSE
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2018-2024 SVR.JS
|
|
||||||
|
|
||||||
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.
|
|
61
config.json
61
config.json
|
@ -1,63 +1,4 @@
|
||||||
{
|
{
|
||||||
"users": [],
|
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"pubport": 80,
|
"exposeServerVersion": true
|
||||||
"page404": "404.html",
|
|
||||||
"timestamp": 1709477722479,
|
|
||||||
"blacklist": [],
|
|
||||||
"nonStandardCodes": [],
|
|
||||||
"enableCompression": true,
|
|
||||||
"customHeaders": {},
|
|
||||||
"enableHTTP2": false,
|
|
||||||
"enableLogging": true,
|
|
||||||
"enableDirectoryListing": true,
|
|
||||||
"enableDirectoryListingWithDefaultHead": false,
|
|
||||||
"serverAdministratorEmail": "[no contact information]",
|
|
||||||
"stackHidden": false,
|
|
||||||
"enableRemoteLogBrowsing": false,
|
|
||||||
"exposeServerVersion": true,
|
|
||||||
"disableServerSideScriptExpose": true,
|
|
||||||
"rewriteMap": [
|
|
||||||
{
|
|
||||||
"definingRegex": "/^\\/serverSideScript\\.js(?:$|[#?])/",
|
|
||||||
"replacements": [
|
|
||||||
{
|
|
||||||
"regex": "/^\\/serverSideScript\\.js($|[#?])/",
|
|
||||||
"replacement": "/NONEXISTENT_PAGE$1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"definingRegex": "/^\\/testdir_rewritten(?:$|[\\/?#])/",
|
|
||||||
"replacements": [
|
|
||||||
{
|
|
||||||
"regex": "/^\\/testdir_rewritten($|[\\/?#])/",
|
|
||||||
"replacement": "/testdir$1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"allowStatus": true,
|
|
||||||
"dontCompress": [
|
|
||||||
"/.*\\.ipxe$/",
|
|
||||||
"/.*\\.img$/",
|
|
||||||
"/.*\\.iso$/",
|
|
||||||
"/.*\\.png$/",
|
|
||||||
"/.*\\.jpg$/",
|
|
||||||
"/.*\\.webp$/"
|
|
||||||
],
|
|
||||||
"enableIPSpoofing": false,
|
|
||||||
"secure": false,
|
|
||||||
"sni": {},
|
|
||||||
"disableNonEncryptedServer": false,
|
|
||||||
"disableToHTTPSRedirect": false,
|
|
||||||
"enableETag": true,
|
|
||||||
"disableUnusedWorkerTermination": false,
|
|
||||||
"rewriteDirtyURLs": true,
|
|
||||||
"errorPages": [],
|
|
||||||
"useWebRootServerSideScript": true,
|
|
||||||
"exposeModsInErrorPages": true,
|
|
||||||
"disableTrailingSlashRedirects": false,
|
|
||||||
"environmentVariables": {},
|
|
||||||
"allowDoubleSlashes": false
|
|
||||||
}
|
}
|
||||||
|
|
74
index.html
74
index.html
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>SVR.JS Nightly-GitMain</title>
|
<title>SVR.JS SimpleServe Nightly-20230401</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<style>
|
<style>
|
||||||
|
@ -12,91 +12,25 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Welcome to SVR.JS Nightly-GitMain</h1>
|
<h1>Welcome to SVR.JS SimpleServe Nightly-20230401</h1>
|
||||||
<div style="background-color: #ffff00; border-color: #ff7f00; border-width: 5px; border-style: solid; padding: 5px; display: inline-block;">
|
<div style="background-color: #ffff00; border-color: #ff7f00; border-width: 5px; border-style: solid; padding: 5px; display: inline-block;">
|
||||||
<b style="font-size: 26px">WARNING!</b><br/>
|
<b style="font-size: 26px">WARNING!</b><br/>
|
||||||
This version is only for test purposes and may be unstable.
|
This version is only for test purposes and may be unstable.
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<img src="/logo.png" style="width: 256px; max-width: 100%;" />
|
<img src="/logo.png" style="width: 640px; max-width: 100%;" />
|
||||||
<br/>
|
<br/>
|
||||||
<p>If you see this page that means that the server is working properly. You can further configure the server and replace <i>index.html</i> and <i>tests.html</i> pages with custom ones.</p>
|
<p>If you see this page that means that the server is working properly. You can further configure the server and replace <i>index.html</i> page with custom one.</p>
|
||||||
<p>Default <i>config.json</i> looks like this:</p>
|
<p>Default <i>config.json</i> looks like this:</p>
|
||||||
<code style="background-color: #e0e0e0; padding: 5px; text-align: left; display: block; display: inline-block;">
|
<code style="background-color: #e0e0e0; padding: 5px; text-align: left; display: block; display: inline-block;">
|
||||||
<pre style="margin: 0.2em; white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word; word-break: break-all; word-break: break-word">{
|
<pre style="margin: 0.2em; white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word; word-break: break-all; word-break: break-word">{
|
||||||
"users": [],
|
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"pubport": 80,
|
|
||||||
"page404": "404.html",
|
|
||||||
"timestamp": 1709477722479,
|
|
||||||
"blacklist": [],
|
|
||||||
"nonStandardCodes": [],
|
|
||||||
"enableCompression": true,
|
|
||||||
"customHeaders": {},
|
|
||||||
"enableHTTP2": false,
|
|
||||||
"enableLogging": true,
|
|
||||||
"enableDirectoryListing": true,
|
|
||||||
"enableDirectoryListingWithDefaultHead": false,
|
|
||||||
"serverAdministratorEmail": "[no contact information]",
|
|
||||||
"stackHidden": false,
|
|
||||||
"enableRemoteLogBrowsing": false,
|
|
||||||
"exposeServerVersion": true,
|
"exposeServerVersion": true,
|
||||||
"disableServerSideScriptExpose": true,
|
|
||||||
"rewriteMap": [
|
|
||||||
{
|
|
||||||
"definingRegex": "/^\\/serverSideScript\\.js(?:$|[#?])/",
|
|
||||||
"replacements": [
|
|
||||||
{
|
|
||||||
"regex": "/^\\/serverSideScript\\.js($|[#?])/",
|
|
||||||
"replacement": "/NONEXISTENT_PAGE$1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"definingRegex": "/^\\/testdir_rewritten(?:$|[\\/?#])/",
|
|
||||||
"replacements": [
|
|
||||||
{
|
|
||||||
"regex": "/^\\/testdir_rewritten($|[\\/?#])/",
|
|
||||||
"replacement": "/testdir$1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"allowStatus": true,
|
|
||||||
"dontCompress": [
|
|
||||||
"/.*\\.ipxe$/",
|
|
||||||
"/.*\\.img$/",
|
|
||||||
"/.*\\.iso$/",
|
|
||||||
"/.*\\.png$/",
|
|
||||||
"/.*\\.jpg$/",
|
|
||||||
"/.*\\.webp$/"
|
|
||||||
],
|
|
||||||
"enableIPSpoofing": false,
|
|
||||||
"secure": false,
|
|
||||||
"sni": {},
|
|
||||||
"disableNonEncryptedServer": false,
|
|
||||||
"disableToHTTPSRedirect": false,
|
|
||||||
"enableETag": true,
|
|
||||||
"disableUnusedWorkerTermination": false,
|
|
||||||
"rewriteDirtyURLs": true,
|
|
||||||
"errorPages": [],
|
|
||||||
"useWebRootServerSideScript": true,
|
|
||||||
"exposeModsInErrorPages": true,
|
|
||||||
"disableTrailingSlashRedirects": false,
|
|
||||||
"environmentVariables": {},
|
|
||||||
"allowDoubleSlashes": false
|
|
||||||
}</pre>
|
}</pre>
|
||||||
</code>
|
</code>
|
||||||
<p>Changes:</p>
|
<p>Changes:</p>
|
||||||
<ul style="display: inline-block; margin: 0;">
|
<ul style="display: inline-block; margin: 0;">
|
||||||
<li><i>INSERT CHANGES THERE</i></li>
|
<li><i>INSERT CHANGES THERE</i></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
|
||||||
<a href="/tests.html">Tests</a><br/>
|
|
||||||
<a href="/licenses/">Licenses</a><br/>
|
|
||||||
<a href="/svrjsstatus.svr">SVR.JS status page</a><br/>
|
|
||||||
<a href="https://svrjs.org/docs">SVR.JS documentation</a>
|
|
||||||
</p>
|
|
||||||
<img src="/powered.png" />
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
|
|
||||||
Copyright 2009–2014 Contributors. All rights reserved.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
Copyright (c) 2010-2014 Caolan McMahon
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,19 +0,0 @@
|
||||||
Copyright Fedor Indutny, 2015.
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020 Jordan Harband
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,21 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2011-present Felix Geisendörfer, and contributors.
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,20 +0,0 @@
|
||||||
Copyright (c) 2013 Raynos.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020 Jordan Harband
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2016 Jordan Harband
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,22 +0,0 @@
|
||||||
Copyright (c) 2013 Thiago de Arruda
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,9 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
@ -1,349 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>SVR.JS Nightly-GitMain Licenses</title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
font-family: FreeSans, Helvetica, Tahoma, Arial, sans-serif;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>SVR.JS Nightly-GitMain Licenses</h1>
|
|
||||||
<h2>SVR.JS Nightly-GitMain</h2>
|
|
||||||
<div style="display: inline-block; text-align: left; border-width: 2px; border-style: solid; border-color: gray; padding: 8px;">
|
|
||||||
MIT License<br/>
|
|
||||||
<br/>
|
|
||||||
Copyright (c) 2018-2024 SVR.JS<br/>
|
|
||||||
<br/>
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy<br/>
|
|
||||||
of this software and associated documentation files (the "Software"), to deal<br/>
|
|
||||||
in the Software without restriction, including without limitation the rights<br/>
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>
|
|
||||||
copies of the Software, and to permit persons to whom the Software is<br/>
|
|
||||||
furnished to do so, subject to the following conditions:<br/>
|
|
||||||
<br/>
|
|
||||||
The above copyright notice and this permission notice shall be included in all<br/>
|
|
||||||
copies or substantial portions of the Software.<br/>
|
|
||||||
<br/>
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br/>
|
|
||||||
SOFTWARE.<br/>
|
|
||||||
</div>
|
|
||||||
<h2>Packages used by SVR.JS Nightly-GitMain</h2>
|
|
||||||
<div style="width: 100%; max-width: 1280px; margin: auto">
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/asap.txt"><b>asap</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
High-priority task queue for Node.js and browsers
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/asn1.js.txt"><b>asn1.js</b></a> (by Fedor Indutny)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
ASN.1 encoder and decoder
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/asn1.js-rfc2560.txt"><b>asn1.js-rfc2560</b></a> (by Fedor Indutny)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
RFC2560 structures for asn1.js
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/asn1.js-rfc5280.txt"><b>asn1.js-rfc5280</b></a> (by Felix Hanley)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
RFC5280 extension structures for asn1.js
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/async.txt"><b>async</b></a> (by Caolan McMahon)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Higher-order functions and common patterns for asynchronous code
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/bn.js.txt"><b>bn.js</b></a> (by Fedor Indutny)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Big number implementation in pure javascript
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/call-bind.txt"><b>call-bind</b></a> (by Jordan Harband)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Robustly `.call.bind()` a function
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/chownr.txt"><b>chownr</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
like `chown -R`
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/dezalgo.txt"><b>dezalgo</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Contain async insanity so that the dark pony lord doesn't eat souls
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/formidable.txt"><b>formidable</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
A node.js module for parsing form data, especially file uploads.<br/>
|
|
||||||
<b>Required by SVR.JS</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/fs-minipass.txt"><b>fs-minipass</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
fs read and write streams based on minipass<br/>
|
|
||||||
<b>Patched to work with Bun</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/function-bind.txt"><b>function-bind</b></a> (by Raynos)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Implementation of Function.prototype.bind
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/get-intrinsic.txt"><b>get-intrinsic</b></a> (by Jordan Harband)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Get and robustly cache all JS language-level intrinsics at first require time
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/graceful-fs.txt"><b>graceful-fs</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
A drop-in replacement for fs, making various improvements.<br/>
|
|
||||||
<b>Required by SVR.JS.</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/has.txt"><b>has</b></a> (by Thiago de Arruda)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Object.prototype.hasOwnProperty.call shortcut
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/has-symbols.txt"><b>has-symbols</b></a> (by Jordan Harband)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Determine if the JS environment has Symbol support. Supports spec, or shams.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/hexoid.txt"><b>hexoid</b></a> (by Luke Edwards)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
A tiny (190B) and extremely fast utility to generate random IDs of fixed length
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/inherits.txt"><b>inherits</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Browser-friendly inheritance fully compatible with standard node.js inherits()
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/mime-db.txt"><b>mime-db</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Media Type Database
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/mime-types.txt"><b>mime-types</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
The ultimate javascript content-type utility.<br/>
|
|
||||||
<b>Required by SVR.JS.</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/minimalistic-assert.txt"><b>minimalistic-assert</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
minimalistic-assert ===
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/minipass.txt"><b>minipass</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
minimal implementation of a PassThrough stream
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/minizlib.txt"><b>minizlib</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
A small fast zlib stream built on <a href="http://npm.im/minipass">minipass</a> and Node.js's zlib binding.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/mkdirp.txt"><b>mkdirp</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Recursively mkdir, like `mkdir -p`
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/object-inspect.txt"><b>object-inspect</b></a> (by James Halliday)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
string representations of objects in node and the browser
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/ocsp.txt"><b>ocsp</b></a> (by Fedor Indutny)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
OCSP Stapling implementation<br/>
|
|
||||||
<b>Required by SVR.JS.</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/once.txt"><b>once</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Run a function exactly one time
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: BSD-3</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/qs.txt"><b>qs</b></a>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
A querystring parser that supports nesting and arrays, with a depth limit
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/side-channel.txt"><b>side-channel</b></a> (by Jordan Harband)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Store information about any JS value in a side channel. Uses WeakMap if available.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: MIT</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/simple-lru-cache.txt"><b>simple-lru-cache</b></a> (by Gabriel Eisbruch)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
node-simple-lru-cache =====================
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/tar.txt"><b>tar</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
tar for node<br/>
|
|
||||||
<b>Required by SVR.JS.</b>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/wrappy.txt"><b>wrappy</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Callback wrapping utility
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="width: 100%; background-color: #ccc; border: 1px solid green; text-align: left; margin: 10px 0;">
|
|
||||||
<div style="float: right;">License: ISC</div>
|
|
||||||
<div style="font-size: 20px;">
|
|
||||||
<a href="/licenses/yallist.txt"><b>yallist</b></a> (by Isaac Z. Schlueter)
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 12px;">
|
|
||||||
Yet Another Linked List
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br/>
|
|
||||||
<img src="/powered.png" />
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,16 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
||||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
||||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
||||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
||||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
||||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
|
@ -1,23 +0,0 @@
|
||||||
(The MIT License)
|
|
||||||
|
|
||||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
|
||||||
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
'Software'), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
@ -1,13 +0,0 @@
|
||||||
Copyright 2015 Calvin Metcalf
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
||||||
with or without fee is hereby granted, provided that the above copyright notice
|
|
||||||
and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
||||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
||||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
||||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
||||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
||||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) npm, Inc. and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,26 +0,0 @@
|
||||||
Minizlib was created by Isaac Z. Schlueter.
|
|
||||||
It is a derivative work of the Node.js project.
|
|
||||||
|
|
||||||
"""
|
|
||||||
Copyright Isaac Z. Schlueter and Contributors
|
|
||||||
Copyright Node.js contributors. All rights reserved.
|
|
||||||
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
||||||
|
|
||||||
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.
|
|
||||||
"""
|
|
|
@ -1,21 +0,0 @@
|
||||||
Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
|
|
||||||
|
|
||||||
This project is free software released under the MIT license:
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2013 James Halliday
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) [year] [fullname]
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,29 +0,0 @@
|
||||||
BSD 3-Clause License
|
|
||||||
|
|
||||||
Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors)
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer in the documentation
|
|
||||||
and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Jordan Harband
|
|
||||||
|
|
||||||
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.
|
|
|
@ -1,19 +0,0 @@
|
||||||
Copyright (c) 2013 Mercadolibre.com
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
@ -1,52 +0,0 @@
|
||||||
//SVR.JS LOG HIGHLIGHTER
|
|
||||||
|
|
||||||
var readline = require("readline");
|
|
||||||
var process = require("process");
|
|
||||||
|
|
||||||
var args = process.argv;
|
|
||||||
for (var i = (process.argv[0].indexOf("node") > -1 || process.argv[0].indexOf("bun") > -1 ? 2 : 1); i < args.length; i++) {
|
|
||||||
if (args[i] == "-h" || args[i] == "--help" || args[i] == "-?" || args[i] == "/h" || args[i] == "/?") {
|
|
||||||
console.log("SVR.JS log highlighter usage:");
|
|
||||||
console.log("<some process> | node loghighlight.js [-h] [--help] [-?] [/h] [/?]");
|
|
||||||
console.log("-h -? /h /? --help -- Displays help");
|
|
||||||
process.exit(0);
|
|
||||||
} else {
|
|
||||||
console.log("Unrecognized argument: " + args[i]);
|
|
||||||
console.log("SVR.JS log highlighter usage:");
|
|
||||||
console.log("<some process> | node loghighlight.js [-h] [--help] [-?] [/h] [/?]");
|
|
||||||
console.log("-h -? /h /? --help -- Displays help");
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var rl = readline.createInterface({
|
|
||||||
input: process.stdin,
|
|
||||||
output: process.stdout,
|
|
||||||
terminal: false,
|
|
||||||
prompt: ''
|
|
||||||
});
|
|
||||||
rl.prompt();
|
|
||||||
rl.on('line', (line) => {
|
|
||||||
viewLog([line]);
|
|
||||||
});
|
|
||||||
|
|
||||||
function viewLog(log) {
|
|
||||||
if(log[log.length-1] == "") log.pop();
|
|
||||||
if(log[0] == "") log.shift();
|
|
||||||
for(var i=0;i<log.length;i++) {
|
|
||||||
if(log[i].indexOf("SERVER REQUEST MESSAGE") != -1) {
|
|
||||||
log[i] = log[i].replace("SERVER REQUEST MESSAGE","\x1b[34m\x1b[1mSERVER REQUEST MESSAGE\x1b[22m") + "\x1b[37m\x1b[0m";
|
|
||||||
} else if(log[i].indexOf("SERVER RESPONSE MESSAGE") != -1) {
|
|
||||||
log[i] = log[i].replace("SERVER RESPONSE MESSAGE","\x1b[32m\x1b[1mSERVER RESPONSE MESSAGE\x1b[22m") + "\x1b[37m\x1b[0m";
|
|
||||||
} else if(log[i].indexOf("SERVER RESPONSE ERROR MESSAGE") != -1) {
|
|
||||||
log[i] = log[i].replace("SERVER RESPONSE ERROR MESSAGE","\x1b[31m\x1b[1mSERVER RESPONSE ERROR MESSAGE\x1b[22m") + "\x1b[37m\x1b[0m";
|
|
||||||
} else if(log[i].indexOf("SERVER ERROR MESSAGE") != -1) {
|
|
||||||
log[i] = log[i].replace("SERVER ERROR MESSAGE","\x1b[41m\x1b[1mSERVER ERROR MESSAGE\x1b[22m") + "\x1b[40m\x1b[0m";
|
|
||||||
} else if(log[i].indexOf("SERVER WARNING MESSAGE") != -1) {
|
|
||||||
log[i] = log[i].replace("SERVER WARNING MESSAGE","\x1b[43m\x1b[1mSERVER WARNING MESSAGE\x1b[22m") + "\x1b[40m\x1b[0m";
|
|
||||||
} else if(log[i].indexOf("SERVER MESSAGE") != -1) {
|
|
||||||
log[i] = log[i].replace("SERVER MESSAGE","\x1b[1mSERVER MESSAGE\x1b[22m");
|
|
||||||
}
|
|
||||||
console.log(log[i]);
|
|
||||||
}
|
|
||||||
}
|
|
BIN
logo.png
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 25 KiB |
177
logviewer.js
177
logviewer.js
File diff suppressed because one or more lines are too long
1
node_modules/.bin/mkdirp
generated
vendored
1
node_modules/.bin/mkdirp
generated
vendored
|
@ -1 +0,0 @@
|
||||||
../mkdirp/bin/cmd.js
|
|
26
node_modules/.package-lock.json
generated
vendored
Normal file
26
node_modules/.package-lock.json
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"name": "simpleserve",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"node_modules/mime-db": {
|
||||||
|
"version": "1.52.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "2.1.35",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
70
node_modules/asap/CHANGES.md
generated
vendored
70
node_modules/asap/CHANGES.md
generated
vendored
|
@ -1,70 +0,0 @@
|
||||||
|
|
||||||
## 2.0.6
|
|
||||||
|
|
||||||
Version 2.0.4 adds support for React Native by clarifying in package.json that
|
|
||||||
the browser environment does not support Node.js domains.
|
|
||||||
Why this is necessary, we leave as an exercise for the user.
|
|
||||||
|
|
||||||
## 2.0.3
|
|
||||||
|
|
||||||
Version 2.0.3 fixes a bug when adjusting the capacity of the task queue.
|
|
||||||
|
|
||||||
## 2.0.1-2.02
|
|
||||||
|
|
||||||
Version 2.0.1 fixes a bug in the way redirects were expressed that affected the
|
|
||||||
function of Browserify, but which Mr would tolerate.
|
|
||||||
|
|
||||||
## 2.0.0
|
|
||||||
|
|
||||||
Version 2 of ASAP is a full rewrite with a few salient changes.
|
|
||||||
First, the ASAP source is CommonJS only and designed with [Browserify][] and
|
|
||||||
[Browserify-compatible][Mr] module loaders in mind.
|
|
||||||
|
|
||||||
[Browserify]: https://github.com/substack/node-browserify
|
|
||||||
[Mr]: https://github.com/montagejs/mr
|
|
||||||
|
|
||||||
The new version has been refactored in two dimensions.
|
|
||||||
Support for Node.js and browsers have been separated, using Browserify
|
|
||||||
redirects and ASAP has been divided into two modules.
|
|
||||||
The "raw" layer depends on the tasks to catch thrown exceptions and unravel
|
|
||||||
Node.js domains.
|
|
||||||
|
|
||||||
The full implementation of ASAP is loadable as `require("asap")` in both Node.js
|
|
||||||
and browsers.
|
|
||||||
|
|
||||||
The raw layer that lacks exception handling overhead is loadable as
|
|
||||||
`require("asap/raw")`.
|
|
||||||
The interface is the same for both layers.
|
|
||||||
|
|
||||||
Tasks are no longer required to be functions, but can rather be any object that
|
|
||||||
implements `task.call()`.
|
|
||||||
With this feature you can recycle task objects to avoid garbage collector churn
|
|
||||||
and avoid closures in general.
|
|
||||||
|
|
||||||
The implementation has been rigorously documented so that our successors can
|
|
||||||
understand the scope of the problem that this module solves and all of its
|
|
||||||
nuances, ensuring that the next generation of implementations know what details
|
|
||||||
are essential.
|
|
||||||
|
|
||||||
- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js)
|
|
||||||
- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js)
|
|
||||||
- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js)
|
|
||||||
- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js)
|
|
||||||
|
|
||||||
The new version has also been rigorously tested across a broad spectrum of
|
|
||||||
browsers, in both the window and worker context.
|
|
||||||
The following charts capture the browser test results for the most recent
|
|
||||||
release.
|
|
||||||
The first chart shows test results for ASAP running in the main window context.
|
|
||||||
The second chart shows test results for ASAP running in a web worker context.
|
|
||||||
Test results are inconclusive (grey) on browsers that do not support web
|
|
||||||
workers.
|
|
||||||
These data are captured automatically by [Continuous
|
|
||||||
Integration][].
|
|
||||||
|
|
||||||
![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
|
|
||||||
|
|
||||||
![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
|
|
||||||
|
|
||||||
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
|
|
||||||
|
|
21
node_modules/asap/LICENSE.md
generated
vendored
21
node_modules/asap/LICENSE.md
generated
vendored
|
@ -1,21 +0,0 @@
|
||||||
|
|
||||||
Copyright 2009–2014 Contributors. All rights reserved.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
237
node_modules/asap/README.md
generated
vendored
237
node_modules/asap/README.md
generated
vendored
|
@ -1,237 +0,0 @@
|
||||||
# ASAP
|
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap)
|
|
||||||
|
|
||||||
Promise and asynchronous observer libraries, as well as hand-rolled callback
|
|
||||||
programs and libraries, often need a mechanism to postpone the execution of a
|
|
||||||
callback until the next available event.
|
|
||||||
(See [Designing API’s for Asynchrony][Zalgo].)
|
|
||||||
The `asap` function executes a task **as soon as possible** but not before it
|
|
||||||
returns, waiting only for the completion of the current event and previously
|
|
||||||
scheduled tasks.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
asap(function () {
|
|
||||||
// ...
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
|
|
||||||
|
|
||||||
This CommonJS package provides an `asap` module that exports a function that
|
|
||||||
executes a task function *as soon as possible*.
|
|
||||||
|
|
||||||
ASAP strives to schedule events to occur before yielding for IO, reflow,
|
|
||||||
or redrawing.
|
|
||||||
Each event receives an independent stack, with only platform code in parent
|
|
||||||
frames and the events run in the order they are scheduled.
|
|
||||||
|
|
||||||
ASAP provides a fast event queue that will execute tasks until it is
|
|
||||||
empty before yielding to the JavaScript engine's underlying event-loop.
|
|
||||||
When a task gets added to a previously empty event queue, ASAP schedules a flush
|
|
||||||
event, preferring for that event to occur before the JavaScript engine has an
|
|
||||||
opportunity to perform IO tasks or rendering, thus making the first task and
|
|
||||||
subsequent tasks semantically indistinguishable.
|
|
||||||
ASAP uses a variety of techniques to preserve this invariant on different
|
|
||||||
versions of browsers and Node.js.
|
|
||||||
|
|
||||||
By design, ASAP prevents input events from being handled until the task
|
|
||||||
queue is empty.
|
|
||||||
If the process is busy enough, this may cause incoming connection requests to be
|
|
||||||
dropped, and may cause existing connections to inform the sender to reduce the
|
|
||||||
transmission rate or stall.
|
|
||||||
ASAP allows this on the theory that, if there is enough work to do, there is no
|
|
||||||
sense in looking for trouble.
|
|
||||||
As a consequence, ASAP can interfere with smooth animation.
|
|
||||||
If your task should be tied to the rendering loop, consider using
|
|
||||||
`requestAnimationFrame` instead.
|
|
||||||
A long sequence of tasks can also effect the long running script dialog.
|
|
||||||
If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to
|
|
||||||
break long processes into shorter intervals and periodically allow the browser
|
|
||||||
to breathe.
|
|
||||||
`setImmediate` will yield for IO, reflow, and repaint events.
|
|
||||||
It also returns a handler and can be canceled.
|
|
||||||
For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].
|
|
||||||
|
|
||||||
[setImmediate]: https://github.com/YuzuJS/setImmediate
|
|
||||||
|
|
||||||
Take care.
|
|
||||||
ASAP can sustain infinite recursive calls without warning.
|
|
||||||
It will not halt from a stack overflow, and it will not consume unbounded
|
|
||||||
memory.
|
|
||||||
This is behaviorally equivalent to an infinite loop.
|
|
||||||
Just as with infinite loops, you can monitor a Node.js process for this behavior
|
|
||||||
with a heart-beat signal.
|
|
||||||
As with infinite loops, a very small amount of caution goes a long way to
|
|
||||||
avoiding problems.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
function loop() {
|
|
||||||
asap(loop);
|
|
||||||
}
|
|
||||||
loop();
|
|
||||||
```
|
|
||||||
|
|
||||||
In browsers, if a task throws an exception, it will not interrupt the flushing
|
|
||||||
of high-priority tasks.
|
|
||||||
The exception will be postponed to a later, low-priority event to avoid
|
|
||||||
slow-downs.
|
|
||||||
In Node.js, if a task throws an exception, ASAP will resume flushing only if—and
|
|
||||||
only after—the error is handled by `domain.on("error")` or
|
|
||||||
`process.on("uncaughtException")`.
|
|
||||||
|
|
||||||
## Raw ASAP
|
|
||||||
|
|
||||||
Checking for exceptions comes at a cost.
|
|
||||||
The package also provides an `asap/raw` module that exports the underlying
|
|
||||||
implementation which is faster but stalls if a task throws an exception.
|
|
||||||
This internal version of the ASAP function does not check for errors.
|
|
||||||
If a task does throw an error, it will stall the event queue unless you manually
|
|
||||||
call `rawAsap.requestFlush()` before throwing the error, or any time after.
|
|
||||||
|
|
||||||
In Node.js, `asap/raw` also runs all tasks outside any domain.
|
|
||||||
If you need a task to be bound to your domain, you will have to do it manually.
|
|
||||||
|
|
||||||
```js
|
|
||||||
if (process.domain) {
|
|
||||||
task = process.domain.bind(task);
|
|
||||||
}
|
|
||||||
rawAsap(task);
|
|
||||||
```
|
|
||||||
|
|
||||||
## Tasks
|
|
||||||
|
|
||||||
A task may be any object that implements `call()`.
|
|
||||||
A function will suffice, but closures tend not to be reusable and can cause
|
|
||||||
garbage collector churn.
|
|
||||||
Both `asap` and `rawAsap` accept task objects to give you the option of
|
|
||||||
recycling task objects or using higher callable object abstractions.
|
|
||||||
See the `asap` source for an illustration.
|
|
||||||
|
|
||||||
|
|
||||||
## Compatibility
|
|
||||||
|
|
||||||
ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.
|
|
||||||
The following charts capture the browser test results for the most recent
|
|
||||||
release.
|
|
||||||
The first chart shows test results for ASAP running in the main window context.
|
|
||||||
The second chart shows test results for ASAP running in a web worker context.
|
|
||||||
Test results are inconclusive (grey) on browsers that do not support web
|
|
||||||
workers.
|
|
||||||
These data are captured automatically by [Continuous
|
|
||||||
Integration][].
|
|
||||||
|
|
||||||
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
|
|
||||||
|
|
||||||
![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
|
|
||||||
|
|
||||||
![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
|
|
||||||
|
|
||||||
## Caveats
|
|
||||||
|
|
||||||
When a task is added to an empty event queue, it is not always possible to
|
|
||||||
guarantee that the task queue will begin flushing immediately after the current
|
|
||||||
event.
|
|
||||||
However, once the task queue begins flushing, it will not yield until the queue
|
|
||||||
is empty, even if the queue grows while executing tasks.
|
|
||||||
|
|
||||||
The following browsers allow the use of [DOM mutation observers][] to access
|
|
||||||
the HTML [microtask queue][], and thus begin flushing ASAP's task queue
|
|
||||||
immediately at the end of the current event loop turn, before any rendering or
|
|
||||||
IO:
|
|
||||||
|
|
||||||
[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue
|
|
||||||
[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers
|
|
||||||
|
|
||||||
- Android 4–4.3
|
|
||||||
- Chrome 26–34
|
|
||||||
- Firefox 14–29
|
|
||||||
- Internet Explorer 11
|
|
||||||
- iPad Safari 6–7.1
|
|
||||||
- iPhone Safari 7–7.1
|
|
||||||
- Safari 6–7
|
|
||||||
|
|
||||||
In the absense of mutation observers, there are a few browsers, and situations
|
|
||||||
like web workers in some of the above browsers, where [message channels][]
|
|
||||||
would be a useful way to avoid falling back to timers.
|
|
||||||
Message channels give direct access to the HTML [task queue][], so the ASAP
|
|
||||||
task queue would flush after any already queued rendering and IO tasks, but
|
|
||||||
without having the minimum delay imposed by timers.
|
|
||||||
However, among these browsers, Internet Explorer 10 and Safari do not reliably
|
|
||||||
dispatch messages, so they are not worth the trouble to implement.
|
|
||||||
|
|
||||||
[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels
|
|
||||||
[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task
|
|
||||||
|
|
||||||
- Internet Explorer 10
|
|
||||||
- Safair 5.0-1
|
|
||||||
- Opera 11-12
|
|
||||||
|
|
||||||
In the absense of mutation observers, these browsers and the following browsers
|
|
||||||
all fall back to using `setTimeout` and `setInterval` to ensure that a `flush`
|
|
||||||
occurs.
|
|
||||||
The implementation uses both and cancels whatever handler loses the race, since
|
|
||||||
`setTimeout` tends to occasionally skip tasks in unisolated circumstances.
|
|
||||||
Timers generally delay the flushing of ASAP's task queue for four milliseconds.
|
|
||||||
|
|
||||||
- Firefox 3–13
|
|
||||||
- Internet Explorer 6–10
|
|
||||||
- iPad Safari 4.3
|
|
||||||
- Lynx 2.8.7
|
|
||||||
|
|
||||||
|
|
||||||
## Heritage
|
|
||||||
|
|
||||||
ASAP has been factored out of the [Q][] asynchronous promise library.
|
|
||||||
It originally had a naïve implementation in terms of `setTimeout`, but
|
|
||||||
[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be
|
|
||||||
useful for creating a high-priority, no-delay event dispatch hack.
|
|
||||||
Since then, Internet Explorer proposed and implemented `setImmediate`.
|
|
||||||
Robert Katić began contributing to Q by measuring the performance of
|
|
||||||
the internal implementation of `asap`, paying particular attention to
|
|
||||||
error recovery.
|
|
||||||
Domenic, Robert, and Kris Kowal collectively settled on the current strategy of
|
|
||||||
unrolling the high-priority event queue internally regardless of what strategy
|
|
||||||
we used to dispatch the potentially lower-priority flush event.
|
|
||||||
Domenic went on to make ASAP cooperate with Node.js domains.
|
|
||||||
|
|
||||||
[Q]: https://github.com/kriskowal/q
|
|
||||||
[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html
|
|
||||||
|
|
||||||
For further reading, Nicholas Zakas provided a thorough article on [The
|
|
||||||
Case for setImmediate][NCZ].
|
|
||||||
|
|
||||||
[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/
|
|
||||||
|
|
||||||
Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but
|
|
||||||
further developed the implentation.
|
|
||||||
Particularly, The `MessagePort` implementation was abandoned due to interaction
|
|
||||||
[problems with Mobile Internet Explorer][IE Problems] in favor of an
|
|
||||||
implementation backed on the newer and more reliable DOM `MutationObserver`
|
|
||||||
interface.
|
|
||||||
These changes were back-ported into this library.
|
|
||||||
|
|
||||||
[IE Problems]: https://github.com/cujojs/when/issues/197
|
|
||||||
[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
|
|
||||||
|
|
||||||
In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained
|
|
||||||
exception-safe, but `asap/raw` provided a tight kernel that could be used for
|
|
||||||
tasks that guaranteed that they would not throw exceptions.
|
|
||||||
This core is useful for promise implementations that capture thrown errors in
|
|
||||||
rejected promises and do not need a second safety net.
|
|
||||||
At the same time, the exception handling in `asap` was factored into separate
|
|
||||||
implementations for Node.js and browsers, using the the [Browserify][Browser
|
|
||||||
Config] `browser` property in `package.json` to instruct browser module loaders
|
|
||||||
and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the
|
|
||||||
browser-only implementation.
|
|
||||||
|
|
||||||
[Browser Config]: https://gist.github.com/defunctzombie/4339901
|
|
||||||
[Browserify]: https://github.com/substack/node-browserify
|
|
||||||
[Mr]: https://github.com/montagejs/mr
|
|
||||||
[Mop]: https://github.com/montagejs/mop
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
Copyright 2009-2014 by Contributors
|
|
||||||
MIT License (enclosed)
|
|
||||||
|
|
65
node_modules/asap/asap.js
generated
vendored
65
node_modules/asap/asap.js
generated
vendored
|
@ -1,65 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var rawAsap = require("./raw");
|
|
||||||
var freeTasks = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls a task as soon as possible after returning, in its own event, with
|
|
||||||
* priority over IO events. An exception thrown in a task can be handled by
|
|
||||||
* `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
|
|
||||||
* crash the process. If the error is handled, all subsequent tasks will
|
|
||||||
* resume.
|
|
||||||
*
|
|
||||||
* @param {{call}} task A callable object, typically a function that takes no
|
|
||||||
* arguments.
|
|
||||||
*/
|
|
||||||
module.exports = asap;
|
|
||||||
function asap(task) {
|
|
||||||
var rawTask;
|
|
||||||
if (freeTasks.length) {
|
|
||||||
rawTask = freeTasks.pop();
|
|
||||||
} else {
|
|
||||||
rawTask = new RawTask();
|
|
||||||
}
|
|
||||||
rawTask.task = task;
|
|
||||||
rawTask.domain = process.domain;
|
|
||||||
rawAsap(rawTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
function RawTask() {
|
|
||||||
this.task = null;
|
|
||||||
this.domain = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
RawTask.prototype.call = function () {
|
|
||||||
if (this.domain) {
|
|
||||||
this.domain.enter();
|
|
||||||
}
|
|
||||||
var threw = true;
|
|
||||||
try {
|
|
||||||
this.task.call();
|
|
||||||
threw = false;
|
|
||||||
// If the task throws an exception (presumably) Node.js restores the
|
|
||||||
// domain stack for the next event.
|
|
||||||
if (this.domain) {
|
|
||||||
this.domain.exit();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
// We use try/finally and a threw flag to avoid messing up stack traces
|
|
||||||
// when we catch and release errors.
|
|
||||||
if (threw) {
|
|
||||||
// In Node.js, uncaught exceptions are considered fatal errors.
|
|
||||||
// Re-throw them to interrupt flushing!
|
|
||||||
// Ensure that flushing continues if an uncaught exception is
|
|
||||||
// suppressed listening process.on("uncaughtException") or
|
|
||||||
// domain.on("error").
|
|
||||||
rawAsap.requestFlush();
|
|
||||||
}
|
|
||||||
// If the task threw an error, we do not want to exit the domain here.
|
|
||||||
// Exiting the domain would prevent the domain from catching the error.
|
|
||||||
this.task = null;
|
|
||||||
this.domain = null;
|
|
||||||
freeTasks.push(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
66
node_modules/asap/browser-asap.js
generated
vendored
66
node_modules/asap/browser-asap.js
generated
vendored
|
@ -1,66 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
// rawAsap provides everything we need except exception management.
|
|
||||||
var rawAsap = require("./raw");
|
|
||||||
// RawTasks are recycled to reduce GC churn.
|
|
||||||
var freeTasks = [];
|
|
||||||
// We queue errors to ensure they are thrown in right order (FIFO).
|
|
||||||
// Array-as-queue is good enough here, since we are just dealing with exceptions.
|
|
||||||
var pendingErrors = [];
|
|
||||||
var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
|
|
||||||
|
|
||||||
function throwFirstError() {
|
|
||||||
if (pendingErrors.length) {
|
|
||||||
throw pendingErrors.shift();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls a task as soon as possible after returning, in its own event, with priority
|
|
||||||
* over other events like animation, reflow, and repaint. An error thrown from an
|
|
||||||
* event will not interrupt, nor even substantially slow down the processing of
|
|
||||||
* other events, but will be rather postponed to a lower priority event.
|
|
||||||
* @param {{call}} task A callable object, typically a function that takes no
|
|
||||||
* arguments.
|
|
||||||
*/
|
|
||||||
module.exports = asap;
|
|
||||||
function asap(task) {
|
|
||||||
var rawTask;
|
|
||||||
if (freeTasks.length) {
|
|
||||||
rawTask = freeTasks.pop();
|
|
||||||
} else {
|
|
||||||
rawTask = new RawTask();
|
|
||||||
}
|
|
||||||
rawTask.task = task;
|
|
||||||
rawAsap(rawTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
// We wrap tasks with recyclable task objects. A task object implements
|
|
||||||
// `call`, just like a function.
|
|
||||||
function RawTask() {
|
|
||||||
this.task = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The sole purpose of wrapping the task is to catch the exception and recycle
|
|
||||||
// the task object after its single use.
|
|
||||||
RawTask.prototype.call = function () {
|
|
||||||
try {
|
|
||||||
this.task.call();
|
|
||||||
} catch (error) {
|
|
||||||
if (asap.onerror) {
|
|
||||||
// This hook exists purely for testing purposes.
|
|
||||||
// Its name will be periodically randomized to break any code that
|
|
||||||
// depends on its existence.
|
|
||||||
asap.onerror(error);
|
|
||||||
} else {
|
|
||||||
// In a web browser, exceptions are not fatal. However, to avoid
|
|
||||||
// slowing down the queue of pending tasks, we rethrow the error in a
|
|
||||||
// lower priority turn.
|
|
||||||
pendingErrors.push(error);
|
|
||||||
requestErrorThrow();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
this.task = null;
|
|
||||||
freeTasks[freeTasks.length] = this;
|
|
||||||
}
|
|
||||||
};
|
|
223
node_modules/asap/browser-raw.js
generated
vendored
223
node_modules/asap/browser-raw.js
generated
vendored
|
@ -1,223 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
// Use the fastest means possible to execute a task in its own turn, with
|
|
||||||
// priority over other events including IO, animation, reflow, and redraw
|
|
||||||
// events in browsers.
|
|
||||||
//
|
|
||||||
// An exception thrown by a task will permanently interrupt the processing of
|
|
||||||
// subsequent tasks. The higher level `asap` function ensures that if an
|
|
||||||
// exception is thrown by a task, that the task queue will continue flushing as
|
|
||||||
// soon as possible, but if you use `rawAsap` directly, you are responsible to
|
|
||||||
// either ensure that no exceptions are thrown from your task, or to manually
|
|
||||||
// call `rawAsap.requestFlush` if an exception is thrown.
|
|
||||||
module.exports = rawAsap;
|
|
||||||
function rawAsap(task) {
|
|
||||||
if (!queue.length) {
|
|
||||||
requestFlush();
|
|
||||||
flushing = true;
|
|
||||||
}
|
|
||||||
// Equivalent to push, but avoids a function call.
|
|
||||||
queue[queue.length] = task;
|
|
||||||
}
|
|
||||||
|
|
||||||
var queue = [];
|
|
||||||
// Once a flush has been requested, no further calls to `requestFlush` are
|
|
||||||
// necessary until the next `flush` completes.
|
|
||||||
var flushing = false;
|
|
||||||
// `requestFlush` is an implementation-specific method that attempts to kick
|
|
||||||
// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
|
|
||||||
// the event queue before yielding to the browser's own event loop.
|
|
||||||
var requestFlush;
|
|
||||||
// The position of the next task to execute in the task queue. This is
|
|
||||||
// preserved between calls to `flush` so that it can be resumed if
|
|
||||||
// a task throws an exception.
|
|
||||||
var index = 0;
|
|
||||||
// If a task schedules additional tasks recursively, the task queue can grow
|
|
||||||
// unbounded. To prevent memory exhaustion, the task queue will periodically
|
|
||||||
// truncate already-completed tasks.
|
|
||||||
var capacity = 1024;
|
|
||||||
|
|
||||||
// The flush function processes all tasks that have been scheduled with
|
|
||||||
// `rawAsap` unless and until one of those tasks throws an exception.
|
|
||||||
// If a task throws an exception, `flush` ensures that its state will remain
|
|
||||||
// consistent and will resume where it left off when called again.
|
|
||||||
// However, `flush` does not make any arrangements to be called again if an
|
|
||||||
// exception is thrown.
|
|
||||||
function flush() {
|
|
||||||
while (index < queue.length) {
|
|
||||||
var currentIndex = index;
|
|
||||||
// Advance the index before calling the task. This ensures that we will
|
|
||||||
// begin flushing on the next task the task throws an error.
|
|
||||||
index = index + 1;
|
|
||||||
queue[currentIndex].call();
|
|
||||||
// Prevent leaking memory for long chains of recursive calls to `asap`.
|
|
||||||
// If we call `asap` within tasks scheduled by `asap`, the queue will
|
|
||||||
// grow, but to avoid an O(n) walk for every task we execute, we don't
|
|
||||||
// shift tasks off the queue after they have been executed.
|
|
||||||
// Instead, we periodically shift 1024 tasks off the queue.
|
|
||||||
if (index > capacity) {
|
|
||||||
// Manually shift all values starting at the index back to the
|
|
||||||
// beginning of the queue.
|
|
||||||
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
|
|
||||||
queue[scan] = queue[scan + index];
|
|
||||||
}
|
|
||||||
queue.length -= index;
|
|
||||||
index = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queue.length = 0;
|
|
||||||
index = 0;
|
|
||||||
flushing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// `requestFlush` is implemented using a strategy based on data collected from
|
|
||||||
// every available SauceLabs Selenium web driver worker at time of writing.
|
|
||||||
// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
|
|
||||||
|
|
||||||
// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
|
|
||||||
// have WebKitMutationObserver but not un-prefixed MutationObserver.
|
|
||||||
// Must use `global` or `self` instead of `window` to work in both frames and web
|
|
||||||
// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
|
|
||||||
|
|
||||||
/* globals self */
|
|
||||||
var scope = typeof global !== "undefined" ? global : self;
|
|
||||||
var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
|
|
||||||
|
|
||||||
// MutationObservers are desirable because they have high priority and work
|
|
||||||
// reliably everywhere they are implemented.
|
|
||||||
// They are implemented in all modern browsers.
|
|
||||||
//
|
|
||||||
// - Android 4-4.3
|
|
||||||
// - Chrome 26-34
|
|
||||||
// - Firefox 14-29
|
|
||||||
// - Internet Explorer 11
|
|
||||||
// - iPad Safari 6-7.1
|
|
||||||
// - iPhone Safari 7-7.1
|
|
||||||
// - Safari 6-7
|
|
||||||
if (typeof BrowserMutationObserver === "function") {
|
|
||||||
requestFlush = makeRequestCallFromMutationObserver(flush);
|
|
||||||
|
|
||||||
// MessageChannels are desirable because they give direct access to the HTML
|
|
||||||
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
|
|
||||||
// 11-12, and in web workers in many engines.
|
|
||||||
// Although message channels yield to any queued rendering and IO tasks, they
|
|
||||||
// would be better than imposing the 4ms delay of timers.
|
|
||||||
// However, they do not work reliably in Internet Explorer or Safari.
|
|
||||||
|
|
||||||
// Internet Explorer 10 is the only browser that has setImmediate but does
|
|
||||||
// not have MutationObservers.
|
|
||||||
// Although setImmediate yields to the browser's renderer, it would be
|
|
||||||
// preferrable to falling back to setTimeout since it does not have
|
|
||||||
// the minimum 4ms penalty.
|
|
||||||
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
|
|
||||||
// Desktop to a lesser extent) that renders both setImmediate and
|
|
||||||
// MessageChannel useless for the purposes of ASAP.
|
|
||||||
// https://github.com/kriskowal/q/issues/396
|
|
||||||
|
|
||||||
// Timers are implemented universally.
|
|
||||||
// We fall back to timers in workers in most engines, and in foreground
|
|
||||||
// contexts in the following browsers.
|
|
||||||
// However, note that even this simple case requires nuances to operate in a
|
|
||||||
// broad spectrum of browsers.
|
|
||||||
//
|
|
||||||
// - Firefox 3-13
|
|
||||||
// - Internet Explorer 6-9
|
|
||||||
// - iPad Safari 4.3
|
|
||||||
// - Lynx 2.8.7
|
|
||||||
} else {
|
|
||||||
requestFlush = makeRequestCallFromTimer(flush);
|
|
||||||
}
|
|
||||||
|
|
||||||
// `requestFlush` requests that the high priority event queue be flushed as
|
|
||||||
// soon as possible.
|
|
||||||
// This is useful to prevent an error thrown in a task from stalling the event
|
|
||||||
// queue if the exception handled by Node.js’s
|
|
||||||
// `process.on("uncaughtException")` or by a domain.
|
|
||||||
rawAsap.requestFlush = requestFlush;
|
|
||||||
|
|
||||||
// To request a high priority event, we induce a mutation observer by toggling
|
|
||||||
// the text of a text node between "1" and "-1".
|
|
||||||
function makeRequestCallFromMutationObserver(callback) {
|
|
||||||
var toggle = 1;
|
|
||||||
var observer = new BrowserMutationObserver(callback);
|
|
||||||
var node = document.createTextNode("");
|
|
||||||
observer.observe(node, {characterData: true});
|
|
||||||
return function requestCall() {
|
|
||||||
toggle = -toggle;
|
|
||||||
node.data = toggle;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// The message channel technique was discovered by Malte Ubl and was the
|
|
||||||
// original foundation for this library.
|
|
||||||
// http://www.nonblocking.io/2011/06/windownexttick.html
|
|
||||||
|
|
||||||
// Safari 6.0.5 (at least) intermittently fails to create message ports on a
|
|
||||||
// page's first load. Thankfully, this version of Safari supports
|
|
||||||
// MutationObservers, so we don't need to fall back in that case.
|
|
||||||
|
|
||||||
// function makeRequestCallFromMessageChannel(callback) {
|
|
||||||
// var channel = new MessageChannel();
|
|
||||||
// channel.port1.onmessage = callback;
|
|
||||||
// return function requestCall() {
|
|
||||||
// channel.port2.postMessage(0);
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
// For reasons explained above, we are also unable to use `setImmediate`
|
|
||||||
// under any circumstances.
|
|
||||||
// Even if we were, there is another bug in Internet Explorer 10.
|
|
||||||
// It is not sufficient to assign `setImmediate` to `requestFlush` because
|
|
||||||
// `setImmediate` must be called *by name* and therefore must be wrapped in a
|
|
||||||
// closure.
|
|
||||||
// Never forget.
|
|
||||||
|
|
||||||
// function makeRequestCallFromSetImmediate(callback) {
|
|
||||||
// return function requestCall() {
|
|
||||||
// setImmediate(callback);
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Safari 6.0 has a problem where timers will get lost while the user is
|
|
||||||
// scrolling. This problem does not impact ASAP because Safari 6.0 supports
|
|
||||||
// mutation observers, so that implementation is used instead.
|
|
||||||
// However, if we ever elect to use timers in Safari, the prevalent work-around
|
|
||||||
// is to add a scroll event listener that calls for a flush.
|
|
||||||
|
|
||||||
// `setTimeout` does not call the passed callback if the delay is less than
|
|
||||||
// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
|
|
||||||
// even then.
|
|
||||||
|
|
||||||
function makeRequestCallFromTimer(callback) {
|
|
||||||
return function requestCall() {
|
|
||||||
// We dispatch a timeout with a specified delay of 0 for engines that
|
|
||||||
// can reliably accommodate that request. This will usually be snapped
|
|
||||||
// to a 4 milisecond delay, but once we're flushing, there's no delay
|
|
||||||
// between events.
|
|
||||||
var timeoutHandle = setTimeout(handleTimer, 0);
|
|
||||||
// However, since this timer gets frequently dropped in Firefox
|
|
||||||
// workers, we enlist an interval handle that will try to fire
|
|
||||||
// an event 20 times per second until it succeeds.
|
|
||||||
var intervalHandle = setInterval(handleTimer, 50);
|
|
||||||
|
|
||||||
function handleTimer() {
|
|
||||||
// Whichever timer succeeds will cancel both timers and
|
|
||||||
// execute the callback.
|
|
||||||
clearTimeout(timeoutHandle);
|
|
||||||
clearInterval(intervalHandle);
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is for `asap.js` only.
|
|
||||||
// Its name will be periodically randomized to break any code that depends on
|
|
||||||
// its existence.
|
|
||||||
rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
|
|
||||||
|
|
||||||
// ASAP was originally a nextTick shim included in Q. This was factored out
|
|
||||||
// into this ASAP package. It was later adapted to RSVP which made further
|
|
||||||
// amendments. These decisions, particularly to marginalize MessageChannel and
|
|
||||||
// to capture the MutationObserver implementation in a closure, were integrated
|
|
||||||
// back into ASAP proper.
|
|
||||||
// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
|
|
87
node_modules/asap/package.json
generated
vendored
87
node_modules/asap/package.json
generated
vendored
|
@ -1,87 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "asap@^2.0.0",
|
|
||||||
"_id": "asap@2.0.6",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==",
|
|
||||||
"_location": "/asap",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "asap@^2.0.0",
|
|
||||||
"name": "asap",
|
|
||||||
"escapedName": "asap",
|
|
||||||
"rawSpec": "^2.0.0",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^2.0.0"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/dezalgo"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
|
|
||||||
"_shasum": "e50347611d7e690943208bbdafebcbc2fb866d46",
|
|
||||||
"_spec": "asap@^2.0.0",
|
|
||||||
"_where": "/home/ubuntu/formidable/node_modules/dezalgo",
|
|
||||||
"browser": {
|
|
||||||
"./asap": "./browser-asap.js",
|
|
||||||
"./asap.js": "./browser-asap.js",
|
|
||||||
"./raw": "./browser-raw.js",
|
|
||||||
"./raw.js": "./browser-raw.js",
|
|
||||||
"./test/domain.js": "./test/browser-domain.js"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/kriskowal/asap/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "High-priority task queue for Node.js and browsers",
|
|
||||||
"devDependencies": {
|
|
||||||
"benchmark": "^1.0.0",
|
|
||||||
"events": "^1.0.1",
|
|
||||||
"jshint": "^2.5.1",
|
|
||||||
"knox": "^0.8.10",
|
|
||||||
"mr": "^2.0.5",
|
|
||||||
"opener": "^1.3.0",
|
|
||||||
"q": "^2.0.3",
|
|
||||||
"q-io": "^2.0.3",
|
|
||||||
"saucelabs": "^0.1.1",
|
|
||||||
"wd": "^0.2.21",
|
|
||||||
"weak-map": "^1.0.5"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"raw.js",
|
|
||||||
"asap.js",
|
|
||||||
"browser-raw.js",
|
|
||||||
"browser-asap.js"
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/kriskowal/asap#readme",
|
|
||||||
"keywords": [
|
|
||||||
"event",
|
|
||||||
"task",
|
|
||||||
"queue"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "./asap.js",
|
|
||||||
"name": "asap",
|
|
||||||
"react-native": {
|
|
||||||
"domain": false
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/kriskowal/asap.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"benchmarks": "node benchmarks",
|
|
||||||
"lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)",
|
|
||||||
"test": "npm run lint && npm run test-node",
|
|
||||||
"test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener",
|
|
||||||
"test-node": "node test/asap-test.js",
|
|
||||||
"test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy",
|
|
||||||
"test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json",
|
|
||||||
"test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json",
|
|
||||||
"test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json",
|
|
||||||
"test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json",
|
|
||||||
"test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker"
|
|
||||||
},
|
|
||||||
"version": "2.0.6"
|
|
||||||
}
|
|
101
node_modules/asap/raw.js
generated
vendored
101
node_modules/asap/raw.js
generated
vendored
|
@ -1,101 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var domain; // The domain module is executed on demand
|
|
||||||
var hasSetImmediate = typeof setImmediate === "function";
|
|
||||||
|
|
||||||
// Use the fastest means possible to execute a task in its own turn, with
|
|
||||||
// priority over other events including network IO events in Node.js.
|
|
||||||
//
|
|
||||||
// An exception thrown by a task will permanently interrupt the processing of
|
|
||||||
// subsequent tasks. The higher level `asap` function ensures that if an
|
|
||||||
// exception is thrown by a task, that the task queue will continue flushing as
|
|
||||||
// soon as possible, but if you use `rawAsap` directly, you are responsible to
|
|
||||||
// either ensure that no exceptions are thrown from your task, or to manually
|
|
||||||
// call `rawAsap.requestFlush` if an exception is thrown.
|
|
||||||
module.exports = rawAsap;
|
|
||||||
function rawAsap(task) {
|
|
||||||
if (!queue.length) {
|
|
||||||
requestFlush();
|
|
||||||
flushing = true;
|
|
||||||
}
|
|
||||||
// Avoids a function call
|
|
||||||
queue[queue.length] = task;
|
|
||||||
}
|
|
||||||
|
|
||||||
var queue = [];
|
|
||||||
// Once a flush has been requested, no further calls to `requestFlush` are
|
|
||||||
// necessary until the next `flush` completes.
|
|
||||||
var flushing = false;
|
|
||||||
// The position of the next task to execute in the task queue. This is
|
|
||||||
// preserved between calls to `flush` so that it can be resumed if
|
|
||||||
// a task throws an exception.
|
|
||||||
var index = 0;
|
|
||||||
// If a task schedules additional tasks recursively, the task queue can grow
|
|
||||||
// unbounded. To prevent memory excaustion, the task queue will periodically
|
|
||||||
// truncate already-completed tasks.
|
|
||||||
var capacity = 1024;
|
|
||||||
|
|
||||||
// The flush function processes all tasks that have been scheduled with
|
|
||||||
// `rawAsap` unless and until one of those tasks throws an exception.
|
|
||||||
// If a task throws an exception, `flush` ensures that its state will remain
|
|
||||||
// consistent and will resume where it left off when called again.
|
|
||||||
// However, `flush` does not make any arrangements to be called again if an
|
|
||||||
// exception is thrown.
|
|
||||||
function flush() {
|
|
||||||
while (index < queue.length) {
|
|
||||||
var currentIndex = index;
|
|
||||||
// Advance the index before calling the task. This ensures that we will
|
|
||||||
// begin flushing on the next task the task throws an error.
|
|
||||||
index = index + 1;
|
|
||||||
queue[currentIndex].call();
|
|
||||||
// Prevent leaking memory for long chains of recursive calls to `asap`.
|
|
||||||
// If we call `asap` within tasks scheduled by `asap`, the queue will
|
|
||||||
// grow, but to avoid an O(n) walk for every task we execute, we don't
|
|
||||||
// shift tasks off the queue after they have been executed.
|
|
||||||
// Instead, we periodically shift 1024 tasks off the queue.
|
|
||||||
if (index > capacity) {
|
|
||||||
// Manually shift all values starting at the index back to the
|
|
||||||
// beginning of the queue.
|
|
||||||
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
|
|
||||||
queue[scan] = queue[scan + index];
|
|
||||||
}
|
|
||||||
queue.length -= index;
|
|
||||||
index = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queue.length = 0;
|
|
||||||
index = 0;
|
|
||||||
flushing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
rawAsap.requestFlush = requestFlush;
|
|
||||||
function requestFlush() {
|
|
||||||
// Ensure flushing is not bound to any domain.
|
|
||||||
// It is not sufficient to exit the domain, because domains exist on a stack.
|
|
||||||
// To execute code outside of any domain, the following dance is necessary.
|
|
||||||
var parentDomain = process.domain;
|
|
||||||
if (parentDomain) {
|
|
||||||
if (!domain) {
|
|
||||||
// Lazy execute the domain module.
|
|
||||||
// Only employed if the user elects to use domains.
|
|
||||||
domain = require("domain");
|
|
||||||
}
|
|
||||||
domain.active = process.domain = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
|
|
||||||
// cannot handle recursion.
|
|
||||||
// `requestFlush` will only be called recursively from `asap.js`, to resume
|
|
||||||
// flushing after an error is thrown into a domain.
|
|
||||||
// Conveniently, `setImmediate` was introduced in the same version
|
|
||||||
// `process.nextTick` started throwing recursion errors.
|
|
||||||
if (flushing && hasSetImmediate) {
|
|
||||||
setImmediate(flush);
|
|
||||||
} else {
|
|
||||||
process.nextTick(flush);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parentDomain) {
|
|
||||||
domain.active = process.domain = parentDomain;
|
|
||||||
}
|
|
||||||
}
|
|
145
node_modules/asn1.js-rfc2560/index.js
generated
vendored
145
node_modules/asn1.js-rfc2560/index.js
generated
vendored
|
@ -1,145 +0,0 @@
|
||||||
var asn1 = require('asn1.js');
|
|
||||||
var rfc5280 = require('asn1.js-rfc5280');
|
|
||||||
|
|
||||||
var OCSPRequest = asn1.define('OCSPRequest', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('tbsRequest').use(TBSRequest),
|
|
||||||
this.key('optionalSignature').optional().explicit(0).use(Signature)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.OCSPRequest = OCSPRequest;
|
|
||||||
|
|
||||||
var TBSRequest = asn1.define('TBSRequest', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('version').def('v1').explicit(0).use(rfc5280.Version),
|
|
||||||
this.key('requestorName').optional().explicit(1).use(rfc5280.GeneralName),
|
|
||||||
this.key('requestList').seqof(Request),
|
|
||||||
this.key('requestExtensions').optional().explicit(2)
|
|
||||||
.seqof(rfc5280.Extension)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.TBSRequest = TBSRequest;
|
|
||||||
|
|
||||||
var Signature = asn1.define('Signature', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('signatureAlgorithm').use(rfc5280.AlgorithmIdentifier),
|
|
||||||
this.key('signature').bitstr(),
|
|
||||||
this.key('certs').optional().explicit(0).seqof(rfc5280.Certificate)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.Signature = Signature;
|
|
||||||
|
|
||||||
var Request = asn1.define('Request', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('reqCert').use(CertID),
|
|
||||||
this.key('singleRequestExtensions').optional().explicit(0).seqof(
|
|
||||||
rfc5280.Extension)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.Request = Request;
|
|
||||||
|
|
||||||
var OCSPResponse = asn1.define('OCSPResponse', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('responseStatus').use(ResponseStatus),
|
|
||||||
this.key('responseBytes').optional().explicit(0).seq().obj(
|
|
||||||
this.key('responseType').objid({
|
|
||||||
'1 3 6 1 5 5 7 48 1 1': 'id-pkix-ocsp-basic'
|
|
||||||
}),
|
|
||||||
this.key('response').octstr()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.OCSPResponse = OCSPResponse;
|
|
||||||
|
|
||||||
var ResponseStatus = asn1.define('ResponseStatus', function() {
|
|
||||||
this.enum({
|
|
||||||
0: 'successful',
|
|
||||||
1: 'malformed_request',
|
|
||||||
2: 'internal_error',
|
|
||||||
3: 'try_later',
|
|
||||||
5: 'sig_required',
|
|
||||||
6: 'unauthorized'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
exports.ResponseStatus = ResponseStatus;
|
|
||||||
|
|
||||||
var BasicOCSPResponse = asn1.define('BasicOCSPResponse', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('tbsResponseData').use(ResponseData),
|
|
||||||
this.key('signatureAlgorithm').use(rfc5280.AlgorithmIdentifier),
|
|
||||||
this.key('signature').bitstr(),
|
|
||||||
this.key('certs').optional().explicit(0).seqof(rfc5280.Certificate)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.BasicOCSPResponse = BasicOCSPResponse;
|
|
||||||
|
|
||||||
var ResponseData = asn1.define('ResponseData', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('version').def('v1').explicit(0).use(rfc5280.Version),
|
|
||||||
this.key('responderID').use(ResponderID),
|
|
||||||
this.key('producedAt').gentime(),
|
|
||||||
this.key('responses').seqof(SingleResponse),
|
|
||||||
this.key('responseExtensions').optional().explicit(0)
|
|
||||||
.seqof(rfc5280.Extension)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.ResponseData = ResponseData;
|
|
||||||
|
|
||||||
var ResponderID = asn1.define('ResponderId', function() {
|
|
||||||
this.choice({
|
|
||||||
byName: this.explicit(1).use(rfc5280.Name),
|
|
||||||
byKey: this.explicit(2).use(KeyHash)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
exports.ResponderID = ResponderID;
|
|
||||||
|
|
||||||
var KeyHash = asn1.define('KeyHash', function() {
|
|
||||||
this.octstr();
|
|
||||||
});
|
|
||||||
exports.KeyHash = KeyHash;
|
|
||||||
|
|
||||||
var SingleResponse = asn1.define('SingleResponse', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('certId').use(CertID),
|
|
||||||
this.key('certStatus').use(CertStatus),
|
|
||||||
this.key('thisUpdate').gentime(),
|
|
||||||
this.key('nextUpdate').optional().explicit(0).gentime(),
|
|
||||||
this.key('singleExtensions').optional().explicit(1).seqof(rfc5280.Extension)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.SingleResponse = SingleResponse;
|
|
||||||
|
|
||||||
var CertStatus = asn1.define('CertStatus', function() {
|
|
||||||
this.choice({
|
|
||||||
good: this.implicit(0).null_(),
|
|
||||||
revoked: this.implicit(1).use(RevokedInfo),
|
|
||||||
unknown: this.implicit(2).null_()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
exports.CertStatus = CertStatus;
|
|
||||||
|
|
||||||
var RevokedInfo = asn1.define('RevokedInfo', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('revocationTime').gentime(),
|
|
||||||
this.key('revocationReason').optional().explicit(0).use(rfc5280.ReasonCode)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.RevokedInfo = RevokedInfo;
|
|
||||||
|
|
||||||
var CertID = asn1.define('CertID', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('hashAlgorithm').use(rfc5280.AlgorithmIdentifier),
|
|
||||||
this.key('issuerNameHash').octstr(),
|
|
||||||
this.key('issuerKeyHash').octstr(),
|
|
||||||
this.key('serialNumber').use(rfc5280.CertificateSerialNumber)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
exports.CertID = CertID;
|
|
||||||
|
|
||||||
var Nonce = asn1.define('Nonce', function() {
|
|
||||||
this.octstr();
|
|
||||||
});
|
|
||||||
exports.Nonce = Nonce;
|
|
||||||
|
|
||||||
exports['id-pkix-ocsp'] = [ 1, 3, 6, 1, 5, 5, 7, 48, 1 ];
|
|
||||||
exports['id-pkix-ocsp-nonce'] = [ 1, 3, 6, 1, 5, 5, 7, 48, 1, 2 ];
|
|
60
node_modules/asn1.js-rfc2560/package.json
generated
vendored
60
node_modules/asn1.js-rfc2560/package.json
generated
vendored
|
@ -1,60 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "asn1.js-rfc2560@^4.0.0",
|
|
||||||
"_id": "asn1.js-rfc2560@4.0.6",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-ysf48ni+f/efNPilq4+ApbifUPcSW/xbDeQAh055I+grr2gXgNRQqHew7kkO70WSMQ2tEOURVwsK+dJqUNjIIg==",
|
|
||||||
"_location": "/asn1.js-rfc2560",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "asn1.js-rfc2560@^4.0.0",
|
|
||||||
"name": "asn1.js-rfc2560",
|
|
||||||
"escapedName": "asn1.js-rfc2560",
|
|
||||||
"rawSpec": "^4.0.0",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^4.0.0"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/ocsp"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/asn1.js-rfc2560/-/asn1.js-rfc2560-4.0.6.tgz",
|
|
||||||
"_shasum": "0975ce84768a8401e95884ad13e2d00e7b25a280",
|
|
||||||
"_spec": "asn1.js-rfc2560@^4.0.0",
|
|
||||||
"_where": "/home/ubuntu/OCSP/node_modules/ocsp",
|
|
||||||
"author": {
|
|
||||||
"name": "Fedor Indutny"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/indutny/asn1.js/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
|
||||||
"asn1.js-rfc5280": "^2.0.0"
|
|
||||||
},
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "RFC2560 structures for asn1.js",
|
|
||||||
"devDependencies": {
|
|
||||||
"mocha": "^4.0.1"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/indutny/asn1.js",
|
|
||||||
"keywords": [
|
|
||||||
"asn1",
|
|
||||||
"rfc2560",
|
|
||||||
"der"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "asn1.js-rfc2560",
|
|
||||||
"peerDependencies": {
|
|
||||||
"asn1.js": "^4.4.0"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+ssh://git@github.com/indutny/asn1.js.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test": "mocha --reporter=spec test/*-test.js"
|
|
||||||
},
|
|
||||||
"version": "4.0.6"
|
|
||||||
}
|
|
892
node_modules/asn1.js-rfc5280/index.js
generated
vendored
892
node_modules/asn1.js-rfc5280/index.js
generated
vendored
|
@ -1,892 +0,0 @@
|
||||||
var asn1 = require('asn1.js');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* RFC5280 X509 and Extension Definitions
|
|
||||||
*/
|
|
||||||
|
|
||||||
var rfc5280 = exports;
|
|
||||||
|
|
||||||
// OIDs
|
|
||||||
var x509OIDs = {
|
|
||||||
'2 5 29 9': 'subjectDirectoryAttributes',
|
|
||||||
'2 5 29 14': 'subjectKeyIdentifier',
|
|
||||||
'2 5 29 15': 'keyUsage',
|
|
||||||
'2 5 29 17': 'subjectAlternativeName',
|
|
||||||
'2 5 29 18': 'issuerAlternativeName',
|
|
||||||
'2 5 29 19': 'basicConstraints',
|
|
||||||
'2 5 29 20': 'cRLNumber',
|
|
||||||
'2 5 29 21': 'reasonCode',
|
|
||||||
'2 5 29 24': 'invalidityDate',
|
|
||||||
'2 5 29 27': 'deltaCRLIndicator',
|
|
||||||
'2 5 29 28': 'issuingDistributionPoint',
|
|
||||||
'2 5 29 29': 'certificateIssuer',
|
|
||||||
'2 5 29 30': 'nameConstraints',
|
|
||||||
'2 5 29 31': 'cRLDistributionPoints',
|
|
||||||
'2 5 29 32': 'certificatePolicies',
|
|
||||||
'2 5 29 33': 'policyMappings',
|
|
||||||
'2 5 29 35': 'authorityKeyIdentifier',
|
|
||||||
'2 5 29 36': 'policyConstraints',
|
|
||||||
'2 5 29 37': 'extendedKeyUsage',
|
|
||||||
'2 5 29 46': 'freshestCRL',
|
|
||||||
'2 5 29 54': 'inhibitAnyPolicy',
|
|
||||||
'1 3 6 1 5 5 7 1 1': 'authorityInformationAccess',
|
|
||||||
'1 3 6 1 5 5 7 11': 'subjectInformationAccess'
|
|
||||||
};
|
|
||||||
|
|
||||||
// CertificateList ::= SEQUENCE {
|
|
||||||
// tbsCertList TBSCertList,
|
|
||||||
// signatureAlgorithm AlgorithmIdentifier,
|
|
||||||
// signature BIT STRING }
|
|
||||||
var CertificateList = asn1.define('CertificateList', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('tbsCertList').use(TBSCertList),
|
|
||||||
this.key('signatureAlgorithm').use(AlgorithmIdentifier),
|
|
||||||
this.key('signature').bitstr()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.CertificateList = CertificateList;
|
|
||||||
|
|
||||||
// AlgorithmIdentifier ::= SEQUENCE {
|
|
||||||
// algorithm OBJECT IDENTIFIER,
|
|
||||||
// parameters ANY DEFINED BY algorithm OPTIONAL }
|
|
||||||
var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('algorithm').objid(),
|
|
||||||
this.key('parameters').optional().any()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.AlgorithmIdentifier = AlgorithmIdentifier;
|
|
||||||
|
|
||||||
// Certificate ::= SEQUENCE {
|
|
||||||
// tbsCertificate TBSCertificate,
|
|
||||||
// signatureAlgorithm AlgorithmIdentifier,
|
|
||||||
// signature BIT STRING }
|
|
||||||
var Certificate = asn1.define('Certificate', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('tbsCertificate').use(TBSCertificate),
|
|
||||||
this.key('signatureAlgorithm').use(AlgorithmIdentifier),
|
|
||||||
this.key('signature').bitstr()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.Certificate = Certificate;
|
|
||||||
|
|
||||||
// TBSCertificate ::= SEQUENCE {
|
|
||||||
// version [0] Version DEFAULT v1,
|
|
||||||
// serialNumber CertificateSerialNumber,
|
|
||||||
// signature AlgorithmIdentifier,
|
|
||||||
// issuer Name,
|
|
||||||
// validity Validity,
|
|
||||||
// subject Name,
|
|
||||||
// subjectPublicKeyInfo SubjectPublicKeyInfo,
|
|
||||||
// issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
|
|
||||||
// subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
|
|
||||||
// extensions [3] Extensions OPTIONAL
|
|
||||||
var TBSCertificate = asn1.define('TBSCertificate', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('version').def('v1').explicit(0).use(Version),
|
|
||||||
this.key('serialNumber').int(),
|
|
||||||
this.key('signature').use(AlgorithmIdentifier),
|
|
||||||
this.key('issuer').use(Name),
|
|
||||||
this.key('validity').use(Validity),
|
|
||||||
this.key('subject').use(Name),
|
|
||||||
this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
|
|
||||||
this.key('issuerUniqueID').optional().implicit(1).bitstr(),
|
|
||||||
this.key('subjectUniqueID').optional().implicit(2).bitstr(),
|
|
||||||
this.key('extensions').optional().explicit(3).seqof(Extension)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.TBSCertificate = TBSCertificate;
|
|
||||||
|
|
||||||
// Version ::= INTEGER { v1(0), v2(1), v3(2) }
|
|
||||||
var Version = asn1.define('Version', function() {
|
|
||||||
this.int({
|
|
||||||
0: 'v1',
|
|
||||||
1: 'v2',
|
|
||||||
2: 'v3'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.Version = Version;
|
|
||||||
|
|
||||||
// Validity ::= SEQUENCE {
|
|
||||||
// notBefore Time,
|
|
||||||
// notAfter Time }
|
|
||||||
var Validity = asn1.define('Validity', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('notBefore').use(Time),
|
|
||||||
this.key('notAfter').use(Time)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.Validity = Validity;
|
|
||||||
|
|
||||||
// Time ::= CHOICE {
|
|
||||||
// utcTime UTCTime,
|
|
||||||
// generalTime GeneralizedTime }
|
|
||||||
var Time = asn1.define('Time', function() {
|
|
||||||
this.choice({
|
|
||||||
utcTime: this.utctime(),
|
|
||||||
genTime: this.gentime()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.Time = Time;
|
|
||||||
|
|
||||||
// SubjectPublicKeyInfo ::= SEQUENCE {
|
|
||||||
// algorithm AlgorithmIdentifier,
|
|
||||||
// subjectPublicKey BIT STRING }
|
|
||||||
var SubjectPublicKeyInfo = asn1.define('SubjectPublicKeyInfo', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('algorithm').use(AlgorithmIdentifier),
|
|
||||||
this.key('subjectPublicKey').bitstr()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.SubjectPublicKeyInfo = SubjectPublicKeyInfo;
|
|
||||||
|
|
||||||
// TBSCertList ::= SEQUENCE {
|
|
||||||
// version Version OPTIONAL,
|
|
||||||
// signature AlgorithmIdentifier,
|
|
||||||
// issuer Name,
|
|
||||||
// thisUpdate Time,
|
|
||||||
// nextUpdate Time OPTIONAL,
|
|
||||||
// revokedCertificates SEQUENCE OF SEQUENCE {
|
|
||||||
// userCertificate CertificateSerialNumber,
|
|
||||||
// revocationDate Time,
|
|
||||||
// crlEntryExtensions Extensions OPTIONAL
|
|
||||||
// } OPTIONAL,
|
|
||||||
// crlExtensions [0] Extensions OPTIONAL }
|
|
||||||
var TBSCertList = asn1.define('TBSCertList', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('version').optional().int(),
|
|
||||||
this.key('signature').use(AlgorithmIdentifier),
|
|
||||||
this.key('issuer').use(Name),
|
|
||||||
this.key('thisUpdate').use(Time),
|
|
||||||
this.key('nextUpdate').use(Time),
|
|
||||||
this.key('revokedCertificates').optional().seqof(RevokedCertificate),
|
|
||||||
this.key('crlExtensions').explicit(0).optional().seqof(Extension)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.TBSCertList = TBSCertList;
|
|
||||||
|
|
||||||
var RevokedCertificate = asn1.define('RevokedCertificate', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('userCertificate').use(CertificateSerialNumber),
|
|
||||||
this.key('revocationDate').use(Time),
|
|
||||||
this.key('crlEntryExtensions').optional().seqof(Extension)
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
// Extension ::= SEQUENCE {
|
|
||||||
// extnID OBJECT IDENTIFIER,
|
|
||||||
// critical BOOLEAN DEFAULT FALSE,
|
|
||||||
// extnValue OCTET STRING }
|
|
||||||
var Extension = asn1.define('Extension', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('extnID').objid(x509OIDs),
|
|
||||||
this.key('critical').bool().def(false),
|
|
||||||
this.key('extnValue').octstr().contains(function(obj) {
|
|
||||||
var out = x509Extensions[obj.extnID];
|
|
||||||
// Cope with unknown extensions
|
|
||||||
return out ? out : asn1.define('OctString', function() { this.any() })
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.Extension = Extension;
|
|
||||||
|
|
||||||
// Name ::= CHOICE { -- only one possibility for now --
|
|
||||||
// rdnSequence RDNSequence }
|
|
||||||
var Name = asn1.define('Name', function() {
|
|
||||||
this.choice({
|
|
||||||
rdnSequence: this.use(RDNSequence)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.Name = Name;
|
|
||||||
|
|
||||||
// GeneralName ::= CHOICE {
|
|
||||||
// otherName [0] AnotherName,
|
|
||||||
// rfc822Name [1] IA5String,
|
|
||||||
// dNSName [2] IA5String,
|
|
||||||
// x400Address [3] ORAddress,
|
|
||||||
// directoryName [4] Name,
|
|
||||||
// ediPartyName [5] EDIPartyName,
|
|
||||||
// uniformResourceIdentifier [6] IA5String,
|
|
||||||
// iPAddress [7] OCTET STRING,
|
|
||||||
// registeredID [8] OBJECT IDENTIFIER }
|
|
||||||
var GeneralName = asn1.define('GeneralName', function() {
|
|
||||||
this.choice({
|
|
||||||
otherName: this.implicit(0).use(AnotherName),
|
|
||||||
rfc822Name: this.implicit(1).ia5str(),
|
|
||||||
dNSName: this.implicit(2).ia5str(),
|
|
||||||
directoryName: this.explicit(4).use(Name),
|
|
||||||
ediPartyName: this.implicit(5).use(EDIPartyName),
|
|
||||||
uniformResourceIdentifier: this.implicit(6).ia5str(),
|
|
||||||
iPAddress: this.implicit(7).octstr(),
|
|
||||||
registeredID: this.implicit(8).objid()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.GeneralName = GeneralName;
|
|
||||||
|
|
||||||
// GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
|
|
||||||
var GeneralNames = asn1.define('GeneralNames', function() {
|
|
||||||
this.seqof(GeneralName);
|
|
||||||
});
|
|
||||||
rfc5280.GeneralNames = GeneralNames;
|
|
||||||
|
|
||||||
// AnotherName ::= SEQUENCE {
|
|
||||||
// type-id OBJECT IDENTIFIER,
|
|
||||||
// value [0] EXPLICIT ANY DEFINED BY type-id }
|
|
||||||
var AnotherName = asn1.define('AnotherName', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('type-id').objid(),
|
|
||||||
this.key('value').explicit(0).any()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.AnotherName = AnotherName;
|
|
||||||
|
|
||||||
// EDIPartyName ::= SEQUENCE {
|
|
||||||
// nameAssigner [0] DirectoryString OPTIONAL,
|
|
||||||
// partyName [1] DirectoryString }
|
|
||||||
var EDIPartyName = asn1.define('EDIPartyName', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('nameAssigner').implicit(0).optional().use(DirectoryString),
|
|
||||||
this.key('partyName').implicit(1).use(DirectoryString)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.EDIPartyName = EDIPartyName;
|
|
||||||
|
|
||||||
// RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
|
|
||||||
var RDNSequence = asn1.define('RDNSequence', function() {
|
|
||||||
this.seqof(RelativeDistinguishedName);
|
|
||||||
});
|
|
||||||
rfc5280.RDNSequence = RDNSequence;
|
|
||||||
|
|
||||||
// RelativeDistinguishedName ::=
|
|
||||||
// SET SIZE (1..MAX) OF AttributeTypeAndValue
|
|
||||||
var RelativeDistinguishedName = asn1.define('RelativeDistinguishedName',
|
|
||||||
function() {
|
|
||||||
this.setof(AttributeTypeAndValue);
|
|
||||||
});
|
|
||||||
rfc5280.RelativeDistinguishedName = RelativeDistinguishedName;
|
|
||||||
|
|
||||||
// AttributeTypeAndValue ::= SEQUENCE {
|
|
||||||
// type AttributeType,
|
|
||||||
// value AttributeValue }
|
|
||||||
var AttributeTypeAndValue = asn1.define('AttributeTypeAndValue', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('type').use(AttributeType),
|
|
||||||
this.key('value').use(AttributeValue)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.AttributeTypeAndValue = AttributeTypeAndValue;
|
|
||||||
|
|
||||||
// Attribute ::= SEQUENCE {
|
|
||||||
// type AttributeType,
|
|
||||||
// values SET OF AttributeValue }
|
|
||||||
var Attribute = asn1.define('Attribute', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('type').use(AttributeType),
|
|
||||||
this.key('values').setof(AttributeValue)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.Attribute = Attribute;
|
|
||||||
|
|
||||||
// AttributeType ::= OBJECT IDENTIFIER
|
|
||||||
var AttributeType = asn1.define('AttributeType', function() {
|
|
||||||
this.objid();
|
|
||||||
});
|
|
||||||
rfc5280.AttributeType = AttributeType;
|
|
||||||
|
|
||||||
// AttributeValue ::= ANY -- DEFINED BY AttributeType
|
|
||||||
var AttributeValue = asn1.define('AttributeValue', function() {
|
|
||||||
this.any();
|
|
||||||
});
|
|
||||||
rfc5280.AttributeValue = AttributeValue;
|
|
||||||
|
|
||||||
// DirectoryString ::= CHOICE {
|
|
||||||
// teletexString TeletexString (SIZE (1..MAX)),
|
|
||||||
// printableString PrintableString (SIZE (1..MAX)),
|
|
||||||
// universalString UniversalString (SIZE (1..MAX)),
|
|
||||||
// utf8String UTF8String (SIZE (1..MAX)),
|
|
||||||
// bmpString BMPString (SIZE (1..MAX)) }
|
|
||||||
var DirectoryString = asn1.define('DirectoryString', function() {
|
|
||||||
this.choice({
|
|
||||||
teletexString: this.t61str(),
|
|
||||||
printableString: this.printstr(),
|
|
||||||
universalString: this.unistr(),
|
|
||||||
utf8String: this.utf8str(),
|
|
||||||
bmpString: this.bmpstr()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.DirectoryString = DirectoryString;
|
|
||||||
|
|
||||||
// AuthorityKeyIdentifier ::= SEQUENCE {
|
|
||||||
// keyIdentifier [0] KeyIdentifier OPTIONAL,
|
|
||||||
// authorityCertIssuer [1] GeneralNames OPTIONAL,
|
|
||||||
// authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
|
|
||||||
var AuthorityKeyIdentifier = asn1.define('AuthorityKeyIdentifier', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('keyIdentifier').implicit(0).optional().use(KeyIdentifier),
|
|
||||||
this.key('authorityCertIssuer').implicit(1).optional().use(GeneralNames),
|
|
||||||
this.key('authorityCertSerialNumber').implicit(2).optional()
|
|
||||||
.use(CertificateSerialNumber)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.AuthorityKeyIdentifier = AuthorityKeyIdentifier;
|
|
||||||
|
|
||||||
// KeyIdentifier ::= OCTET STRING
|
|
||||||
var KeyIdentifier = asn1.define('KeyIdentifier', function() {
|
|
||||||
this.octstr();
|
|
||||||
});
|
|
||||||
rfc5280.KeyIdentifier = KeyIdentifier;
|
|
||||||
|
|
||||||
// CertificateSerialNumber ::= INTEGER
|
|
||||||
var CertificateSerialNumber = asn1.define('CertificateSerialNumber',
|
|
||||||
function() {
|
|
||||||
this.int();
|
|
||||||
});
|
|
||||||
rfc5280.CertificateSerialNumber = CertificateSerialNumber;
|
|
||||||
|
|
||||||
// ORAddress ::= SEQUENCE {
|
|
||||||
// built-in-standard-attributes BuiltInStandardAttributes,
|
|
||||||
// built-in-domain-defined-attributes BuiltInDomainDefinedAttributes
|
|
||||||
// OPTIONAL,
|
|
||||||
// extension-attributes ExtensionAttributes OPTIONAL }
|
|
||||||
var ORAddress = asn1.define('ORAddress', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('builtInStandardAttributes').use(BuiltInStandardAttributes),
|
|
||||||
this.key('builtInDomainDefinedAttributes').optional()
|
|
||||||
.use(BuiltInDomainDefinedAttributes),
|
|
||||||
this.key('extensionAttributes').optional().use(ExtensionAttributes)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.ORAddress = ORAddress;
|
|
||||||
|
|
||||||
// BuiltInStandardAttributes ::= SEQUENCE {
|
|
||||||
// country-name CountryName OPTIONAL,
|
|
||||||
// administration-domain-name AdministrationDomainName OPTIONAL,
|
|
||||||
// network-address [0] IMPLICIT NetworkAddress OPTIONAL,
|
|
||||||
// terminal-identifier [1] IMPLICIT TerminalIdentifier OPTIONAL,
|
|
||||||
// private-domain-name [2] PrivateDomainName OPTIONAL,
|
|
||||||
// organization-name [3] IMPLICIT OrganizationName OPTIONAL,
|
|
||||||
// numeric-user-identifier [4] IMPLICIT NumericUserIdentifier OPTIONAL,
|
|
||||||
// personal-name [5] IMPLICIT PersonalName OPTIONAL,
|
|
||||||
// organizational-unit-names [6] IMPLICIT OrganizationalUnitNames OPTIONAL }
|
|
||||||
var BuiltInStandardAttributes = asn1.define('BuiltInStandardAttributes',
|
|
||||||
function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('countryName').optional().use(CountryName),
|
|
||||||
this.key('administrationDomainName').optional()
|
|
||||||
.use(AdministrationDomainName),
|
|
||||||
this.key('networkAddress').implicit(0).optional().use(NetworkAddress),
|
|
||||||
this.key('terminalIdentifier').implicit(1).optional()
|
|
||||||
.use(TerminalIdentifier),
|
|
||||||
this.key('privateDomainName').explicit(2).optional().use(PrivateDomainName),
|
|
||||||
this.key('organizationName').implicit(3).optional().use(OrganizationName),
|
|
||||||
this.key('numericUserIdentifier').implicit(4).optional()
|
|
||||||
.use(NumericUserIdentifier),
|
|
||||||
this.key('personalName').implicit(5).optional().use(PersonalName),
|
|
||||||
this.key('organizationalUnitNames').implicit(6).optional()
|
|
||||||
.use(OrganizationalUnitNames)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.BuiltInStandardAttributes = BuiltInStandardAttributes;
|
|
||||||
|
|
||||||
// CountryName ::= CHOICE {
|
|
||||||
// x121-dcc-code NumericString,
|
|
||||||
// iso-3166-alpha2-code PrintableString }
|
|
||||||
var CountryName = asn1.define('CountryName', function() {
|
|
||||||
this.choice({
|
|
||||||
x121DccCode: this.numstr(),
|
|
||||||
iso3166Alpha2Code: this.printstr()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.CountryName = CountryName;
|
|
||||||
|
|
||||||
|
|
||||||
// AdministrationDomainName ::= CHOICE {
|
|
||||||
// numeric NumericString,
|
|
||||||
// printable PrintableString }
|
|
||||||
var AdministrationDomainName = asn1.define('AdministrationDomainName',
|
|
||||||
function() {
|
|
||||||
this.choice({
|
|
||||||
numeric: this.numstr(),
|
|
||||||
printable: this.printstr()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.AdministrationDomainName = AdministrationDomainName;
|
|
||||||
|
|
||||||
// NetworkAddress ::= X121Address
|
|
||||||
var NetworkAddress = asn1.define('NetworkAddress', function() {
|
|
||||||
this.use(X121Address);
|
|
||||||
});
|
|
||||||
rfc5280.NetworkAddress = NetworkAddress;
|
|
||||||
|
|
||||||
// X121Address ::= NumericString
|
|
||||||
var X121Address = asn1.define('X121Address', function() {
|
|
||||||
this.numstr();
|
|
||||||
});
|
|
||||||
rfc5280.X121Address = X121Address;
|
|
||||||
|
|
||||||
// TerminalIdentifier ::= PrintableString
|
|
||||||
var TerminalIdentifier = asn1.define('TerminalIdentifier', function() {
|
|
||||||
this.printstr();
|
|
||||||
});
|
|
||||||
rfc5280.TerminalIdentifier = TerminalIdentifier;
|
|
||||||
|
|
||||||
// PrivateDomainName ::= CHOICE {
|
|
||||||
// numeric NumericString,
|
|
||||||
// printable PrintableString }
|
|
||||||
var PrivateDomainName = asn1.define('PrivateDomainName', function() {
|
|
||||||
this.choice({
|
|
||||||
numeric: this.numstr(),
|
|
||||||
printable: this.printstr()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.PrivateDomainName = PrivateDomainName;
|
|
||||||
|
|
||||||
// OrganizationName ::= PrintableString
|
|
||||||
var OrganizationName = asn1.define('OrganizationName', function() {
|
|
||||||
this.printstr();
|
|
||||||
});
|
|
||||||
rfc5280.OrganizationName = OrganizationName;
|
|
||||||
|
|
||||||
// NumericUserIdentifier ::= NumericString
|
|
||||||
var NumericUserIdentifier = asn1.define('NumericUserIdentifier', function() {
|
|
||||||
this.numstr();
|
|
||||||
});
|
|
||||||
rfc5280.NumericUserIdentifier = NumericUserIdentifier;
|
|
||||||
|
|
||||||
// PersonalName ::= SET {
|
|
||||||
// surname [0] IMPLICIT PrintableString,
|
|
||||||
// given-name [1] IMPLICIT PrintableString OPTIONAL,
|
|
||||||
// initials [2] IMPLICIT PrintableString OPTIONAL,
|
|
||||||
// generation-qualifier [3] IMPLICIT PrintableString OPTIONAL }
|
|
||||||
var PersonalName = asn1.define('PersonalName', function() {
|
|
||||||
this.set().obj(
|
|
||||||
this.key('surname').implicit(0).printstr(),
|
|
||||||
this.key('givenName').implicit(1).printstr(),
|
|
||||||
this.key('initials').implicit(2).printstr(),
|
|
||||||
this.key('generationQualifier').implicit(3).printstr()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.PersonalName = PersonalName;
|
|
||||||
|
|
||||||
// OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
|
|
||||||
// OF OrganizationalUnitName
|
|
||||||
var OrganizationalUnitNames = asn1.define('OrganizationalUnitNames',
|
|
||||||
function() {
|
|
||||||
this.seqof(OrganizationalUnitName);
|
|
||||||
});
|
|
||||||
rfc5280.OrganizationalUnitNames = OrganizationalUnitNames;
|
|
||||||
|
|
||||||
// OrganizationalUnitName ::= PrintableString (SIZE
|
|
||||||
// (1..ub-organizational-unit-name-length))
|
|
||||||
var OrganizationalUnitName = asn1.define('OrganizationalUnitName', function() {
|
|
||||||
this.printstr();
|
|
||||||
});
|
|
||||||
rfc5280.OrganizationalUnitName = OrganizationalUnitName;
|
|
||||||
|
|
||||||
// uiltInDomainDefinedAttributes ::= SEQUENCE SIZE
|
|
||||||
// (1..ub-domain-defined-attributes)
|
|
||||||
// OF BuiltInDomainDefinedAttribute
|
|
||||||
var BuiltInDomainDefinedAttributes = asn1.define(
|
|
||||||
'BuiltInDomainDefinedAttributes', function() {
|
|
||||||
this.seqof(BuiltInDomainDefinedAttribute);
|
|
||||||
});
|
|
||||||
rfc5280.BuiltInDomainDefinedAttributes = BuiltInDomainDefinedAttributes;
|
|
||||||
|
|
||||||
// BuiltInDomainDefinedAttribute ::= SEQUENCE {
|
|
||||||
// type PrintableString (SIZE (1..ub-domain-defined-attribute-type-length)),
|
|
||||||
// value PrintableString (SIZE (1..ub-domain-defined-attribute-value-length))
|
|
||||||
//}
|
|
||||||
var BuiltInDomainDefinedAttribute = asn1.define('BuiltInDomainDefinedAttribute',
|
|
||||||
function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('type').printstr(),
|
|
||||||
this.key('value').printstr()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.BuiltInDomainDefinedAttribute = BuiltInDomainDefinedAttribute;
|
|
||||||
|
|
||||||
|
|
||||||
// ExtensionAttributes ::= SET SIZE (1..ub-extension-attributes) OF
|
|
||||||
// ExtensionAttribute
|
|
||||||
var ExtensionAttributes = asn1.define('ExtensionAttributes', function() {
|
|
||||||
this.seqof(ExtensionAttribute);
|
|
||||||
});
|
|
||||||
rfc5280.ExtensionAttributes = ExtensionAttributes;
|
|
||||||
|
|
||||||
// ExtensionAttribute ::= SEQUENCE {
|
|
||||||
// extension-attribute-type [0] IMPLICIT INTEGER,
|
|
||||||
// extension-attribute-value [1] ANY DEFINED BY extension-attribute-type }
|
|
||||||
var ExtensionAttribute = asn1.define('ExtensionAttribute', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('extensionAttributeType').implicit(0).int(),
|
|
||||||
this.key('extensionAttributeValue').any().explicit(1).int()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.ExtensionAttribute = ExtensionAttribute;
|
|
||||||
|
|
||||||
// SubjectKeyIdentifier ::= KeyIdentifier
|
|
||||||
var SubjectKeyIdentifier = asn1.define('SubjectKeyIdentifier', function() {
|
|
||||||
this.use(KeyIdentifier);
|
|
||||||
});
|
|
||||||
rfc5280.SubjectKeyIdentifier = SubjectKeyIdentifier;
|
|
||||||
|
|
||||||
// KeyUsage ::= BIT STRING {
|
|
||||||
// digitalSignature (0),
|
|
||||||
// nonRepudiation (1), -- recent editions of X.509 have
|
|
||||||
// -- renamed this bit to contentCommitment
|
|
||||||
// keyEncipherment (2),
|
|
||||||
// dataEncipherment (3),
|
|
||||||
// keyAgreement (4),
|
|
||||||
// keyCertSign (5),
|
|
||||||
// cRLSign (6),
|
|
||||||
// encipherOnly (7),
|
|
||||||
// decipherOnly (8) }
|
|
||||||
var KeyUsage = asn1.define('KeyUsage', function() {
|
|
||||||
this.bitstr();
|
|
||||||
});
|
|
||||||
rfc5280.KeyUsage = KeyUsage;
|
|
||||||
|
|
||||||
// CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
|
|
||||||
var CertificatePolicies = asn1.define('CertificatePolicies', function() {
|
|
||||||
this.seqof(PolicyInformation);
|
|
||||||
});
|
|
||||||
rfc5280.CertificatePolicies = CertificatePolicies;
|
|
||||||
|
|
||||||
// PolicyInformation ::= SEQUENCE {
|
|
||||||
// policyIdentifier CertPolicyId,
|
|
||||||
// policyQualifiers SEQUENCE SIZE (1..MAX) OF PolicyQualifierInfo
|
|
||||||
// OPTIONAL }
|
|
||||||
var PolicyInformation = asn1.define('PolicyInformation', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('policyIdentifier').use(CertPolicyId),
|
|
||||||
this.key('policyQualifiers').optional().use(PolicyQualifiers)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.PolicyInformation = PolicyInformation;
|
|
||||||
|
|
||||||
// CertPolicyId ::= OBJECT IDENTIFIER
|
|
||||||
var CertPolicyId = asn1.define('CertPolicyId', function() {
|
|
||||||
this.objid();
|
|
||||||
});
|
|
||||||
rfc5280.CertPolicyId = CertPolicyId;
|
|
||||||
|
|
||||||
var PolicyQualifiers = asn1.define('PolicyQualifiers', function() {
|
|
||||||
this.seqof(PolicyQualifierInfo);
|
|
||||||
});
|
|
||||||
rfc5280.PolicyQualifiers = PolicyQualifiers;
|
|
||||||
|
|
||||||
// PolicyQualifierInfo ::= SEQUENCE {
|
|
||||||
// policyQualifierId PolicyQualifierId,
|
|
||||||
// qualifier ANY DEFINED BY policyQualifierId }
|
|
||||||
var PolicyQualifierInfo = asn1.define('PolicyQualifierInfo', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('policyQualifierId').use(PolicyQualifierId),
|
|
||||||
this.key('qualifier').any()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.PolicyQualifierInfo = PolicyQualifierInfo;
|
|
||||||
|
|
||||||
// PolicyQualifierId ::= OBJECT IDENTIFIER
|
|
||||||
var PolicyQualifierId = asn1.define('PolicyQualifierId', function() {
|
|
||||||
this.objid();
|
|
||||||
});
|
|
||||||
rfc5280.PolicyQualifierId = PolicyQualifierId;
|
|
||||||
|
|
||||||
// PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
|
|
||||||
// issuerDomainPolicy CertPolicyId,
|
|
||||||
// subjectDomainPolicy CertPolicyId }
|
|
||||||
var PolicyMappings = asn1.define('PolicyMappings', function() {
|
|
||||||
this.seqof(PolicyMapping);
|
|
||||||
});
|
|
||||||
rfc5280.PolicyMappings = PolicyMappings;
|
|
||||||
|
|
||||||
var PolicyMapping = asn1.define('PolicyMapping', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('issuerDomainPolicy').use(CertPolicyId),
|
|
||||||
this.key('subjectDomainPolicy').use(CertPolicyId)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.PolicyMapping = PolicyMapping;
|
|
||||||
|
|
||||||
// SubjectAltName ::= GeneralNames
|
|
||||||
var SubjectAlternativeName = asn1.define('SubjectAlternativeName', function() {
|
|
||||||
this.use(GeneralNames);
|
|
||||||
});
|
|
||||||
rfc5280.SubjectAlternativeName = SubjectAlternativeName;
|
|
||||||
|
|
||||||
// IssuerAltName ::= GeneralNames
|
|
||||||
var IssuerAlternativeName = asn1.define('IssuerAlternativeName', function() {
|
|
||||||
this.use(GeneralNames);
|
|
||||||
});
|
|
||||||
rfc5280.IssuerAlternativeName = IssuerAlternativeName;
|
|
||||||
|
|
||||||
// SubjectDirectoryAttributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
|
|
||||||
var SubjectDirectoryAttributes = asn1.define('SubjectDirectoryAttributes',
|
|
||||||
function() {
|
|
||||||
this.seqof(Attribute);
|
|
||||||
});
|
|
||||||
rfc5280.SubjectDirectoryAttributes = SubjectDirectoryAttributes;
|
|
||||||
|
|
||||||
// BasicConstraints ::= SEQUENCE {
|
|
||||||
// cA BOOLEAN DEFAULT FALSE,
|
|
||||||
// pathLenConstraint INTEGER (0..MAX) OPTIONAL }
|
|
||||||
var BasicConstraints = asn1.define('BasicConstraints', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('cA').bool().def(false),
|
|
||||||
this.key('pathLenConstraint').optional().int()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.BasicConstraints = BasicConstraints;
|
|
||||||
|
|
||||||
// NameConstraints ::= SEQUENCE {
|
|
||||||
// permittedSubtrees [0] GeneralSubtrees OPTIONAL,
|
|
||||||
// excludedSubtrees [1] GeneralSubtrees OPTIONAL }
|
|
||||||
var NameConstraints = asn1.define('NameConstraints', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('permittedSubtrees').implicit(0).optional().use(GeneralSubtrees),
|
|
||||||
this.key('excludedSubtrees').implicit(1).optional().use(GeneralSubtrees)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.NameConstraints = NameConstraints;
|
|
||||||
|
|
||||||
// GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
|
|
||||||
var GeneralSubtrees = asn1.define('GeneralSubtrees', function() {
|
|
||||||
this.seqof(GeneralSubtree);
|
|
||||||
});
|
|
||||||
rfc5280.GeneralSubtrees = GeneralSubtrees;
|
|
||||||
|
|
||||||
// GeneralSubtree ::= SEQUENCE {
|
|
||||||
// base GeneralName,
|
|
||||||
// minimum [0] BaseDistance DEFAULT 0,
|
|
||||||
// maximum [1] BaseDistance OPTIONAL }
|
|
||||||
var GeneralSubtree = asn1.define('GeneralSubtree', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('base').use(GeneralName),
|
|
||||||
this.key('minimum').implicit(0).def(0).use(BaseDistance),
|
|
||||||
this.key('maximum').implicit(0).optional().use(BaseDistance)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.GeneralSubtree = GeneralSubtree;
|
|
||||||
|
|
||||||
// BaseDistance ::= INTEGER
|
|
||||||
var BaseDistance = asn1.define('BaseDistance', function() {
|
|
||||||
this.int();
|
|
||||||
});
|
|
||||||
rfc5280.BaseDistance = BaseDistance;
|
|
||||||
|
|
||||||
// PolicyConstraints ::= SEQUENCE {
|
|
||||||
// requireExplicitPolicy [0] SkipCerts OPTIONAL,
|
|
||||||
// inhibitPolicyMapping [1] SkipCerts OPTIONAL }
|
|
||||||
var PolicyConstraints = asn1.define('PolicyConstraints', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('requireExplicitPolicy').implicit(0).optional().use(SkipCerts),
|
|
||||||
this.key('inhibitPolicyMapping').implicit(1).optional().use(SkipCerts)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.PolicyConstraints = PolicyConstraints;
|
|
||||||
|
|
||||||
// SkipCerts ::= INTEGER
|
|
||||||
var SkipCerts = asn1.define('SkipCerts', function() {
|
|
||||||
this.int();
|
|
||||||
});
|
|
||||||
rfc5280.SkipCerts = SkipCerts;
|
|
||||||
|
|
||||||
// ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
|
|
||||||
var ExtendedKeyUsage = asn1.define('ExtendedKeyUsage', function() {
|
|
||||||
this.seqof(KeyPurposeId);
|
|
||||||
});
|
|
||||||
rfc5280.ExtendedKeyUsage = ExtendedKeyUsage;
|
|
||||||
|
|
||||||
// KeyPurposeId ::= OBJECT IDENTIFIER
|
|
||||||
var KeyPurposeId = asn1.define('KeyPurposeId', function() {
|
|
||||||
this.objid();
|
|
||||||
});
|
|
||||||
rfc5280.KeyPurposeId = KeyPurposeId;
|
|
||||||
|
|
||||||
// RLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
|
|
||||||
var CRLDistributionPoints = asn1.define('CRLDistributionPoints', function() {
|
|
||||||
this.seqof(DistributionPoint);
|
|
||||||
});
|
|
||||||
rfc5280.CRLDistributionPoints = CRLDistributionPoints;
|
|
||||||
|
|
||||||
// DistributionPoint ::= SEQUENCE {
|
|
||||||
// distributionPoint [0] DistributionPointName OPTIONAL,
|
|
||||||
// reasons [1] ReasonFlags OPTIONAL,
|
|
||||||
// cRLIssuer [2] GeneralNames OPTIONAL }
|
|
||||||
var DistributionPoint = asn1.define('DistributionPoint', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('distributionPoint').optional().explicit(0)
|
|
||||||
.use(DistributionPointName),
|
|
||||||
this.key('reasons').optional().implicit(1).use(ReasonFlags),
|
|
||||||
this.key('cRLIssuer').optional().implicit(2).use(GeneralNames)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.DistributionPoint = DistributionPoint;
|
|
||||||
|
|
||||||
// DistributionPointName ::= CHOICE {
|
|
||||||
// fullName [0] GeneralNames,
|
|
||||||
// nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
|
|
||||||
var DistributionPointName = asn1.define('DistributionPointName', function() {
|
|
||||||
this.choice({
|
|
||||||
fullName: this.implicit(0).use(GeneralNames),
|
|
||||||
nameRelativeToCRLIssuer: this.implicit(1).use(RelativeDistinguishedName)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.DistributionPointName = DistributionPointName;
|
|
||||||
|
|
||||||
// ReasonFlags ::= BIT STRING {
|
|
||||||
// unused (0),
|
|
||||||
// keyCompromise (1),
|
|
||||||
// cACompromise (2),
|
|
||||||
// affiliationChanged (3),
|
|
||||||
// superseded (4),
|
|
||||||
// cessationOfOperation (5),
|
|
||||||
// certificateHold (6),
|
|
||||||
// privilegeWithdrawn (7),
|
|
||||||
// aACompromise (8) }
|
|
||||||
var ReasonFlags = asn1.define('ReasonFlags', function() {
|
|
||||||
this.bitstr();
|
|
||||||
});
|
|
||||||
rfc5280.ReasonFlags = ReasonFlags;
|
|
||||||
|
|
||||||
// InhibitAnyPolicy ::= SkipCerts
|
|
||||||
var InhibitAnyPolicy = asn1.define('InhibitAnyPolicy', function() {
|
|
||||||
this.use(SkipCerts);
|
|
||||||
});
|
|
||||||
rfc5280.InhibitAnyPolicy = InhibitAnyPolicy;
|
|
||||||
|
|
||||||
// FreshestCRL ::= CRLDistributionPoints
|
|
||||||
var FreshestCRL = asn1.define('FreshestCRL', function() {
|
|
||||||
this.use(CRLDistributionPoints);
|
|
||||||
});
|
|
||||||
rfc5280.FreshestCRL = FreshestCRL;
|
|
||||||
|
|
||||||
// AuthorityInfoAccessSyntax ::=
|
|
||||||
// SEQUENCE SIZE (1..MAX) OF AccessDescription
|
|
||||||
var AuthorityInfoAccessSyntax = asn1.define('AuthorityInfoAccessSyntax',
|
|
||||||
function() {
|
|
||||||
this.seqof(AccessDescription);
|
|
||||||
});
|
|
||||||
rfc5280.AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax;
|
|
||||||
|
|
||||||
// AccessDescription ::= SEQUENCE {
|
|
||||||
// accessMethod OBJECT IDENTIFIER,
|
|
||||||
// accessLocation GeneralName }
|
|
||||||
var AccessDescription = asn1.define('AccessDescription', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('accessMethod').objid(),
|
|
||||||
this.key('accessLocation').use(GeneralName)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.AccessDescription = AccessDescription;
|
|
||||||
|
|
||||||
// SubjectInfoAccessSyntax ::=
|
|
||||||
// SEQUENCE SIZE (1..MAX) OF AccessDescription
|
|
||||||
var SubjectInformationAccess = asn1.define('SubjectInformationAccess',
|
|
||||||
function() {
|
|
||||||
this.seqof(AccessDescription);
|
|
||||||
});
|
|
||||||
rfc5280.SubjectInformationAccess = SubjectInformationAccess;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CRL Extensions
|
|
||||||
*/
|
|
||||||
|
|
||||||
// CRLNumber ::= INTEGER
|
|
||||||
var CRLNumber = asn1.define('CRLNumber', function() {
|
|
||||||
this.int();
|
|
||||||
});
|
|
||||||
rfc5280.CRLNumber = CRLNumber;
|
|
||||||
|
|
||||||
var DeltaCRLIndicator = asn1.define('DeltaCRLIndicator', function() {
|
|
||||||
this.use(CRLNumber);
|
|
||||||
});
|
|
||||||
rfc5280.DeltaCRLIndicator = DeltaCRLIndicator;
|
|
||||||
|
|
||||||
// IssuingDistributionPoint ::= SEQUENCE {
|
|
||||||
// distributionPoint [0] DistributionPointName OPTIONAL,
|
|
||||||
// onlyContainsUserCerts [1] BOOLEAN DEFAULT FALSE,
|
|
||||||
// onlyContainsCACerts [2] BOOLEAN DEFAULT FALSE,
|
|
||||||
// onlySomeReasons [3] ReasonFlags OPTIONAL,
|
|
||||||
// indirectCRL [4] BOOLEAN DEFAULT FALSE,
|
|
||||||
// onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
|
|
||||||
var IssuingDistributionPoint = asn1.define('IssuingDistributionPoint',
|
|
||||||
function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('distributionPoint').explicit(0).optional()
|
|
||||||
.use(DistributionPointName),
|
|
||||||
this.key('onlyContainsUserCerts').implicit(1).def(false).bool(),
|
|
||||||
this.key('onlyContainsCACerts').implicit(2).def(false).bool(),
|
|
||||||
this.key('onlySomeReasons').implicit(3).optional().use(ReasonFlags),
|
|
||||||
this.key('indirectCRL').implicit(4).def(false).bool(),
|
|
||||||
this.key('onlyContainsAttributeCerts').implicit(5).def(false).bool()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
rfc5280.IssuingDistributionPoint = IssuingDistributionPoint;
|
|
||||||
|
|
||||||
// CRLReason ::= ENUMERATED {
|
|
||||||
// unspecified (0),
|
|
||||||
// keyCompromise (1),
|
|
||||||
// cACompromise (2),
|
|
||||||
// affiliationChanged (3),
|
|
||||||
// superseded (4),
|
|
||||||
// cessationOfOperation (5),
|
|
||||||
// certificateHold (6),
|
|
||||||
// -- value 7 is not used
|
|
||||||
// removeFromCRL (8),
|
|
||||||
// privilegeWithdrawn (9),
|
|
||||||
// aACompromise (10) }
|
|
||||||
var ReasonCode = asn1.define('ReasonCode', function() {
|
|
||||||
this.enum({
|
|
||||||
0: 'unspecified',
|
|
||||||
1: 'keyCompromise',
|
|
||||||
2: 'cACompromise',
|
|
||||||
3: 'affiliationChanged',
|
|
||||||
4: 'superseded',
|
|
||||||
5: 'cessationOfOperation',
|
|
||||||
6: 'certificateHold',
|
|
||||||
8: 'removeFromCRL',
|
|
||||||
9: 'privilegeWithdrawn',
|
|
||||||
10: 'aACompromise'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rfc5280.ReasonCode = ReasonCode;
|
|
||||||
|
|
||||||
// InvalidityDate ::= GeneralizedTime
|
|
||||||
var InvalidityDate = asn1.define('InvalidityDate', function() {
|
|
||||||
this.gentime();
|
|
||||||
});
|
|
||||||
rfc5280.InvalidityDate = InvalidityDate;
|
|
||||||
|
|
||||||
// CertificateIssuer ::= GeneralNames
|
|
||||||
var CertificateIssuer = asn1.define('CertificateIssuer', function() {
|
|
||||||
this.use(GeneralNames);
|
|
||||||
});
|
|
||||||
rfc5280.CertificateIssuer = CertificateIssuer;
|
|
||||||
|
|
||||||
// OID label to extension model mapping
|
|
||||||
var x509Extensions = {
|
|
||||||
subjectDirectoryAttributes: SubjectDirectoryAttributes,
|
|
||||||
subjectKeyIdentifier: SubjectKeyIdentifier,
|
|
||||||
keyUsage: KeyUsage,
|
|
||||||
subjectAlternativeName: SubjectAlternativeName,
|
|
||||||
issuerAlternativeName: IssuerAlternativeName,
|
|
||||||
basicConstraints: BasicConstraints,
|
|
||||||
cRLNumber: CRLNumber,
|
|
||||||
reasonCode: ReasonCode,
|
|
||||||
invalidityDate: InvalidityDate,
|
|
||||||
deltaCRLIndicator: DeltaCRLIndicator,
|
|
||||||
issuingDistributionPoint: IssuingDistributionPoint,
|
|
||||||
certificateIssuer: CertificateIssuer,
|
|
||||||
nameConstraints: NameConstraints,
|
|
||||||
cRLDistributionPoints: CRLDistributionPoints,
|
|
||||||
certificatePolicies: CertificatePolicies,
|
|
||||||
policyMappings: PolicyMappings,
|
|
||||||
authorityKeyIdentifier: AuthorityKeyIdentifier,
|
|
||||||
policyConstraints: PolicyConstraints,
|
|
||||||
extendedKeyUsage: ExtendedKeyUsage,
|
|
||||||
freshestCRL: FreshestCRL,
|
|
||||||
inhibitAnyPolicy: InhibitAnyPolicy,
|
|
||||||
authorityInformationAccess: AuthorityInfoAccessSyntax,
|
|
||||||
subjectInformationAccess: SubjectInformationAccess
|
|
||||||
};
|
|
58
node_modules/asn1.js-rfc5280/package.json
generated
vendored
58
node_modules/asn1.js-rfc5280/package.json
generated
vendored
|
@ -1,58 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "asn1.js-rfc5280@^2.0.0",
|
|
||||||
"_id": "asn1.js-rfc5280@2.0.1",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-1e2ypnvTbYD/GdxWK77tdLBahvo1fZUHlQJqAVUuZWdYj0rdjGcf2CWYUtbsyRYpYUMwMWLZFUtLxog8ZXTrcg==",
|
|
||||||
"_location": "/asn1.js-rfc5280",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "asn1.js-rfc5280@^2.0.0",
|
|
||||||
"name": "asn1.js-rfc5280",
|
|
||||||
"escapedName": "asn1.js-rfc5280",
|
|
||||||
"rawSpec": "^2.0.0",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^2.0.0"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/asn1.js-rfc2560",
|
|
||||||
"/ocsp"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/asn1.js-rfc5280/-/asn1.js-rfc5280-2.0.1.tgz",
|
|
||||||
"_shasum": "072f3dfc03f86d1faae7485c6197584ba2bb5ddc",
|
|
||||||
"_spec": "asn1.js-rfc5280@^2.0.0",
|
|
||||||
"_where": "/home/ubuntu/OCSP/node_modules/ocsp",
|
|
||||||
"author": {
|
|
||||||
"name": "Felix Hanley"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/indutny/asn1.js/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
|
||||||
"asn1.js": "^4.5.0"
|
|
||||||
},
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "RFC5280 extension structures for asn1.js",
|
|
||||||
"devDependencies": {
|
|
||||||
"mocha": "^4.0.1"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/indutny/asn1.js",
|
|
||||||
"keywords": [
|
|
||||||
"asn1",
|
|
||||||
"rfc5280",
|
|
||||||
"der"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "asn1.js-rfc5280",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+ssh://git@github.com/indutny/asn1.js.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test": "mocha --reporter=spec test/*-test.js"
|
|
||||||
},
|
|
||||||
"version": "2.0.1"
|
|
||||||
}
|
|
100
node_modules/asn1.js/README.md
generated
vendored
100
node_modules/asn1.js/README.md
generated
vendored
|
@ -1,100 +0,0 @@
|
||||||
# ASN1.js
|
|
||||||
|
|
||||||
ASN.1 DER Encoder/Decoder and DSL.
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
Define model:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var asn = require('asn1.js');
|
|
||||||
|
|
||||||
var Human = asn.define('Human', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('firstName').octstr(),
|
|
||||||
this.key('lastName').octstr(),
|
|
||||||
this.key('age').int(),
|
|
||||||
this.key('gender').enum({ 0: 'male', 1: 'female' }),
|
|
||||||
this.key('bio').seqof(Bio)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
var Bio = asn.define('Bio', function() {
|
|
||||||
this.seq().obj(
|
|
||||||
this.key('time').gentime(),
|
|
||||||
this.key('description').octstr()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
Encode data:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var output = Human.encode({
|
|
||||||
firstName: 'Thomas',
|
|
||||||
lastName: 'Anderson',
|
|
||||||
age: 28,
|
|
||||||
gender: 'male',
|
|
||||||
bio: [
|
|
||||||
{
|
|
||||||
time: +new Date('31 March 1999'),
|
|
||||||
description: 'freedom of mind'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}, 'der');
|
|
||||||
```
|
|
||||||
|
|
||||||
Decode data:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var human = Human.decode(output, 'der');
|
|
||||||
console.log(human);
|
|
||||||
/*
|
|
||||||
{ firstName: <Buffer 54 68 6f 6d 61 73>,
|
|
||||||
lastName: <Buffer 41 6e 64 65 72 73 6f 6e>,
|
|
||||||
age: 28,
|
|
||||||
gender: 'male',
|
|
||||||
bio:
|
|
||||||
[ { time: 922820400000,
|
|
||||||
description: <Buffer 66 72 65 65 64 6f 6d 20 6f 66 20 6d 69 6e 64> } ] }
|
|
||||||
*/
|
|
||||||
```
|
|
||||||
|
|
||||||
### Partial decode
|
|
||||||
|
|
||||||
Its possible to parse data without stopping on first error. In order to do it,
|
|
||||||
you should call:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var human = Human.decode(output, 'der', { partial: true });
|
|
||||||
console.log(human);
|
|
||||||
/*
|
|
||||||
{ result: { ... },
|
|
||||||
errors: [ ... ] }
|
|
||||||
*/
|
|
||||||
```
|
|
||||||
|
|
||||||
#### LICENSE
|
|
||||||
|
|
||||||
This software is licensed under the MIT License.
|
|
||||||
|
|
||||||
Copyright Fedor Indutny, 2013.
|
|
||||||
|
|
||||||
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.
|
|
9
node_modules/asn1.js/lib/asn1.js
generated
vendored
9
node_modules/asn1.js/lib/asn1.js
generated
vendored
|
@ -1,9 +0,0 @@
|
||||||
var asn1 = exports;
|
|
||||||
|
|
||||||
asn1.bignum = require('bn.js');
|
|
||||||
|
|
||||||
asn1.define = require('./asn1/api').define;
|
|
||||||
asn1.base = require('./asn1/base');
|
|
||||||
asn1.constants = require('./asn1/constants');
|
|
||||||
asn1.decoders = require('./asn1/decoders');
|
|
||||||
asn1.encoders = require('./asn1/encoders');
|
|
61
node_modules/asn1.js/lib/asn1/api.js
generated
vendored
61
node_modules/asn1.js/lib/asn1/api.js
generated
vendored
|
@ -1,61 +0,0 @@
|
||||||
var asn1 = require('../asn1');
|
|
||||||
var inherits = require('inherits');
|
|
||||||
|
|
||||||
var api = exports;
|
|
||||||
|
|
||||||
api.define = function define(name, body) {
|
|
||||||
return new Entity(name, body);
|
|
||||||
};
|
|
||||||
|
|
||||||
function Entity(name, body) {
|
|
||||||
this.name = name;
|
|
||||||
this.body = body;
|
|
||||||
|
|
||||||
this.decoders = {};
|
|
||||||
this.encoders = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
Entity.prototype._createNamed = function createNamed(base) {
|
|
||||||
var named;
|
|
||||||
try {
|
|
||||||
named = require('vm').runInThisContext(
|
|
||||||
'(function ' + this.name + '(entity) {\n' +
|
|
||||||
' this._initNamed(entity);\n' +
|
|
||||||
'})'
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
named = function (entity) {
|
|
||||||
this._initNamed(entity);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
inherits(named, base);
|
|
||||||
named.prototype._initNamed = function initnamed(entity) {
|
|
||||||
base.call(this, entity);
|
|
||||||
};
|
|
||||||
|
|
||||||
return new named(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Entity.prototype._getDecoder = function _getDecoder(enc) {
|
|
||||||
enc = enc || 'der';
|
|
||||||
// Lazily create decoder
|
|
||||||
if (!this.decoders.hasOwnProperty(enc))
|
|
||||||
this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
|
|
||||||
return this.decoders[enc];
|
|
||||||
};
|
|
||||||
|
|
||||||
Entity.prototype.decode = function decode(data, enc, options) {
|
|
||||||
return this._getDecoder(enc).decode(data, options);
|
|
||||||
};
|
|
||||||
|
|
||||||
Entity.prototype._getEncoder = function _getEncoder(enc) {
|
|
||||||
enc = enc || 'der';
|
|
||||||
// Lazily create encoder
|
|
||||||
if (!this.encoders.hasOwnProperty(enc))
|
|
||||||
this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
|
|
||||||
return this.encoders[enc];
|
|
||||||
};
|
|
||||||
|
|
||||||
Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
|
|
||||||
return this._getEncoder(enc).encode(data, reporter);
|
|
||||||
};
|
|
116
node_modules/asn1.js/lib/asn1/base/buffer.js
generated
vendored
116
node_modules/asn1.js/lib/asn1/base/buffer.js
generated
vendored
|
@ -1,116 +0,0 @@
|
||||||
var inherits = require('inherits');
|
|
||||||
var Reporter = require('../base').Reporter;
|
|
||||||
var Buffer = require('buffer').Buffer;
|
|
||||||
|
|
||||||
function DecoderBuffer(base, options) {
|
|
||||||
Reporter.call(this, options);
|
|
||||||
if (!Buffer.isBuffer(base)) {
|
|
||||||
this.error('Input not Buffer');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.base = base;
|
|
||||||
this.offset = 0;
|
|
||||||
this.length = base.length;
|
|
||||||
}
|
|
||||||
inherits(DecoderBuffer, Reporter);
|
|
||||||
exports.DecoderBuffer = DecoderBuffer;
|
|
||||||
|
|
||||||
DecoderBuffer.prototype.save = function save() {
|
|
||||||
return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
|
|
||||||
};
|
|
||||||
|
|
||||||
DecoderBuffer.prototype.restore = function restore(save) {
|
|
||||||
// Return skipped data
|
|
||||||
var res = new DecoderBuffer(this.base);
|
|
||||||
res.offset = save.offset;
|
|
||||||
res.length = this.offset;
|
|
||||||
|
|
||||||
this.offset = save.offset;
|
|
||||||
Reporter.prototype.restore.call(this, save.reporter);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
|
|
||||||
DecoderBuffer.prototype.isEmpty = function isEmpty() {
|
|
||||||
return this.offset === this.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
|
|
||||||
if (this.offset + 1 <= this.length)
|
|
||||||
return this.base.readUInt8(this.offset++, true);
|
|
||||||
else
|
|
||||||
return this.error(fail || 'DecoderBuffer overrun');
|
|
||||||
}
|
|
||||||
|
|
||||||
DecoderBuffer.prototype.skip = function skip(bytes, fail) {
|
|
||||||
if (!(this.offset + bytes <= this.length))
|
|
||||||
return this.error(fail || 'DecoderBuffer overrun');
|
|
||||||
|
|
||||||
var res = new DecoderBuffer(this.base);
|
|
||||||
|
|
||||||
// Share reporter state
|
|
||||||
res._reporterState = this._reporterState;
|
|
||||||
|
|
||||||
res.offset = this.offset;
|
|
||||||
res.length = this.offset + bytes;
|
|
||||||
this.offset += bytes;
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
DecoderBuffer.prototype.raw = function raw(save) {
|
|
||||||
return this.base.slice(save ? save.offset : this.offset, this.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
function EncoderBuffer(value, reporter) {
|
|
||||||
if (Array.isArray(value)) {
|
|
||||||
this.length = 0;
|
|
||||||
this.value = value.map(function(item) {
|
|
||||||
if (!(item instanceof EncoderBuffer))
|
|
||||||
item = new EncoderBuffer(item, reporter);
|
|
||||||
this.length += item.length;
|
|
||||||
return item;
|
|
||||||
}, this);
|
|
||||||
} else if (typeof value === 'number') {
|
|
||||||
if (!(0 <= value && value <= 0xff))
|
|
||||||
return reporter.error('non-byte EncoderBuffer value');
|
|
||||||
this.value = value;
|
|
||||||
this.length = 1;
|
|
||||||
} else if (typeof value === 'string') {
|
|
||||||
this.value = value;
|
|
||||||
this.length = Buffer.byteLength(value);
|
|
||||||
} else if (Buffer.isBuffer(value)) {
|
|
||||||
this.value = value;
|
|
||||||
this.length = value.length;
|
|
||||||
} else {
|
|
||||||
return reporter.error('Unsupported type: ' + typeof value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.EncoderBuffer = EncoderBuffer;
|
|
||||||
|
|
||||||
EncoderBuffer.prototype.join = function join(out, offset) {
|
|
||||||
if (!out)
|
|
||||||
out = new Buffer(this.length);
|
|
||||||
if (!offset)
|
|
||||||
offset = 0;
|
|
||||||
|
|
||||||
if (this.length === 0)
|
|
||||||
return out;
|
|
||||||
|
|
||||||
if (Array.isArray(this.value)) {
|
|
||||||
this.value.forEach(function(item) {
|
|
||||||
item.join(out, offset);
|
|
||||||
offset += item.length;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (typeof this.value === 'number')
|
|
||||||
out[offset] = this.value;
|
|
||||||
else if (typeof this.value === 'string')
|
|
||||||
out.write(this.value, offset);
|
|
||||||
else if (Buffer.isBuffer(this.value))
|
|
||||||
this.value.copy(out, offset);
|
|
||||||
offset += this.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
return out;
|
|
||||||
};
|
|
6
node_modules/asn1.js/lib/asn1/base/index.js
generated
vendored
6
node_modules/asn1.js/lib/asn1/base/index.js
generated
vendored
|
@ -1,6 +0,0 @@
|
||||||
var base = exports;
|
|
||||||
|
|
||||||
base.Reporter = require('./reporter').Reporter;
|
|
||||||
base.DecoderBuffer = require('./buffer').DecoderBuffer;
|
|
||||||
base.EncoderBuffer = require('./buffer').EncoderBuffer;
|
|
||||||
base.Node = require('./node');
|
|
634
node_modules/asn1.js/lib/asn1/base/node.js
generated
vendored
634
node_modules/asn1.js/lib/asn1/base/node.js
generated
vendored
|
@ -1,634 +0,0 @@
|
||||||
var Reporter = require('../base').Reporter;
|
|
||||||
var EncoderBuffer = require('../base').EncoderBuffer;
|
|
||||||
var DecoderBuffer = require('../base').DecoderBuffer;
|
|
||||||
var assert = require('minimalistic-assert');
|
|
||||||
|
|
||||||
// Supported tags
|
|
||||||
var tags = [
|
|
||||||
'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
|
|
||||||
'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
|
|
||||||
'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
|
|
||||||
'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
|
|
||||||
];
|
|
||||||
|
|
||||||
// Public methods list
|
|
||||||
var methods = [
|
|
||||||
'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
|
|
||||||
'any', 'contains'
|
|
||||||
].concat(tags);
|
|
||||||
|
|
||||||
// Overrided methods list
|
|
||||||
var overrided = [
|
|
||||||
'_peekTag', '_decodeTag', '_use',
|
|
||||||
'_decodeStr', '_decodeObjid', '_decodeTime',
|
|
||||||
'_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
|
|
||||||
|
|
||||||
'_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
|
|
||||||
'_encodeNull', '_encodeInt', '_encodeBool'
|
|
||||||
];
|
|
||||||
|
|
||||||
function Node(enc, parent) {
|
|
||||||
var state = {};
|
|
||||||
this._baseState = state;
|
|
||||||
|
|
||||||
state.enc = enc;
|
|
||||||
|
|
||||||
state.parent = parent || null;
|
|
||||||
state.children = null;
|
|
||||||
|
|
||||||
// State
|
|
||||||
state.tag = null;
|
|
||||||
state.args = null;
|
|
||||||
state.reverseArgs = null;
|
|
||||||
state.choice = null;
|
|
||||||
state.optional = false;
|
|
||||||
state.any = false;
|
|
||||||
state.obj = false;
|
|
||||||
state.use = null;
|
|
||||||
state.useDecoder = null;
|
|
||||||
state.key = null;
|
|
||||||
state['default'] = null;
|
|
||||||
state.explicit = null;
|
|
||||||
state.implicit = null;
|
|
||||||
state.contains = null;
|
|
||||||
|
|
||||||
// Should create new instance on each method
|
|
||||||
if (!state.parent) {
|
|
||||||
state.children = [];
|
|
||||||
this._wrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
module.exports = Node;
|
|
||||||
|
|
||||||
var stateProps = [
|
|
||||||
'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
|
|
||||||
'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
|
|
||||||
'implicit', 'contains'
|
|
||||||
];
|
|
||||||
|
|
||||||
Node.prototype.clone = function clone() {
|
|
||||||
var state = this._baseState;
|
|
||||||
var cstate = {};
|
|
||||||
stateProps.forEach(function(prop) {
|
|
||||||
cstate[prop] = state[prop];
|
|
||||||
});
|
|
||||||
var res = new this.constructor(cstate.parent);
|
|
||||||
res._baseState = cstate;
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._wrap = function wrap() {
|
|
||||||
var state = this._baseState;
|
|
||||||
methods.forEach(function(method) {
|
|
||||||
this[method] = function _wrappedMethod() {
|
|
||||||
var clone = new this.constructor(this);
|
|
||||||
state.children.push(clone);
|
|
||||||
return clone[method].apply(clone, arguments);
|
|
||||||
};
|
|
||||||
}, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._init = function init(body) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state.parent === null);
|
|
||||||
body.call(this);
|
|
||||||
|
|
||||||
// Filter children
|
|
||||||
state.children = state.children.filter(function(child) {
|
|
||||||
return child._baseState.parent === this;
|
|
||||||
}, this);
|
|
||||||
assert.equal(state.children.length, 1, 'Root node can have only one child');
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._useArgs = function useArgs(args) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
// Filter children and args
|
|
||||||
var children = args.filter(function(arg) {
|
|
||||||
return arg instanceof this.constructor;
|
|
||||||
}, this);
|
|
||||||
args = args.filter(function(arg) {
|
|
||||||
return !(arg instanceof this.constructor);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
if (children.length !== 0) {
|
|
||||||
assert(state.children === null);
|
|
||||||
state.children = children;
|
|
||||||
|
|
||||||
// Replace parent to maintain backward link
|
|
||||||
children.forEach(function(child) {
|
|
||||||
child._baseState.parent = this;
|
|
||||||
}, this);
|
|
||||||
}
|
|
||||||
if (args.length !== 0) {
|
|
||||||
assert(state.args === null);
|
|
||||||
state.args = args;
|
|
||||||
state.reverseArgs = args.map(function(arg) {
|
|
||||||
if (typeof arg !== 'object' || arg.constructor !== Object)
|
|
||||||
return arg;
|
|
||||||
|
|
||||||
var res = {};
|
|
||||||
Object.keys(arg).forEach(function(key) {
|
|
||||||
if (key == (key | 0))
|
|
||||||
key |= 0;
|
|
||||||
var value = arg[key];
|
|
||||||
res[value] = key;
|
|
||||||
});
|
|
||||||
return res;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Overrided methods
|
|
||||||
//
|
|
||||||
|
|
||||||
overrided.forEach(function(method) {
|
|
||||||
Node.prototype[method] = function _overrided() {
|
|
||||||
var state = this._baseState;
|
|
||||||
throw new Error(method + ' not implemented for encoding: ' + state.enc);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
//
|
|
||||||
// Public methods
|
|
||||||
//
|
|
||||||
|
|
||||||
tags.forEach(function(tag) {
|
|
||||||
Node.prototype[tag] = function _tagMethod() {
|
|
||||||
var state = this._baseState;
|
|
||||||
var args = Array.prototype.slice.call(arguments);
|
|
||||||
|
|
||||||
assert(state.tag === null);
|
|
||||||
state.tag = tag;
|
|
||||||
|
|
||||||
this._useArgs(args);
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
Node.prototype.use = function use(item) {
|
|
||||||
assert(item);
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state.use === null);
|
|
||||||
state.use = item;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.optional = function optional() {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
state.optional = true;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.def = function def(val) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state['default'] === null);
|
|
||||||
state['default'] = val;
|
|
||||||
state.optional = true;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.explicit = function explicit(num) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state.explicit === null && state.implicit === null);
|
|
||||||
state.explicit = num;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.implicit = function implicit(num) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state.explicit === null && state.implicit === null);
|
|
||||||
state.implicit = num;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.obj = function obj() {
|
|
||||||
var state = this._baseState;
|
|
||||||
var args = Array.prototype.slice.call(arguments);
|
|
||||||
|
|
||||||
state.obj = true;
|
|
||||||
|
|
||||||
if (args.length !== 0)
|
|
||||||
this._useArgs(args);
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.key = function key(newKey) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state.key === null);
|
|
||||||
state.key = newKey;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.any = function any() {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
state.any = true;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.choice = function choice(obj) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state.choice === null);
|
|
||||||
state.choice = obj;
|
|
||||||
this._useArgs(Object.keys(obj).map(function(key) {
|
|
||||||
return obj[key];
|
|
||||||
}));
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype.contains = function contains(item) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
assert(state.use === null);
|
|
||||||
state.contains = item;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Decoding
|
|
||||||
//
|
|
||||||
|
|
||||||
Node.prototype._decode = function decode(input, options) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
// Decode root node
|
|
||||||
if (state.parent === null)
|
|
||||||
return input.wrapResult(state.children[0]._decode(input, options));
|
|
||||||
|
|
||||||
var result = state['default'];
|
|
||||||
var present = true;
|
|
||||||
|
|
||||||
var prevKey = null;
|
|
||||||
if (state.key !== null)
|
|
||||||
prevKey = input.enterKey(state.key);
|
|
||||||
|
|
||||||
// Check if tag is there
|
|
||||||
if (state.optional) {
|
|
||||||
var tag = null;
|
|
||||||
if (state.explicit !== null)
|
|
||||||
tag = state.explicit;
|
|
||||||
else if (state.implicit !== null)
|
|
||||||
tag = state.implicit;
|
|
||||||
else if (state.tag !== null)
|
|
||||||
tag = state.tag;
|
|
||||||
|
|
||||||
if (tag === null && !state.any) {
|
|
||||||
// Trial and Error
|
|
||||||
var save = input.save();
|
|
||||||
try {
|
|
||||||
if (state.choice === null)
|
|
||||||
this._decodeGeneric(state.tag, input, options);
|
|
||||||
else
|
|
||||||
this._decodeChoice(input, options);
|
|
||||||
present = true;
|
|
||||||
} catch (e) {
|
|
||||||
present = false;
|
|
||||||
}
|
|
||||||
input.restore(save);
|
|
||||||
} else {
|
|
||||||
present = this._peekTag(input, tag, state.any);
|
|
||||||
|
|
||||||
if (input.isError(present))
|
|
||||||
return present;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Push object on stack
|
|
||||||
var prevObj;
|
|
||||||
if (state.obj && present)
|
|
||||||
prevObj = input.enterObject();
|
|
||||||
|
|
||||||
if (present) {
|
|
||||||
// Unwrap explicit values
|
|
||||||
if (state.explicit !== null) {
|
|
||||||
var explicit = this._decodeTag(input, state.explicit);
|
|
||||||
if (input.isError(explicit))
|
|
||||||
return explicit;
|
|
||||||
input = explicit;
|
|
||||||
}
|
|
||||||
|
|
||||||
var start = input.offset;
|
|
||||||
|
|
||||||
// Unwrap implicit and normal values
|
|
||||||
if (state.use === null && state.choice === null) {
|
|
||||||
if (state.any)
|
|
||||||
var save = input.save();
|
|
||||||
var body = this._decodeTag(
|
|
||||||
input,
|
|
||||||
state.implicit !== null ? state.implicit : state.tag,
|
|
||||||
state.any
|
|
||||||
);
|
|
||||||
if (input.isError(body))
|
|
||||||
return body;
|
|
||||||
|
|
||||||
if (state.any)
|
|
||||||
result = input.raw(save);
|
|
||||||
else
|
|
||||||
input = body;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options && options.track && state.tag !== null)
|
|
||||||
options.track(input.path(), start, input.length, 'tagged');
|
|
||||||
|
|
||||||
if (options && options.track && state.tag !== null)
|
|
||||||
options.track(input.path(), input.offset, input.length, 'content');
|
|
||||||
|
|
||||||
// Select proper method for tag
|
|
||||||
if (state.any)
|
|
||||||
result = result;
|
|
||||||
else if (state.choice === null)
|
|
||||||
result = this._decodeGeneric(state.tag, input, options);
|
|
||||||
else
|
|
||||||
result = this._decodeChoice(input, options);
|
|
||||||
|
|
||||||
if (input.isError(result))
|
|
||||||
return result;
|
|
||||||
|
|
||||||
// Decode children
|
|
||||||
if (!state.any && state.choice === null && state.children !== null) {
|
|
||||||
state.children.forEach(function decodeChildren(child) {
|
|
||||||
// NOTE: We are ignoring errors here, to let parser continue with other
|
|
||||||
// parts of encoded data
|
|
||||||
child._decode(input, options);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode contained/encoded by schema, only in bit or octet strings
|
|
||||||
if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
|
|
||||||
var data = new DecoderBuffer(result);
|
|
||||||
result = this._getUse(state.contains, input._reporterState.obj)
|
|
||||||
._decode(data, options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pop object
|
|
||||||
if (state.obj && present)
|
|
||||||
result = input.leaveObject(prevObj);
|
|
||||||
|
|
||||||
// Set key
|
|
||||||
if (state.key !== null && (result !== null || present === true))
|
|
||||||
input.leaveKey(prevKey, state.key, result);
|
|
||||||
else if (prevKey !== null)
|
|
||||||
input.exitKey(prevKey);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
if (tag === 'seq' || tag === 'set')
|
|
||||||
return null;
|
|
||||||
if (tag === 'seqof' || tag === 'setof')
|
|
||||||
return this._decodeList(input, tag, state.args[0], options);
|
|
||||||
else if (/str$/.test(tag))
|
|
||||||
return this._decodeStr(input, tag, options);
|
|
||||||
else if (tag === 'objid' && state.args)
|
|
||||||
return this._decodeObjid(input, state.args[0], state.args[1], options);
|
|
||||||
else if (tag === 'objid')
|
|
||||||
return this._decodeObjid(input, null, null, options);
|
|
||||||
else if (tag === 'gentime' || tag === 'utctime')
|
|
||||||
return this._decodeTime(input, tag, options);
|
|
||||||
else if (tag === 'null_')
|
|
||||||
return this._decodeNull(input, options);
|
|
||||||
else if (tag === 'bool')
|
|
||||||
return this._decodeBool(input, options);
|
|
||||||
else if (tag === 'objDesc')
|
|
||||||
return this._decodeStr(input, tag, options);
|
|
||||||
else if (tag === 'int' || tag === 'enum')
|
|
||||||
return this._decodeInt(input, state.args && state.args[0], options);
|
|
||||||
|
|
||||||
if (state.use !== null) {
|
|
||||||
return this._getUse(state.use, input._reporterState.obj)
|
|
||||||
._decode(input, options);
|
|
||||||
} else {
|
|
||||||
return input.error('unknown tag: ' + tag);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._getUse = function _getUse(entity, obj) {
|
|
||||||
|
|
||||||
var state = this._baseState;
|
|
||||||
// Create altered use decoder if implicit is set
|
|
||||||
state.useDecoder = this._use(entity, obj);
|
|
||||||
assert(state.useDecoder._baseState.parent === null);
|
|
||||||
state.useDecoder = state.useDecoder._baseState.children[0];
|
|
||||||
if (state.implicit !== state.useDecoder._baseState.implicit) {
|
|
||||||
state.useDecoder = state.useDecoder.clone();
|
|
||||||
state.useDecoder._baseState.implicit = state.implicit;
|
|
||||||
}
|
|
||||||
return state.useDecoder;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._decodeChoice = function decodeChoice(input, options) {
|
|
||||||
var state = this._baseState;
|
|
||||||
var result = null;
|
|
||||||
var match = false;
|
|
||||||
|
|
||||||
Object.keys(state.choice).some(function(key) {
|
|
||||||
var save = input.save();
|
|
||||||
var node = state.choice[key];
|
|
||||||
try {
|
|
||||||
var value = node._decode(input, options);
|
|
||||||
if (input.isError(value))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
result = { type: key, value: value };
|
|
||||||
match = true;
|
|
||||||
} catch (e) {
|
|
||||||
input.restore(save);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
if (!match)
|
|
||||||
return input.error('Choice not matched');
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Encoding
|
|
||||||
//
|
|
||||||
|
|
||||||
Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
|
|
||||||
return new EncoderBuffer(data, this.reporter);
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._encode = function encode(data, reporter, parent) {
|
|
||||||
var state = this._baseState;
|
|
||||||
if (state['default'] !== null && state['default'] === data)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var result = this._encodeValue(data, reporter, parent);
|
|
||||||
if (result === undefined)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this._skipDefault(result, reporter, parent))
|
|
||||||
return;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._encodeValue = function encode(data, reporter, parent) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
// Decode root node
|
|
||||||
if (state.parent === null)
|
|
||||||
return state.children[0]._encode(data, reporter || new Reporter());
|
|
||||||
|
|
||||||
var result = null;
|
|
||||||
|
|
||||||
// Set reporter to share it with a child class
|
|
||||||
this.reporter = reporter;
|
|
||||||
|
|
||||||
// Check if data is there
|
|
||||||
if (state.optional && data === undefined) {
|
|
||||||
if (state['default'] !== null)
|
|
||||||
data = state['default']
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode children first
|
|
||||||
var content = null;
|
|
||||||
var primitive = false;
|
|
||||||
if (state.any) {
|
|
||||||
// Anything that was given is translated to buffer
|
|
||||||
result = this._createEncoderBuffer(data);
|
|
||||||
} else if (state.choice) {
|
|
||||||
result = this._encodeChoice(data, reporter);
|
|
||||||
} else if (state.contains) {
|
|
||||||
content = this._getUse(state.contains, parent)._encode(data, reporter);
|
|
||||||
primitive = true;
|
|
||||||
} else if (state.children) {
|
|
||||||
content = state.children.map(function(child) {
|
|
||||||
if (child._baseState.tag === 'null_')
|
|
||||||
return child._encode(null, reporter, data);
|
|
||||||
|
|
||||||
if (child._baseState.key === null)
|
|
||||||
return reporter.error('Child should have a key');
|
|
||||||
var prevKey = reporter.enterKey(child._baseState.key);
|
|
||||||
|
|
||||||
if (typeof data !== 'object')
|
|
||||||
return reporter.error('Child expected, but input is not object');
|
|
||||||
|
|
||||||
var res = child._encode(data[child._baseState.key], reporter, data);
|
|
||||||
reporter.leaveKey(prevKey);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}, this).filter(function(child) {
|
|
||||||
return child;
|
|
||||||
});
|
|
||||||
content = this._createEncoderBuffer(content);
|
|
||||||
} else {
|
|
||||||
if (state.tag === 'seqof' || state.tag === 'setof') {
|
|
||||||
// TODO(indutny): this should be thrown on DSL level
|
|
||||||
if (!(state.args && state.args.length === 1))
|
|
||||||
return reporter.error('Too many args for : ' + state.tag);
|
|
||||||
|
|
||||||
if (!Array.isArray(data))
|
|
||||||
return reporter.error('seqof/setof, but data is not Array');
|
|
||||||
|
|
||||||
var child = this.clone();
|
|
||||||
child._baseState.implicit = null;
|
|
||||||
content = this._createEncoderBuffer(data.map(function(item) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
return this._getUse(state.args[0], data)._encode(item, reporter);
|
|
||||||
}, child));
|
|
||||||
} else if (state.use !== null) {
|
|
||||||
result = this._getUse(state.use, parent)._encode(data, reporter);
|
|
||||||
} else {
|
|
||||||
content = this._encodePrimitive(state.tag, data);
|
|
||||||
primitive = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode data itself
|
|
||||||
var result;
|
|
||||||
if (!state.any && state.choice === null) {
|
|
||||||
var tag = state.implicit !== null ? state.implicit : state.tag;
|
|
||||||
var cls = state.implicit === null ? 'universal' : 'context';
|
|
||||||
|
|
||||||
if (tag === null) {
|
|
||||||
if (state.use === null)
|
|
||||||
reporter.error('Tag could be omitted only for .use()');
|
|
||||||
} else {
|
|
||||||
if (state.use === null)
|
|
||||||
result = this._encodeComposite(tag, primitive, cls, content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wrap in explicit
|
|
||||||
if (state.explicit !== null)
|
|
||||||
result = this._encodeComposite(state.explicit, false, 'context', result);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
var node = state.choice[data.type];
|
|
||||||
if (!node) {
|
|
||||||
assert(
|
|
||||||
false,
|
|
||||||
data.type + ' not found in ' +
|
|
||||||
JSON.stringify(Object.keys(state.choice)));
|
|
||||||
}
|
|
||||||
return node._encode(data.value, reporter);
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
|
|
||||||
var state = this._baseState;
|
|
||||||
|
|
||||||
if (/str$/.test(tag))
|
|
||||||
return this._encodeStr(data, tag);
|
|
||||||
else if (tag === 'objid' && state.args)
|
|
||||||
return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
|
|
||||||
else if (tag === 'objid')
|
|
||||||
return this._encodeObjid(data, null, null);
|
|
||||||
else if (tag === 'gentime' || tag === 'utctime')
|
|
||||||
return this._encodeTime(data, tag);
|
|
||||||
else if (tag === 'null_')
|
|
||||||
return this._encodeNull();
|
|
||||||
else if (tag === 'int' || tag === 'enum')
|
|
||||||
return this._encodeInt(data, state.args && state.reverseArgs[0]);
|
|
||||||
else if (tag === 'bool')
|
|
||||||
return this._encodeBool(data);
|
|
||||||
else if (tag === 'objDesc')
|
|
||||||
return this._encodeStr(data, tag);
|
|
||||||
else
|
|
||||||
throw new Error('Unsupported tag: ' + tag);
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._isNumstr = function isNumstr(str) {
|
|
||||||
return /^[0-9 ]*$/.test(str);
|
|
||||||
};
|
|
||||||
|
|
||||||
Node.prototype._isPrintstr = function isPrintstr(str) {
|
|
||||||
return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
|
|
||||||
};
|
|
121
node_modules/asn1.js/lib/asn1/base/reporter.js
generated
vendored
121
node_modules/asn1.js/lib/asn1/base/reporter.js
generated
vendored
|
@ -1,121 +0,0 @@
|
||||||
var inherits = require('inherits');
|
|
||||||
|
|
||||||
function Reporter(options) {
|
|
||||||
this._reporterState = {
|
|
||||||
obj: null,
|
|
||||||
path: [],
|
|
||||||
options: options || {},
|
|
||||||
errors: []
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Reporter = Reporter;
|
|
||||||
|
|
||||||
Reporter.prototype.isError = function isError(obj) {
|
|
||||||
return obj instanceof ReporterError;
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.save = function save() {
|
|
||||||
var state = this._reporterState;
|
|
||||||
|
|
||||||
return { obj: state.obj, pathLen: state.path.length };
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.restore = function restore(data) {
|
|
||||||
var state = this._reporterState;
|
|
||||||
|
|
||||||
state.obj = data.obj;
|
|
||||||
state.path = state.path.slice(0, data.pathLen);
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.enterKey = function enterKey(key) {
|
|
||||||
return this._reporterState.path.push(key);
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.exitKey = function exitKey(index) {
|
|
||||||
var state = this._reporterState;
|
|
||||||
|
|
||||||
state.path = state.path.slice(0, index - 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
|
|
||||||
var state = this._reporterState;
|
|
||||||
|
|
||||||
this.exitKey(index);
|
|
||||||
if (state.obj !== null)
|
|
||||||
state.obj[key] = value;
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.path = function path() {
|
|
||||||
return this._reporterState.path.join('/');
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.enterObject = function enterObject() {
|
|
||||||
var state = this._reporterState;
|
|
||||||
|
|
||||||
var prev = state.obj;
|
|
||||||
state.obj = {};
|
|
||||||
return prev;
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.leaveObject = function leaveObject(prev) {
|
|
||||||
var state = this._reporterState;
|
|
||||||
|
|
||||||
var now = state.obj;
|
|
||||||
state.obj = prev;
|
|
||||||
return now;
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.error = function error(msg) {
|
|
||||||
var err;
|
|
||||||
var state = this._reporterState;
|
|
||||||
|
|
||||||
var inherited = msg instanceof ReporterError;
|
|
||||||
if (inherited) {
|
|
||||||
err = msg;
|
|
||||||
} else {
|
|
||||||
err = new ReporterError(state.path.map(function(elem) {
|
|
||||||
return '[' + JSON.stringify(elem) + ']';
|
|
||||||
}).join(''), msg.message || msg, msg.stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!state.options.partial)
|
|
||||||
throw err;
|
|
||||||
|
|
||||||
if (!inherited)
|
|
||||||
state.errors.push(err);
|
|
||||||
|
|
||||||
return err;
|
|
||||||
};
|
|
||||||
|
|
||||||
Reporter.prototype.wrapResult = function wrapResult(result) {
|
|
||||||
var state = this._reporterState;
|
|
||||||
if (!state.options.partial)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
return {
|
|
||||||
result: this.isError(result) ? null : result,
|
|
||||||
errors: state.errors
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
function ReporterError(path, msg) {
|
|
||||||
this.path = path;
|
|
||||||
this.rethrow(msg);
|
|
||||||
};
|
|
||||||
inherits(ReporterError, Error);
|
|
||||||
|
|
||||||
ReporterError.prototype.rethrow = function rethrow(msg) {
|
|
||||||
this.message = msg + ' at: ' + (this.path || '(shallow)');
|
|
||||||
if (Error.captureStackTrace)
|
|
||||||
Error.captureStackTrace(this, ReporterError);
|
|
||||||
|
|
||||||
if (!this.stack) {
|
|
||||||
try {
|
|
||||||
// IE only adds stack when thrown
|
|
||||||
throw new Error(this.message);
|
|
||||||
} catch (e) {
|
|
||||||
this.stack = e.stack;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
};
|
|
42
node_modules/asn1.js/lib/asn1/constants/der.js
generated
vendored
42
node_modules/asn1.js/lib/asn1/constants/der.js
generated
vendored
|
@ -1,42 +0,0 @@
|
||||||
var constants = require('../constants');
|
|
||||||
|
|
||||||
exports.tagClass = {
|
|
||||||
0: 'universal',
|
|
||||||
1: 'application',
|
|
||||||
2: 'context',
|
|
||||||
3: 'private'
|
|
||||||
};
|
|
||||||
exports.tagClassByName = constants._reverse(exports.tagClass);
|
|
||||||
|
|
||||||
exports.tag = {
|
|
||||||
0x00: 'end',
|
|
||||||
0x01: 'bool',
|
|
||||||
0x02: 'int',
|
|
||||||
0x03: 'bitstr',
|
|
||||||
0x04: 'octstr',
|
|
||||||
0x05: 'null_',
|
|
||||||
0x06: 'objid',
|
|
||||||
0x07: 'objDesc',
|
|
||||||
0x08: 'external',
|
|
||||||
0x09: 'real',
|
|
||||||
0x0a: 'enum',
|
|
||||||
0x0b: 'embed',
|
|
||||||
0x0c: 'utf8str',
|
|
||||||
0x0d: 'relativeOid',
|
|
||||||
0x10: 'seq',
|
|
||||||
0x11: 'set',
|
|
||||||
0x12: 'numstr',
|
|
||||||
0x13: 'printstr',
|
|
||||||
0x14: 't61str',
|
|
||||||
0x15: 'videostr',
|
|
||||||
0x16: 'ia5str',
|
|
||||||
0x17: 'utctime',
|
|
||||||
0x18: 'gentime',
|
|
||||||
0x19: 'graphstr',
|
|
||||||
0x1a: 'iso646str',
|
|
||||||
0x1b: 'genstr',
|
|
||||||
0x1c: 'unistr',
|
|
||||||
0x1d: 'charstr',
|
|
||||||
0x1e: 'bmpstr'
|
|
||||||
};
|
|
||||||
exports.tagByName = constants._reverse(exports.tag);
|
|
19
node_modules/asn1.js/lib/asn1/constants/index.js
generated
vendored
19
node_modules/asn1.js/lib/asn1/constants/index.js
generated
vendored
|
@ -1,19 +0,0 @@
|
||||||
var constants = exports;
|
|
||||||
|
|
||||||
// Helper
|
|
||||||
constants._reverse = function reverse(map) {
|
|
||||||
var res = {};
|
|
||||||
|
|
||||||
Object.keys(map).forEach(function(key) {
|
|
||||||
// Convert key to integer if it is stringified
|
|
||||||
if ((key | 0) == key)
|
|
||||||
key = key | 0;
|
|
||||||
|
|
||||||
var value = map[key];
|
|
||||||
res[value] = key;
|
|
||||||
});
|
|
||||||
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
|
|
||||||
constants.der = require('./der');
|
|
324
node_modules/asn1.js/lib/asn1/decoders/der.js
generated
vendored
324
node_modules/asn1.js/lib/asn1/decoders/der.js
generated
vendored
|
@ -1,324 +0,0 @@
|
||||||
var inherits = require('inherits');
|
|
||||||
|
|
||||||
var asn1 = require('../../asn1');
|
|
||||||
var base = asn1.base;
|
|
||||||
var bignum = asn1.bignum;
|
|
||||||
|
|
||||||
// Import DER constants
|
|
||||||
var der = asn1.constants.der;
|
|
||||||
|
|
||||||
function DERDecoder(entity) {
|
|
||||||
this.enc = 'der';
|
|
||||||
this.name = entity.name;
|
|
||||||
this.entity = entity;
|
|
||||||
|
|
||||||
// Construct base tree
|
|
||||||
this.tree = new DERNode();
|
|
||||||
this.tree._init(entity.body);
|
|
||||||
};
|
|
||||||
module.exports = DERDecoder;
|
|
||||||
|
|
||||||
DERDecoder.prototype.decode = function decode(data, options) {
|
|
||||||
if (!(data instanceof base.DecoderBuffer))
|
|
||||||
data = new base.DecoderBuffer(data, options);
|
|
||||||
|
|
||||||
return this.tree._decode(data, options);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Tree methods
|
|
||||||
|
|
||||||
function DERNode(parent) {
|
|
||||||
base.Node.call(this, 'der', parent);
|
|
||||||
}
|
|
||||||
inherits(DERNode, base.Node);
|
|
||||||
|
|
||||||
DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
|
|
||||||
if (buffer.isEmpty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var state = buffer.save();
|
|
||||||
var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
|
|
||||||
if (buffer.isError(decodedTag))
|
|
||||||
return decodedTag;
|
|
||||||
|
|
||||||
buffer.restore(state);
|
|
||||||
|
|
||||||
return decodedTag.tag === tag || decodedTag.tagStr === tag ||
|
|
||||||
(decodedTag.tagStr + 'of') === tag || any;
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
|
|
||||||
var decodedTag = derDecodeTag(buffer,
|
|
||||||
'Failed to decode tag of "' + tag + '"');
|
|
||||||
if (buffer.isError(decodedTag))
|
|
||||||
return decodedTag;
|
|
||||||
|
|
||||||
var len = derDecodeLen(buffer,
|
|
||||||
decodedTag.primitive,
|
|
||||||
'Failed to get length of "' + tag + '"');
|
|
||||||
|
|
||||||
// Failure
|
|
||||||
if (buffer.isError(len))
|
|
||||||
return len;
|
|
||||||
|
|
||||||
if (!any &&
|
|
||||||
decodedTag.tag !== tag &&
|
|
||||||
decodedTag.tagStr !== tag &&
|
|
||||||
decodedTag.tagStr + 'of' !== tag) {
|
|
||||||
return buffer.error('Failed to match tag: "' + tag + '"');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (decodedTag.primitive || len !== null)
|
|
||||||
return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
|
|
||||||
|
|
||||||
// Indefinite length... find END tag
|
|
||||||
var state = buffer.save();
|
|
||||||
var res = this._skipUntilEnd(
|
|
||||||
buffer,
|
|
||||||
'Failed to skip indefinite length body: "' + this.tag + '"');
|
|
||||||
if (buffer.isError(res))
|
|
||||||
return res;
|
|
||||||
|
|
||||||
len = buffer.offset - state.offset;
|
|
||||||
buffer.restore(state);
|
|
||||||
return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
|
|
||||||
while (true) {
|
|
||||||
var tag = derDecodeTag(buffer, fail);
|
|
||||||
if (buffer.isError(tag))
|
|
||||||
return tag;
|
|
||||||
var len = derDecodeLen(buffer, tag.primitive, fail);
|
|
||||||
if (buffer.isError(len))
|
|
||||||
return len;
|
|
||||||
|
|
||||||
var res;
|
|
||||||
if (tag.primitive || len !== null)
|
|
||||||
res = buffer.skip(len)
|
|
||||||
else
|
|
||||||
res = this._skipUntilEnd(buffer, fail);
|
|
||||||
|
|
||||||
// Failure
|
|
||||||
if (buffer.isError(res))
|
|
||||||
return res;
|
|
||||||
|
|
||||||
if (tag.tagStr === 'end')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
|
|
||||||
options) {
|
|
||||||
var result = [];
|
|
||||||
while (!buffer.isEmpty()) {
|
|
||||||
var possibleEnd = this._peekTag(buffer, 'end');
|
|
||||||
if (buffer.isError(possibleEnd))
|
|
||||||
return possibleEnd;
|
|
||||||
|
|
||||||
var res = decoder.decode(buffer, 'der', options);
|
|
||||||
if (buffer.isError(res) && possibleEnd)
|
|
||||||
break;
|
|
||||||
result.push(res);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
|
|
||||||
if (tag === 'bitstr') {
|
|
||||||
var unused = buffer.readUInt8();
|
|
||||||
if (buffer.isError(unused))
|
|
||||||
return unused;
|
|
||||||
return { unused: unused, data: buffer.raw() };
|
|
||||||
} else if (tag === 'bmpstr') {
|
|
||||||
var raw = buffer.raw();
|
|
||||||
if (raw.length % 2 === 1)
|
|
||||||
return buffer.error('Decoding of string type: bmpstr length mismatch');
|
|
||||||
|
|
||||||
var str = '';
|
|
||||||
for (var i = 0; i < raw.length / 2; i++) {
|
|
||||||
str += String.fromCharCode(raw.readUInt16BE(i * 2));
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
} else if (tag === 'numstr') {
|
|
||||||
var numstr = buffer.raw().toString('ascii');
|
|
||||||
if (!this._isNumstr(numstr)) {
|
|
||||||
return buffer.error('Decoding of string type: ' +
|
|
||||||
'numstr unsupported characters');
|
|
||||||
}
|
|
||||||
return numstr;
|
|
||||||
} else if (tag === 'octstr') {
|
|
||||||
return buffer.raw();
|
|
||||||
} else if (tag === 'objDesc') {
|
|
||||||
return buffer.raw();
|
|
||||||
} else if (tag === 'printstr') {
|
|
||||||
var printstr = buffer.raw().toString('ascii');
|
|
||||||
if (!this._isPrintstr(printstr)) {
|
|
||||||
return buffer.error('Decoding of string type: ' +
|
|
||||||
'printstr unsupported characters');
|
|
||||||
}
|
|
||||||
return printstr;
|
|
||||||
} else if (/str$/.test(tag)) {
|
|
||||||
return buffer.raw().toString();
|
|
||||||
} else {
|
|
||||||
return buffer.error('Decoding of string type: ' + tag + ' unsupported');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
|
|
||||||
var result;
|
|
||||||
var identifiers = [];
|
|
||||||
var ident = 0;
|
|
||||||
while (!buffer.isEmpty()) {
|
|
||||||
var subident = buffer.readUInt8();
|
|
||||||
ident <<= 7;
|
|
||||||
ident |= subident & 0x7f;
|
|
||||||
if ((subident & 0x80) === 0) {
|
|
||||||
identifiers.push(ident);
|
|
||||||
ident = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (subident & 0x80)
|
|
||||||
identifiers.push(ident);
|
|
||||||
|
|
||||||
var first = (identifiers[0] / 40) | 0;
|
|
||||||
var second = identifiers[0] % 40;
|
|
||||||
|
|
||||||
if (relative)
|
|
||||||
result = identifiers;
|
|
||||||
else
|
|
||||||
result = [first, second].concat(identifiers.slice(1));
|
|
||||||
|
|
||||||
if (values) {
|
|
||||||
var tmp = values[result.join(' ')];
|
|
||||||
if (tmp === undefined)
|
|
||||||
tmp = values[result.join('.')];
|
|
||||||
if (tmp !== undefined)
|
|
||||||
result = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
|
|
||||||
var str = buffer.raw().toString();
|
|
||||||
if (tag === 'gentime') {
|
|
||||||
var year = str.slice(0, 4) | 0;
|
|
||||||
var mon = str.slice(4, 6) | 0;
|
|
||||||
var day = str.slice(6, 8) | 0;
|
|
||||||
var hour = str.slice(8, 10) | 0;
|
|
||||||
var min = str.slice(10, 12) | 0;
|
|
||||||
var sec = str.slice(12, 14) | 0;
|
|
||||||
} else if (tag === 'utctime') {
|
|
||||||
var year = str.slice(0, 2) | 0;
|
|
||||||
var mon = str.slice(2, 4) | 0;
|
|
||||||
var day = str.slice(4, 6) | 0;
|
|
||||||
var hour = str.slice(6, 8) | 0;
|
|
||||||
var min = str.slice(8, 10) | 0;
|
|
||||||
var sec = str.slice(10, 12) | 0;
|
|
||||||
if (year < 70)
|
|
||||||
year = 2000 + year;
|
|
||||||
else
|
|
||||||
year = 1900 + year;
|
|
||||||
} else {
|
|
||||||
return buffer.error('Decoding ' + tag + ' time is not supported yet');
|
|
||||||
}
|
|
||||||
|
|
||||||
return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeNull = function decodeNull(buffer) {
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeBool = function decodeBool(buffer) {
|
|
||||||
var res = buffer.readUInt8();
|
|
||||||
if (buffer.isError(res))
|
|
||||||
return res;
|
|
||||||
else
|
|
||||||
return res !== 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
|
|
||||||
// Bigint, return as it is (assume big endian)
|
|
||||||
var raw = buffer.raw();
|
|
||||||
var res = new bignum(raw);
|
|
||||||
|
|
||||||
if (values)
|
|
||||||
res = values[res.toString(10)] || res;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._use = function use(entity, obj) {
|
|
||||||
if (typeof entity === 'function')
|
|
||||||
entity = entity(obj);
|
|
||||||
return entity._getDecoder('der').tree;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Utility methods
|
|
||||||
|
|
||||||
function derDecodeTag(buf, fail) {
|
|
||||||
var tag = buf.readUInt8(fail);
|
|
||||||
if (buf.isError(tag))
|
|
||||||
return tag;
|
|
||||||
|
|
||||||
var cls = der.tagClass[tag >> 6];
|
|
||||||
var primitive = (tag & 0x20) === 0;
|
|
||||||
|
|
||||||
// Multi-octet tag - load
|
|
||||||
if ((tag & 0x1f) === 0x1f) {
|
|
||||||
var oct = tag;
|
|
||||||
tag = 0;
|
|
||||||
while ((oct & 0x80) === 0x80) {
|
|
||||||
oct = buf.readUInt8(fail);
|
|
||||||
if (buf.isError(oct))
|
|
||||||
return oct;
|
|
||||||
|
|
||||||
tag <<= 7;
|
|
||||||
tag |= oct & 0x7f;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tag &= 0x1f;
|
|
||||||
}
|
|
||||||
var tagStr = der.tag[tag];
|
|
||||||
|
|
||||||
return {
|
|
||||||
cls: cls,
|
|
||||||
primitive: primitive,
|
|
||||||
tag: tag,
|
|
||||||
tagStr: tagStr
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function derDecodeLen(buf, primitive, fail) {
|
|
||||||
var len = buf.readUInt8(fail);
|
|
||||||
if (buf.isError(len))
|
|
||||||
return len;
|
|
||||||
|
|
||||||
// Indefinite form
|
|
||||||
if (!primitive && len === 0x80)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
// Definite form
|
|
||||||
if ((len & 0x80) === 0) {
|
|
||||||
// Short form
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Long form
|
|
||||||
var num = len & 0x7f;
|
|
||||||
if (num > 4)
|
|
||||||
return buf.error('length octect is too long');
|
|
||||||
|
|
||||||
len = 0;
|
|
||||||
for (var i = 0; i < num; i++) {
|
|
||||||
len <<= 8;
|
|
||||||
var j = buf.readUInt8(fail);
|
|
||||||
if (buf.isError(j))
|
|
||||||
return j;
|
|
||||||
len |= j;
|
|
||||||
}
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
4
node_modules/asn1.js/lib/asn1/decoders/index.js
generated
vendored
4
node_modules/asn1.js/lib/asn1/decoders/index.js
generated
vendored
|
@ -1,4 +0,0 @@
|
||||||
var decoders = exports;
|
|
||||||
|
|
||||||
decoders.der = require('./der');
|
|
||||||
decoders.pem = require('./pem');
|
|
49
node_modules/asn1.js/lib/asn1/decoders/pem.js
generated
vendored
49
node_modules/asn1.js/lib/asn1/decoders/pem.js
generated
vendored
|
@ -1,49 +0,0 @@
|
||||||
var inherits = require('inherits');
|
|
||||||
var Buffer = require('buffer').Buffer;
|
|
||||||
|
|
||||||
var DERDecoder = require('./der');
|
|
||||||
|
|
||||||
function PEMDecoder(entity) {
|
|
||||||
DERDecoder.call(this, entity);
|
|
||||||
this.enc = 'pem';
|
|
||||||
};
|
|
||||||
inherits(PEMDecoder, DERDecoder);
|
|
||||||
module.exports = PEMDecoder;
|
|
||||||
|
|
||||||
PEMDecoder.prototype.decode = function decode(data, options) {
|
|
||||||
var lines = data.toString().split(/[\r\n]+/g);
|
|
||||||
|
|
||||||
var label = options.label.toUpperCase();
|
|
||||||
|
|
||||||
var re = /^-----(BEGIN|END) ([^-]+)-----$/;
|
|
||||||
var start = -1;
|
|
||||||
var end = -1;
|
|
||||||
for (var i = 0; i < lines.length; i++) {
|
|
||||||
var match = lines[i].match(re);
|
|
||||||
if (match === null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (match[2] !== label)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (start === -1) {
|
|
||||||
if (match[1] !== 'BEGIN')
|
|
||||||
break;
|
|
||||||
start = i;
|
|
||||||
} else {
|
|
||||||
if (match[1] !== 'END')
|
|
||||||
break;
|
|
||||||
end = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (start === -1 || end === -1)
|
|
||||||
throw new Error('PEM section not found for: ' + label);
|
|
||||||
|
|
||||||
var base64 = lines.slice(start + 1, end).join('');
|
|
||||||
// Remove excessive symbols
|
|
||||||
base64.replace(/[^a-z0-9\+\/=]+/gi, '');
|
|
||||||
|
|
||||||
var input = new Buffer(base64, 'base64');
|
|
||||||
return DERDecoder.prototype.decode.call(this, input, options);
|
|
||||||
};
|
|
295
node_modules/asn1.js/lib/asn1/encoders/der.js
generated
vendored
295
node_modules/asn1.js/lib/asn1/encoders/der.js
generated
vendored
|
@ -1,295 +0,0 @@
|
||||||
var inherits = require('inherits');
|
|
||||||
var Buffer = require('buffer').Buffer;
|
|
||||||
|
|
||||||
var asn1 = require('../../asn1');
|
|
||||||
var base = asn1.base;
|
|
||||||
|
|
||||||
// Import DER constants
|
|
||||||
var der = asn1.constants.der;
|
|
||||||
|
|
||||||
function DEREncoder(entity) {
|
|
||||||
this.enc = 'der';
|
|
||||||
this.name = entity.name;
|
|
||||||
this.entity = entity;
|
|
||||||
|
|
||||||
// Construct base tree
|
|
||||||
this.tree = new DERNode();
|
|
||||||
this.tree._init(entity.body);
|
|
||||||
};
|
|
||||||
module.exports = DEREncoder;
|
|
||||||
|
|
||||||
DEREncoder.prototype.encode = function encode(data, reporter) {
|
|
||||||
return this.tree._encode(data, reporter).join();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Tree methods
|
|
||||||
|
|
||||||
function DERNode(parent) {
|
|
||||||
base.Node.call(this, 'der', parent);
|
|
||||||
}
|
|
||||||
inherits(DERNode, base.Node);
|
|
||||||
|
|
||||||
DERNode.prototype._encodeComposite = function encodeComposite(tag,
|
|
||||||
primitive,
|
|
||||||
cls,
|
|
||||||
content) {
|
|
||||||
var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
|
|
||||||
|
|
||||||
// Short form
|
|
||||||
if (content.length < 0x80) {
|
|
||||||
var header = new Buffer(2);
|
|
||||||
header[0] = encodedTag;
|
|
||||||
header[1] = content.length;
|
|
||||||
return this._createEncoderBuffer([ header, content ]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Long form
|
|
||||||
// Count octets required to store length
|
|
||||||
var lenOctets = 1;
|
|
||||||
for (var i = content.length; i >= 0x100; i >>= 8)
|
|
||||||
lenOctets++;
|
|
||||||
|
|
||||||
var header = new Buffer(1 + 1 + lenOctets);
|
|
||||||
header[0] = encodedTag;
|
|
||||||
header[1] = 0x80 | lenOctets;
|
|
||||||
|
|
||||||
for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
|
|
||||||
header[i] = j & 0xff;
|
|
||||||
|
|
||||||
return this._createEncoderBuffer([ header, content ]);
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._encodeStr = function encodeStr(str, tag) {
|
|
||||||
if (tag === 'bitstr') {
|
|
||||||
return this._createEncoderBuffer([ str.unused | 0, str.data ]);
|
|
||||||
} else if (tag === 'bmpstr') {
|
|
||||||
var buf = new Buffer(str.length * 2);
|
|
||||||
for (var i = 0; i < str.length; i++) {
|
|
||||||
buf.writeUInt16BE(str.charCodeAt(i), i * 2);
|
|
||||||
}
|
|
||||||
return this._createEncoderBuffer(buf);
|
|
||||||
} else if (tag === 'numstr') {
|
|
||||||
if (!this._isNumstr(str)) {
|
|
||||||
return this.reporter.error('Encoding of string type: numstr supports ' +
|
|
||||||
'only digits and space');
|
|
||||||
}
|
|
||||||
return this._createEncoderBuffer(str);
|
|
||||||
} else if (tag === 'printstr') {
|
|
||||||
if (!this._isPrintstr(str)) {
|
|
||||||
return this.reporter.error('Encoding of string type: printstr supports ' +
|
|
||||||
'only latin upper and lower case letters, ' +
|
|
||||||
'digits, space, apostrophe, left and rigth ' +
|
|
||||||
'parenthesis, plus sign, comma, hyphen, ' +
|
|
||||||
'dot, slash, colon, equal sign, ' +
|
|
||||||
'question mark');
|
|
||||||
}
|
|
||||||
return this._createEncoderBuffer(str);
|
|
||||||
} else if (/str$/.test(tag)) {
|
|
||||||
return this._createEncoderBuffer(str);
|
|
||||||
} else if (tag === 'objDesc') {
|
|
||||||
return this._createEncoderBuffer(str);
|
|
||||||
} else {
|
|
||||||
return this.reporter.error('Encoding of string type: ' + tag +
|
|
||||||
' unsupported');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
|
|
||||||
if (typeof id === 'string') {
|
|
||||||
if (!values)
|
|
||||||
return this.reporter.error('string objid given, but no values map found');
|
|
||||||
if (!values.hasOwnProperty(id))
|
|
||||||
return this.reporter.error('objid not found in values map');
|
|
||||||
id = values[id].split(/[\s\.]+/g);
|
|
||||||
for (var i = 0; i < id.length; i++)
|
|
||||||
id[i] |= 0;
|
|
||||||
} else if (Array.isArray(id)) {
|
|
||||||
id = id.slice();
|
|
||||||
for (var i = 0; i < id.length; i++)
|
|
||||||
id[i] |= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Array.isArray(id)) {
|
|
||||||
return this.reporter.error('objid() should be either array or string, ' +
|
|
||||||
'got: ' + JSON.stringify(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!relative) {
|
|
||||||
if (id[1] >= 40)
|
|
||||||
return this.reporter.error('Second objid identifier OOB');
|
|
||||||
id.splice(0, 2, id[0] * 40 + id[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Count number of octets
|
|
||||||
var size = 0;
|
|
||||||
for (var i = 0; i < id.length; i++) {
|
|
||||||
var ident = id[i];
|
|
||||||
for (size++; ident >= 0x80; ident >>= 7)
|
|
||||||
size++;
|
|
||||||
}
|
|
||||||
|
|
||||||
var objid = new Buffer(size);
|
|
||||||
var offset = objid.length - 1;
|
|
||||||
for (var i = id.length - 1; i >= 0; i--) {
|
|
||||||
var ident = id[i];
|
|
||||||
objid[offset--] = ident & 0x7f;
|
|
||||||
while ((ident >>= 7) > 0)
|
|
||||||
objid[offset--] = 0x80 | (ident & 0x7f);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this._createEncoderBuffer(objid);
|
|
||||||
};
|
|
||||||
|
|
||||||
function two(num) {
|
|
||||||
if (num < 10)
|
|
||||||
return '0' + num;
|
|
||||||
else
|
|
||||||
return num;
|
|
||||||
}
|
|
||||||
|
|
||||||
DERNode.prototype._encodeTime = function encodeTime(time, tag) {
|
|
||||||
var str;
|
|
||||||
var date = new Date(time);
|
|
||||||
|
|
||||||
if (tag === 'gentime') {
|
|
||||||
str = [
|
|
||||||
two(date.getFullYear()),
|
|
||||||
two(date.getUTCMonth() + 1),
|
|
||||||
two(date.getUTCDate()),
|
|
||||||
two(date.getUTCHours()),
|
|
||||||
two(date.getUTCMinutes()),
|
|
||||||
two(date.getUTCSeconds()),
|
|
||||||
'Z'
|
|
||||||
].join('');
|
|
||||||
} else if (tag === 'utctime') {
|
|
||||||
str = [
|
|
||||||
two(date.getFullYear() % 100),
|
|
||||||
two(date.getUTCMonth() + 1),
|
|
||||||
two(date.getUTCDate()),
|
|
||||||
two(date.getUTCHours()),
|
|
||||||
two(date.getUTCMinutes()),
|
|
||||||
two(date.getUTCSeconds()),
|
|
||||||
'Z'
|
|
||||||
].join('');
|
|
||||||
} else {
|
|
||||||
this.reporter.error('Encoding ' + tag + ' time is not supported yet');
|
|
||||||
}
|
|
||||||
|
|
||||||
return this._encodeStr(str, 'octstr');
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._encodeNull = function encodeNull() {
|
|
||||||
return this._createEncoderBuffer('');
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._encodeInt = function encodeInt(num, values) {
|
|
||||||
if (typeof num === 'string') {
|
|
||||||
if (!values)
|
|
||||||
return this.reporter.error('String int or enum given, but no values map');
|
|
||||||
if (!values.hasOwnProperty(num)) {
|
|
||||||
return this.reporter.error('Values map doesn\'t contain: ' +
|
|
||||||
JSON.stringify(num));
|
|
||||||
}
|
|
||||||
num = values[num];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bignum, assume big endian
|
|
||||||
if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
|
|
||||||
var numArray = num.toArray();
|
|
||||||
if (!num.sign && numArray[0] & 0x80) {
|
|
||||||
numArray.unshift(0);
|
|
||||||
}
|
|
||||||
num = new Buffer(numArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Buffer.isBuffer(num)) {
|
|
||||||
var size = num.length;
|
|
||||||
if (num.length === 0)
|
|
||||||
size++;
|
|
||||||
|
|
||||||
var out = new Buffer(size);
|
|
||||||
num.copy(out);
|
|
||||||
if (num.length === 0)
|
|
||||||
out[0] = 0
|
|
||||||
return this._createEncoderBuffer(out);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (num < 0x80)
|
|
||||||
return this._createEncoderBuffer(num);
|
|
||||||
|
|
||||||
if (num < 0x100)
|
|
||||||
return this._createEncoderBuffer([0, num]);
|
|
||||||
|
|
||||||
var size = 1;
|
|
||||||
for (var i = num; i >= 0x100; i >>= 8)
|
|
||||||
size++;
|
|
||||||
|
|
||||||
var out = new Array(size);
|
|
||||||
for (var i = out.length - 1; i >= 0; i--) {
|
|
||||||
out[i] = num & 0xff;
|
|
||||||
num >>= 8;
|
|
||||||
}
|
|
||||||
if(out[0] & 0x80) {
|
|
||||||
out.unshift(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this._createEncoderBuffer(new Buffer(out));
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._encodeBool = function encodeBool(value) {
|
|
||||||
return this._createEncoderBuffer(value ? 0xff : 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._use = function use(entity, obj) {
|
|
||||||
if (typeof entity === 'function')
|
|
||||||
entity = entity(obj);
|
|
||||||
return entity._getEncoder('der').tree;
|
|
||||||
};
|
|
||||||
|
|
||||||
DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
|
|
||||||
var state = this._baseState;
|
|
||||||
var i;
|
|
||||||
if (state['default'] === null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var data = dataBuffer.join();
|
|
||||||
if (state.defaultBuffer === undefined)
|
|
||||||
state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
|
|
||||||
|
|
||||||
if (data.length !== state.defaultBuffer.length)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for (i=0; i < data.length; i++)
|
|
||||||
if (data[i] !== state.defaultBuffer[i])
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Utility methods
|
|
||||||
|
|
||||||
function encodeTag(tag, primitive, cls, reporter) {
|
|
||||||
var res;
|
|
||||||
|
|
||||||
if (tag === 'seqof')
|
|
||||||
tag = 'seq';
|
|
||||||
else if (tag === 'setof')
|
|
||||||
tag = 'set';
|
|
||||||
|
|
||||||
if (der.tagByName.hasOwnProperty(tag))
|
|
||||||
res = der.tagByName[tag];
|
|
||||||
else if (typeof tag === 'number' && (tag | 0) === tag)
|
|
||||||
res = tag;
|
|
||||||
else
|
|
||||||
return reporter.error('Unknown tag: ' + tag);
|
|
||||||
|
|
||||||
if (res >= 0x1f)
|
|
||||||
return reporter.error('Multi-octet tag encoding unsupported');
|
|
||||||
|
|
||||||
if (!primitive)
|
|
||||||
res |= 0x20;
|
|
||||||
|
|
||||||
res |= (der.tagClassByName[cls || 'universal'] << 6);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
4
node_modules/asn1.js/lib/asn1/encoders/index.js
generated
vendored
4
node_modules/asn1.js/lib/asn1/encoders/index.js
generated
vendored
|
@ -1,4 +0,0 @@
|
||||||
var encoders = exports;
|
|
||||||
|
|
||||||
encoders.der = require('./der');
|
|
||||||
encoders.pem = require('./pem');
|
|
21
node_modules/asn1.js/lib/asn1/encoders/pem.js
generated
vendored
21
node_modules/asn1.js/lib/asn1/encoders/pem.js
generated
vendored
|
@ -1,21 +0,0 @@
|
||||||
var inherits = require('inherits');
|
|
||||||
|
|
||||||
var DEREncoder = require('./der');
|
|
||||||
|
|
||||||
function PEMEncoder(entity) {
|
|
||||||
DEREncoder.call(this, entity);
|
|
||||||
this.enc = 'pem';
|
|
||||||
};
|
|
||||||
inherits(PEMEncoder, DEREncoder);
|
|
||||||
module.exports = PEMEncoder;
|
|
||||||
|
|
||||||
PEMEncoder.prototype.encode = function encode(data, options) {
|
|
||||||
var buf = DEREncoder.prototype.encode.call(this, data);
|
|
||||||
|
|
||||||
var p = buf.toString('base64');
|
|
||||||
var out = [ '-----BEGIN ' + options.label + '-----' ];
|
|
||||||
for (var i = 0; i < p.length; i += 64)
|
|
||||||
out.push(p.slice(i, i + 64));
|
|
||||||
out.push('-----END ' + options.label + '-----');
|
|
||||||
return out.join('\n');
|
|
||||||
};
|
|
59
node_modules/asn1.js/package.json
generated
vendored
59
node_modules/asn1.js/package.json
generated
vendored
|
@ -1,59 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "asn1.js@^4.8.0",
|
|
||||||
"_id": "asn1.js@4.10.1",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==",
|
|
||||||
"_location": "/asn1.js",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "asn1.js@^4.8.0",
|
|
||||||
"name": "asn1.js",
|
|
||||||
"escapedName": "asn1.js",
|
|
||||||
"rawSpec": "^4.8.0",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^4.8.0"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/asn1.js-rfc5280",
|
|
||||||
"/ocsp"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz",
|
|
||||||
"_shasum": "b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0",
|
|
||||||
"_spec": "asn1.js@^4.8.0",
|
|
||||||
"_where": "/home/ubuntu/OCSP/node_modules/ocsp",
|
|
||||||
"author": {
|
|
||||||
"name": "Fedor Indutny"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/indutny/asn1.js/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
|
||||||
"bn.js": "^4.0.0",
|
|
||||||
"inherits": "^2.0.1",
|
|
||||||
"minimalistic-assert": "^1.0.0"
|
|
||||||
},
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "ASN.1 encoder and decoder",
|
|
||||||
"devDependencies": {
|
|
||||||
"mocha": "^2.3.4"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/indutny/asn1.js",
|
|
||||||
"keywords": [
|
|
||||||
"asn.1",
|
|
||||||
"der"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/asn1.js",
|
|
||||||
"name": "asn1.js",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+ssh://git@github.com/indutny/asn1.js.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test": "mocha --reporter spec test/*-test.js && cd rfc/2560 && npm i && npm test && cd ../../rfc/5280 && npm i && npm test"
|
|
||||||
},
|
|
||||||
"version": "4.10.1"
|
|
||||||
}
|
|
125
node_modules/async/CHANGELOG.md
generated
vendored
125
node_modules/async/CHANGELOG.md
generated
vendored
|
@ -1,125 +0,0 @@
|
||||||
# v1.5.2
|
|
||||||
- Allow using `"consructor"` as an argument in `memoize` (#998)
|
|
||||||
- Give a better error messsage when `auto` dependency checking fails (#994)
|
|
||||||
- Various doc updates (#936, #956, #979, #1002)
|
|
||||||
|
|
||||||
# v1.5.1
|
|
||||||
- Fix issue with `pause` in `queue` with concurrency enabled (#946)
|
|
||||||
- `while` and `until` now pass the final result to callback (#963)
|
|
||||||
- `auto` will properly handle concurrency when there is no callback (#966)
|
|
||||||
- `auto` will now properly stop execution when an error occurs (#988, #993)
|
|
||||||
- Various doc fixes (#971, #980)
|
|
||||||
|
|
||||||
# v1.5.0
|
|
||||||
|
|
||||||
- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
|
|
||||||
- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873)
|
|
||||||
- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637)
|
|
||||||
- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891)
|
|
||||||
- Various code simplifications (#896, #904)
|
|
||||||
- Various doc fixes :scroll: (#890, #894, #903, #905, #912)
|
|
||||||
|
|
||||||
# v1.4.2
|
|
||||||
|
|
||||||
- Ensure coverage files don't get published on npm (#879)
|
|
||||||
|
|
||||||
# v1.4.1
|
|
||||||
|
|
||||||
- Add in overlooked `detectLimit` method (#866)
|
|
||||||
- Removed unnecessary files from npm releases (#861)
|
|
||||||
- Removed usage of a reserved word to prevent :boom: in older environments (#870)
|
|
||||||
|
|
||||||
# v1.4.0
|
|
||||||
|
|
||||||
- `asyncify` now supports promises (#840)
|
|
||||||
- Added `Limit` versions of `filter` and `reject` (#836)
|
|
||||||
- Add `Limit` versions of `detect`, `some` and `every` (#828, #829)
|
|
||||||
- `some`, `every` and `detect` now short circuit early (#828, #829)
|
|
||||||
- Improve detection of the global object (#804), enabling use in WebWorkers
|
|
||||||
- `whilst` now called with arguments from iterator (#823)
|
|
||||||
- `during` now gets called with arguments from iterator (#824)
|
|
||||||
- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
|
|
||||||
|
|
||||||
|
|
||||||
# v1.3.0
|
|
||||||
|
|
||||||
New Features:
|
|
||||||
- Added `constant`
|
|
||||||
- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806)
|
|
||||||
- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800)
|
|
||||||
- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793)
|
|
||||||
- `async` should work better in Web Workers due to better `root` detection (#804)
|
|
||||||
- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642)
|
|
||||||
- Various internal updates (#786, #801, #802, #803)
|
|
||||||
- Various doc fixes (#790, #794)
|
|
||||||
|
|
||||||
Bug Fixes:
|
|
||||||
- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783)
|
|
||||||
|
|
||||||
|
|
||||||
# v1.2.1
|
|
||||||
|
|
||||||
Bug Fix:
|
|
||||||
|
|
||||||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
|
|
||||||
|
|
||||||
|
|
||||||
# v1.2.0
|
|
||||||
|
|
||||||
New Features:
|
|
||||||
|
|
||||||
- Added `timesLimit` (#743)
|
|
||||||
- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772)
|
|
||||||
|
|
||||||
Bug Fixes:
|
|
||||||
|
|
||||||
- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
|
|
||||||
|
|
||||||
|
|
||||||
# v1.1.1
|
|
||||||
|
|
||||||
Bug Fix:
|
|
||||||
|
|
||||||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
|
|
||||||
|
|
||||||
|
|
||||||
# v1.1.0
|
|
||||||
|
|
||||||
New Features:
|
|
||||||
|
|
||||||
- `cargo` now supports all of the same methods and event callbacks as `queue`.
|
|
||||||
- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
|
|
||||||
- Optimized `map`, `eachOf`, and `waterfall` families of functions
|
|
||||||
- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667).
|
|
||||||
- The callback is now optional for the composed results of `compose` and `seq`. (#618)
|
|
||||||
- Reduced file size by 4kb, (minified version by 1kb)
|
|
||||||
- Added code coverage through `nyc` and `coveralls` (#768)
|
|
||||||
|
|
||||||
Bug Fixes:
|
|
||||||
|
|
||||||
- `forever` will no longer stack overflow with a synchronous iterator (#622)
|
|
||||||
- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
|
|
||||||
- Always pass `null` in callbacks when there is no error (#439)
|
|
||||||
- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
|
|
||||||
- `each` and family will properly handle an empty array (#578)
|
|
||||||
- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
|
|
||||||
- `queue` will throw if a non-function is passed to `q.push()` (#593)
|
|
||||||
- Doc fixes (#629, #766)
|
|
||||||
|
|
||||||
|
|
||||||
# v1.0.0
|
|
||||||
|
|
||||||
No known breaking changes, we are simply complying with semver from here on out.
|
|
||||||
|
|
||||||
Changes:
|
|
||||||
|
|
||||||
- Start using a changelog!
|
|
||||||
- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
|
|
||||||
- Detect deadlocks in `auto` (#663)
|
|
||||||
- Better support for require.js (#527)
|
|
||||||
- Throw if queue created with concurrency `0` (#714)
|
|
||||||
- Fix unneeded iteration in `queue.resume()` (#758)
|
|
||||||
- Guard against timer mocking overriding `setImmediate` (#609 #611)
|
|
||||||
- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
|
|
||||||
- Use single noop function internally (#546)
|
|
||||||
- Optimize internal `_each`, `_map` and `_keys` functions.
|
|
19
node_modules/async/LICENSE
generated
vendored
19
node_modules/async/LICENSE
generated
vendored
|
@ -1,19 +0,0 @@
|
||||||
Copyright (c) 2010-2014 Caolan McMahon
|
|
||||||
|
|
||||||
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.
|
|
1877
node_modules/async/README.md
generated
vendored
1877
node_modules/async/README.md
generated
vendored
File diff suppressed because it is too large
Load diff
1265
node_modules/async/dist/async.js
generated
vendored
1265
node_modules/async/dist/async.js
generated
vendored
File diff suppressed because it is too large
Load diff
2
node_modules/async/dist/async.min.js
generated
vendored
2
node_modules/async/dist/async.min.js
generated
vendored
File diff suppressed because one or more lines are too long
1265
node_modules/async/lib/async.js
generated
vendored
1265
node_modules/async/lib/async.js
generated
vendored
File diff suppressed because it is too large
Load diff
113
node_modules/async/package.json
generated
vendored
113
node_modules/async/package.json
generated
vendored
|
@ -1,113 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "async@^1.5.2",
|
|
||||||
"_id": "async@1.5.2",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==",
|
|
||||||
"_location": "/async",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "async@^1.5.2",
|
|
||||||
"name": "async",
|
|
||||||
"escapedName": "async",
|
|
||||||
"rawSpec": "^1.5.2",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^1.5.2"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/ocsp"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
|
|
||||||
"_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
|
|
||||||
"_spec": "async@^1.5.2",
|
|
||||||
"_where": "/home/ubuntu/OCSP/node_modules/ocsp",
|
|
||||||
"author": {
|
|
||||||
"name": "Caolan McMahon"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/caolan/async/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Higher-order functions and common patterns for asynchronous code",
|
|
||||||
"devDependencies": {
|
|
||||||
"benchmark": "github:bestiejs/benchmark.js",
|
|
||||||
"bluebird": "^2.9.32",
|
|
||||||
"chai": "^3.1.0",
|
|
||||||
"coveralls": "^2.11.2",
|
|
||||||
"es6-promise": "^2.3.0",
|
|
||||||
"jscs": "^1.13.1",
|
|
||||||
"jshint": "~2.8.0",
|
|
||||||
"karma": "^0.13.2",
|
|
||||||
"karma-browserify": "^4.2.1",
|
|
||||||
"karma-firefox-launcher": "^0.1.6",
|
|
||||||
"karma-mocha": "^0.2.0",
|
|
||||||
"karma-mocha-reporter": "^1.0.2",
|
|
||||||
"lodash": "^3.9.0",
|
|
||||||
"mkdirp": "~0.5.1",
|
|
||||||
"mocha": "^2.2.5",
|
|
||||||
"native-promise-only": "^0.8.0-a",
|
|
||||||
"nodeunit": ">0.0.0",
|
|
||||||
"nyc": "^2.1.0",
|
|
||||||
"rsvp": "^3.0.18",
|
|
||||||
"semver": "^4.3.6",
|
|
||||||
"uglify-js": "~2.4.0",
|
|
||||||
"xyz": "^0.5.0",
|
|
||||||
"yargs": "~3.9.1"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib",
|
|
||||||
"dist/async.js",
|
|
||||||
"dist/async.min.js"
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/caolan/async#readme",
|
|
||||||
"jam": {
|
|
||||||
"main": "lib/async.js",
|
|
||||||
"include": [
|
|
||||||
"lib/async.js",
|
|
||||||
"README.md",
|
|
||||||
"LICENSE"
|
|
||||||
],
|
|
||||||
"categories": [
|
|
||||||
"Utilities"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"async",
|
|
||||||
"callback",
|
|
||||||
"utility",
|
|
||||||
"module"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/async.js",
|
|
||||||
"name": "async",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/caolan/async.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"coverage": "nyc npm test && nyc report",
|
|
||||||
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
|
|
||||||
"lint": "jshint lib/*.js test/*.js perf/*.js && jscs lib/*.js test/*.js perf/*.js",
|
|
||||||
"mocha-browser-test": "karma start",
|
|
||||||
"mocha-node-test": "mocha mocha_test/",
|
|
||||||
"mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
|
|
||||||
"nodeunit-test": "nodeunit test/test-async.js",
|
|
||||||
"test": "npm run-script lint && npm run nodeunit-test && npm run mocha-test"
|
|
||||||
},
|
|
||||||
"spm": {
|
|
||||||
"main": "lib/async.js"
|
|
||||||
},
|
|
||||||
"version": "1.5.2",
|
|
||||||
"volo": {
|
|
||||||
"main": "lib/async.js",
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"node_modules",
|
|
||||||
"bower_components",
|
|
||||||
"test",
|
|
||||||
"tests"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
19
node_modules/bn.js/LICENSE
generated
vendored
19
node_modules/bn.js/LICENSE
generated
vendored
|
@ -1,19 +0,0 @@
|
||||||
Copyright Fedor Indutny, 2015.
|
|
||||||
|
|
||||||
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.
|
|
200
node_modules/bn.js/README.md
generated
vendored
200
node_modules/bn.js/README.md
generated
vendored
|
@ -1,200 +0,0 @@
|
||||||
# <img src="./logo.png" alt="bn.js" width="160" height="160" />
|
|
||||||
|
|
||||||
> BigNum in pure javascript
|
|
||||||
|
|
||||||
[![Build Status](https://secure.travis-ci.org/indutny/bn.js.png)](http://travis-ci.org/indutny/bn.js)
|
|
||||||
|
|
||||||
## Install
|
|
||||||
`npm install --save bn.js`
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```js
|
|
||||||
const BN = require('bn.js');
|
|
||||||
|
|
||||||
var a = new BN('dead', 16);
|
|
||||||
var b = new BN('101010', 2);
|
|
||||||
|
|
||||||
var res = a.add(b);
|
|
||||||
console.log(res.toString(10)); // 57047
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note**: decimals are not supported in this library.
|
|
||||||
|
|
||||||
## Notation
|
|
||||||
|
|
||||||
### Prefixes
|
|
||||||
|
|
||||||
There are several prefixes to instructions that affect the way the work. Here
|
|
||||||
is the list of them in the order of appearance in the function name:
|
|
||||||
|
|
||||||
* `i` - perform operation in-place, storing the result in the host object (on
|
|
||||||
which the method was invoked). Might be used to avoid number allocation costs
|
|
||||||
* `u` - unsigned, ignore the sign of operands when performing operation, or
|
|
||||||
always return positive value. Second case applies to reduction operations
|
|
||||||
like `mod()`. In such cases if the result will be negative - modulo will be
|
|
||||||
added to the result to make it positive
|
|
||||||
|
|
||||||
### Postfixes
|
|
||||||
|
|
||||||
The only available postfix at the moment is:
|
|
||||||
|
|
||||||
* `n` - which means that the argument of the function must be a plain JavaScript
|
|
||||||
Number. Decimals are not supported.
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
* `a.iadd(b)` - perform addition on `a` and `b`, storing the result in `a`
|
|
||||||
* `a.umod(b)` - reduce `a` modulo `b`, returning positive value
|
|
||||||
* `a.iushln(13)` - shift bits of `a` left by 13
|
|
||||||
|
|
||||||
## Instructions
|
|
||||||
|
|
||||||
Prefixes/postfixes are put in parens at the of the line. `endian` - could be
|
|
||||||
either `le` (little-endian) or `be` (big-endian).
|
|
||||||
|
|
||||||
### Utilities
|
|
||||||
|
|
||||||
* `a.clone()` - clone number
|
|
||||||
* `a.toString(base, length)` - convert to base-string and pad with zeroes
|
|
||||||
* `a.toNumber()` - convert to Javascript Number (limited to 53 bits)
|
|
||||||
* `a.toJSON()` - convert to JSON compatible hex string (alias of `toString(16)`)
|
|
||||||
* `a.toArray(endian, length)` - convert to byte `Array`, and optionally zero
|
|
||||||
pad to length, throwing if already exceeding
|
|
||||||
* `a.toArrayLike(type, endian, length)` - convert to an instance of `type`,
|
|
||||||
which must behave like an `Array`
|
|
||||||
* `a.toBuffer(endian, length)` - convert to Node.js Buffer (if available). For
|
|
||||||
compatibility with browserify and similar tools, use this instead:
|
|
||||||
`a.toArrayLike(Buffer, endian, length)`
|
|
||||||
* `a.bitLength()` - get number of bits occupied
|
|
||||||
* `a.zeroBits()` - return number of less-significant consequent zero bits
|
|
||||||
(example: `1010000` has 4 zero bits)
|
|
||||||
* `a.byteLength()` - return number of bytes occupied
|
|
||||||
* `a.isNeg()` - true if the number is negative
|
|
||||||
* `a.isEven()` - no comments
|
|
||||||
* `a.isOdd()` - no comments
|
|
||||||
* `a.isZero()` - no comments
|
|
||||||
* `a.cmp(b)` - compare numbers and return `-1` (a `<` b), `0` (a `==` b), or `1` (a `>` b)
|
|
||||||
depending on the comparison result (`ucmp`, `cmpn`)
|
|
||||||
* `a.lt(b)` - `a` less than `b` (`n`)
|
|
||||||
* `a.lte(b)` - `a` less than or equals `b` (`n`)
|
|
||||||
* `a.gt(b)` - `a` greater than `b` (`n`)
|
|
||||||
* `a.gte(b)` - `a` greater than or equals `b` (`n`)
|
|
||||||
* `a.eq(b)` - `a` equals `b` (`n`)
|
|
||||||
* `a.toTwos(width)` - convert to two's complement representation, where `width` is bit width
|
|
||||||
* `a.fromTwos(width)` - convert from two's complement representation, where `width` is the bit width
|
|
||||||
* `BN.isBN(object)` - returns true if the supplied `object` is a BN.js instance
|
|
||||||
|
|
||||||
### Arithmetics
|
|
||||||
|
|
||||||
* `a.neg()` - negate sign (`i`)
|
|
||||||
* `a.abs()` - absolute value (`i`)
|
|
||||||
* `a.add(b)` - addition (`i`, `n`, `in`)
|
|
||||||
* `a.sub(b)` - subtraction (`i`, `n`, `in`)
|
|
||||||
* `a.mul(b)` - multiply (`i`, `n`, `in`)
|
|
||||||
* `a.sqr()` - square (`i`)
|
|
||||||
* `a.pow(b)` - raise `a` to the power of `b`
|
|
||||||
* `a.div(b)` - divide (`divn`, `idivn`)
|
|
||||||
* `a.mod(b)` - reduct (`u`, `n`) (but no `umodn`)
|
|
||||||
* `a.divRound(b)` - rounded division
|
|
||||||
|
|
||||||
### Bit operations
|
|
||||||
|
|
||||||
* `a.or(b)` - or (`i`, `u`, `iu`)
|
|
||||||
* `a.and(b)` - and (`i`, `u`, `iu`, `andln`) (NOTE: `andln` is going to be replaced
|
|
||||||
with `andn` in future)
|
|
||||||
* `a.xor(b)` - xor (`i`, `u`, `iu`)
|
|
||||||
* `a.setn(b)` - set specified bit to `1`
|
|
||||||
* `a.shln(b)` - shift left (`i`, `u`, `iu`)
|
|
||||||
* `a.shrn(b)` - shift right (`i`, `u`, `iu`)
|
|
||||||
* `a.testn(b)` - test if specified bit is set
|
|
||||||
* `a.maskn(b)` - clear bits with indexes higher or equal to `b` (`i`)
|
|
||||||
* `a.bincn(b)` - add `1 << b` to the number
|
|
||||||
* `a.notn(w)` - not (for the width specified by `w`) (`i`)
|
|
||||||
|
|
||||||
### Reduction
|
|
||||||
|
|
||||||
* `a.gcd(b)` - GCD
|
|
||||||
* `a.egcd(b)` - Extended GCD results (`{ a: ..., b: ..., gcd: ... }`)
|
|
||||||
* `a.invm(b)` - inverse `a` modulo `b`
|
|
||||||
|
|
||||||
## Fast reduction
|
|
||||||
|
|
||||||
When doing lots of reductions using the same modulo, it might be beneficial to
|
|
||||||
use some tricks: like [Montgomery multiplication][0], or using special algorithm
|
|
||||||
for [Mersenne Prime][1].
|
|
||||||
|
|
||||||
### Reduction context
|
|
||||||
|
|
||||||
To enable this tricks one should create a reduction context:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var red = BN.red(num);
|
|
||||||
```
|
|
||||||
where `num` is just a BN instance.
|
|
||||||
|
|
||||||
Or:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var red = BN.red(primeName);
|
|
||||||
```
|
|
||||||
|
|
||||||
Where `primeName` is either of these [Mersenne Primes][1]:
|
|
||||||
|
|
||||||
* `'k256'`
|
|
||||||
* `'p224'`
|
|
||||||
* `'p192'`
|
|
||||||
* `'p25519'`
|
|
||||||
|
|
||||||
Or:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var red = BN.mont(num);
|
|
||||||
```
|
|
||||||
|
|
||||||
To reduce numbers with [Montgomery trick][0]. `.mont()` is generally faster than
|
|
||||||
`.red(num)`, but slower than `BN.red(primeName)`.
|
|
||||||
|
|
||||||
### Converting numbers
|
|
||||||
|
|
||||||
Before performing anything in reduction context - numbers should be converted
|
|
||||||
to it. Usually, this means that one should:
|
|
||||||
|
|
||||||
* Convert inputs to reducted ones
|
|
||||||
* Operate on them in reduction context
|
|
||||||
* Convert outputs back from the reduction context
|
|
||||||
|
|
||||||
Here is how one may convert numbers to `red`:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var redA = a.toRed(red);
|
|
||||||
```
|
|
||||||
Where `red` is a reduction context created using instructions above
|
|
||||||
|
|
||||||
Here is how to convert them back:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var a = redA.fromRed();
|
|
||||||
```
|
|
||||||
|
|
||||||
### Red instructions
|
|
||||||
|
|
||||||
Most of the instructions from the very start of this readme have their
|
|
||||||
counterparts in red context:
|
|
||||||
|
|
||||||
* `a.redAdd(b)`, `a.redIAdd(b)`
|
|
||||||
* `a.redSub(b)`, `a.redISub(b)`
|
|
||||||
* `a.redShl(num)`
|
|
||||||
* `a.redMul(b)`, `a.redIMul(b)`
|
|
||||||
* `a.redSqr()`, `a.redISqr()`
|
|
||||||
* `a.redSqrt()` - square root modulo reduction context's prime
|
|
||||||
* `a.redInvm()` - modular inverse of the number
|
|
||||||
* `a.redNeg()`
|
|
||||||
* `a.redPow(b)` - modular exponentiation
|
|
||||||
|
|
||||||
## LICENSE
|
|
||||||
|
|
||||||
This software is licensed under the MIT License.
|
|
||||||
|
|
||||||
[0]: https://en.wikipedia.org/wiki/Montgomery_modular_multiplication
|
|
||||||
[1]: https://en.wikipedia.org/wiki/Mersenne_prime
|
|
3446
node_modules/bn.js/lib/bn.js
generated
vendored
3446
node_modules/bn.js/lib/bn.js
generated
vendored
File diff suppressed because it is too large
Load diff
64
node_modules/bn.js/package.json
generated
vendored
64
node_modules/bn.js/package.json
generated
vendored
|
@ -1,64 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "bn.js@^4.0.0",
|
|
||||||
"_id": "bn.js@4.12.0",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
|
|
||||||
"_location": "/bn.js",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "bn.js@^4.0.0",
|
|
||||||
"name": "bn.js",
|
|
||||||
"escapedName": "bn.js",
|
|
||||||
"rawSpec": "^4.0.0",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^4.0.0"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/asn1.js"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
|
|
||||||
"_shasum": "775b3f278efbb9718eec7361f483fb36fbbfea88",
|
|
||||||
"_spec": "bn.js@^4.0.0",
|
|
||||||
"_where": "/home/ubuntu/OCSP/node_modules/asn1.js",
|
|
||||||
"author": {
|
|
||||||
"name": "Fedor Indutny",
|
|
||||||
"email": "fedor@indutny.com"
|
|
||||||
},
|
|
||||||
"browser": {
|
|
||||||
"buffer": false
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/indutny/bn.js/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Big number implementation in pure javascript",
|
|
||||||
"devDependencies": {
|
|
||||||
"istanbul": "^0.3.5",
|
|
||||||
"mocha": "^2.1.0",
|
|
||||||
"semistandard": "^7.0.4"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/indutny/bn.js",
|
|
||||||
"keywords": [
|
|
||||||
"BN",
|
|
||||||
"BigNum",
|
|
||||||
"Big number",
|
|
||||||
"Modulo",
|
|
||||||
"Montgomery"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/bn.js",
|
|
||||||
"name": "bn.js",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+ssh://git@github.com/indutny/bn.js.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"lint": "semistandard",
|
|
||||||
"test": "npm run lint && npm run unit",
|
|
||||||
"unit": "mocha --reporter=spec test/*-test.js"
|
|
||||||
},
|
|
||||||
"version": "4.12.0"
|
|
||||||
}
|
|
1
node_modules/call-bind/.eslintignore
generated
vendored
1
node_modules/call-bind/.eslintignore
generated
vendored
|
@ -1 +0,0 @@
|
||||||
coverage/
|
|
17
node_modules/call-bind/.eslintrc
generated
vendored
17
node_modules/call-bind/.eslintrc
generated
vendored
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"root": true,
|
|
||||||
|
|
||||||
"extends": "@ljharb",
|
|
||||||
|
|
||||||
"rules": {
|
|
||||||
"func-name-matching": 0,
|
|
||||||
"id-length": 0,
|
|
||||||
"new-cap": [2, {
|
|
||||||
"capIsNewExceptions": [
|
|
||||||
"GetIntrinsic",
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
"no-magic-numbers": 0,
|
|
||||||
"operator-linebreak": [2, "before"],
|
|
||||||
},
|
|
||||||
}
|
|
12
node_modules/call-bind/.github/FUNDING.yml
generated
vendored
12
node_modules/call-bind/.github/FUNDING.yml
generated
vendored
|
@ -1,12 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: [ljharb]
|
|
||||||
patreon: # Replace with a single Patreon username
|
|
||||||
open_collective: # Replace with a single Open Collective username
|
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
|
||||||
tidelift: npm/call-bind
|
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
||||||
liberapay: # Replace with a single Liberapay username
|
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
|
||||||
otechie: # Replace with a single Otechie username
|
|
||||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
13
node_modules/call-bind/.nycrc
generated
vendored
13
node_modules/call-bind/.nycrc
generated
vendored
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"all": true,
|
|
||||||
"check-coverage": false,
|
|
||||||
"reporter": ["text-summary", "text", "html", "json"],
|
|
||||||
"lines": 86,
|
|
||||||
"statements": 85.93,
|
|
||||||
"functions": 82.43,
|
|
||||||
"branches": 76.06,
|
|
||||||
"exclude": [
|
|
||||||
"coverage",
|
|
||||||
"test"
|
|
||||||
]
|
|
||||||
}
|
|
42
node_modules/call-bind/CHANGELOG.md
generated
vendored
42
node_modules/call-bind/CHANGELOG.md
generated
vendored
|
@ -1,42 +0,0 @@
|
||||||
# Changelog
|
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
||||||
|
|
||||||
## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11
|
|
||||||
|
|
||||||
### Commits
|
|
||||||
|
|
||||||
- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d)
|
|
||||||
|
|
||||||
## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08
|
|
||||||
|
|
||||||
### Commits
|
|
||||||
|
|
||||||
- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1)
|
|
||||||
- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e)
|
|
||||||
- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb)
|
|
||||||
- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8)
|
|
||||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71)
|
|
||||||
- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee)
|
|
||||||
- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2)
|
|
||||||
- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8)
|
|
||||||
- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532)
|
|
||||||
- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6)
|
|
||||||
|
|
||||||
## v1.0.0 - 2020-10-30
|
|
||||||
|
|
||||||
### Commits
|
|
||||||
|
|
||||||
- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50)
|
|
||||||
- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df)
|
|
||||||
- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65)
|
|
||||||
- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249)
|
|
||||||
- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13)
|
|
||||||
- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4)
|
|
||||||
- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717)
|
|
||||||
- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af)
|
|
||||||
- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650)
|
|
||||||
- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f)
|
|
21
node_modules/call-bind/LICENSE
generated
vendored
21
node_modules/call-bind/LICENSE
generated
vendored
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020 Jordan Harband
|
|
||||||
|
|
||||||
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.
|
|
2
node_modules/call-bind/README.md
generated
vendored
2
node_modules/call-bind/README.md
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
# call-bind
|
|
||||||
Robustly `.call.bind()` a function.
|
|
15
node_modules/call-bind/callBound.js
generated
vendored
15
node_modules/call-bind/callBound.js
generated
vendored
|
@ -1,15 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var GetIntrinsic = require('get-intrinsic');
|
|
||||||
|
|
||||||
var callBind = require('./');
|
|
||||||
|
|
||||||
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
|
||||||
|
|
||||||
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
||||||
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
|
||||||
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
||||||
return callBind(intrinsic);
|
|
||||||
}
|
|
||||||
return intrinsic;
|
|
||||||
};
|
|
47
node_modules/call-bind/index.js
generated
vendored
47
node_modules/call-bind/index.js
generated
vendored
|
@ -1,47 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var bind = require('function-bind');
|
|
||||||
var GetIntrinsic = require('get-intrinsic');
|
|
||||||
|
|
||||||
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
||||||
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
||||||
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
||||||
|
|
||||||
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
||||||
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
||||||
var $max = GetIntrinsic('%Math.max%');
|
|
||||||
|
|
||||||
if ($defineProperty) {
|
|
||||||
try {
|
|
||||||
$defineProperty({}, 'a', { value: 1 });
|
|
||||||
} catch (e) {
|
|
||||||
// IE 8 has a broken defineProperty
|
|
||||||
$defineProperty = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = function callBind(originalFunction) {
|
|
||||||
var func = $reflectApply(bind, $call, arguments);
|
|
||||||
if ($gOPD && $defineProperty) {
|
|
||||||
var desc = $gOPD(func, 'length');
|
|
||||||
if (desc.configurable) {
|
|
||||||
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
||||||
$defineProperty(
|
|
||||||
func,
|
|
||||||
'length',
|
|
||||||
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return func;
|
|
||||||
};
|
|
||||||
|
|
||||||
var applyBind = function applyBind() {
|
|
||||||
return $reflectApply(bind, $apply, arguments);
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($defineProperty) {
|
|
||||||
$defineProperty(module.exports, 'apply', { value: applyBind });
|
|
||||||
} else {
|
|
||||||
module.exports.apply = applyBind;
|
|
||||||
}
|
|
108
node_modules/call-bind/package.json
generated
vendored
108
node_modules/call-bind/package.json
generated
vendored
|
@ -1,108 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "call-bind@^1.0.0",
|
|
||||||
"_id": "call-bind@1.0.2",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
|
||||||
"_location": "/call-bind",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "call-bind@^1.0.0",
|
|
||||||
"name": "call-bind",
|
|
||||||
"escapedName": "call-bind",
|
|
||||||
"rawSpec": "^1.0.0",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^1.0.0"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/side-channel"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
|
||||||
"_shasum": "b1d4e89e688119c3c9a903ad30abb2f6a919be3c",
|
|
||||||
"_spec": "call-bind@^1.0.0",
|
|
||||||
"_where": "/home/ubuntu/formidable/node_modules/side-channel",
|
|
||||||
"author": {
|
|
||||||
"name": "Jordan Harband",
|
|
||||||
"email": "ljharb@gmail.com"
|
|
||||||
},
|
|
||||||
"auto-changelog": {
|
|
||||||
"output": "CHANGELOG.md",
|
|
||||||
"template": "keepachangelog",
|
|
||||||
"unreleased": false,
|
|
||||||
"commitLimit": false,
|
|
||||||
"backfillLimit": false,
|
|
||||||
"hideCredit": true
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/ljharb/call-bind/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
|
||||||
"function-bind": "^1.1.1",
|
|
||||||
"get-intrinsic": "^1.0.2"
|
|
||||||
},
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Robustly `.call.bind()` a function",
|
|
||||||
"devDependencies": {
|
|
||||||
"@ljharb/eslint-config": "^17.3.0",
|
|
||||||
"aud": "^1.1.3",
|
|
||||||
"auto-changelog": "^2.2.1",
|
|
||||||
"eslint": "^7.17.0",
|
|
||||||
"nyc": "^10.3.2",
|
|
||||||
"safe-publish-latest": "^1.1.4",
|
|
||||||
"tape": "^5.1.1"
|
|
||||||
},
|
|
||||||
"exports": {
|
|
||||||
".": [
|
|
||||||
{
|
|
||||||
"default": "./index.js"
|
|
||||||
},
|
|
||||||
"./index.js"
|
|
||||||
],
|
|
||||||
"./callBound": [
|
|
||||||
{
|
|
||||||
"default": "./callBound.js"
|
|
||||||
},
|
|
||||||
"./callBound.js"
|
|
||||||
],
|
|
||||||
"./package.json": "./package.json"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/ljharb/call-bind#readme",
|
|
||||||
"keywords": [
|
|
||||||
"javascript",
|
|
||||||
"ecmascript",
|
|
||||||
"es",
|
|
||||||
"js",
|
|
||||||
"callbind",
|
|
||||||
"callbound",
|
|
||||||
"call",
|
|
||||||
"bind",
|
|
||||||
"bound",
|
|
||||||
"call-bind",
|
|
||||||
"call-bound",
|
|
||||||
"function",
|
|
||||||
"es-abstract"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "index.js",
|
|
||||||
"name": "call-bind",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/ljharb/call-bind.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint --ext=.js,.mjs .",
|
|
||||||
"posttest": "aud --production",
|
|
||||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"",
|
|
||||||
"prepublish": "safe-publish-latest",
|
|
||||||
"pretest": "npm run lint",
|
|
||||||
"test": "npm run tests-only",
|
|
||||||
"tests-only": "nyc tape 'test/*'",
|
|
||||||
"version": "auto-changelog && git add CHANGELOG.md"
|
|
||||||
},
|
|
||||||
"version": "1.0.2"
|
|
||||||
}
|
|
55
node_modules/call-bind/test/callBound.js
generated
vendored
55
node_modules/call-bind/test/callBound.js
generated
vendored
|
@ -1,55 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var test = require('tape');
|
|
||||||
|
|
||||||
var callBound = require('../callBound');
|
|
||||||
|
|
||||||
test('callBound', function (t) {
|
|
||||||
// static primitive
|
|
||||||
t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself');
|
|
||||||
t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself');
|
|
||||||
|
|
||||||
// static non-function object
|
|
||||||
t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself');
|
|
||||||
t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself');
|
|
||||||
t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself');
|
|
||||||
t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself');
|
|
||||||
|
|
||||||
// static function
|
|
||||||
t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself');
|
|
||||||
t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself');
|
|
||||||
|
|
||||||
// prototype primitive
|
|
||||||
t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself');
|
|
||||||
t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself');
|
|
||||||
|
|
||||||
// prototype function
|
|
||||||
t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself');
|
|
||||||
t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself');
|
|
||||||
t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original');
|
|
||||||
t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original');
|
|
||||||
|
|
||||||
t['throws'](
|
|
||||||
function () { callBound('does not exist'); },
|
|
||||||
SyntaxError,
|
|
||||||
'nonexistent intrinsic throws'
|
|
||||||
);
|
|
||||||
t['throws'](
|
|
||||||
function () { callBound('does not exist', true); },
|
|
||||||
SyntaxError,
|
|
||||||
'allowMissing arg still throws for unknown intrinsic'
|
|
||||||
);
|
|
||||||
|
|
||||||
/* globals WeakRef: false */
|
|
||||||
t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) {
|
|
||||||
st['throws'](
|
|
||||||
function () { callBound('WeakRef'); },
|
|
||||||
TypeError,
|
|
||||||
'real but absent intrinsic throws'
|
|
||||||
);
|
|
||||||
st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception');
|
|
||||||
st.end();
|
|
||||||
});
|
|
||||||
|
|
||||||
t.end();
|
|
||||||
});
|
|
66
node_modules/call-bind/test/index.js
generated
vendored
66
node_modules/call-bind/test/index.js
generated
vendored
|
@ -1,66 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var callBind = require('../');
|
|
||||||
var bind = require('function-bind');
|
|
||||||
|
|
||||||
var test = require('tape');
|
|
||||||
|
|
||||||
/*
|
|
||||||
* older engines have length nonconfigurable
|
|
||||||
* in io.js v3, it is configurable except on bound functions, hence the .bind()
|
|
||||||
*/
|
|
||||||
var functionsHaveConfigurableLengths = !!(
|
|
||||||
Object.getOwnPropertyDescriptor
|
|
||||||
&& Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable
|
|
||||||
);
|
|
||||||
|
|
||||||
test('callBind', function (t) {
|
|
||||||
var sentinel = { sentinel: true };
|
|
||||||
var func = function (a, b) {
|
|
||||||
// eslint-disable-next-line no-invalid-this
|
|
||||||
return [this, a, b];
|
|
||||||
};
|
|
||||||
t.equal(func.length, 2, 'original function length is 2');
|
|
||||||
t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
|
|
||||||
t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args');
|
|
||||||
t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args');
|
|
||||||
|
|
||||||
var bound = callBind(func);
|
|
||||||
t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
|
||||||
t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args');
|
|
||||||
t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args');
|
|
||||||
t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args');
|
|
||||||
|
|
||||||
var boundR = callBind(func, sentinel);
|
|
||||||
t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
|
||||||
t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
|
|
||||||
t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
|
|
||||||
t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args');
|
|
||||||
|
|
||||||
var boundArg = callBind(func, sentinel, 1);
|
|
||||||
t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
|
||||||
t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
|
|
||||||
t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
|
|
||||||
t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args');
|
|
||||||
|
|
||||||
t.test('callBind.apply', function (st) {
|
|
||||||
var aBound = callBind.apply(func);
|
|
||||||
st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args');
|
|
||||||
st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args');
|
|
||||||
st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args');
|
|
||||||
|
|
||||||
var aBoundArg = callBind.apply(func);
|
|
||||||
st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args');
|
|
||||||
st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args');
|
|
||||||
st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args');
|
|
||||||
|
|
||||||
var aBoundR = callBind.apply(func, sentinel);
|
|
||||||
st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args');
|
|
||||||
st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args');
|
|
||||||
st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args');
|
|
||||||
|
|
||||||
st.end();
|
|
||||||
});
|
|
||||||
|
|
||||||
t.end();
|
|
||||||
});
|
|
15
node_modules/chownr/LICENSE
generated
vendored
15
node_modules/chownr/LICENSE
generated
vendored
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
3
node_modules/chownr/README.md
generated
vendored
3
node_modules/chownr/README.md
generated
vendored
|
@ -1,3 +0,0 @@
|
||||||
Like `chown -R`.
|
|
||||||
|
|
||||||
Takes the same arguments as `fs.chown()`
|
|
167
node_modules/chownr/chownr.js
generated
vendored
167
node_modules/chownr/chownr.js
generated
vendored
|
@ -1,167 +0,0 @@
|
||||||
'use strict'
|
|
||||||
const fs = require('fs')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
|
||||||
const LCHOWN = fs.lchown ? 'lchown' : 'chown'
|
|
||||||
/* istanbul ignore next */
|
|
||||||
const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
|
||||||
const needEISDIRHandled = fs.lchown &&
|
|
||||||
!process.version.match(/v1[1-9]+\./) &&
|
|
||||||
!process.version.match(/v10\.[6-9]/)
|
|
||||||
|
|
||||||
const lchownSync = (path, uid, gid) => {
|
|
||||||
try {
|
|
||||||
return fs[LCHOWNSYNC](path, uid, gid)
|
|
||||||
} catch (er) {
|
|
||||||
if (er.code !== 'ENOENT')
|
|
||||||
throw er
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
|
||||||
const chownSync = (path, uid, gid) => {
|
|
||||||
try {
|
|
||||||
return fs.chownSync(path, uid, gid)
|
|
||||||
} catch (er) {
|
|
||||||
if (er.code !== 'ENOENT')
|
|
||||||
throw er
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
|
||||||
const handleEISDIR =
|
|
||||||
needEISDIRHandled ? (path, uid, gid, cb) => er => {
|
|
||||||
// Node prior to v10 had a very questionable implementation of
|
|
||||||
// fs.lchown, which would always try to call fs.open on a directory
|
|
||||||
// Fall back to fs.chown in those cases.
|
|
||||||
if (!er || er.code !== 'EISDIR')
|
|
||||||
cb(er)
|
|
||||||
else
|
|
||||||
fs.chown(path, uid, gid, cb)
|
|
||||||
}
|
|
||||||
: (_, __, ___, cb) => cb
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
|
||||||
const handleEISDirSync =
|
|
||||||
needEISDIRHandled ? (path, uid, gid) => {
|
|
||||||
try {
|
|
||||||
return lchownSync(path, uid, gid)
|
|
||||||
} catch (er) {
|
|
||||||
if (er.code !== 'EISDIR')
|
|
||||||
throw er
|
|
||||||
chownSync(path, uid, gid)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: (path, uid, gid) => lchownSync(path, uid, gid)
|
|
||||||
|
|
||||||
// fs.readdir could only accept an options object as of node v6
|
|
||||||
const nodeVersion = process.version
|
|
||||||
let readdir = (path, options, cb) => fs.readdir(path, options, cb)
|
|
||||||
let readdirSync = (path, options) => fs.readdirSync(path, options)
|
|
||||||
/* istanbul ignore next */
|
|
||||||
if (/^v4\./.test(nodeVersion))
|
|
||||||
readdir = (path, options, cb) => fs.readdir(path, cb)
|
|
||||||
|
|
||||||
const chown = (cpath, uid, gid, cb) => {
|
|
||||||
fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => {
|
|
||||||
// Skip ENOENT error
|
|
||||||
cb(er && er.code !== 'ENOENT' ? er : null)
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
const chownrKid = (p, child, uid, gid, cb) => {
|
|
||||||
if (typeof child === 'string')
|
|
||||||
return fs.lstat(path.resolve(p, child), (er, stats) => {
|
|
||||||
// Skip ENOENT error
|
|
||||||
if (er)
|
|
||||||
return cb(er.code !== 'ENOENT' ? er : null)
|
|
||||||
stats.name = child
|
|
||||||
chownrKid(p, stats, uid, gid, cb)
|
|
||||||
})
|
|
||||||
|
|
||||||
if (child.isDirectory()) {
|
|
||||||
chownr(path.resolve(p, child.name), uid, gid, er => {
|
|
||||||
if (er)
|
|
||||||
return cb(er)
|
|
||||||
const cpath = path.resolve(p, child.name)
|
|
||||||
chown(cpath, uid, gid, cb)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const cpath = path.resolve(p, child.name)
|
|
||||||
chown(cpath, uid, gid, cb)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const chownr = (p, uid, gid, cb) => {
|
|
||||||
readdir(p, { withFileTypes: true }, (er, children) => {
|
|
||||||
// any error other than ENOTDIR or ENOTSUP means it's not readable,
|
|
||||||
// or doesn't exist. give up.
|
|
||||||
if (er) {
|
|
||||||
if (er.code === 'ENOENT')
|
|
||||||
return cb()
|
|
||||||
else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
|
|
||||||
return cb(er)
|
|
||||||
}
|
|
||||||
if (er || !children.length)
|
|
||||||
return chown(p, uid, gid, cb)
|
|
||||||
|
|
||||||
let len = children.length
|
|
||||||
let errState = null
|
|
||||||
const then = er => {
|
|
||||||
if (errState)
|
|
||||||
return
|
|
||||||
if (er)
|
|
||||||
return cb(errState = er)
|
|
||||||
if (-- len === 0)
|
|
||||||
return chown(p, uid, gid, cb)
|
|
||||||
}
|
|
||||||
|
|
||||||
children.forEach(child => chownrKid(p, child, uid, gid, then))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const chownrKidSync = (p, child, uid, gid) => {
|
|
||||||
if (typeof child === 'string') {
|
|
||||||
try {
|
|
||||||
const stats = fs.lstatSync(path.resolve(p, child))
|
|
||||||
stats.name = child
|
|
||||||
child = stats
|
|
||||||
} catch (er) {
|
|
||||||
if (er.code === 'ENOENT')
|
|
||||||
return
|
|
||||||
else
|
|
||||||
throw er
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (child.isDirectory())
|
|
||||||
chownrSync(path.resolve(p, child.name), uid, gid)
|
|
||||||
|
|
||||||
handleEISDirSync(path.resolve(p, child.name), uid, gid)
|
|
||||||
}
|
|
||||||
|
|
||||||
const chownrSync = (p, uid, gid) => {
|
|
||||||
let children
|
|
||||||
try {
|
|
||||||
children = readdirSync(p, { withFileTypes: true })
|
|
||||||
} catch (er) {
|
|
||||||
if (er.code === 'ENOENT')
|
|
||||||
return
|
|
||||||
else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP')
|
|
||||||
return handleEISDirSync(p, uid, gid)
|
|
||||||
else
|
|
||||||
throw er
|
|
||||||
}
|
|
||||||
|
|
||||||
if (children && children.length)
|
|
||||||
children.forEach(child => chownrKidSync(p, child, uid, gid))
|
|
||||||
|
|
||||||
return handleEISDirSync(p, uid, gid)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = chownr
|
|
||||||
chownr.sync = chownrSync
|
|
65
node_modules/chownr/package.json
generated
vendored
65
node_modules/chownr/package.json
generated
vendored
|
@ -1,65 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "chownr@^2.0.0",
|
|
||||||
"_id": "chownr@2.0.0",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
|
|
||||||
"_location": "/chownr",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "chownr@^2.0.0",
|
|
||||||
"name": "chownr",
|
|
||||||
"escapedName": "chownr",
|
|
||||||
"rawSpec": "^2.0.0",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^2.0.0"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/tar"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
|
|
||||||
"_shasum": "15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece",
|
|
||||||
"_spec": "chownr@^2.0.0",
|
|
||||||
"_where": "/home/ubuntu/fix/node_modules/tar",
|
|
||||||
"author": {
|
|
||||||
"name": "Isaac Z. Schlueter",
|
|
||||||
"email": "i@izs.me",
|
|
||||||
"url": "http://blog.izs.me/"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/isaacs/chownr/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "like `chown -R`",
|
|
||||||
"devDependencies": {
|
|
||||||
"mkdirp": "0.3",
|
|
||||||
"rimraf": "^2.7.1",
|
|
||||||
"tap": "^14.10.6"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"chownr.js"
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/isaacs/chownr#readme",
|
|
||||||
"license": "ISC",
|
|
||||||
"main": "chownr.js",
|
|
||||||
"name": "chownr",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/isaacs/chownr.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"postversion": "npm publish",
|
|
||||||
"prepublishOnly": "git push origin --follow-tags",
|
|
||||||
"preversion": "npm test",
|
|
||||||
"test": "tap"
|
|
||||||
},
|
|
||||||
"tap": {
|
|
||||||
"check-coverage": true
|
|
||||||
},
|
|
||||||
"version": "2.0.0"
|
|
||||||
}
|
|
15
node_modules/dezalgo/LICENSE
generated
vendored
15
node_modules/dezalgo/LICENSE
generated
vendored
|
@ -1,15 +0,0 @@
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
29
node_modules/dezalgo/README.md
generated
vendored
29
node_modules/dezalgo/README.md
generated
vendored
|
@ -1,29 +0,0 @@
|
||||||
# dezalgo
|
|
||||||
|
|
||||||
Contain async insanity so that the dark pony lord doesn't eat souls
|
|
||||||
|
|
||||||
See [this blog
|
|
||||||
post](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony).
|
|
||||||
|
|
||||||
## USAGE
|
|
||||||
|
|
||||||
Pass a callback to `dezalgo` and it will ensure that it is *always*
|
|
||||||
called in a future tick, and never in this tick.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var dz = require('dezalgo')
|
|
||||||
|
|
||||||
var cache = {}
|
|
||||||
function maybeSync(arg, cb) {
|
|
||||||
cb = dz(cb)
|
|
||||||
|
|
||||||
// this will actually defer to nextTick
|
|
||||||
if (cache[arg]) cb(null, cache[arg])
|
|
||||||
|
|
||||||
fs.readFile(arg, function (er, data) {
|
|
||||||
// since this is *already* defered, it will call immediately
|
|
||||||
if (er) cb(er)
|
|
||||||
cb(null, cache[arg] = data)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
```
|
|
22
node_modules/dezalgo/dezalgo.js
generated
vendored
22
node_modules/dezalgo/dezalgo.js
generated
vendored
|
@ -1,22 +0,0 @@
|
||||||
var wrappy = require('wrappy')
|
|
||||||
module.exports = wrappy(dezalgo)
|
|
||||||
|
|
||||||
var asap = require('asap')
|
|
||||||
|
|
||||||
function dezalgo (cb) {
|
|
||||||
var sync = true
|
|
||||||
asap(function () {
|
|
||||||
sync = false
|
|
||||||
})
|
|
||||||
|
|
||||||
return function zalgoSafe() {
|
|
||||||
var args = arguments
|
|
||||||
var me = this
|
|
||||||
if (sync)
|
|
||||||
asap(function() {
|
|
||||||
cb.apply(me, args)
|
|
||||||
})
|
|
||||||
else
|
|
||||||
cb.apply(me, args)
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue