+response.url;
+// 'https://example.com'
+
+response.pipe(process.stdout);
+// Hi!
+```
+
+
+## API
+
+### new Response(statusCode, headers, body, url)
+
+Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
+
+#### statusCode
+
+Type: `number`
+
+HTTP response status code.
+
+#### headers
+
+Type: `object`
+
+HTTP headers object. Keys will be automatically lowercased.
+
+#### body
+
+Type: `buffer`
+
+A Buffer containing the response body. The Buffer contents will be streamable but is also exposed directly as `response.body`.
+
+#### url
+
+Type: `string`
+
+Request URL string.
+
+## License
+
+MIT © Luke Childs
diff --git a/node_modules/responselike/package.json b/node_modules/responselike/package.json
new file mode 100644
index 0000000..1898585
--- /dev/null
+++ b/node_modules/responselike/package.json
@@ -0,0 +1,69 @@
+{
+ "_from": "responselike@^1.0.2",
+ "_id": "responselike@1.0.2",
+ "_inBundle": false,
+ "_integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=",
+ "_location": "/responselike",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "responselike@^1.0.2",
+ "name": "responselike",
+ "escapedName": "responselike",
+ "rawSpec": "^1.0.2",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.2"
+ },
+ "_requiredBy": [
+ "/cacheable-request"
+ ],
+ "_resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
+ "_shasum": "918720ef3b631c5642be068f15ade5a46f4ba1e7",
+ "_spec": "responselike@^1.0.2",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/cacheable-request",
+ "author": {
+ "name": "lukechilds"
+ },
+ "bugs": {
+ "url": "https://github.com/lukechilds/responselike/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "lowercase-keys": "^1.0.0"
+ },
+ "deprecated": false,
+ "description": "A response-like object for mocking a Node.js HTTP response stream",
+ "devDependencies": {
+ "ava": "^0.22.0",
+ "coveralls": "^2.13.1",
+ "eslint-config-xo-lukechilds": "^1.0.0",
+ "get-stream": "^3.0.0",
+ "nyc": "^11.1.0",
+ "xo": "^0.19.0"
+ },
+ "homepage": "https://github.com/lukechilds/responselike#readme",
+ "keywords": [
+ "http",
+ "https",
+ "response",
+ "mock",
+ "request",
+ "responselike"
+ ],
+ "license": "MIT",
+ "main": "src/index.js",
+ "name": "responselike",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lukechilds/responselike.git"
+ },
+ "scripts": {
+ "coverage": "nyc report --reporter=text-lcov | coveralls",
+ "test": "xo && nyc ava"
+ },
+ "version": "1.0.2",
+ "xo": {
+ "extends": "xo-lukechilds"
+ }
+}
diff --git a/node_modules/responselike/src/index.js b/node_modules/responselike/src/index.js
new file mode 100644
index 0000000..b17b481
--- /dev/null
+++ b/node_modules/responselike/src/index.js
@@ -0,0 +1,34 @@
+'use strict';
+
+const Readable = require('stream').Readable;
+const lowercaseKeys = require('lowercase-keys');
+
+class Response extends Readable {
+ constructor(statusCode, headers, body, url) {
+ if (typeof statusCode !== 'number') {
+ throw new TypeError('Argument `statusCode` should be a number');
+ }
+ if (typeof headers !== 'object') {
+ throw new TypeError('Argument `headers` should be an object');
+ }
+ if (!(body instanceof Buffer)) {
+ throw new TypeError('Argument `body` should be a buffer');
+ }
+ if (typeof url !== 'string') {
+ throw new TypeError('Argument `url` should be a string');
+ }
+
+ super();
+ this.statusCode = statusCode;
+ this.headers = lowercaseKeys(headers);
+ this.body = body;
+ this.url = url;
+ }
+
+ _read() {
+ this.push(this.body);
+ this.push(null);
+ }
+}
+
+module.exports = Response;
diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json
index bb16002..09d8bc7 100644
--- a/node_modules/safe-buffer/package.json
+++ b/node_modules/safe-buffer/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"safe-buffer@5.1.2",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "safe-buffer@5.1.2",
@@ -30,7 +30,7 @@
],
"_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"_spec": "5.1.2",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
diff --git a/node_modules/safer-buffer/package.json b/node_modules/safer-buffer/package.json
index ca67e7b..de7c388 100644
--- a/node_modules/safer-buffer/package.json
+++ b/node_modules/safer-buffer/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"safer-buffer@2.1.2",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "safer-buffer@2.1.2",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"_spec": "2.1.2",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"author": {
"name": "Nikita Skovoroda",
"email": "chalkerx@gmail.com",
diff --git a/node_modules/sanitize-html/CHANGELOG.md b/node_modules/sanitize-html/CHANGELOG.md
new file mode 100644
index 0000000..8ba3de1
--- /dev/null
+++ b/node_modules/sanitize-html/CHANGELOG.md
@@ -0,0 +1,370 @@
+# Changelog
+
+## 2.6.0 (2021-11-23)
+
+- Support for regular expressions in the `allowedClasses` option. Thanks to [Alex Rantos](https://github.com/alex-rantos).
+
+## 2.5.3 (2021-11-02):
+
+- Fixed bug introduced by klona 2.0.5, by removing klona entirely.
+
+## 2.5.2 (2021-10-13):
+
+- Nullish HTML input now returns an empty string. Nullish value may be explicit `null`, `undefined` or implicit `undefined` when value is not provided. Thanks to Artem Kostiuk for the contribution.
+- Documented that all text content is escaped. Thanks to Siddharth Singh.
+
+## 2.5.1 (2021-09-14):
+- The `allowedScriptHostnames` and `allowedScriptDomains` options now implicitly purge the inline content of all script tags, not just those with `src` attributes. This behavior was already strongly implied by the fact that they purged it in the case where a `src` attribute was actually present, and is necessary for the feature to provide any real security. Thanks to Grigorii Duca for pointing out the issue.
+
+## 2.5.0 (2021-09-08):
+
+- New `allowedScriptHostnames` option, it enables you to specify which hostnames are allowed in a script tag.
+- New `allowedScriptDomains` option, it enables you to specify which domains are allowed in a script tag. Thank you to [Yorick Girard](https://github.com/yorickgirard) for this and the `allowedScriptHostnames` contribution.
+- Updates whitelist to allowlist.
+
+## 2.4.0 (2021-05-19):
+- Added support for class names with wildcards in `allowedClasses`. Thanks to [zhangbenber](https://github.com/zhangbenber) for the contribution.
+
+## 2.3.3 (2021-03-19):
+- Security fix: `allowedSchemes` and related options did not properly block schemes containing a hyphen, plus sign, period or digit, such as `ms-calculator:`. Thanks to Lukas Euler for pointing out the issue.
+- Added a security note about the known risks associated with using the `parser` option, especially `decodeEntities: false`. See the documentation.
+
+## 2.3.2 (2021-01-26):
+
+- Additional fixes for iframe validation exploits. Prevent exploits based on browsers' tolerance of the use of "\" rather than "/" and the presence of whitespace at this point in the URL. Thanks to Ron Masas of [Checkmarx](https://www.checkmarx.com/) for pointing out the issue and writing unit tests.
+- Updates README `yarn add` syntax. Thanks to [Tagir Khadshiev](https://github.com/Aspedm) for the contribution.
+
+## 2.3.1 (2021-01-22):
+- Uses the standard WHATWG URL parser to stop IDNA (Internationalized Domain Name) attacks on the iframe hostname validator. Thanks to Ron Masas of [Checkmarx](https://www.checkmarx.com/) for pointing out the issue and suggesting the use of the WHATWG parser.
+
+## 2.3.0 (2020-12-16):
+- Upgrades `htmlparser2` to new major version `^6.0.0`. Thanks to [Bogdan Chadkin](https://github.com/TrySound) for the contribution.
+
+## 2.2.0 (2020-12-02):
+- Adds a note to the README about Typescript support (or the lack-thereof).
+- Adds `tel` to the default `allowedSchemes`. Thanks to [Arne Herbots](https://github.com/aHerbots) for this contribution.
+
+## 2.1.2 (2020-11-04):
+- Fixes typos and inconsistencies in the README. Thanks to [Eric Lefevre-Ardant](https://github.com/elefevre) for this contribution.
+
+## 2.1.1 (2020-10-21):
+- Fixes a bug when using `allowedClasses` with an `'*'` wildcard selector. Thanks to [Clemens Damke](https://github.com/Cortys) for this contribution.
+- Updates mocha to 7.x to resolve security warnings.
+
+## 2.1.0 (2020-10-07):
+- `sup` added to the default allowed tags list. Thanks to [Julian Lam](https://github.com/julianlam) for the contribution.
+- Updates default `allowedTags` README documentation. Thanks to [Marco Arduini](https://github.com/nerfologist) for the contribution.
+
+## 2.0.0 (2020-09-23):
+- `nestingLimit` option added.
+- Updates ESLint config package and fixes warnings.
+- Upgrade `is-plain-object` package with named export. Thanks to [Bogdan Chadkin](https://github.com/TrySound) for the contribution.
+- Upgrade `postcss` package and drop Node 11 and Node 13 support (enforced by postcss).
+
+### Backwards compatibility breaks:
+- There is no build. You should no longer directly link to a sanitize-html file directly in the browser as it is using modern Javascript that is not fully supported by all major browsers (depending on your definition). You should now include sanitize-html in your project build for this purpose if you have one.
+- On the server side, Node.js 10 or higher is required.
+- The default `allowedTags` array was updated significantly. This mostly added HTML tags to be more comprehensive by default. You should review your projects and consider the `allowedTags` defaults if you are not already overriding them.
+
+## 2.0.0-rc.2 (2020-09-09):
+- Always use existing `has` function rather than duplicating it.
+
+## 2.0.0-rc.1 (2020-08-26):
+- Upgrade `klona` package. Thanks to [Bogdan Chadkin](https://github.com/TrySound) for the contribution.
+
+## 2.0.0-beta.2:
+- Add `files` to `package.json` to prevent publishing unnecessary files to npm #392. Thanks to [styfle](https://github.com/styfle) for the contribution.
+- Removes `iframe` and `nl` from default allowed tags. Adds most innocuous tags to the default `allowedTags` array.
+- Fixes a bug when using `transformTags` with out `textFilter`. Thanks to [Andrzej Porebski](https://github.com/andpor) for the help with a failing test.
+
+## 2.0.0-beta:
+- Moves the `index.js` file to the project root and removes all build steps within the package. Going forward, it is up to the developer to include sanitize-html in their project builds as-needed. This removes major points of conflict with project code and frees this module to not worry about myriad build-related questions.
+- Replaces lodash with utility packages: klona, is-plain-object, deepmerge, escape-string-regexp.
+- Makes custom tag transformations less error-prone by escaping frame `innerText`. Thanks to [Mike Samuel](https://github.com/mikesamuel) for the contribution. Prior to this patch, tag transformations which turned an attribute
+value into a text node could be vulnerable to code execution.
+- Updates code to use modern features including `const`/`let` variable assignment.
+- ESLint clean up.
+- Updates `is-plain-object` to the 4.x major version.
+- Updates `srcset` to the 3.x major version.
+
+Thanks to [Bogdan Chadkin](https://github.com/TrySound) for contributions to this major version update.
+
+## 1.27.5 (2020-09-23):
+- Updates README to include ES modules syntax.
+
+## 1.27.4 (2020-08-26):
+- Fixes an IE11 regression from using `Array.prototype.includes`, replacing it with `Array.prototype.indexOf`.
+
+## 1.27.3 (2020-08-12):
+- Fixes a bug when using `transformTags` with out `textFilter`. Thanks to [Andrzej Porebski](https://github.com/andpor) for the help with a failing test.
+
+## 1.27.2 (2020-07-29):
+- Fixes CHANGELOG links. Thanks to [Alex Mayer](https://github.com/amayer5125) for the contribution.
+- Replaces `srcset` with `parse-srcset`. Thanks to [Massimiliano Mirra](https://github.com/bard) for the contribution.
+
+## 1.27.1 (2020-07-15):
+- Removes the unused chalk dependency.
+- Adds configuration for a Github stale bot.
+- Replace `xtend` package with native `Object.assign`.
+
+## 1.27.0:
+- Adds the `allowedIframeDomains` option. This works similar to `allowedIframeHostnames`, where you would set it to an array of web domains. It would then permit any hostname on those domains to be used in iframe `src` attributes. Thanks to [Stanislav Kravchenko](https://github.com/StanisLove) for the contribution.
+
+## 1.26.0:
+- Adds the `option` element to the default `nonTextTagsArray` of tags with contents that aren't meant to be displayed visually as text. This can be overridden with the `nonTextTags` option.
+
+## 1.25.0:
+- Adds `enforceHtmlBoundary` option to process code bounded by the `html` tag, discarding any code outside of those tags.
+- Migrates to the main lodash package from the per method packages since they are deprecated and cause code duplication. Thanks to [Merceyz](https://github.com/merceyz) for the contribution.
+- Adds a warning when `style` and `script` tags are allowed, as they are inherently vulnerable to being used in XSS attacks. That warning can be disabled by including the option `allowVulnerableTags: true` so this choice is knowing and explicit.
+
+## 1.24.0:
+- Fixes a bug where self-closing tags resulted in deletion with `disallowedTagsMode: 'escape'` set. Thanks to [Thiago Negri](https://github.com/thiago-negri) for the contribution.
+- Adds `abbr` to the default `allowedTags` for better accessibility support. Thanks to [Will Farrell](https://github.com/willfarrell) for the contribution.
+- Adds a `mediaChildren` property to the `frame` object in custom filters. This allows you to check for links or other parent tags that contain self-contained media to prevent collapse, regardless of whether there is also text inside. Thanks to [axdg](https://github.com/axdg) for the initial implementation and [Marco Arduini](https://github.com/nerfologist) for a failing test contribution.
+
+## 1.23.0:
+- Adds eslint configuration and adds eslint to test script.
+- Sets `sideEffects: false` on package.json to allow module bundlers like webpack tree-shake this module and all the dependencies from client build. Thanks to [Egor Voronov](https://github.com/egorvoronov) for the contribution.
+- Adds the `tagName` (HTML element name) as a second parameter passed to `textFilter`. Thanks to [Slava](https://github.com/slavaGanzin) for the contribution.
+
+## 1.22.1:
+ncreases the patch version of `lodash.mergewith` to enforce an audit fix.
+
+## 1.22.0:
+bumped `htmlparser2` dependency to the 4.x series. This fixes longstanding bugs and should cause no bc breaks for this module, since the only bc breaks upstream are in regard to features we don't expose in this module.
+
+## 1.21.1:
+fixed issue with bad `main` setting in package.json that broke 1.21.0.
+
+## 1.21.0:
+new `disallowedTagsMode` option can be set to `escape` to escape disallowed tags rather than discarding them. Any subtags are handled as usual. If you want to recursively escape them too, you can set `disallowedTagsMode` to `recursiveEscape`. Thanks to Yehonatan Zecharia for this contribution.
+
+## 1.20.1:
+Fix failing tests, add CircleCI config
+
+## 1.20.0:
+reduced size of npm package via the `files` key; we only need to publish what's in `dist`. Thanks to Steven. There should be zero impact on behavior, minor version bump is precautionary.
+
+## 1.19.3:
+reverted to `postcss` due to a [reported issue with `css-tree` that might or might not have XSS implications](https://github.com/punkave/sanitize-html/issues/269).
+
+## 1.19.2:
+
+* Switched out the heavy `postcss` dependency for the lightweight `css-tree` module. No API changes. Thanks to Justin Braithwaite.
+* Various doc updates. Thanks to Pulkit Aggarwal and Cody Robertson.
+
+## 1.19.1:
+
+* `"` characters are now entity-escaped only when they appear in attribute values, reducing the verbosity of the resulting markup.
+
+* Fixed a regression introduced in version 1.18.5 in the handling of markup that looks similar to a valid entity, but isn't. The bogus entity was passed through intact, i.e. `&0;` did not become `&0;` as it should have. This fix has been made for the default parser settings only. There is no fix yet for those who wish to enable `decodeEntities: false`. That will require improving the alternative encoder in the `escapeHtml` function to only pass 100% valid entities.
+
+**For those using the default `parser` settings this bug is fixed.** Read on if you are using alternative `parser` settings.
+
+When `decodeEntities: true` is in effect (the default), this is not a problem because we only have to encode `& < > "` and we always encode those things.
+
+There is currently a commented-out test which verifies one example of the problem when `decodeEntities` is false. However a correct implementation would need to not only pass that simple example but correctly escape all invalid entities, and not escape those that are valid.
+
+## 1.19.0:
+
+* New `allowIframeRelativeUrls` option. It defaults to `true` unless `allowedIframeHostnames` is present, in which case it defaults to false, for backwards compatibility with existing behavior in both cases; however you can now set the option explicitly to allow both certain hostnames and relative URLs. Thanks to Rick Martin.
+
+## 1.18.5:
+
+* Stop double encoding ampersands on HTML entities. Thanks to Will Gibson.
+
+## 1.18.4:
+
+* Removed incorrect `browser` key, restoring frontend build. Thanks to Felix Becker.
+
+## 1.18.3:
+
+* `iframe` is an allowed tag by default, to better facilitate typical use cases and the use of the `allowedIframeHostnames` option.
+* Documentation improvements.
+* More browser packaging improvements.
+* Protocol-relative URLs are properly supported for iframe tags.
+
+## 1.18.2:
+
+* Travis tests passing.
+* Fixed another case issue — and instituted Travis CI testing so this doesn't happen again. Sorry for the hassle.
+
+## 1.18.1:
+
+* A file was required with incorrect case, breaking the library on case sensitive filesystems such as Linux. Fixed.
+
+## 1.18.0:
+
+* The new `allowedSchemesAppliedToAttributes` option. This determines which attributes are validated as URLs, replacing the old hardcoded list of `src` and `href` only. The default list now includes `cite`. Thanks to ml-dublin for this contribution.
+* It is now easy to configure a specific list of allowed values for an attribute. When configuring `allowedAttributes`, rather than listing an attribute name, simply list an object with an attribute `name` property and an allowed `values` array property. You can also add `multiple: true` to allow multiple space-separated allowed values in the attribute, otherwise the attribute must match one and only one of the allowed values. Thanks again to ml-dublin for this contribution.
+* Fixed a bug in the npm test procedure.
+
+## 1.17.0:
+The new `allowedIframeHostnames` option. If present, this must be an array, and only iframe `src` URLs hostnames (complete hostnames; domain name matches are not enough) that appear on this list are allowed. You must also configure `hostname` as an allowed attribute for `iframe`. Thanks to Ryan Verys for this contribution.
+
+## 1.16.3:
+Don't throw away the browserified versions before publishing them. `prepare` is not a good place to `make clean`, it runs after `prepublish`.
+
+## 1.16.2:
+`sanitize-html` is now compiled with `babel`. An npm `prepublish` script takes care of this at `npm publish` time, so the latest code should always be compiled to operate all the way back to ES5 browsers and earlier versions of Node. Thanks to Ayushya Jaiswal.
+
+Please note that running `sanitize-html` in the browser is usually a security hole. Are you trusting the browser? Anyone could bypass that using the network panel. Sanitization is almost always best done on servers and that is the primary use case for this module.
+
+## 1.16.1:
+changelog formatting only.
+
+## 1.16.0:
+support for sanitizing inline CSS styles, by specifying the allowed attributes and a regular expression for each. Thanks to Cameron Will and Michael Loschiavo.
+
+## 1.15.0:
+if configured as an allowed attribute (not the default), check for naughty URLs in `srcset` attributes. Thanks to Mike Samuel for the nudge to do this and to Sindre Sorhus for the `srcset` module.
+
+## 1.14.3:
+inadvertent removal of lodash regexp quote dependency in 1.14.2 has been corrected.
+
+## 1.14.2:
+protocol-relative URL detection must spot URLs starting with `\\` rather than `//` due to ages-old tolerance features of web browsers, intended for sleepy Windows developers. Thanks to Martin Bajanik.
+
+## 1.14.1:
+documented `allowProtocolRelative` option. No code changes from 1.14.0, released a few moments ago.
+
+## 1.14.0:
+the new `allowProtocolRelative` option, which is set to `true` by default, allows you to decline to accept URLs that start with `//` and thus point to a different host using the current protocol. If you do **not** want to permit this, set this option to `false`. This is fully backwards compatible because the default behavior is to allow them. Thanks to Luke Bernard.
+
+## 1.13.0:
+`transformTags` can now add text to an element that initially had none. Thanks to Dushyant Singh.
+
+## 1.12.0:
+option to build for browser-side use. Thanks to Michael Blum.
+
+## 1.11.4:
+fixed crash when `__proto__` is a tag name. Now using a safe check for the existence of properties in all cases. Thanks to Andrew Krasichkov.
+
+Fixed XSS attack vector via `textarea` tags (when explicitly allowed). Decided that `script` (obviously) and `style` (due to its own XSS vectors) cannot realistically be afforded any XSS protection if allowed, unless we add a full CSS parser. Thanks again to Andrew Krasichkov.
+
+## 1.11.3:
+bumped `htmlparser2` version to address crashing bug in older version. Thanks to e-jigsaw.
+
+## 1.11.2:
+fixed README typo that interfered with readability due to markdown issues. No code changes. Thanks to Mikael Korpela. Also improved code block highlighting in README. Thanks to Alex Siman.
+
+## 1.11.1:
+fixed a regression introduced in 1.11.0 which caused the closing tag of the parent of a `textarea` tag to be lost. Thanks to Stefano Sala, who contributed the missing test.
+
+## 1.11.0:
+added the `nonTextTags` option, with tests.
+
+## 1.10.1:
+documentation cleanup. No code changes. Thanks to Rex Schrader.
+
+## 1.10.0:
+`allowedAttributes` now allows you to allow attributes for all tags by specifying `*` as the tag name. Thanks to Zdravko Georgiev.
+
+## 1.9.0:
+`parser` option allows options to be passed directly to `htmlparser`. Thanks to Danny Scott.
+
+## 1.8.0:
+
+* `transformTags` now accepts the `*` wildcard to transform all tags. Thanks to Jamy Timmermans.
+
+* Text that has been modified by `transformTags` is then passed through `textFilter`. Thanks to Pavlo Yurichuk.
+
+* Content inside `textarea` is discarded if `textarea` is not allowed. I don't know why it took me this long to see that this is just common sense. Thanks to David Frank.
+
+## 1.7.2:
+removed `array-includes` dependency in favor of `indexOf`, which is a little more verbose but slightly faster and doesn't require a shim. Thanks again to Joseph Dykstra.
+
+## 1.7.1:
+removed lodash dependency, adding lighter dependencies and polyfills in its place. Thanks to Joseph Dykstra.
+
+## 1.7.0:
+introduced `allowedSchemesByTag` option. Thanks to Cameron Will.
+
+## 1.6.1:
+the string `'undefined'` (as opposed to `undefined`) is perfectly valid text and shouldn't be expressly converted to the empty string.
+
+## 1.6.0:
+added `textFilter` option. Thanks to Csaba Palfi.
+
+## 1.5.3:
+do not escape special characters inside a script or style element, if they are allowed. This is consistent with the way browsers parse them; nothing closes them except the appropriate closing tag for the entire element. Of course, this only comes into play if you actually choose to allow those tags. Thanks to aletorrado.
+
+## 1.5.2:
+guard checks for allowed attributes correctly to avoid an undefined property error. Thanks to Zeke.
+
+## 1.5.1:
+updated to htmlparser2 1.8.x. Started using the `decodeEntities` option, which allows us to pass our filter evasion tests without the need to recursively invoke the filter.
+
+## 1.5.0:
+support for `*` wildcards in allowedAttributes. With tests. Thanks to Calvin Montgomery.
+
+## 1.4.3:
+invokes itself recursively until the markup stops changing to guard against [this issue](https://github.com/fb55/htmlparser2/issues/105). Bump to htmlparser2 version 3.7.x.
+
+## 1.4.1, 1.4.2:
+more tests.
+
+## 1.4.0:
+ability to allow all attributes or tags through by setting `allowedAttributes` and/or `allowedTags` to false. Thanks to Anand Thakker.
+
+## 1.3.0:
+`attribs` now available on frames passed to exclusive filter.
+
+## 1.2.3:
+fixed another possible XSS attack vector; no definitive exploit was found but it looks possible. [See this issue.](https://github.com/punkave/sanitize-html/pull/20) Thanks to Jim O'Brien.
+
+## 1.2.2:
+reject `javascript:` URLs when disguised with an internal comment. This is probably not respected by browsers anyway except when inside an XML data island element, which you almost certainly are not allowing in your `allowedTags`, but we aim to be thorough. Thanks to Jim O'Brien.
+
+## 1.2.1:
+fixed crashing bug when presented with bad markup. The bug was in the `exclusiveFilter` mechanism. Unit test added. Thanks to Ilya Kantor for catching it.
+
+## 1.2.0:
+* The `allowedClasses` option now allows you to permit CSS classes in a fine-grained way.
+
+* Text passed to your `exclusiveFilter` function now includes the text of child elements, making it more useful for identifying elements that truly lack any inner text.
+
+## 1.1.7:
+use `he` for entity decoding, because it is more actively maintained.
+
+## 1.1.6:
+`allowedSchemes` option for those who want to permit `data` URLs and such.
+
+## 1.1.5:
+just a packaging thing.
+
+## 1.1.4:
+custom exclusion filter.
+
+## 1.1.3:
+moved to lodash. 1.1.2 pointed to the wrong version of lodash.
+
+## 1.1.0:
+the `transformTags` option was added. Thanks to [kl3ryk](https://github.com/kl3ryk).
+
+## 1.0.3:
+fixed several more javascript URL attack vectors after [studying the XSS filter evasion cheat sheet](https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet) to better understand my enemy. Whitespace characters (codes from 0 to 32), which browsers ignore in URLs in certain cases allowing the "javascript" scheme to be snuck in, are now stripped out when checking for naughty URLs. Thanks again to [pinpickle](https://github.com/pinpickle).
+
+## 1.0.2:
+fixed a javascript URL attack vector. naughtyHref must entity-decode URLs and also check for mixed-case scheme names. Thanks to [pinpickle](https://github.com/pinpickle).
+
+## 1.0.1:
+Doc tweaks.
+
+## 1.0.0:
+If the style tag is disallowed, then its content should be dumped, so that it doesn't appear as text. We were already doing this for script tags, however in both cases the content is now preserved if the tag is explicitly allowed.
+
+We're rocking our tests and have been working great in production for months, so: declared 1.0.0 stable.
+
+## 0.1.3:
+do not double-escape entities in attributes or text. Turns out the "text" provided by htmlparser2 is already escaped.
+
+## 0.1.2:
+packaging error meant it wouldn't install properly.
+
+## 0.1.1:
+discard the text of script tags.
+
+## 0.1.0:
+initial release.
diff --git a/node_modules/sanitize-html/LICENSE b/node_modules/sanitize-html/LICENSE
new file mode 100644
index 0000000..57f8866
--- /dev/null
+++ b/node_modules/sanitize-html/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2013, 2014, 2015 P'unk Avenue LLC
+
+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.
diff --git a/node_modules/sanitize-html/README.md b/node_modules/sanitize-html/README.md
new file mode 100644
index 0000000..414984a
--- /dev/null
+++ b/node_modules/sanitize-html/README.md
@@ -0,0 +1,644 @@
+# sanitize-html
+
+[](https://circleci.com/gh/apostrophecms/sanitize-html/tree/main)
+
+
+
+sanitize-html provides a simple HTML sanitizer with a clear API.
+
+sanitize-html is tolerant. It is well suited for cleaning up HTML fragments such as those created by CKEditor and other rich text editors. It is especially handy for removing unwanted CSS when copying and pasting from Word.
+
+sanitize-html allows you to specify the tags you want to permit, and the permitted attributes for each of those tags.
+
+If a tag is not permitted, the contents of the tag are not discarded. There are
+some exceptions to this, discussed below in the "Discarding the entire contents
+of a disallowed tag" section.
+
+The syntax of poorly closed `p` and `img` elements is cleaned up.
+
+`href` attributes are validated to ensure they only contain `http`, `https`, `ftp` and `mailto` URLs. Relative URLs are also allowed. Ditto for `src` attributes.
+
+Allowing particular urls as a `src` to an iframe tag by filtering hostnames is also supported.
+
+HTML comments are not preserved.
+Additionally, `sanitize-html` escapes _ALL_ text content - this means that ampersands, greater-than, and less-than signs are converted to their equivalent HTML character references (`&` --> `&`, `<` --> `<`, and so on). Additionally, in attribute values, quotation marks are escaped as well (`"` --> `"`).
+
+## Requirements
+
+sanitize-html is intended for use with Node.js and supports Node 10+. All of its npm dependencies are pure JavaScript. sanitize-html is built on the excellent `htmlparser2` module.
+
+### Regarding TypeScript
+
+sanitize-html is not written in TypeScript and there is no plan to directly support it. There is a community supported typing definition, [`@types/sanitize-html`](https://www.npmjs.com/package/@types/sanitize-html), however.
+```bash
+npm install -D @types/sanitize-html
+```
+If `esModuleInterop=true` is not set in your `tsconfig.json` file, you have to import it with:
+
+```javascript
+import * as sanitizeHtml from 'sanitize-html';
+```
+
+Any questions or problems while using `@types/sanitize-html` should be directed to its maintainers as directed by that project's contribution guidelines.
+
+## How to use
+
+### Browser
+
+*Think first: why do you want to use it in the browser?* Remember, *servers must never trust browsers.* You can't sanitize HTML for saving on the server anywhere else but on the server.
+
+But, perhaps you'd like to display sanitized HTML immediately in the browser for preview. Or ask the browser to do the sanitization work on every page load. You can if you want to!
+
+* Install the package:
+
+```bash
+npm install sanitize-html
+```
+or
+```
+yarn add sanitize-html
+```
+
+The primary change in the 2.x version of sanitize-html is that it no longer includes a build that is ready for browser use. Developers are expected to include sanitize-html in their project builds (e.g., webpack) as they would any other dependency. So while sanitize-html is no longer ready to link to directly in HTML, developers can now more easily process it according to their needs.
+
+Once built and linked in the browser with other project Javascript, it can be used to sanitize HTML strings in front end code:
+
+```javascript
+import sanitizeHtml from 'sanitize-html';
+
+const html = "hello world";
+console.log(sanitizeHtml(html));
+console.log(sanitizeHtml("
"));
+console.log(sanitizeHtml("console.log('hello world')"));
+console.log(sanitizeHtml(""));
+```
+
+### Node (Recommended)
+
+Install module from console:
+
+```bash
+npm install sanitize-html
+```
+
+Import the module:
+
+```js
+// In ES modules
+import sanitizeHtml from 'sanitize-html';
+
+// Or in CommonJS
+const sanitizeHtml = require('sanitize-html');
+```
+
+Use it in your JavaScript app:
+
+```js
+const dirty = 'some really tacky HTML';
+const clean = sanitizeHtml(dirty);
+```
+
+That will allow our [default list of allowed tags and attributes](#default-options) through. It's a nice set, but probably not quite what you want. So:
+
+```js
+// Allow only a super restricted set of tags and attributes
+const clean = sanitizeHtml(dirty, {
+ allowedTags: [ 'b', 'i', 'em', 'strong', 'a' ],
+ allowedAttributes: {
+ 'a': [ 'href' ]
+ },
+ allowedIframeHostnames: ['www.youtube.com']
+});
+```
+
+Boom!
+
+### Default options
+
+```js
+allowedTags: [
+ "address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4",
+ "h5", "h6", "hgroup", "main", "nav", "section", "blockquote", "dd", "div",
+ "dl", "dt", "figcaption", "figure", "hr", "li", "main", "ol", "p", "pre",
+ "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn",
+ "em", "i", "kbd", "mark", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp",
+ "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "caption",
+ "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr"
+],
+disallowedTagsMode: 'discard',
+allowedAttributes: {
+ a: [ 'href', 'name', 'target' ],
+ // We don't currently allow img itself by default, but this
+ // would make sense if we did. You could add srcset here,
+ // and if you do the URL is checked for safety
+ img: [ 'src' ]
+},
+// Lots of these won't come up by default because we don't allow them
+selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ],
+// URL schemes we permit
+allowedSchemes: [ 'http', 'https', 'ftp', 'mailto', 'tel' ],
+allowedSchemesByTag: {},
+allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite' ],
+allowProtocolRelative: true,
+enforceHtmlBoundary: false
+```
+
+### Common use cases
+
+#### "I like your set but I want to add one more tag. Is there a convenient way?"
+
+Sure:
+
+```js
+const clean = sanitizeHtml(dirty, {
+ allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ])
+});
+```
+
+If you do not specify `allowedTags` or `allowedAttributes`, our default list is applied. So if you really want an empty list, specify one.
+
+#### "What if I want to allow all tags or all attributes?"
+
+Simple! Instead of leaving `allowedTags` or `allowedAttributes` out of the options, set either
+one or both to `false`:
+
+```js
+allowedTags: false,
+allowedAttributes: false
+```
+
+#### "What if I don't want to allow *any* tags?"
+
+Also simple! Set `allowedTags` to `[]` and `allowedAttributes` to `{}`.
+
+```js
+allowedTags: [],
+allowedAttributes: {}
+```
+
+#### "What if I want disallowed tags to be escaped rather than discarded?"
+
+If you set `disallowedTagsMode` to `discard` (the default), disallowed tags are discarded. Any text content or subtags is still included, depending on whether the individual subtags are allowed.
+
+If you set `disallowedTagsMode` to `escape`, the disallowed tags are escaped rather than discarded. Any text or subtags is handled normally.
+
+If you set `disallowedTagsMode` to `recursiveEscape`, the disallowed tags are escaped rather than discarded, and the same treatment is applied to all subtags, whether otherwise allowed or not.
+
+#### "What if I want to allow only specific values on some attributes?"
+
+When configuring the attribute in `allowedAttributes` simply use an object with attribute `name` and an allowed `values` array. In the following example `sandbox="allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-scripts"` would become `sandbox="allow-popups allow-scripts"`:
+
+```js
+allowedAttributes: {
+ iframe: [
+ {
+ name: 'sandbox',
+ multiple: true,
+ values: ['allow-popups', 'allow-same-origin', 'allow-scripts']
+ }
+ ]
+}
+```
+
+With `multiple: true`, several allowed values may appear in the same attribute, separated by spaces. Otherwise the attribute must exactly match one and only one of the allowed values.
+
+### Wildcards for attributes
+
+You can use the `*` wildcard to allow all attributes with a certain prefix:
+
+```js
+allowedAttributes: {
+ a: [ 'href', 'data-*' ]
+}
+```
+
+Also you can use the `*` as name for a tag, to allow listed attributes to be valid for any tag:
+
+```js
+allowedAttributes: {
+ '*': [ 'href', 'align', 'alt', 'center', 'bgcolor' ]
+}
+```
+
+## Additional options
+
+### Allowed CSS Classes
+
+If you wish to allow specific CSS classes on a particular element, you can do so with the `allowedClasses` option. Any other CSS classes are discarded.
+
+This implies that the `class` attribute is allowed on that element.
+
+```javascript
+// Allow only a restricted set of CSS classes and only on the p tag
+const clean = sanitizeHtml(dirty, {
+ allowedTags: [ 'p', 'em', 'strong' ],
+ allowedClasses: {
+ 'p': [ 'fancy', 'simple' ]
+ }
+});
+```
+
+Similar to `allowedAttributes`, you can use `*` to allow classes with a certain prefix, or use `*` as a tag name to allow listed classes to be valid for any tag:
+
+```js
+allowedClasses: {
+ 'code': [ 'language-*', 'lang-*' ],
+ '*': [ 'fancy', 'simple' ]
+}
+```
+
+Furthermore, regular expressions are supported too:
+
+```js
+allowedClasses: {
+ p: [ /^regex\d{2}$/ ]
+}
+```
+
+> Note: It is advised that your regular expressions always begin with `^` so that you are requiring a known prefix. A regular expression with neither `^` nor `$` just requires that something appear in the middle.
+
+### Allowed CSS Styles
+
+If you wish to allow specific CSS _styles_ on a particular element, you can do that with the `allowedStyles` option. Simply declare your desired attributes as regular expression options within an array for the given attribute. Specific elements will inherit allowlisted attributes from the global (`*`) attribute. Any other CSS classes are discarded.
+
+**You must also use `allowedAttributes`** to activate the `style` attribute for the relevant elements. Otherwise this feature will never come into play.
+
+**When constructing regular expressions, don't forget `^` and `$`.** It's not enough to say "the string should contain this." It must also say "and only this."
+
+**URLs in inline styles are NOT filtered by any mechanism other than your regular expression.**
+
+```javascript
+const clean = sanitizeHtml(dirty, {
+ allowedTags: ['p'],
+ allowedAttributes: {
+ 'p': ["style"],
+ },
+ allowedStyles: {
+ '*': {
+ // Match HEX and RGB
+ 'color': [/^#(0x)?[0-9a-f]+$/i, /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/],
+ 'text-align': [/^left$/, /^right$/, /^center$/],
+ // Match any number with px, em, or %
+ 'font-size': [/^\d+(?:px|em|%)$/]
+ },
+ 'p': {
+ 'font-size': [/^\d+rem$/]
+ }
+ }
+ });
+```
+
+### Discarding text outside of `````` tags
+
+Some text editing applications generate HTML to allow copying over to a web application. These can sometimes include undesireable control characters after terminating `html` tag. By default sanitize-html will not discard these characters, instead returning them in sanitized string. This behaviour can be modified using `enforceHtmlBoundary` option.
+
+Setting this option to true will instruct sanitize-html to discard all characters outside of `html` tag boundaries -- before `` and after `` tags.
+
+```js
+enforceHtmlBoundary: true
+```
+
+### htmlparser2 Options
+
+sanitize-html is built on `htmlparser2`. By default the only option passed down is `decodeEntities: true`. You can set the options to pass by using the parser option.
+
+**Security note: changing the `parser` settings can be risky.** In particular, `decodeEntities: false` has known security concerns and a complete test suite does not exist for every possible combination of settings when used with `sanitize-html`. If security is your goal we recommend you use the defaults rather than changing `parser`, except for the `lowerCaseTags` option.
+
+```javascript
+const clean = sanitizeHtml(dirty, {
+ allowedTags: ['a'],
+ parser: {
+ lowerCaseTags: true
+ }
+});
+```
+See the [htmlparser2 wiki](https://github.com/fb55/htmlparser2/wiki/Parser-options) for the full list of possible options.
+
+### Transformations
+
+What if you want to add or change an attribute? What if you want to transform one tag to another? No problem, it's simple!
+
+The easiest way (will change all `ol` tags to `ul` tags):
+
+```js
+const clean = sanitizeHtml(dirty, {
+ transformTags: {
+ 'ol': 'ul',
+ }
+});
+```
+
+The most advanced usage:
+
+```js
+const clean = sanitizeHtml(dirty, {
+ transformTags: {
+ 'ol': function(tagName, attribs) {
+ // My own custom magic goes here
+ return {
+ tagName: 'ul',
+ attribs: {
+ class: 'foo'
+ }
+ };
+ }
+ }
+});
+```
+
+You can specify the `*` wildcard instead of a tag name to transform all tags.
+
+There is also a helper method which should be enough for simple cases in which you want to change the tag and/or add some attributes:
+
+```js
+const clean = sanitizeHtml(dirty, {
+ transformTags: {
+ 'ol': sanitizeHtml.simpleTransform('ul', {class: 'foo'}),
+ }
+});
+```
+
+The `simpleTransform` helper method has 3 parameters:
+
+```js
+simpleTransform(newTag, newAttributes, shouldMerge)
+```
+
+The last parameter (`shouldMerge`) is set to `true` by default. When `true`, `simpleTransform` will merge the current attributes with the new ones (`newAttributes`). When `false`, all existing attributes are discarded.
+
+You can also add or modify the text contents of a tag:
+
+```js
+const clean = sanitizeHtml(dirty, {
+ transformTags: {
+ 'a': function(tagName, attribs) {
+ return {
+ tagName: 'a',
+ text: 'Some text'
+ };
+ }
+ }
+});
+```
+For example, you could transform a link element with missing anchor text:
+```js
+
+```
+To a link with anchor text:
+```js
+Some text
+```
+
+### Filters
+
+You can provide a filter function to remove unwanted tags. Let's suppose we need to remove empty `a` tags like:
+
+```html
+
+```
+
+We can do that with the following filter:
+
+```js
+sanitizeHtml(
+ 'This is
Linux
',
+ {
+ exclusiveFilter: function(frame) {
+ return frame.tag === 'a' && !frame.text.trim();
+ }
+ }
+);
+```
+
+The `frame` object supplied to the callback provides the following attributes:
+
+- `tag`: The tag name, i.e. `'img'`.
+- `attribs`: The tag's attributes, i.e. `{ src: "/path/to/tux.png" }`.
+- `text`: The text content of the tag.
+- `mediaChildren`: Immediate child tags that are likely to represent self-contained media (e.g., `img`, `video`, `picture`, `iframe`). See the `mediaTags` variable in `src/index.js` for the full list.
+- `tagPosition`: The index of the tag's position in the result string.
+
+You can also process all text content with a provided filter function. Let's say we want an ellipsis instead of three dots.
+
+```html
+some text...
+```
+
+We can do that with the following filter:
+
+```js
+sanitizeHtml(
+ 'some text...
',
+ {
+ textFilter: function(text, tagName) {
+ if (['a'].indexOf(tagName) > -1) return //Skip anchor tags
+
+ return text.replace(/\.\.\./, '…');
+ }
+ }
+);
+```
+
+Note that the text passed to the `textFilter` method is already escaped for safe display as HTML. You may add markup and use entity escape sequences in your `textFilter`.
+
+### Iframe Filters
+
+If you would like to allow iframe tags but want to control the domains that are allowed through, you can provide an array of hostnames and/or array of domains that you would like to allow as iframe sources. This hostname is a property in the options object passed as an argument to the sanitize-html function.
+
+These arrays will be checked against the html that is passed to the function and return only `src` urls that include the allowed hostnames or domains in the object. The url in the html that is passed must be formatted correctly (valid hostname) as an embedded iframe otherwise the module will strip out the src from the iframe.
+
+Make sure to pass a valid hostname along with the domain you wish to allow, i.e.:
+
+```js
+allowedIframeHostnames: ['www.youtube.com', 'player.vimeo.com'],
+allowedIframeDomains: ['zoom.us']
+```
+
+You may also specify whether or not to allow relative URLs as iframe sources.
+
+```js
+allowIframeRelativeUrls: true
+```
+
+Note that if unspecified, relative URLs will be allowed by default if no hostname or domain filter is provided but removed by default if a hostname or domain filter is provided.
+
+**Remember that the `iframe` tag must be allowed as well as the `src` attribute.**
+
+For example:
+
+```javascript
+const clean = sanitizeHtml('', {
+ allowedTags: [ 'p', 'em', 'strong', 'iframe' ],
+ allowedClasses: {
+ 'p': [ 'fancy', 'simple' ],
+ },
+ allowedAttributes: {
+ 'iframe': ['src']
+ },
+ allowedIframeHostnames: ['www.youtube.com', 'player.vimeo.com']
+});
+```
+
+will pass through as safe whereas:
+
+```javascript
+const clean = sanitizeHtml('
', {
+ allowedTags: [ 'p', 'em', 'strong', 'iframe' ],
+ allowedClasses: {
+ 'p': [ 'fancy', 'simple' ],
+ },
+ allowedAttributes: {
+ 'iframe': ['src']
+ },
+ allowedIframeHostnames: ['www.youtube.com', 'player.vimeo.com']
+});
+```
+
+or
+
+```javascript
+const clean = sanitizeHtml('
', {
+ allowedTags: [ 'p', 'em', 'strong', 'iframe' ],
+ allowedClasses: {
+ 'p': [ 'fancy', 'simple' ],
+ },
+ allowedAttributes: {
+ 'iframe': ['src']
+ },
+ allowedIframeHostnames: ['www.youtube.com', 'player.vimeo.com']
+});
+```
+
+will return an empty iframe tag.
+
+If you want to allow any subdomain of any level you can provide the domain in `allowedIframeDomains`
+
+```javascript
+// This iframe markup will pass through as safe.
+const clean = sanitizeHtml('
', {
+ allowedTags: [ 'p', 'em', 'strong', 'iframe' ],
+ allowedClasses: {
+ 'p': [ 'fancy', 'simple' ],
+ },
+ allowedAttributes: {
+ 'iframe': ['src']
+ },
+ allowedIframeHostnames: ['www.youtube.com', 'player.vimeo.com'],
+ allowedIframeDomains: ['zoom.us']
+});
+```
+
+### Script Filters
+
+Similarly to iframes you can allow a script tag on a list of allowlisted domains
+
+```js
+const clean = sanitizeHtml('', {
+ allowedTags: ['script'],
+ allowedAttributes: {
+ script: ['src']
+ },
+ allowedScriptDomains: ['authorized.com'],
+})
+```
+
+You can allow a script tag on a list of allowlisted hostnames too
+
+```js
+const clean = sanitizeHtml('', {
+ allowedTags: ['script'],
+ allowedAttributes: {
+ script: ['src']
+ },
+ allowedScriptHostnames: [ 'www.authorized.com' ],
+})
+```
+
+### Allowed URL schemes
+
+By default, we allow the following URL schemes in cases where `href`, `src`, etc. are allowed:
+
+```js
+[ 'http', 'https', 'ftp', 'mailto' ]
+```
+
+You can override this if you want to:
+
+```js
+sanitizeHtml(
+ // teeny-tiny valid transparent GIF in a data URL
+ '
',
+ {
+ allowedTags: [ 'img', 'p' ],
+ allowedSchemes: [ 'data', 'http' ]
+ }
+);
+```
+
+You can also allow a scheme for a particular tag only:
+
+```js
+allowedSchemes: [ 'http', 'https' ],
+allowedSchemesByTag: {
+ img: [ 'data' ]
+}
+```
+
+And you can forbid the use of protocol-relative URLs (starting with `//`) to access another site using the current protocol, which is allowed by default:
+
+```js
+allowProtocolRelative: false
+```
+
+### Discarding the entire contents of a disallowed tag
+
+Normally, with a few exceptions, if a tag is not allowed, all of the text within it is preserved, and so are any allowed tags within it.
+
+The exceptions are:
+
+`style`, `script`, `textarea`, `option`
+
+If you wish to replace this list, for instance to discard whatever is found
+inside a `noscript` tag, use the `nonTextTags` option:
+
+```js
+nonTextTags: [ 'style', 'script', 'textarea', 'option', 'noscript' ]
+```
+
+Note that if you use this option you are responsible for stating the entire list. This gives you the power to retain the content of `textarea`, if you want to.
+
+The content still gets escaped properly, with the exception of the `script` and
+`style` tags. *Allowing either `script` or `style` leaves you open to XSS
+attacks. Don't do that* unless you have good reason to trust their origin.
+sanitize-html will log a warning if these tags are allowed, which can be
+disabled with the `allowVulnerableTags: true` option.
+
+### Choose what to do with disallowed tags
+
+Instead of discarding, or keeping text only, you may enable escaping of the entire content:
+
+```js
+disallowedTagsMode: 'escape'
+```
+
+This will transform `content` to `<disallowed>content</disallowed>`
+
+Valid values are: `'discard'` (default), `'escape'` (escape the tag) and `'recursiveEscape'` (to escape the tag and all its content).
+
+### Restricting deep nesting
+
+You can limit the depth of HTML tags in the document with the `nestingLimit` option:
+
+```javascript
+nestingLimit: 6
+```
+
+This will prevent the user from nesting tags more than 6 levels deep. Tags deeper than that are stripped out exactly as if they were disallowed. Note that this means text is preserved in the usual ways where appropriate.
+
+## About ApostropheCMS
+
+sanitize-html was created at [P'unk Avenue](https://punkave.com) for use in [ApostropheCMS](https://apostrophecms.com), an open-source content management system built on Node.js. If you like sanitize-html you should definitely check out ApostropheCMS.
+
+## Support
+
+Feel free to open issues on [github](https://github.com/apostrophecms/sanitize-html).
diff --git a/node_modules/sanitize-html/index.js b/node_modules/sanitize-html/index.js
new file mode 100644
index 0000000..ed87028
--- /dev/null
+++ b/node_modules/sanitize-html/index.js
@@ -0,0 +1,816 @@
+const htmlparser = require('htmlparser2');
+const escapeStringRegexp = require('escape-string-regexp');
+const { isPlainObject } = require('is-plain-object');
+const deepmerge = require('deepmerge');
+const parseSrcset = require('parse-srcset');
+const { parse: postcssParse } = require('postcss');
+// Tags that can conceivably represent stand-alone media.
+const mediaTags = [
+ 'img', 'audio', 'video', 'picture', 'svg',
+ 'object', 'map', 'iframe', 'embed'
+];
+// Tags that are inherently vulnerable to being used in XSS attacks.
+const vulnerableTags = [ 'script', 'style' ];
+
+function each(obj, cb) {
+ if (obj) {
+ Object.keys(obj).forEach(function (key) {
+ cb(obj[key], key);
+ });
+ }
+}
+
+// Avoid false positives with .__proto__, .hasOwnProperty, etc.
+function has(obj, key) {
+ return ({}).hasOwnProperty.call(obj, key);
+}
+
+// Returns those elements of `a` for which `cb(a)` returns truthy
+function filter(a, cb) {
+ const n = [];
+ each(a, function(v) {
+ if (cb(v)) {
+ n.push(v);
+ }
+ });
+ return n;
+}
+
+function isEmptyObject(obj) {
+ for (const key in obj) {
+ if (has(obj, key)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+function stringifySrcset(parsedSrcset) {
+ return parsedSrcset.map(function(part) {
+ if (!part.url) {
+ throw new Error('URL missing');
+ }
+
+ return (
+ part.url +
+ (part.w ? ` ${part.w}w` : '') +
+ (part.h ? ` ${part.h}h` : '') +
+ (part.d ? ` ${part.d}x` : '')
+ );
+ }).join(', ');
+}
+
+module.exports = sanitizeHtml;
+
+// A valid attribute name.
+// We use a tolerant definition based on the set of strings defined by
+// html.spec.whatwg.org/multipage/parsing.html#before-attribute-name-state
+// and html.spec.whatwg.org/multipage/parsing.html#attribute-name-state .
+// The characters accepted are ones which can be appended to the attribute
+// name buffer without triggering a parse error:
+// * unexpected-equals-sign-before-attribute-name
+// * unexpected-null-character
+// * unexpected-character-in-attribute-name
+// We exclude the empty string because it's impossible to get to the after
+// attribute name state with an empty attribute name buffer.
+const VALID_HTML_ATTRIBUTE_NAME = /^[^\0\t\n\f\r /<=>]+$/;
+
+// Ignore the _recursing flag; it's there for recursive
+// invocation as a guard against this exploit:
+// https://github.com/fb55/htmlparser2/issues/105
+
+function sanitizeHtml(html, options, _recursing) {
+ if (html == null) {
+ return '';
+ }
+
+ let result = '';
+ // Used for hot swapping the result variable with an empty string in order to "capture" the text written to it.
+ let tempResult = '';
+
+ function Frame(tag, attribs) {
+ const that = this;
+ this.tag = tag;
+ this.attribs = attribs || {};
+ this.tagPosition = result.length;
+ this.text = ''; // Node inner text
+ this.mediaChildren = [];
+
+ this.updateParentNodeText = function() {
+ if (stack.length) {
+ const parentFrame = stack[stack.length - 1];
+ parentFrame.text += that.text;
+ }
+ };
+
+ this.updateParentNodeMediaChildren = function() {
+ if (stack.length && mediaTags.includes(this.tag)) {
+ const parentFrame = stack[stack.length - 1];
+ parentFrame.mediaChildren.push(this.tag);
+ }
+ };
+ }
+
+ options = Object.assign({}, sanitizeHtml.defaults, options);
+ options.parser = Object.assign({}, htmlParserDefaults, options.parser);
+
+ // vulnerableTags
+ vulnerableTags.forEach(function (tag) {
+ if (
+ options.allowedTags && options.allowedTags.indexOf(tag) > -1 &&
+ !options.allowVulnerableTags
+ ) {
+ console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${tag}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`);
+ }
+ });
+
+ // Tags that contain something other than HTML, or where discarding
+ // the text when the tag is disallowed makes sense for other reasons.
+ // If we are not allowing these tags, we should drop their content too.
+ // For other tags you would drop the tag but keep its content.
+ const nonTextTagsArray = options.nonTextTags || [
+ 'script',
+ 'style',
+ 'textarea',
+ 'option'
+ ];
+ let allowedAttributesMap;
+ let allowedAttributesGlobMap;
+ if (options.allowedAttributes) {
+ allowedAttributesMap = {};
+ allowedAttributesGlobMap = {};
+ each(options.allowedAttributes, function(attributes, tag) {
+ allowedAttributesMap[tag] = [];
+ const globRegex = [];
+ attributes.forEach(function(obj) {
+ if (typeof obj === 'string' && obj.indexOf('*') >= 0) {
+ globRegex.push(escapeStringRegexp(obj).replace(/\\\*/g, '.*'));
+ } else {
+ allowedAttributesMap[tag].push(obj);
+ }
+ });
+ if (globRegex.length) {
+ allowedAttributesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');
+ }
+ });
+ }
+ const allowedClassesMap = {};
+ const allowedClassesGlobMap = {};
+ const allowedClassesRegexMap = {};
+ each(options.allowedClasses, function(classes, tag) {
+ // Implicitly allows the class attribute
+ if (allowedAttributesMap) {
+ if (!has(allowedAttributesMap, tag)) {
+ allowedAttributesMap[tag] = [];
+ }
+ allowedAttributesMap[tag].push('class');
+ }
+
+ allowedClassesMap[tag] = [];
+ allowedClassesRegexMap[tag] = [];
+ const globRegex = [];
+ classes.forEach(function(obj) {
+ if (typeof obj === 'string' && obj.indexOf('*') >= 0) {
+ globRegex.push(escapeStringRegexp(obj).replace(/\\\*/g, '.*'));
+ } else if (obj instanceof RegExp) {
+ allowedClassesRegexMap[tag].push(obj);
+ } else {
+ allowedClassesMap[tag].push(obj);
+ }
+ });
+ if (globRegex.length) {
+ allowedClassesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');
+ }
+ });
+
+ const transformTagsMap = {};
+ let transformTagsAll;
+ each(options.transformTags, function(transform, tag) {
+ let transFun;
+ if (typeof transform === 'function') {
+ transFun = transform;
+ } else if (typeof transform === 'string') {
+ transFun = sanitizeHtml.simpleTransform(transform);
+ }
+ if (tag === '*') {
+ transformTagsAll = transFun;
+ } else {
+ transformTagsMap[tag] = transFun;
+ }
+ });
+
+ let depth;
+ let stack;
+ let skipMap;
+ let transformMap;
+ let skipText;
+ let skipTextDepth;
+ let addedText = false;
+
+ initializeState();
+
+ const parser = new htmlparser.Parser({
+ onopentag: function(name, attribs) {
+ // If `enforceHtmlBoundary` is `true` and this has found the opening
+ // `html` tag, reset the state.
+ if (options.enforceHtmlBoundary && name === 'html') {
+ initializeState();
+ }
+
+ if (skipText) {
+ skipTextDepth++;
+ return;
+ }
+ const frame = new Frame(name, attribs);
+ stack.push(frame);
+
+ let skip = false;
+ const hasText = !!frame.text;
+ let transformedTag;
+ if (has(transformTagsMap, name)) {
+ transformedTag = transformTagsMap[name](name, attribs);
+
+ frame.attribs = attribs = transformedTag.attribs;
+
+ if (transformedTag.text !== undefined) {
+ frame.innerText = transformedTag.text;
+ }
+
+ if (name !== transformedTag.tagName) {
+ frame.name = name = transformedTag.tagName;
+ transformMap[depth] = transformedTag.tagName;
+ }
+ }
+ if (transformTagsAll) {
+ transformedTag = transformTagsAll(name, attribs);
+
+ frame.attribs = attribs = transformedTag.attribs;
+ if (name !== transformedTag.tagName) {
+ frame.name = name = transformedTag.tagName;
+ transformMap[depth] = transformedTag.tagName;
+ }
+ }
+
+ if ((options.allowedTags && options.allowedTags.indexOf(name) === -1) || (options.disallowedTagsMode === 'recursiveEscape' && !isEmptyObject(skipMap)) || (options.nestingLimit != null && depth >= options.nestingLimit)) {
+ skip = true;
+ skipMap[depth] = true;
+ if (options.disallowedTagsMode === 'discard') {
+ if (nonTextTagsArray.indexOf(name) !== -1) {
+ skipText = true;
+ skipTextDepth = 1;
+ }
+ }
+ skipMap[depth] = true;
+ }
+ depth++;
+ if (skip) {
+ if (options.disallowedTagsMode === 'discard') {
+ // We want the contents but not this tag
+ return;
+ }
+ tempResult = result;
+ result = '';
+ }
+ result += '<' + name;
+
+ if (name === 'script') {
+ if (options.allowedScriptHostnames || options.allowedScriptDomains) {
+ frame.innerText = '';
+ }
+ }
+
+ if (!allowedAttributesMap || has(allowedAttributesMap, name) || allowedAttributesMap['*']) {
+ each(attribs, function(value, a) {
+ if (!VALID_HTML_ATTRIBUTE_NAME.test(a)) {
+ // This prevents part of an attribute name in the output from being
+ // interpreted as the end of an attribute, or end of a tag.
+ delete frame.attribs[a];
+ return;
+ }
+ let parsed;
+ // check allowedAttributesMap for the element and attribute and modify the value
+ // as necessary if there are specific values defined.
+ let passedAllowedAttributesMapCheck = false;
+ if (!allowedAttributesMap ||
+ (has(allowedAttributesMap, name) && allowedAttributesMap[name].indexOf(a) !== -1) ||
+ (allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1) ||
+ (has(allowedAttributesGlobMap, name) && allowedAttributesGlobMap[name].test(a)) ||
+ (allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a))) {
+ passedAllowedAttributesMapCheck = true;
+ } else if (allowedAttributesMap && allowedAttributesMap[name]) {
+ for (const o of allowedAttributesMap[name]) {
+ if (isPlainObject(o) && o.name && (o.name === a)) {
+ passedAllowedAttributesMapCheck = true;
+ let newValue = '';
+ if (o.multiple === true) {
+ // verify the values that are allowed
+ const splitStrArray = value.split(' ');
+ for (const s of splitStrArray) {
+ if (o.values.indexOf(s) !== -1) {
+ if (newValue === '') {
+ newValue = s;
+ } else {
+ newValue += ' ' + s;
+ }
+ }
+ }
+ } else if (o.values.indexOf(value) >= 0) {
+ // verified an allowed value matches the entire attribute value
+ newValue = value;
+ }
+ value = newValue;
+ }
+ }
+ }
+ if (passedAllowedAttributesMapCheck) {
+ if (options.allowedSchemesAppliedToAttributes.indexOf(a) !== -1) {
+ if (naughtyHref(name, value)) {
+ delete frame.attribs[a];
+ return;
+ }
+ }
+
+ if (name === 'script' && a === 'src') {
+
+ let allowed = true;
+
+ try {
+ const parsed = new URL(value);
+
+ if (options.allowedScriptHostnames || options.allowedScriptDomains) {
+ const allowedHostname = (options.allowedScriptHostnames || []).find(function (hostname) {
+ return hostname === parsed.hostname;
+ });
+ const allowedDomain = (options.allowedScriptDomains || []).find(function(domain) {
+ return parsed.hostname === domain || parsed.hostname.endsWith(`.${domain}`);
+ });
+ allowed = allowedHostname || allowedDomain;
+ }
+ } catch (e) {
+ allowed = false;
+ }
+
+ if (!allowed) {
+ delete frame.attribs[a];
+ return;
+ }
+ }
+
+ if (name === 'iframe' && a === 'src') {
+ let allowed = true;
+ try {
+ // Chrome accepts \ as a substitute for / in the // at the
+ // start of a URL, so rewrite accordingly to prevent exploit.
+ // Also drop any whitespace at that point in the URL
+ value = value.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/, '$1//');
+ if (value.startsWith('relative:')) {
+ // An attempt to exploit our workaround for base URLs being
+ // mandatory for relative URL validation in the WHATWG
+ // URL parser, reject it
+ throw new Error('relative: exploit attempt');
+ }
+ // naughtyHref is in charge of whether protocol relative URLs
+ // are cool. Here we are concerned just with allowed hostnames and
+ // whether to allow relative URLs.
+ //
+ // Build a placeholder "base URL" against which any reasonable
+ // relative URL may be parsed successfully
+ let base = 'relative://relative-site';
+ for (let i = 0; (i < 100); i++) {
+ base += `/${i}`;
+ }
+ const parsed = new URL(value, base);
+ const isRelativeUrl = parsed && parsed.hostname === 'relative-site' && parsed.protocol === 'relative:';
+ if (isRelativeUrl) {
+ // default value of allowIframeRelativeUrls is true
+ // unless allowedIframeHostnames or allowedIframeDomains specified
+ allowed = has(options, 'allowIframeRelativeUrls')
+ ? options.allowIframeRelativeUrls
+ : (!options.allowedIframeHostnames && !options.allowedIframeDomains);
+ } else if (options.allowedIframeHostnames || options.allowedIframeDomains) {
+ const allowedHostname = (options.allowedIframeHostnames || []).find(function (hostname) {
+ return hostname === parsed.hostname;
+ });
+ const allowedDomain = (options.allowedIframeDomains || []).find(function(domain) {
+ return parsed.hostname === domain || parsed.hostname.endsWith(`.${domain}`);
+ });
+ allowed = allowedHostname || allowedDomain;
+ }
+ } catch (e) {
+ // Unparseable iframe src
+ allowed = false;
+ }
+ if (!allowed) {
+ delete frame.attribs[a];
+ return;
+ }
+ }
+ if (a === 'srcset') {
+ try {
+ parsed = parseSrcset(value);
+ parsed.forEach(function(value) {
+ if (naughtyHref('srcset', value.url)) {
+ value.evil = true;
+ }
+ });
+ parsed = filter(parsed, function(v) {
+ return !v.evil;
+ });
+ if (!parsed.length) {
+ delete frame.attribs[a];
+ return;
+ } else {
+ value = stringifySrcset(filter(parsed, function(v) {
+ return !v.evil;
+ }));
+ frame.attribs[a] = value;
+ }
+ } catch (e) {
+ // Unparseable srcset
+ delete frame.attribs[a];
+ return;
+ }
+ }
+ if (a === 'class') {
+ const allowedSpecificClasses = allowedClassesMap[name];
+ const allowedWildcardClasses = allowedClassesMap['*'];
+ const allowedSpecificClassesGlob = allowedClassesGlobMap[name];
+ const allowedSpecificClassesRegex = allowedClassesRegexMap[name];
+ const allowedWildcardClassesGlob = allowedClassesGlobMap['*'];
+ const allowedClassesGlobs = [
+ allowedSpecificClassesGlob,
+ allowedWildcardClassesGlob
+ ]
+ .concat(allowedSpecificClassesRegex)
+ .filter(function (t) {
+ return t;
+ });
+ if (allowedSpecificClasses && allowedWildcardClasses) {
+ value = filterClasses(value, deepmerge(allowedSpecificClasses, allowedWildcardClasses), allowedClassesGlobs);
+ } else {
+ value = filterClasses(value, allowedSpecificClasses || allowedWildcardClasses, allowedClassesGlobs);
+ }
+ if (!value.length) {
+ delete frame.attribs[a];
+ return;
+ }
+ }
+ if (a === 'style') {
+ try {
+ const abstractSyntaxTree = postcssParse(name + ' {' + value + '}');
+ const filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles);
+
+ value = stringifyStyleAttributes(filteredAST);
+
+ if (value.length === 0) {
+ delete frame.attribs[a];
+ return;
+ }
+ } catch (e) {
+ delete frame.attribs[a];
+ return;
+ }
+ }
+ result += ' ' + a;
+ if (value && value.length) {
+ result += '="' + escapeHtml(value, true) + '"';
+ }
+ } else {
+ delete frame.attribs[a];
+ }
+ });
+ }
+ if (options.selfClosing.indexOf(name) !== -1) {
+ result += ' />';
+ } else {
+ result += '>';
+ if (frame.innerText && !hasText && !options.textFilter) {
+ result += escapeHtml(frame.innerText);
+ addedText = true;
+ }
+ }
+ if (skip) {
+ result = tempResult + escapeHtml(result);
+ tempResult = '';
+ }
+ },
+ ontext: function(text) {
+ if (skipText) {
+ return;
+ }
+ const lastFrame = stack[stack.length - 1];
+ let tag;
+
+ if (lastFrame) {
+ tag = lastFrame.tag;
+ // If inner text was set by transform function then let's use it
+ text = lastFrame.innerText !== undefined ? lastFrame.innerText : text;
+ }
+
+ if (options.disallowedTagsMode === 'discard' && ((tag === 'script') || (tag === 'style'))) {
+ // htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing
+ // script tags is, by definition, game over for XSS protection, so if that's
+ // your concern, don't allow them. The same is essentially true for style tags
+ // which have their own collection of XSS vectors.
+ result += text;
+ } else {
+ const escaped = escapeHtml(text, false);
+ if (options.textFilter && !addedText) {
+ result += options.textFilter(escaped, tag);
+ } else if (!addedText) {
+ result += escaped;
+ }
+ }
+ if (stack.length) {
+ const frame = stack[stack.length - 1];
+ frame.text += text;
+ }
+ },
+ onclosetag: function(name) {
+
+ if (skipText) {
+ skipTextDepth--;
+ if (!skipTextDepth) {
+ skipText = false;
+ } else {
+ return;
+ }
+ }
+
+ const frame = stack.pop();
+ if (!frame) {
+ // Do not crash on bad markup
+ return;
+ }
+ skipText = options.enforceHtmlBoundary ? name === 'html' : false;
+ depth--;
+ const skip = skipMap[depth];
+ if (skip) {
+ delete skipMap[depth];
+ if (options.disallowedTagsMode === 'discard') {
+ frame.updateParentNodeText();
+ return;
+ }
+ tempResult = result;
+ result = '';
+ }
+
+ if (transformMap[depth]) {
+ name = transformMap[depth];
+ delete transformMap[depth];
+ }
+
+ if (options.exclusiveFilter && options.exclusiveFilter(frame)) {
+ result = result.substr(0, frame.tagPosition);
+ return;
+ }
+
+ frame.updateParentNodeMediaChildren();
+ frame.updateParentNodeText();
+
+ if (options.selfClosing.indexOf(name) !== -1) {
+ // Already output />
+ if (skip) {
+ result = tempResult;
+ tempResult = '';
+ }
+ return;
+ }
+
+ result += '' + name + '>';
+ if (skip) {
+ result = tempResult + escapeHtml(result);
+ tempResult = '';
+ }
+ }
+ }, options.parser);
+ parser.write(html);
+ parser.end();
+
+ return result;
+
+ function initializeState() {
+ result = '';
+ depth = 0;
+ stack = [];
+ skipMap = {};
+ transformMap = {};
+ skipText = false;
+ skipTextDepth = 0;
+ }
+
+ function escapeHtml(s, quote) {
+ if (typeof (s) !== 'string') {
+ s = s + '';
+ }
+ if (options.parser.decodeEntities) {
+ s = s.replace(/&/g, '&').replace(//g, '>');
+ if (quote) {
+ s = s.replace(/"/g, '"');
+ }
+ }
+ // TODO: this is inadequate because it will pass `&0;`. This approach
+ // will not work, each & must be considered with regard to whether it
+ // is followed by a 100% syntactically valid entity or not, and escaped
+ // if it is not. If this bothers you, don't set parser.decodeEntities
+ // to false. (The default is true.)
+ s = s.replace(/&(?![a-zA-Z0-9#]{1,20};)/g, '&') // Match ampersands not part of existing HTML entity
+ .replace(//g, '>');
+ if (quote) {
+ s = s.replace(/"/g, '"');
+ }
+ return s;
+ }
+
+ function naughtyHref(name, href) {
+ // Browsers ignore character codes of 32 (space) and below in a surprising
+ // number of situations. Start reading here:
+ // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab
+ // eslint-disable-next-line no-control-regex
+ href = href.replace(/[\x00-\x20]+/g, '');
+ // Clobber any comments in URLs, which the browser might
+ // interpret inside an XML data island, allowing
+ // a javascript: URL to be snuck through
+ href = href.replace(//g, '');
+ // Case insensitive so we don't get faked out by JAVASCRIPT #1
+ // Allow more characters after the first so we don't get faked
+ // out by certain schemes browsers accept
+ const matches = href.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);
+ if (!matches) {
+ // Protocol-relative URL starting with any combination of '/' and '\'
+ if (href.match(/^[/\\]{2}/)) {
+ return !options.allowProtocolRelative;
+ }
+
+ // No scheme
+ return false;
+ }
+ const scheme = matches[1].toLowerCase();
+
+ if (has(options.allowedSchemesByTag, name)) {
+ return options.allowedSchemesByTag[name].indexOf(scheme) === -1;
+ }
+
+ return !options.allowedSchemes || options.allowedSchemes.indexOf(scheme) === -1;
+ }
+
+ /**
+ * Filters user input css properties by allowlisted regex attributes.
+ * Modifies the abstractSyntaxTree object.
+ *
+ * @param {object} abstractSyntaxTree - Object representation of CSS attributes.
+ * @property {array[Declaration]} abstractSyntaxTree.nodes[0] - Each object cointains prop and value key, i.e { prop: 'color', value: 'red' }.
+ * @param {object} allowedStyles - Keys are properties (i.e color), value is list of permitted regex rules (i.e /green/i).
+ * @return {object} - The modified tree.
+ */
+ function filterCss(abstractSyntaxTree, allowedStyles) {
+ if (!allowedStyles) {
+ return abstractSyntaxTree;
+ }
+
+ const astRules = abstractSyntaxTree.nodes[0];
+ let selectedRule;
+
+ // Merge global and tag-specific styles into new AST.
+ if (allowedStyles[astRules.selector] && allowedStyles['*']) {
+ selectedRule = deepmerge(
+ allowedStyles[astRules.selector],
+ allowedStyles['*']
+ );
+ } else {
+ selectedRule = allowedStyles[astRules.selector] || allowedStyles['*'];
+ }
+
+ if (selectedRule) {
+ abstractSyntaxTree.nodes[0].nodes = astRules.nodes.reduce(filterDeclarations(selectedRule), []);
+ }
+
+ return abstractSyntaxTree;
+ }
+
+ /**
+ * Extracts the style attribues from an AbstractSyntaxTree and formats those
+ * values in the inline style attribute format.
+ *
+ * @param {AbstractSyntaxTree} filteredAST
+ * @return {string} - Example: "color:yellow;text-align:center;font-family:helvetica;"
+ */
+ function stringifyStyleAttributes(filteredAST) {
+ return filteredAST.nodes[0].nodes
+ .reduce(function(extractedAttributes, attributeObject) {
+ extractedAttributes.push(
+ attributeObject.prop + ':' + attributeObject.value
+ );
+ return extractedAttributes;
+ }, [])
+ .join(';');
+ }
+
+ /**
+ * Filters the existing attributes for the given property. Discards any attributes
+ * which don't match the allowlist.
+ *
+ * @param {object} selectedRule - Example: { color: red, font-family: helvetica }
+ * @param {array} allowedDeclarationsList - List of declarations which pass the allowlist.
+ * @param {object} attributeObject - Object representing the current css property.
+ * @property {string} attributeObject.type - Typically 'declaration'.
+ * @property {string} attributeObject.prop - The CSS property, i.e 'color'.
+ * @property {string} attributeObject.value - The corresponding value to the css property, i.e 'red'.
+ * @return {function} - When used in Array.reduce, will return an array of Declaration objects
+ */
+ function filterDeclarations(selectedRule) {
+ return function (allowedDeclarationsList, attributeObject) {
+ // If this property is allowlisted...
+ if (has(selectedRule, attributeObject.prop)) {
+ const matchesRegex = selectedRule[attributeObject.prop].some(function(regularExpression) {
+ return regularExpression.test(attributeObject.value);
+ });
+
+ if (matchesRegex) {
+ allowedDeclarationsList.push(attributeObject);
+ }
+ }
+ return allowedDeclarationsList;
+ };
+ }
+
+ function filterClasses(classes, allowed, allowedGlobs) {
+ if (!allowed) {
+ // The class attribute is allowed without filtering on this tag
+ return classes;
+ }
+ classes = classes.split(/\s+/);
+ return classes.filter(function(clss) {
+ return allowed.indexOf(clss) !== -1 || allowedGlobs.some(function(glob) {
+ return glob.test(clss);
+ });
+ }).join(' ');
+ }
+}
+
+// Defaults are accessible to you so that you can use them as a starting point
+// programmatically if you wish
+
+const htmlParserDefaults = {
+ decodeEntities: true
+};
+sanitizeHtml.defaults = {
+ allowedTags: [
+ // Sections derived from MDN element categories and limited to the more
+ // benign categories.
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
+ // Content sectioning
+ 'address', 'article', 'aside', 'footer', 'header',
+ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup',
+ 'main', 'nav', 'section',
+ // Text content
+ 'blockquote', 'dd', 'div', 'dl', 'dt', 'figcaption', 'figure',
+ 'hr', 'li', 'main', 'ol', 'p', 'pre', 'ul',
+ // Inline text semantics
+ 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'code', 'data', 'dfn',
+ 'em', 'i', 'kbd', 'mark', 'q',
+ 'rb', 'rp', 'rt', 'rtc', 'ruby',
+ 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr',
+ // Table content
+ 'caption', 'col', 'colgroup', 'table', 'tbody', 'td', 'tfoot', 'th',
+ 'thead', 'tr'
+ ],
+ disallowedTagsMode: 'discard',
+ allowedAttributes: {
+ a: [ 'href', 'name', 'target' ],
+ // We don't currently allow img itself by default, but this
+ // would make sense if we did. You could add srcset here,
+ // and if you do the URL is checked for safety
+ img: [ 'src' ]
+ },
+ // Lots of these won't come up by default because we don't allow them
+ selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ],
+ // URL schemes we permit
+ allowedSchemes: [ 'http', 'https', 'ftp', 'mailto', 'tel' ],
+ allowedSchemesByTag: {},
+ allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite' ],
+ allowProtocolRelative: true,
+ enforceHtmlBoundary: false
+};
+
+sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {
+ merge = (merge === undefined) ? true : merge;
+ newAttribs = newAttribs || {};
+
+ return function(tagName, attribs) {
+ let attrib;
+ if (merge) {
+ for (attrib in newAttribs) {
+ attribs[attrib] = newAttribs[attrib];
+ }
+ } else {
+ attribs = newAttribs;
+ }
+
+ return {
+ tagName: newTagName,
+ attribs: attribs
+ };
+ };
+};
diff --git a/node_modules/sanitize-html/package.json b/node_modules/sanitize-html/package.json
new file mode 100644
index 0000000..50da984
--- /dev/null
+++ b/node_modules/sanitize-html/package.json
@@ -0,0 +1,76 @@
+{
+ "_from": "sanitize-html",
+ "_id": "sanitize-html@2.6.0",
+ "_inBundle": false,
+ "_integrity": "sha512-qc+NqTeaOi/QVAVs5gOY9tqIVk4r1pcUbx1Q2N1a609Os3TNlm85zll2d8g8m/RM6RWg9llir0SpAcePQVIC1w==",
+ "_location": "/sanitize-html",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "tag",
+ "registry": true,
+ "raw": "sanitize-html",
+ "name": "sanitize-html",
+ "escapedName": "sanitize-html",
+ "rawSpec": "",
+ "saveSpec": null,
+ "fetchSpec": "latest"
+ },
+ "_requiredBy": [
+ "#USER",
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.6.0.tgz",
+ "_shasum": "b82df416d0c485df47c8943e68057662c770c869",
+ "_spec": "sanitize-html",
+ "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "author": {
+ "name": "Apostrophe Technologies, Inc."
+ },
+ "bugs": {
+ "url": "https://github.com/apostrophecms/sanitize-html/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "deepmerge": "^4.2.2",
+ "escape-string-regexp": "^4.0.0",
+ "htmlparser2": "^6.0.0",
+ "is-plain-object": "^5.0.0",
+ "parse-srcset": "^1.0.2",
+ "postcss": "^8.3.11"
+ },
+ "deprecated": false,
+ "description": "Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis",
+ "devDependencies": {
+ "eslint": "^7.3.1",
+ "eslint-config-apostrophe": "^3.4.0",
+ "eslint-config-standard": "^14.1.1",
+ "eslint-plugin-import": "^2.25.2",
+ "eslint-plugin-node": "^11.1.0",
+ "eslint-plugin-promise": "^4.2.1",
+ "eslint-plugin-standard": "^4.0.1",
+ "mocha": "^7.0.0",
+ "sinon": "^9.0.2"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/apostrophecms/sanitize-html#readme",
+ "keywords": [
+ "html",
+ "parser",
+ "sanitizer",
+ "sanitize"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "sanitize-html",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apostrophecms/sanitize-html.git"
+ },
+ "scripts": {
+ "test": "npx eslint . && mocha test/test.js"
+ },
+ "sideEffects": false,
+ "version": "2.6.0"
+}
diff --git a/node_modules/semver-diff/index.d.ts b/node_modules/semver-diff/index.d.ts
new file mode 100644
index 0000000..d6f6a42
--- /dev/null
+++ b/node_modules/semver-diff/index.d.ts
@@ -0,0 +1,58 @@
+declare namespace semverDiff {
+ type Result =
+ | 'major'
+ | 'premajor'
+ | 'minor'
+ | 'preminor'
+ | 'patch'
+ | 'prepatch'
+ | 'prerelease'
+ | 'build';
+}
+
+/**
+Get the diff type of two [semver](https://github.com/npm/node-semver) versions: `0.0.1 0.0.2` → `patch`.
+
+@returns The difference type between two semver versions, or `undefined` if they're identical or the second one is lower than the first.
+
+@example
+```
+import semverDiff = require('semver-diff');
+
+semverDiff('1.1.1', '1.1.2');
+//=> 'patch'
+
+semverDiff('1.1.1-foo', '1.1.2');
+//=> 'prepatch'
+
+semverDiff('0.0.1', '1.0.0');
+//=> 'major'
+
+semverDiff('0.0.1-foo', '1.0.0');
+//=> 'premajor'
+
+semverDiff('0.0.1', '0.1.0');
+//=> 'minor'
+
+semverDiff('0.0.1-foo', '0.1.0');
+//=> 'preminor'
+
+semverDiff('0.0.1-foo', '0.0.1-foo.bar');
+//=> 'prerelease'
+
+semverDiff('0.1.0', '0.1.0+foo');
+//=> 'build'
+
+semverDiff('0.0.1', '0.0.1');
+//=> undefined
+
+semverDiff('0.0.2', '0.0.1');
+//=> undefined
+```
+*/
+declare function semverDiff(
+ versionA: string,
+ versionB: string
+): semverDiff.Result | undefined;
+
+export = semverDiff;
diff --git a/node_modules/semver-diff/index.js b/node_modules/semver-diff/index.js
new file mode 100644
index 0000000..5521801
--- /dev/null
+++ b/node_modules/semver-diff/index.js
@@ -0,0 +1,13 @@
+'use strict';
+const semver = require('semver');
+
+module.exports = (versionA, versionB) => {
+ versionA = semver.parse(versionA);
+ versionB = semver.parse(versionB);
+
+ if (semver.compareBuild(versionA, versionB) >= 0) {
+ return;
+ }
+
+ return semver.diff(versionA, versionB) || 'build';
+};
diff --git a/node_modules/semver-diff/license b/node_modules/semver-diff/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/semver-diff/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.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.
diff --git a/node_modules/semver-diff/node_modules/.bin/semver b/node_modules/semver-diff/node_modules/.bin/semver
new file mode 120000
index 0000000..5aaadf4
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/.bin/semver
@@ -0,0 +1 @@
+../semver/bin/semver.js
\ No newline at end of file
diff --git a/node_modules/semver-diff/node_modules/semver/CHANGELOG.md b/node_modules/semver-diff/node_modules/semver/CHANGELOG.md
new file mode 100644
index 0000000..f567dd3
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/semver/CHANGELOG.md
@@ -0,0 +1,70 @@
+# changes log
+
+## 6.2.0
+
+* Coerce numbers to strings when passed to semver.coerce()
+* Add `rtl` option to coerce from right to left
+
+## 6.1.3
+
+* Handle X-ranges properly in includePrerelease mode
+
+## 6.1.2
+
+* Do not throw when testing invalid version strings
+
+## 6.1.1
+
+* Add options support for semver.coerce()
+* Handle undefined version passed to Range.test
+
+## 6.1.0
+
+* Add semver.compareBuild function
+* Support `*` in semver.intersects
+
+## 6.0
+
+* Fix `intersects` logic.
+
+ This is technically a bug fix, but since it is also a change to behavior
+ that may require users updating their code, it is marked as a major
+ version increment.
+
+## 5.7
+
+* Add `minVersion` method
+
+## 5.6
+
+* Move boolean `loose` param to an options object, with
+ backwards-compatibility protection.
+* Add ability to opt out of special prerelease version handling with
+ the `includePrerelease` option flag.
+
+## 5.5
+
+* Add version coercion capabilities
+
+## 5.4
+
+* Add intersection checking
+
+## 5.3
+
+* Add `minSatisfying` method
+
+## 5.2
+
+* Add `prerelease(v)` that returns prerelease components
+
+## 5.1
+
+* Add Backus-Naur for ranges
+* Remove excessively cute inspection methods
+
+## 5.0
+
+* Remove AMD/Browserified build artifacts
+* Fix ltr and gtr when using the `*` range
+* Fix for range `*` with a prerelease identifier
diff --git a/node_modules/semver-diff/node_modules/semver/LICENSE b/node_modules/semver-diff/node_modules/semver/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/semver/LICENSE
@@ -0,0 +1,15 @@
+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.
diff --git a/node_modules/semver-diff/node_modules/semver/README.md b/node_modules/semver-diff/node_modules/semver/README.md
new file mode 100644
index 0000000..2293a14
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/semver/README.md
@@ -0,0 +1,443 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Install
+
+```bash
+npm install semver
+````
+
+## Usage
+
+As a node module:
+
+```js
+const semver = require('semver')
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean(' =v1.2.3 ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+semver.minVersion('>=1.0.0') // '1.0.0'
+semver.valid(semver.coerce('v2')) // '2.0.0'
+semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
+```
+
+As a command-line utility:
+
+```
+$ semver -h
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] [ [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range
+ Print versions that match the specified range.
+
+-i --increment []
+ Increment a version by the specified level. Level can
+ be one of: major, minor, patch, premajor, preminor,
+ prepatch, or prerelease. Default level is 'patch'.
+ Only one version may be specified.
+
+--preid
+ Identifier to be used to prefix premajor, preminor,
+ prepatch or prerelease version increments.
+
+-l --loose
+ Interpret versions and ranges loosely
+
+-p --include-prerelease
+ Always include prerelease versions in range matching
+
+-c --coerce
+ Coerce a string into SemVer if possible
+ (does not imply --loose)
+
+--rtl
+ Coerce version strings right to left
+
+--ltr
+ Coerce version strings left to right (default)
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+```
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`. The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal. If no operator is specified, then equality is assumed,
+ so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`. A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
+range only accepts prerelease tags on the `1.2.3` version. The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold. First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions. By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk. However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+Note that this behavior can be suppressed (treating all prerelease
+versions as if they were normal versions, for the purpose of range
+matching) by setting the `includePrerelease` flag on the options
+object to any
+[functions](https://github.com/npm/node-semver#functions) that do
+range matching.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```bash
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any version satisfies)
+* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator. Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero element in the
+`[major, minor, patch]` tuple. In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0`
+* `^0.2.3` := `>=0.2.3 <0.3.0`
+* `^0.0.3` := `>=0.0.3 <0.0.4`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
+ `0.0.3` version *only* will be allowed, if they are greater than or
+ equal to `beta`. So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0`
+* `^0.0.x` := `>=0.0.0 <0.1.0`
+* `^0.0` := `>=0.0.0 <0.1.0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0`
+* `^0.x` := `>=0.0.0 <1.0.0`
+
+### Range Grammar
+
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+
+```bnf
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
+```
+
+## Functions
+
+All methods and classes take a final `options` object argument. All
+options in this object are `false` by default. The options supported
+are:
+
+- `loose` Be more forgiving about not-quite-valid semver strings.
+ (Any resulting output will always be 100% strict compliant, of
+ course.) For backwards compatibility reasons, if the `options`
+ argument is a boolean value instead of an object, it is interpreted
+ to be the `loose` param.
+- `includePrerelease` Set to suppress the [default
+ behavior](https://github.com/npm/node-semver#prerelease-tags) of
+ excluding prerelease tagged versions from ranges unless they are
+ explicitly opted into.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+ type (`major`, `premajor`, `minor`, `preminor`, `patch`,
+ `prepatch`, or `prerelease`), or null if it's not valid
+ * `premajor` in one call will bump the version up to the next major
+ version and down to a prerelease of that major version.
+ `preminor`, and `prepatch` work the same way.
+ * If called from a non-prerelease version, the `prerelease` will work the
+ same as `prepatch`. It increments the patch version, then makes a
+ prerelease. If the input version is already a prerelease it simply
+ increments it.
+* `prerelease(v)`: Returns an array of prerelease components, or null
+ if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
+ or comparators intersect.
+* `parse(v)`: Attempt to parse a string as a semantic version, returning either
+ a `SemVer` object or `null`.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+ even if they're not the exact same string. You already know how to
+ compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+ the corresponding function above. `"==="` and `"!=="` do simple
+ string comparison, but are included for completeness. Throws if an
+ invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
+ in descending order when passed to `Array.sort()`.
+* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
+ are equal. Sorts in ascending order if passed to `Array.sort()`.
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+ (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+ or null if the versions are the same.
+
+### Comparators
+
+* `intersects(comparator)`: Return true if the comparators intersect
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+ range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minSatisfying(versions, range)`: Return the lowest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minVersion(range)`: Return the lowest version that can possibly match
+ the given range.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+ versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+ versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+ the bounds of the range in either the high or low direction. The
+ `hilo` argument must be either the string `'>'` or `'<'`. (This is
+ the function called by `gtr` and `ltr`.)
+* `intersects(range)`: Return true if any of the ranges comparators intersect
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range! For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
+
+### Coercion
+
+* `coerce(version, options)`: Coerces a string to semver if possible
+
+This aims to provide a very forgiving translation of a non-semver string to
+semver. It looks for the first digit in a string, and consumes all
+remaining characters which satisfy at least a partial semver (e.g., `1`,
+`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
+versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
+surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
+`3.4.0`). Only text which lacks digits will fail coercion (`version one`
+is not valid). The maximum length for any semver component considered for
+coercion is 16 characters; longer components will be ignored
+(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
+semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
+components are invalid (`9999999999999999.4.7.4` is likely invalid).
+
+If the `options.rtl` flag is set, then `coerce` will return the right-most
+coercible tuple that does not share an ending index with a longer coercible
+tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
+`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
+any other overlapping SemVer tuple.
+
+### Clean
+
+* `clean(version)`: Clean a string to be a valid semver if possible
+
+This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges.
+
+ex.
+* `s.clean(' = v 2.1.5foo')`: `null`
+* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean(' = v 2.1.5-foo')`: `null`
+* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean('=v2.1.5')`: `'2.1.5'`
+* `s.clean(' =v2.1.5')`: `2.1.5`
+* `s.clean(' 2.1.5 ')`: `'2.1.5'`
+* `s.clean('~1.0.0')`: `null`
diff --git a/node_modules/semver-diff/node_modules/semver/bin/semver.js b/node_modules/semver-diff/node_modules/semver/bin/semver.js
new file mode 100755
index 0000000..666034a
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/semver/bin/semver.js
@@ -0,0 +1,174 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+var argv = process.argv.slice(2)
+
+var versions = []
+
+var range = []
+
+var inc = null
+
+var version = require('../package.json').version
+
+var loose = false
+
+var includePrerelease = false
+
+var coerce = false
+
+var rtl = false
+
+var identifier
+
+var semver = require('../semver')
+
+var reverse = false
+
+var options = {}
+
+main()
+
+function main () {
+ if (!argv.length) return help()
+ while (argv.length) {
+ var a = argv.shift()
+ var indexOfEqualSign = a.indexOf('=')
+ if (indexOfEqualSign !== -1) {
+ a = a.slice(0, indexOfEqualSign)
+ argv.unshift(a.slice(indexOfEqualSign + 1))
+ }
+ switch (a) {
+ case '-rv': case '-rev': case '--rev': case '--reverse':
+ reverse = true
+ break
+ case '-l': case '--loose':
+ loose = true
+ break
+ case '-p': case '--include-prerelease':
+ includePrerelease = true
+ break
+ case '-v': case '--version':
+ versions.push(argv.shift())
+ break
+ case '-i': case '--inc': case '--increment':
+ switch (argv[0]) {
+ case 'major': case 'minor': case 'patch': case 'prerelease':
+ case 'premajor': case 'preminor': case 'prepatch':
+ inc = argv.shift()
+ break
+ default:
+ inc = 'patch'
+ break
+ }
+ break
+ case '--preid':
+ identifier = argv.shift()
+ break
+ case '-r': case '--range':
+ range.push(argv.shift())
+ break
+ case '-c': case '--coerce':
+ coerce = true
+ break
+ case '--rtl':
+ rtl = true
+ break
+ case '--ltr':
+ rtl = false
+ break
+ case '-h': case '--help': case '-?':
+ return help()
+ default:
+ versions.push(a)
+ break
+ }
+ }
+
+ var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
+
+ versions = versions.map(function (v) {
+ return coerce ? (semver.coerce(v, options) || { version: v }).version : v
+ }).filter(function (v) {
+ return semver.valid(v)
+ })
+ if (!versions.length) return fail()
+ if (inc && (versions.length !== 1 || range.length)) { return failInc() }
+
+ for (var i = 0, l = range.length; i < l; i++) {
+ versions = versions.filter(function (v) {
+ return semver.satisfies(v, range[i], options)
+ })
+ if (!versions.length) return fail()
+ }
+ return success(versions)
+}
+
+function failInc () {
+ console.error('--inc can only be used on a single version with no range')
+ fail()
+}
+
+function fail () { process.exit(1) }
+
+function success () {
+ var compare = reverse ? 'rcompare' : 'compare'
+ versions.sort(function (a, b) {
+ return semver[compare](a, b, options)
+ }).map(function (v) {
+ return semver.clean(v, options)
+ }).map(function (v) {
+ return inc ? semver.inc(v, inc, options, identifier) : v
+ }).forEach(function (v, i, _) { console.log(v) })
+}
+
+function help () {
+ console.log(['SemVer ' + version,
+ '',
+ 'A JavaScript implementation of the https://semver.org/ specification',
+ 'Copyright Isaac Z. Schlueter',
+ '',
+ 'Usage: semver [options] [ [...]]',
+ 'Prints valid versions sorted by SemVer precedence',
+ '',
+ 'Options:',
+ '-r --range ',
+ ' Print versions that match the specified range.',
+ '',
+ '-i --increment []',
+ ' Increment a version by the specified level. Level can',
+ ' be one of: major, minor, patch, premajor, preminor,',
+ " prepatch, or prerelease. Default level is 'patch'.",
+ ' Only one version may be specified.',
+ '',
+ '--preid ',
+ ' Identifier to be used to prefix premajor, preminor,',
+ ' prepatch or prerelease version increments.',
+ '',
+ '-l --loose',
+ ' Interpret versions and ranges loosely',
+ '',
+ '-p --include-prerelease',
+ ' Always include prerelease versions in range matching',
+ '',
+ '-c --coerce',
+ ' Coerce a string into SemVer if possible',
+ ' (does not imply --loose)',
+ '',
+ '--rtl',
+ ' Coerce version strings right to left',
+ '',
+ '--ltr',
+ ' Coerce version strings left to right (default)',
+ '',
+ 'Program exits successfully if any valid version satisfies',
+ 'all supplied ranges, and prints all satisfying versions.',
+ '',
+ 'If no satisfying versions are found, then exits failure.',
+ '',
+ 'Versions are printed in ascending order, so supplying',
+ 'multiple versions to the utility will just sort them.'
+ ].join('\n'))
+}
diff --git a/node_modules/semver-diff/node_modules/semver/package.json b/node_modules/semver-diff/node_modules/semver/package.json
new file mode 100644
index 0000000..b2d66d8
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/semver/package.json
@@ -0,0 +1,60 @@
+{
+ "_from": "semver@^6.3.0",
+ "_id": "semver@6.3.0",
+ "_inBundle": false,
+ "_integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "_location": "/semver-diff/semver",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "semver@^6.3.0",
+ "name": "semver",
+ "escapedName": "semver",
+ "rawSpec": "^6.3.0",
+ "saveSpec": null,
+ "fetchSpec": "^6.3.0"
+ },
+ "_requiredBy": [
+ "/semver-diff"
+ ],
+ "_resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "_shasum": "ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
+ "_spec": "semver@^6.3.0",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/semver-diff",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "bugs": {
+ "url": "https://github.com/npm/node-semver/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "The semantic version parser used by npm.",
+ "devDependencies": {
+ "tap": "^14.3.1"
+ },
+ "files": [
+ "bin",
+ "range.bnf",
+ "semver.js"
+ ],
+ "homepage": "https://github.com/npm/node-semver#readme",
+ "license": "ISC",
+ "main": "semver.js",
+ "name": "semver",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/npm/node-semver.git"
+ },
+ "scripts": {
+ "postpublish": "git push origin --follow-tags",
+ "postversion": "npm publish",
+ "preversion": "npm test",
+ "test": "tap"
+ },
+ "tap": {
+ "check-coverage": true
+ },
+ "version": "6.3.0"
+}
diff --git a/node_modules/semver-diff/node_modules/semver/range.bnf b/node_modules/semver-diff/node_modules/semver/range.bnf
new file mode 100644
index 0000000..d4c6ae0
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/semver/range.bnf
@@ -0,0 +1,16 @@
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | [1-9] ( [0-9] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
diff --git a/node_modules/semver-diff/node_modules/semver/semver.js b/node_modules/semver-diff/node_modules/semver/semver.js
new file mode 100644
index 0000000..636fa43
--- /dev/null
+++ b/node_modules/semver-diff/node_modules/semver/semver.js
@@ -0,0 +1,1596 @@
+exports = module.exports = SemVer
+
+var debug
+/* istanbul ignore next */
+if (typeof process === 'object' &&
+ process.env &&
+ process.env.NODE_DEBUG &&
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
+ debug = function () {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.unshift('SEMVER')
+ console.log.apply(console, args)
+ }
+} else {
+ debug = function () {}
+}
+
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+exports.SEMVER_SPEC_VERSION = '2.0.0'
+
+var MAX_LENGTH = 256
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+ /* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+var MAX_SAFE_COMPONENT_LENGTH = 16
+
+// The actual regexps go on exports.re
+var re = exports.re = []
+var src = exports.src = []
+var t = exports.tokens = {}
+var R = 0
+
+function tok (n) {
+ t[n] = R++
+}
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+tok('NUMERICIDENTIFIER')
+src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
+tok('NUMERICIDENTIFIERLOOSE')
+src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+tok('NONNUMERICIDENTIFIER')
+src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+tok('MAINVERSION')
+src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIER] + ')'
+
+tok('MAINVERSIONLOOSE')
+src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+tok('PRERELEASEIDENTIFIER')
+src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
+ '|' + src[t.NONNUMERICIDENTIFIER] + ')'
+
+tok('PRERELEASEIDENTIFIERLOOSE')
+src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
+ '|' + src[t.NONNUMERICIDENTIFIER] + ')'
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+tok('PRERELEASE')
+src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
+ '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
+
+tok('PRERELEASELOOSE')
+src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
+ '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+tok('BUILDIDENTIFIER')
+src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+tok('BUILD')
+src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
+ '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups. The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+tok('FULL')
+tok('FULLPLAIN')
+src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
+ src[t.PRERELEASE] + '?' +
+ src[t.BUILD] + '?'
+
+src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+tok('LOOSEPLAIN')
+src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
+ src[t.PRERELEASELOOSE] + '?' +
+ src[t.BUILD] + '?'
+
+tok('LOOSE')
+src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
+
+tok('GTLT')
+src[t.GTLT] = '((?:<|>)?=?)'
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+tok('XRANGEIDENTIFIERLOOSE')
+src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
+tok('XRANGEIDENTIFIER')
+src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
+
+tok('XRANGEPLAIN')
+src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
+ '(?:' + src[t.PRERELEASE] + ')?' +
+ src[t.BUILD] + '?' +
+ ')?)?'
+
+tok('XRANGEPLAINLOOSE')
+src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:' + src[t.PRERELEASELOOSE] + ')?' +
+ src[t.BUILD] + '?' +
+ ')?)?'
+
+tok('XRANGE')
+src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
+tok('XRANGELOOSE')
+src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+tok('COERCE')
+src[t.COERCE] = '(^|[^\\d])' +
+ '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:$|[^\\d])'
+tok('COERCERTL')
+re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+tok('LONETILDE')
+src[t.LONETILDE] = '(?:~>?)'
+
+tok('TILDETRIM')
+src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
+re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
+var tildeTrimReplace = '$1~'
+
+tok('TILDE')
+src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
+tok('TILDELOOSE')
+src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+tok('LONECARET')
+src[t.LONECARET] = '(?:\\^)'
+
+tok('CARETTRIM')
+src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
+re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
+var caretTrimReplace = '$1^'
+
+tok('CARET')
+src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
+tok('CARETLOOSE')
+src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+tok('COMPARATORLOOSE')
+src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
+tok('COMPARATOR')
+src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+tok('COMPARATORTRIM')
+src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
+ '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
+
+// this one has to use the /g flag
+re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
+var comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+tok('HYPHENRANGE')
+src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[t.XRANGEPLAIN] + ')' +
+ '\\s*$'
+
+tok('HYPHENRANGELOOSE')
+src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[t.XRANGEPLAINLOOSE] + ')' +
+ '\\s*$'
+
+// Star ranges basically just allow anything at all.
+tok('STAR')
+src[t.STAR] = '(<|>)?=?\\s*\\*'
+
+// Compile to actual regexp objects.
+// All are flag-free, unless they were created above with a flag.
+for (var i = 0; i < R; i++) {
+ debug(i, src[i])
+ if (!re[i]) {
+ re[i] = new RegExp(src[i])
+ }
+}
+
+exports.parse = parse
+function parse (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ if (version.length > MAX_LENGTH) {
+ return null
+ }
+
+ var r = options.loose ? re[t.LOOSE] : re[t.FULL]
+ if (!r.test(version)) {
+ return null
+ }
+
+ try {
+ return new SemVer(version, options)
+ } catch (er) {
+ return null
+ }
+}
+
+exports.valid = valid
+function valid (version, options) {
+ var v = parse(version, options)
+ return v ? v.version : null
+}
+
+exports.clean = clean
+function clean (version, options) {
+ var s = parse(version.trim().replace(/^[=v]+/, ''), options)
+ return s ? s.version : null
+}
+
+exports.SemVer = SemVer
+
+function SemVer (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+ if (version instanceof SemVer) {
+ if (version.loose === options.loose) {
+ return version
+ } else {
+ version = version.version
+ }
+ } else if (typeof version !== 'string') {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ if (version.length > MAX_LENGTH) {
+ throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
+ }
+
+ if (!(this instanceof SemVer)) {
+ return new SemVer(version, options)
+ }
+
+ debug('SemVer', version, options)
+ this.options = options
+ this.loose = !!options.loose
+
+ var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
+
+ if (!m) {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ this.raw = version
+
+ // these are actually numbers
+ this.major = +m[1]
+ this.minor = +m[2]
+ this.patch = +m[3]
+
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+ throw new TypeError('Invalid major version')
+ }
+
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+ throw new TypeError('Invalid minor version')
+ }
+
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+ throw new TypeError('Invalid patch version')
+ }
+
+ // numberify any prerelease numeric ids
+ if (!m[4]) {
+ this.prerelease = []
+ } else {
+ this.prerelease = m[4].split('.').map(function (id) {
+ if (/^[0-9]+$/.test(id)) {
+ var num = +id
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
+ return num
+ }
+ }
+ return id
+ })
+ }
+
+ this.build = m[5] ? m[5].split('.') : []
+ this.format()
+}
+
+SemVer.prototype.format = function () {
+ this.version = this.major + '.' + this.minor + '.' + this.patch
+ if (this.prerelease.length) {
+ this.version += '-' + this.prerelease.join('.')
+ }
+ return this.version
+}
+
+SemVer.prototype.toString = function () {
+ return this.version
+}
+
+SemVer.prototype.compare = function (other) {
+ debug('SemVer.compare', this.version, this.options, other)
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return this.compareMain(other) || this.comparePre(other)
+}
+
+SemVer.prototype.compareMain = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return compareIdentifiers(this.major, other.major) ||
+ compareIdentifiers(this.minor, other.minor) ||
+ compareIdentifiers(this.patch, other.patch)
+}
+
+SemVer.prototype.comparePre = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ // NOT having a prerelease is > having one
+ if (this.prerelease.length && !other.prerelease.length) {
+ return -1
+ } else if (!this.prerelease.length && other.prerelease.length) {
+ return 1
+ } else if (!this.prerelease.length && !other.prerelease.length) {
+ return 0
+ }
+
+ var i = 0
+ do {
+ var a = this.prerelease[i]
+ var b = other.prerelease[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+}
+
+SemVer.prototype.compareBuild = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ var i = 0
+ do {
+ var a = this.build[i]
+ var b = other.build[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+}
+
+// preminor will bump the version up to the next minor release, and immediately
+// down to pre-release. premajor and prepatch work the same way.
+SemVer.prototype.inc = function (release, identifier) {
+ switch (release) {
+ case 'premajor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor = 0
+ this.major++
+ this.inc('pre', identifier)
+ break
+ case 'preminor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor++
+ this.inc('pre', identifier)
+ break
+ case 'prepatch':
+ // If this is already a prerelease, it will bump to the next version
+ // drop any prereleases that might already exist, since they are not
+ // relevant at this point.
+ this.prerelease.length = 0
+ this.inc('patch', identifier)
+ this.inc('pre', identifier)
+ break
+ // If the input is a non-prerelease version, this acts the same as
+ // prepatch.
+ case 'prerelease':
+ if (this.prerelease.length === 0) {
+ this.inc('patch', identifier)
+ }
+ this.inc('pre', identifier)
+ break
+
+ case 'major':
+ // If this is a pre-major version, bump up to the same major version.
+ // Otherwise increment major.
+ // 1.0.0-5 bumps to 1.0.0
+ // 1.1.0 bumps to 2.0.0
+ if (this.minor !== 0 ||
+ this.patch !== 0 ||
+ this.prerelease.length === 0) {
+ this.major++
+ }
+ this.minor = 0
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'minor':
+ // If this is a pre-minor version, bump up to the same minor version.
+ // Otherwise increment minor.
+ // 1.2.0-5 bumps to 1.2.0
+ // 1.2.1 bumps to 1.3.0
+ if (this.patch !== 0 || this.prerelease.length === 0) {
+ this.minor++
+ }
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'patch':
+ // If this is not a pre-release version, it will increment the patch.
+ // If it is a pre-release it will bump up to the same patch version.
+ // 1.2.0-5 patches to 1.2.0
+ // 1.2.0 patches to 1.2.1
+ if (this.prerelease.length === 0) {
+ this.patch++
+ }
+ this.prerelease = []
+ break
+ // This probably shouldn't be used publicly.
+ // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+ case 'pre':
+ if (this.prerelease.length === 0) {
+ this.prerelease = [0]
+ } else {
+ var i = this.prerelease.length
+ while (--i >= 0) {
+ if (typeof this.prerelease[i] === 'number') {
+ this.prerelease[i]++
+ i = -2
+ }
+ }
+ if (i === -1) {
+ // didn't increment anything
+ this.prerelease.push(0)
+ }
+ }
+ if (identifier) {
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+ if (this.prerelease[0] === identifier) {
+ if (isNaN(this.prerelease[1])) {
+ this.prerelease = [identifier, 0]
+ }
+ } else {
+ this.prerelease = [identifier, 0]
+ }
+ }
+ break
+
+ default:
+ throw new Error('invalid increment argument: ' + release)
+ }
+ this.format()
+ this.raw = this.version
+ return this
+}
+
+exports.inc = inc
+function inc (version, release, loose, identifier) {
+ if (typeof (loose) === 'string') {
+ identifier = loose
+ loose = undefined
+ }
+
+ try {
+ return new SemVer(version, loose).inc(release, identifier).version
+ } catch (er) {
+ return null
+ }
+}
+
+exports.diff = diff
+function diff (version1, version2) {
+ if (eq(version1, version2)) {
+ return null
+ } else {
+ var v1 = parse(version1)
+ var v2 = parse(version2)
+ var prefix = ''
+ if (v1.prerelease.length || v2.prerelease.length) {
+ prefix = 'pre'
+ var defaultResult = 'prerelease'
+ }
+ for (var key in v1) {
+ if (key === 'major' || key === 'minor' || key === 'patch') {
+ if (v1[key] !== v2[key]) {
+ return prefix + key
+ }
+ }
+ }
+ return defaultResult // may be undefined
+ }
+}
+
+exports.compareIdentifiers = compareIdentifiers
+
+var numeric = /^[0-9]+$/
+function compareIdentifiers (a, b) {
+ var anum = numeric.test(a)
+ var bnum = numeric.test(b)
+
+ if (anum && bnum) {
+ a = +a
+ b = +b
+ }
+
+ return a === b ? 0
+ : (anum && !bnum) ? -1
+ : (bnum && !anum) ? 1
+ : a < b ? -1
+ : 1
+}
+
+exports.rcompareIdentifiers = rcompareIdentifiers
+function rcompareIdentifiers (a, b) {
+ return compareIdentifiers(b, a)
+}
+
+exports.major = major
+function major (a, loose) {
+ return new SemVer(a, loose).major
+}
+
+exports.minor = minor
+function minor (a, loose) {
+ return new SemVer(a, loose).minor
+}
+
+exports.patch = patch
+function patch (a, loose) {
+ return new SemVer(a, loose).patch
+}
+
+exports.compare = compare
+function compare (a, b, loose) {
+ return new SemVer(a, loose).compare(new SemVer(b, loose))
+}
+
+exports.compareLoose = compareLoose
+function compareLoose (a, b) {
+ return compare(a, b, true)
+}
+
+exports.compareBuild = compareBuild
+function compareBuild (a, b, loose) {
+ var versionA = new SemVer(a, loose)
+ var versionB = new SemVer(b, loose)
+ return versionA.compare(versionB) || versionA.compareBuild(versionB)
+}
+
+exports.rcompare = rcompare
+function rcompare (a, b, loose) {
+ return compare(b, a, loose)
+}
+
+exports.sort = sort
+function sort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.compareBuild(a, b, loose)
+ })
+}
+
+exports.rsort = rsort
+function rsort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.compareBuild(b, a, loose)
+ })
+}
+
+exports.gt = gt
+function gt (a, b, loose) {
+ return compare(a, b, loose) > 0
+}
+
+exports.lt = lt
+function lt (a, b, loose) {
+ return compare(a, b, loose) < 0
+}
+
+exports.eq = eq
+function eq (a, b, loose) {
+ return compare(a, b, loose) === 0
+}
+
+exports.neq = neq
+function neq (a, b, loose) {
+ return compare(a, b, loose) !== 0
+}
+
+exports.gte = gte
+function gte (a, b, loose) {
+ return compare(a, b, loose) >= 0
+}
+
+exports.lte = lte
+function lte (a, b, loose) {
+ return compare(a, b, loose) <= 0
+}
+
+exports.cmp = cmp
+function cmp (a, op, b, loose) {
+ switch (op) {
+ case '===':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a === b
+
+ case '!==':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a !== b
+
+ case '':
+ case '=':
+ case '==':
+ return eq(a, b, loose)
+
+ case '!=':
+ return neq(a, b, loose)
+
+ case '>':
+ return gt(a, b, loose)
+
+ case '>=':
+ return gte(a, b, loose)
+
+ case '<':
+ return lt(a, b, loose)
+
+ case '<=':
+ return lte(a, b, loose)
+
+ default:
+ throw new TypeError('Invalid operator: ' + op)
+ }
+}
+
+exports.Comparator = Comparator
+function Comparator (comp, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (comp instanceof Comparator) {
+ if (comp.loose === !!options.loose) {
+ return comp
+ } else {
+ comp = comp.value
+ }
+ }
+
+ if (!(this instanceof Comparator)) {
+ return new Comparator(comp, options)
+ }
+
+ debug('comparator', comp, options)
+ this.options = options
+ this.loose = !!options.loose
+ this.parse(comp)
+
+ if (this.semver === ANY) {
+ this.value = ''
+ } else {
+ this.value = this.operator + this.semver.version
+ }
+
+ debug('comp', this)
+}
+
+var ANY = {}
+Comparator.prototype.parse = function (comp) {
+ var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
+ var m = comp.match(r)
+
+ if (!m) {
+ throw new TypeError('Invalid comparator: ' + comp)
+ }
+
+ this.operator = m[1] !== undefined ? m[1] : ''
+ if (this.operator === '=') {
+ this.operator = ''
+ }
+
+ // if it literally is just '>' or '' then allow anything.
+ if (!m[2]) {
+ this.semver = ANY
+ } else {
+ this.semver = new SemVer(m[2], this.options.loose)
+ }
+}
+
+Comparator.prototype.toString = function () {
+ return this.value
+}
+
+Comparator.prototype.test = function (version) {
+ debug('Comparator.test', version, this.options.loose)
+
+ if (this.semver === ANY || version === ANY) {
+ return true
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ return cmp(version, this.operator, this.semver, this.options)
+}
+
+Comparator.prototype.intersects = function (comp, options) {
+ if (!(comp instanceof Comparator)) {
+ throw new TypeError('a Comparator is required')
+ }
+
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ var rangeTmp
+
+ if (this.operator === '') {
+ if (this.value === '') {
+ return true
+ }
+ rangeTmp = new Range(comp.value, options)
+ return satisfies(this.value, rangeTmp, options)
+ } else if (comp.operator === '') {
+ if (comp.value === '') {
+ return true
+ }
+ rangeTmp = new Range(this.value, options)
+ return satisfies(comp.semver, rangeTmp, options)
+ }
+
+ var sameDirectionIncreasing =
+ (this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '>=' || comp.operator === '>')
+ var sameDirectionDecreasing =
+ (this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '<=' || comp.operator === '<')
+ var sameSemVer = this.semver.version === comp.semver.version
+ var differentDirectionsInclusive =
+ (this.operator === '>=' || this.operator === '<=') &&
+ (comp.operator === '>=' || comp.operator === '<=')
+ var oppositeDirectionsLessThan =
+ cmp(this.semver, '<', comp.semver, options) &&
+ ((this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '<=' || comp.operator === '<'))
+ var oppositeDirectionsGreaterThan =
+ cmp(this.semver, '>', comp.semver, options) &&
+ ((this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '>=' || comp.operator === '>'))
+
+ return sameDirectionIncreasing || sameDirectionDecreasing ||
+ (sameSemVer && differentDirectionsInclusive) ||
+ oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
+}
+
+exports.Range = Range
+function Range (range, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (range instanceof Range) {
+ if (range.loose === !!options.loose &&
+ range.includePrerelease === !!options.includePrerelease) {
+ return range
+ } else {
+ return new Range(range.raw, options)
+ }
+ }
+
+ if (range instanceof Comparator) {
+ return new Range(range.value, options)
+ }
+
+ if (!(this instanceof Range)) {
+ return new Range(range, options)
+ }
+
+ this.options = options
+ this.loose = !!options.loose
+ this.includePrerelease = !!options.includePrerelease
+
+ // First, split based on boolean or ||
+ this.raw = range
+ this.set = range.split(/\s*\|\|\s*/).map(function (range) {
+ return this.parseRange(range.trim())
+ }, this).filter(function (c) {
+ // throw out any that are not relevant for whatever reason
+ return c.length
+ })
+
+ if (!this.set.length) {
+ throw new TypeError('Invalid SemVer Range: ' + range)
+ }
+
+ this.format()
+}
+
+Range.prototype.format = function () {
+ this.range = this.set.map(function (comps) {
+ return comps.join(' ').trim()
+ }).join('||').trim()
+ return this.range
+}
+
+Range.prototype.toString = function () {
+ return this.range
+}
+
+Range.prototype.parseRange = function (range) {
+ var loose = this.options.loose
+ range = range.trim()
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+ var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
+ range = range.replace(hr, hyphenReplace)
+ debug('hyphen replace', range)
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
+ debug('comparator trim', range, re[t.COMPARATORTRIM])
+
+ // `~ 1.2.3` => `~1.2.3`
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
+
+ // `^ 1.2.3` => `^1.2.3`
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace)
+
+ // normalize spaces
+ range = range.split(/\s+/).join(' ')
+
+ // At this point, the range is completely trimmed and
+ // ready to be split into comparators.
+
+ var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
+ var set = range.split(' ').map(function (comp) {
+ return parseComparator(comp, this.options)
+ }, this).join(' ').split(/\s+/)
+ if (this.options.loose) {
+ // in loose mode, throw out any that are not valid comparators
+ set = set.filter(function (comp) {
+ return !!comp.match(compRe)
+ })
+ }
+ set = set.map(function (comp) {
+ return new Comparator(comp, this.options)
+ }, this)
+
+ return set
+}
+
+Range.prototype.intersects = function (range, options) {
+ if (!(range instanceof Range)) {
+ throw new TypeError('a Range is required')
+ }
+
+ return this.set.some(function (thisComparators) {
+ return (
+ isSatisfiable(thisComparators, options) &&
+ range.set.some(function (rangeComparators) {
+ return (
+ isSatisfiable(rangeComparators, options) &&
+ thisComparators.every(function (thisComparator) {
+ return rangeComparators.every(function (rangeComparator) {
+ return thisComparator.intersects(rangeComparator, options)
+ })
+ })
+ )
+ })
+ )
+ })
+}
+
+// take a set of comparators and determine whether there
+// exists a version which can satisfy it
+function isSatisfiable (comparators, options) {
+ var result = true
+ var remainingComparators = comparators.slice()
+ var testComparator = remainingComparators.pop()
+
+ while (result && remainingComparators.length) {
+ result = remainingComparators.every(function (otherComparator) {
+ return testComparator.intersects(otherComparator, options)
+ })
+
+ testComparator = remainingComparators.pop()
+ }
+
+ return result
+}
+
+// Mostly just for testing and legacy API reasons
+exports.toComparators = toComparators
+function toComparators (range, options) {
+ return new Range(range, options).set.map(function (comp) {
+ return comp.map(function (c) {
+ return c.value
+ }).join(' ').trim().split(' ')
+ })
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+function parseComparator (comp, options) {
+ debug('comp', comp, options)
+ comp = replaceCarets(comp, options)
+ debug('caret', comp)
+ comp = replaceTildes(comp, options)
+ debug('tildes', comp)
+ comp = replaceXRanges(comp, options)
+ debug('xrange', comp)
+ comp = replaceStars(comp, options)
+ debug('stars', comp)
+ return comp
+}
+
+function isX (id) {
+ return !id || id.toLowerCase() === 'x' || id === '*'
+}
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+function replaceTildes (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceTilde(comp, options)
+ }).join(' ')
+}
+
+function replaceTilde (comp, options) {
+ var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('tilde', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ // ~1.2 == >=1.2.0 <1.3.0
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else if (pr) {
+ debug('replaceTilde pr', pr)
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ // ~1.2.3 == >=1.2.3 <1.3.0
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+
+ debug('tilde return', ret)
+ return ret
+ })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2.0 --> >=1.2.0 <2.0.0
+function replaceCarets (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceCaret(comp, options)
+ }).join(' ')
+}
+
+function replaceCaret (comp, options) {
+ debug('caret', comp, options)
+ var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('caret', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ if (M === '0') {
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
+ }
+ } else if (pr) {
+ debug('replaceCaret pr', pr)
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ } else {
+ debug('no pr')
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ }
+
+ debug('caret return', ret)
+ return ret
+ })
+}
+
+function replaceXRanges (comp, options) {
+ debug('replaceXRanges', comp, options)
+ return comp.split(/\s+/).map(function (comp) {
+ return replaceXRange(comp, options)
+ }).join(' ')
+}
+
+function replaceXRange (comp, options) {
+ comp = comp.trim()
+ var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
+ return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
+ debug('xRange', comp, ret, gtlt, M, m, p, pr)
+ var xM = isX(M)
+ var xm = xM || isX(m)
+ var xp = xm || isX(p)
+ var anyX = xp
+
+ if (gtlt === '=' && anyX) {
+ gtlt = ''
+ }
+
+ // if we're including prereleases in the match, then we need
+ // to fix this to -0, the lowest possible prerelease value
+ pr = options.includePrerelease ? '-0' : ''
+
+ if (xM) {
+ if (gtlt === '>' || gtlt === '<') {
+ // nothing is allowed
+ ret = '<0.0.0-0'
+ } else {
+ // nothing is forbidden
+ ret = '*'
+ }
+ } else if (gtlt && anyX) {
+ // we know patch is an x, because we have any x at all.
+ // replace X with 0
+ if (xm) {
+ m = 0
+ }
+ p = 0
+
+ if (gtlt === '>') {
+ // >1 => >=2.0.0
+ // >1.2 => >=1.3.0
+ // >1.2.3 => >= 1.2.4
+ gtlt = '>='
+ if (xm) {
+ M = +M + 1
+ m = 0
+ p = 0
+ } else {
+ m = +m + 1
+ p = 0
+ }
+ } else if (gtlt === '<=') {
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
+ gtlt = '<'
+ if (xm) {
+ M = +M + 1
+ } else {
+ m = +m + 1
+ }
+ }
+
+ ret = gtlt + M + '.' + m + '.' + p + pr
+ } else if (xm) {
+ ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
+ } else if (xp) {
+ ret = '>=' + M + '.' + m + '.0' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0' + pr
+ }
+
+ debug('xRange return', ret)
+
+ return ret
+ })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+function replaceStars (comp, options) {
+ debug('replaceStars', comp, options)
+ // Looseness is ignored here. star is always as loose as it gets!
+ return comp.trim().replace(re[t.STAR], '')
+}
+
+// This function is passed to string.replace(re[t.HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0
+function hyphenReplace ($0,
+ from, fM, fm, fp, fpr, fb,
+ to, tM, tm, tp, tpr, tb) {
+ if (isX(fM)) {
+ from = ''
+ } else if (isX(fm)) {
+ from = '>=' + fM + '.0.0'
+ } else if (isX(fp)) {
+ from = '>=' + fM + '.' + fm + '.0'
+ } else {
+ from = '>=' + from
+ }
+
+ if (isX(tM)) {
+ to = ''
+ } else if (isX(tm)) {
+ to = '<' + (+tM + 1) + '.0.0'
+ } else if (isX(tp)) {
+ to = '<' + tM + '.' + (+tm + 1) + '.0'
+ } else if (tpr) {
+ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
+ } else {
+ to = '<=' + to
+ }
+
+ return (from + ' ' + to).trim()
+}
+
+// if ANY of the sets match ALL of its comparators, then pass
+Range.prototype.test = function (version) {
+ if (!version) {
+ return false
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ for (var i = 0; i < this.set.length; i++) {
+ if (testSet(this.set[i], version, this.options)) {
+ return true
+ }
+ }
+ return false
+}
+
+function testSet (set, version, options) {
+ for (var i = 0; i < set.length; i++) {
+ if (!set[i].test(version)) {
+ return false
+ }
+ }
+
+ if (version.prerelease.length && !options.includePrerelease) {
+ // Find the set of versions that are allowed to have prereleases
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+ // That should allow `1.2.3-pr.2` to pass.
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
+ // even though it's within the range set by the comparators.
+ for (i = 0; i < set.length; i++) {
+ debug(set[i].semver)
+ if (set[i].semver === ANY) {
+ continue
+ }
+
+ if (set[i].semver.prerelease.length > 0) {
+ var allowed = set[i].semver
+ if (allowed.major === version.major &&
+ allowed.minor === version.minor &&
+ allowed.patch === version.patch) {
+ return true
+ }
+ }
+ }
+
+ // Version has a -pre, but it's not one of the ones we like.
+ return false
+ }
+
+ return true
+}
+
+exports.satisfies = satisfies
+function satisfies (version, range, options) {
+ try {
+ range = new Range(range, options)
+ } catch (er) {
+ return false
+ }
+ return range.test(version)
+}
+
+exports.maxSatisfying = maxSatisfying
+function maxSatisfying (versions, range, options) {
+ var max = null
+ var maxSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!max || maxSV.compare(v) === -1) {
+ // compare(max, v, true)
+ max = v
+ maxSV = new SemVer(max, options)
+ }
+ }
+ })
+ return max
+}
+
+exports.minSatisfying = minSatisfying
+function minSatisfying (versions, range, options) {
+ var min = null
+ var minSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!min || minSV.compare(v) === 1) {
+ // compare(min, v, true)
+ min = v
+ minSV = new SemVer(min, options)
+ }
+ }
+ })
+ return min
+}
+
+exports.minVersion = minVersion
+function minVersion (range, loose) {
+ range = new Range(range, loose)
+
+ var minver = new SemVer('0.0.0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = new SemVer('0.0.0-0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = null
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ comparators.forEach(function (comparator) {
+ // Clone to avoid manipulating the comparator's semver object.
+ var compver = new SemVer(comparator.semver.version)
+ switch (comparator.operator) {
+ case '>':
+ if (compver.prerelease.length === 0) {
+ compver.patch++
+ } else {
+ compver.prerelease.push(0)
+ }
+ compver.raw = compver.format()
+ /* fallthrough */
+ case '':
+ case '>=':
+ if (!minver || gt(minver, compver)) {
+ minver = compver
+ }
+ break
+ case '<':
+ case '<=':
+ /* Ignore maximum versions */
+ break
+ /* istanbul ignore next */
+ default:
+ throw new Error('Unexpected operation: ' + comparator.operator)
+ }
+ })
+ }
+
+ if (minver && range.test(minver)) {
+ return minver
+ }
+
+ return null
+}
+
+exports.validRange = validRange
+function validRange (range, options) {
+ try {
+ // Return '*' instead of '' so that truthiness works.
+ // This will throw if it's invalid anyway
+ return new Range(range, options).range || '*'
+ } catch (er) {
+ return null
+ }
+}
+
+// Determine if version is less than all the versions possible in the range
+exports.ltr = ltr
+function ltr (version, range, options) {
+ return outside(version, range, '<', options)
+}
+
+// Determine if version is greater than all the versions possible in the range.
+exports.gtr = gtr
+function gtr (version, range, options) {
+ return outside(version, range, '>', options)
+}
+
+exports.outside = outside
+function outside (version, range, hilo, options) {
+ version = new SemVer(version, options)
+ range = new Range(range, options)
+
+ var gtfn, ltefn, ltfn, comp, ecomp
+ switch (hilo) {
+ case '>':
+ gtfn = gt
+ ltefn = lte
+ ltfn = lt
+ comp = '>'
+ ecomp = '>='
+ break
+ case '<':
+ gtfn = lt
+ ltefn = gte
+ ltfn = gt
+ comp = '<'
+ ecomp = '<='
+ break
+ default:
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
+ }
+
+ // If it satisifes the range it is not outside
+ if (satisfies(version, range, options)) {
+ return false
+ }
+
+ // From now on, variable terms are as if we're in "gtr" mode.
+ // but note that everything is flipped for the "ltr" function.
+
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ var high = null
+ var low = null
+
+ comparators.forEach(function (comparator) {
+ if (comparator.semver === ANY) {
+ comparator = new Comparator('>=0.0.0')
+ }
+ high = high || comparator
+ low = low || comparator
+ if (gtfn(comparator.semver, high.semver, options)) {
+ high = comparator
+ } else if (ltfn(comparator.semver, low.semver, options)) {
+ low = comparator
+ }
+ })
+
+ // If the edge version comparator has a operator then our version
+ // isn't outside it
+ if (high.operator === comp || high.operator === ecomp) {
+ return false
+ }
+
+ // If the lowest version comparator has an operator and our version
+ // is less than it then it isn't higher than the range
+ if ((!low.operator || low.operator === comp) &&
+ ltefn(version, low.semver)) {
+ return false
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+ return false
+ }
+ }
+ return true
+}
+
+exports.prerelease = prerelease
+function prerelease (version, options) {
+ var parsed = parse(version, options)
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+
+exports.intersects = intersects
+function intersects (r1, r2, options) {
+ r1 = new Range(r1, options)
+ r2 = new Range(r2, options)
+ return r1.intersects(r2)
+}
+
+exports.coerce = coerce
+function coerce (version, options) {
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version === 'number') {
+ version = String(version)
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ options = options || {}
+
+ var match = null
+ if (!options.rtl) {
+ match = version.match(re[t.COERCE])
+ } else {
+ // Find the right-most coercible string that does not share
+ // a terminus with a more left-ward coercible string.
+ // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
+ //
+ // Walk through the string checking with a /g regexp
+ // Manually set the index so as to pick up overlapping matches.
+ // Stop when we get a match that ends at the string end, since no
+ // coercible string can be more right-ward without the same terminus.
+ var next
+ while ((next = re[t.COERCERTL].exec(version)) &&
+ (!match || match.index + match[0].length !== version.length)
+ ) {
+ if (!match ||
+ next.index + next[0].length !== match.index + match[0].length) {
+ match = next
+ }
+ re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
+ }
+ // leave it in a clean state
+ re[t.COERCERTL].lastIndex = -1
+ }
+
+ if (match === null) {
+ return null
+ }
+
+ return parse(match[2] +
+ '.' + (match[3] || '0') +
+ '.' + (match[4] || '0'), options)
+}
diff --git a/node_modules/semver-diff/package.json b/node_modules/semver-diff/package.json
new file mode 100644
index 0000000..8b7f9fe
--- /dev/null
+++ b/node_modules/semver-diff/package.json
@@ -0,0 +1,69 @@
+{
+ "_from": "semver-diff@^3.1.1",
+ "_id": "semver-diff@3.1.1",
+ "_inBundle": false,
+ "_integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==",
+ "_location": "/semver-diff",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "semver-diff@^3.1.1",
+ "name": "semver-diff",
+ "escapedName": "semver-diff",
+ "rawSpec": "^3.1.1",
+ "saveSpec": null,
+ "fetchSpec": "^3.1.1"
+ },
+ "_requiredBy": [
+ "/update-notifier"
+ ],
+ "_resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz",
+ "_shasum": "05f77ce59f325e00e2706afd67bb506ddb1ca32b",
+ "_spec": "semver-diff@^3.1.1",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/update-notifier",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/semver-diff/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "semver": "^6.3.0"
+ },
+ "deprecated": false,
+ "description": "Get the diff type of two semver versions: 0.0.1 0.0.2 → patch",
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "tsd": "^0.9.0",
+ "xo": "^0.25.3"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "homepage": "https://github.com/sindresorhus/semver-diff#readme",
+ "keywords": [
+ "semver",
+ "version",
+ "semantic",
+ "diff",
+ "difference"
+ ],
+ "license": "MIT",
+ "name": "semver-diff",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/semver-diff.git"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "version": "3.1.1"
+}
diff --git a/node_modules/semver-diff/readme.md b/node_modules/semver-diff/readme.md
new file mode 100644
index 0000000..6e21aff
--- /dev/null
+++ b/node_modules/semver-diff/readme.md
@@ -0,0 +1,77 @@
+# semver-diff [](https://travis-ci.org/sindresorhus/semver-diff)
+
+> Get the diff type of two [semver](https://github.com/npm/node-semver) versions: `0.0.1 0.0.2` → `patch`
+
+
+## Install
+
+```
+$ npm install semver-diff
+```
+
+
+## Usage
+
+```js
+const semverDiff = require('semver-diff');
+
+semverDiff('1.1.1', '1.1.2');
+//=> 'patch'
+
+semverDiff('1.1.1-foo', '1.1.2');
+//=> 'prepatch'
+
+semverDiff('0.0.1', '1.0.0');
+//=> 'major'
+
+semverDiff('0.0.1-foo', '1.0.0');
+//=> 'premajor'
+
+semverDiff('0.0.1', '0.1.0');
+//=> 'minor'
+
+semverDiff('0.0.1-foo', '0.1.0');
+//=> 'preminor'
+
+semverDiff('0.0.1-foo', '0.0.1-foo.bar');
+//=> 'prerelease'
+
+semverDiff('0.1.0', '0.1.0+foo');
+//=> 'build'
+
+semverDiff('0.0.1', '0.0.1');
+//=> undefined
+
+semverDiff('0.0.2', '0.0.1');
+//=> undefined
+```
+
+
+## API
+
+### semverDiff(versionA, versionB)
+
+Returns the difference type between two semver versions, or `undefined` if they're identical or the second one is lower than the first.
+
+Possible values: `'major'`, `'premajor'`, `'minor'`, `'preminor'`, `'patch'`, `'prepatch'`, `'prerelease'`, `'build'`, `undefined`.
+
+
+## Related
+
+- [latest-semver](https://github.com/sindresorhus/latest-semver) - Get the latest stable semver version from an array of versions
+- [to-semver](https://github.com/sindresorhus/to-semver) - Get an array of valid, sorted, and cleaned semver versions from an array of strings
+- [semver-regex](https://github.com/sindresorhus/semver-regex) - Regular expression for matching semver versions
+- [semver-truncate](https://github.com/sindresorhus/semver-truncate) - Truncate a semver version: `1.2.3` → `1.2.0`
+
+
+---
+
+
diff --git a/node_modules/semver/CHANGELOG.md b/node_modules/semver/CHANGELOG.md
new file mode 100644
index 0000000..66304fd
--- /dev/null
+++ b/node_modules/semver/CHANGELOG.md
@@ -0,0 +1,39 @@
+# changes log
+
+## 5.7
+
+* Add `minVersion` method
+
+## 5.6
+
+* Move boolean `loose` param to an options object, with
+ backwards-compatibility protection.
+* Add ability to opt out of special prerelease version handling with
+ the `includePrerelease` option flag.
+
+## 5.5
+
+* Add version coercion capabilities
+
+## 5.4
+
+* Add intersection checking
+
+## 5.3
+
+* Add `minSatisfying` method
+
+## 5.2
+
+* Add `prerelease(v)` that returns prerelease components
+
+## 5.1
+
+* Add Backus-Naur for ranges
+* Remove excessively cute inspection methods
+
+## 5.0
+
+* Remove AMD/Browserified build artifacts
+* Fix ltr and gtr when using the `*` range
+* Fix for range `*` with a prerelease identifier
diff --git a/node_modules/semver/LICENSE b/node_modules/semver/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/node_modules/semver/LICENSE
@@ -0,0 +1,15 @@
+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.
diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md
new file mode 100644
index 0000000..f8dfa5a
--- /dev/null
+++ b/node_modules/semver/README.md
@@ -0,0 +1,412 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Install
+
+```bash
+npm install --save semver
+````
+
+## Usage
+
+As a node module:
+
+```js
+const semver = require('semver')
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean(' =v1.2.3 ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+semver.minVersion('>=1.0.0') // '1.0.0'
+semver.valid(semver.coerce('v2')) // '2.0.0'
+semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
+```
+
+As a command-line utility:
+
+```
+$ semver -h
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] [ [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range
+ Print versions that match the specified range.
+
+-i --increment []
+ Increment a version by the specified level. Level can
+ be one of: major, minor, patch, premajor, preminor,
+ prepatch, or prerelease. Default level is 'patch'.
+ Only one version may be specified.
+
+--preid
+ Identifier to be used to prefix premajor, preminor,
+ prepatch or prerelease version increments.
+
+-l --loose
+ Interpret versions and ranges loosely
+
+-p --include-prerelease
+ Always include prerelease versions in range matching
+
+-c --coerce
+ Coerce a string into SemVer if possible
+ (does not imply --loose)
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+```
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`. The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal. If no operator is specified, then equality is assumed,
+ so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`. A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
+range only accepts prerelease tags on the `1.2.3` version. The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold. First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions. By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk. However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+Note that this behavior can be suppressed (treating all prerelease
+versions as if they were normal versions, for the purpose of range
+matching) by setting the `includePrerelease` flag on the options
+object to any
+[functions](https://github.com/npm/node-semver#functions) that do
+range matching.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```bash
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any version satisfies)
+* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator. Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero digit in the
+`[major, minor, patch]` tuple. In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0`
+* `^0.2.3` := `>=0.2.3 <0.3.0`
+* `^0.0.3` := `>=0.0.3 <0.0.4`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
+ `0.0.3` version *only* will be allowed, if they are greater than or
+ equal to `beta`. So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0`
+* `^0.0.x` := `>=0.0.0 <0.1.0`
+* `^0.0` := `>=0.0.0 <0.1.0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0`
+* `^0.x` := `>=0.0.0 <1.0.0`
+
+### Range Grammar
+
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+
+```bnf
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
+```
+
+## Functions
+
+All methods and classes take a final `options` object argument. All
+options in this object are `false` by default. The options supported
+are:
+
+- `loose` Be more forgiving about not-quite-valid semver strings.
+ (Any resulting output will always be 100% strict compliant, of
+ course.) For backwards compatibility reasons, if the `options`
+ argument is a boolean value instead of an object, it is interpreted
+ to be the `loose` param.
+- `includePrerelease` Set to suppress the [default
+ behavior](https://github.com/npm/node-semver#prerelease-tags) of
+ excluding prerelease tagged versions from ranges unless they are
+ explicitly opted into.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+ type (`major`, `premajor`, `minor`, `preminor`, `patch`,
+ `prepatch`, or `prerelease`), or null if it's not valid
+ * `premajor` in one call will bump the version up to the next major
+ version and down to a prerelease of that major version.
+ `preminor`, and `prepatch` work the same way.
+ * If called from a non-prerelease version, the `prerelease` will work the
+ same as `prepatch`. It increments the patch version, then makes a
+ prerelease. If the input version is already a prerelease it simply
+ increments it.
+* `prerelease(v)`: Returns an array of prerelease components, or null
+ if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
+ or comparators intersect.
+* `parse(v)`: Attempt to parse a string as a semantic version, returning either
+ a `SemVer` object or `null`.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+ even if they're not the exact same string. You already know how to
+ compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+ the corresponding function above. `"==="` and `"!=="` do simple
+ string comparison, but are included for completeness. Throws if an
+ invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
+ in descending order when passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+ (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+ or null if the versions are the same.
+
+### Comparators
+
+* `intersects(comparator)`: Return true if the comparators intersect
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+ range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minSatisfying(versions, range)`: Return the lowest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minVersion(range)`: Return the lowest version that can possibly match
+ the given range.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+ versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+ versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+ the bounds of the range in either the high or low direction. The
+ `hilo` argument must be either the string `'>'` or `'<'`. (This is
+ the function called by `gtr` and `ltr`.)
+* `intersects(range)`: Return true if any of the ranges comparators intersect
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range! For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
+
+### Coercion
+
+* `coerce(version)`: Coerces a string to semver if possible
+
+This aims to provide a very forgiving translation of a non-semver string to
+semver. It looks for the first digit in a string, and consumes all
+remaining characters which satisfy at least a partial semver (e.g., `1`,
+`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
+versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
+surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
+`3.4.0`). Only text which lacks digits will fail coercion (`version one`
+is not valid). The maximum length for any semver component considered for
+coercion is 16 characters; longer components will be ignored
+(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
+semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
+components are invalid (`9999999999999999.4.7.4` is likely invalid).
diff --git a/node_modules/semver/bin/semver b/node_modules/semver/bin/semver
new file mode 100755
index 0000000..801e77f
--- /dev/null
+++ b/node_modules/semver/bin/semver
@@ -0,0 +1,160 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+var argv = process.argv.slice(2)
+
+var versions = []
+
+var range = []
+
+var inc = null
+
+var version = require('../package.json').version
+
+var loose = false
+
+var includePrerelease = false
+
+var coerce = false
+
+var identifier
+
+var semver = require('../semver')
+
+var reverse = false
+
+var options = {}
+
+main()
+
+function main () {
+ if (!argv.length) return help()
+ while (argv.length) {
+ var a = argv.shift()
+ var indexOfEqualSign = a.indexOf('=')
+ if (indexOfEqualSign !== -1) {
+ a = a.slice(0, indexOfEqualSign)
+ argv.unshift(a.slice(indexOfEqualSign + 1))
+ }
+ switch (a) {
+ case '-rv': case '-rev': case '--rev': case '--reverse':
+ reverse = true
+ break
+ case '-l': case '--loose':
+ loose = true
+ break
+ case '-p': case '--include-prerelease':
+ includePrerelease = true
+ break
+ case '-v': case '--version':
+ versions.push(argv.shift())
+ break
+ case '-i': case '--inc': case '--increment':
+ switch (argv[0]) {
+ case 'major': case 'minor': case 'patch': case 'prerelease':
+ case 'premajor': case 'preminor': case 'prepatch':
+ inc = argv.shift()
+ break
+ default:
+ inc = 'patch'
+ break
+ }
+ break
+ case '--preid':
+ identifier = argv.shift()
+ break
+ case '-r': case '--range':
+ range.push(argv.shift())
+ break
+ case '-c': case '--coerce':
+ coerce = true
+ break
+ case '-h': case '--help': case '-?':
+ return help()
+ default:
+ versions.push(a)
+ break
+ }
+ }
+
+ var options = { loose: loose, includePrerelease: includePrerelease }
+
+ versions = versions.map(function (v) {
+ return coerce ? (semver.coerce(v) || { version: v }).version : v
+ }).filter(function (v) {
+ return semver.valid(v)
+ })
+ if (!versions.length) return fail()
+ if (inc && (versions.length !== 1 || range.length)) { return failInc() }
+
+ for (var i = 0, l = range.length; i < l; i++) {
+ versions = versions.filter(function (v) {
+ return semver.satisfies(v, range[i], options)
+ })
+ if (!versions.length) return fail()
+ }
+ return success(versions)
+}
+
+function failInc () {
+ console.error('--inc can only be used on a single version with no range')
+ fail()
+}
+
+function fail () { process.exit(1) }
+
+function success () {
+ var compare = reverse ? 'rcompare' : 'compare'
+ versions.sort(function (a, b) {
+ return semver[compare](a, b, options)
+ }).map(function (v) {
+ return semver.clean(v, options)
+ }).map(function (v) {
+ return inc ? semver.inc(v, inc, options, identifier) : v
+ }).forEach(function (v, i, _) { console.log(v) })
+}
+
+function help () {
+ console.log(['SemVer ' + version,
+ '',
+ 'A JavaScript implementation of the https://semver.org/ specification',
+ 'Copyright Isaac Z. Schlueter',
+ '',
+ 'Usage: semver [options] [ [...]]',
+ 'Prints valid versions sorted by SemVer precedence',
+ '',
+ 'Options:',
+ '-r --range ',
+ ' Print versions that match the specified range.',
+ '',
+ '-i --increment []',
+ ' Increment a version by the specified level. Level can',
+ ' be one of: major, minor, patch, premajor, preminor,',
+ " prepatch, or prerelease. Default level is 'patch'.",
+ ' Only one version may be specified.',
+ '',
+ '--preid ',
+ ' Identifier to be used to prefix premajor, preminor,',
+ ' prepatch or prerelease version increments.',
+ '',
+ '-l --loose',
+ ' Interpret versions and ranges loosely',
+ '',
+ '-p --include-prerelease',
+ ' Always include prerelease versions in range matching',
+ '',
+ '-c --coerce',
+ ' Coerce a string into SemVer if possible',
+ ' (does not imply --loose)',
+ '',
+ 'Program exits successfully if any valid version satisfies',
+ 'all supplied ranges, and prints all satisfying versions.',
+ '',
+ 'If no satisfying versions are found, then exits failure.',
+ '',
+ 'Versions are printed in ascending order, so supplying',
+ 'multiple versions to the utility will just sort them.'
+ ].join('\n'))
+}
diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json
new file mode 100644
index 0000000..90ec9cc
--- /dev/null
+++ b/node_modules/semver/package.json
@@ -0,0 +1,60 @@
+{
+ "_from": "semver@^5.7.1",
+ "_id": "semver@5.7.1",
+ "_inBundle": false,
+ "_integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "_location": "/semver",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "semver@^5.7.1",
+ "name": "semver",
+ "escapedName": "semver",
+ "rawSpec": "^5.7.1",
+ "saveSpec": null,
+ "fetchSpec": "^5.7.1"
+ },
+ "_requiredBy": [
+ "/nodemon"
+ ],
+ "_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "_shasum": "a954f931aeba508d307bbf069eff0c01c96116f7",
+ "_spec": "semver@^5.7.1",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/nodemon",
+ "bin": {
+ "semver": "bin/semver"
+ },
+ "bugs": {
+ "url": "https://github.com/npm/node-semver/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "The semantic version parser used by npm.",
+ "devDependencies": {
+ "tap": "^13.0.0-rc.18"
+ },
+ "files": [
+ "bin",
+ "range.bnf",
+ "semver.js"
+ ],
+ "homepage": "https://github.com/npm/node-semver#readme",
+ "license": "ISC",
+ "main": "semver.js",
+ "name": "semver",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/npm/node-semver.git"
+ },
+ "scripts": {
+ "postpublish": "git push origin --all; git push origin --tags",
+ "postversion": "npm publish",
+ "preversion": "npm test",
+ "test": "tap"
+ },
+ "tap": {
+ "check-coverage": true
+ },
+ "version": "5.7.1"
+}
diff --git a/node_modules/semver/range.bnf b/node_modules/semver/range.bnf
new file mode 100644
index 0000000..d4c6ae0
--- /dev/null
+++ b/node_modules/semver/range.bnf
@@ -0,0 +1,16 @@
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | [1-9] ( [0-9] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
diff --git a/node_modules/semver/semver.js b/node_modules/semver/semver.js
new file mode 100644
index 0000000..d315d5d
--- /dev/null
+++ b/node_modules/semver/semver.js
@@ -0,0 +1,1483 @@
+exports = module.exports = SemVer
+
+var debug
+/* istanbul ignore next */
+if (typeof process === 'object' &&
+ process.env &&
+ process.env.NODE_DEBUG &&
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
+ debug = function () {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.unshift('SEMVER')
+ console.log.apply(console, args)
+ }
+} else {
+ debug = function () {}
+}
+
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+exports.SEMVER_SPEC_VERSION = '2.0.0'
+
+var MAX_LENGTH = 256
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+ /* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+var MAX_SAFE_COMPONENT_LENGTH = 16
+
+// The actual regexps go on exports.re
+var re = exports.re = []
+var src = exports.src = []
+var R = 0
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+var NUMERICIDENTIFIER = R++
+src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
+var NUMERICIDENTIFIERLOOSE = R++
+src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+var NONNUMERICIDENTIFIER = R++
+src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+var MAINVERSION = R++
+src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIER] + ')'
+
+var MAINVERSIONLOOSE = R++
+src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+var PRERELEASEIDENTIFIER = R++
+src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
+ '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+var PRERELEASEIDENTIFIERLOOSE = R++
+src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
+ '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+var PRERELEASE = R++
+src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
+ '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
+
+var PRERELEASELOOSE = R++
+src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
+ '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+var BUILDIDENTIFIER = R++
+src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+var BUILD = R++
+src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
+ '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups. The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+var FULL = R++
+var FULLPLAIN = 'v?' + src[MAINVERSION] +
+ src[PRERELEASE] + '?' +
+ src[BUILD] + '?'
+
+src[FULL] = '^' + FULLPLAIN + '$'
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
+ src[PRERELEASELOOSE] + '?' +
+ src[BUILD] + '?'
+
+var LOOSE = R++
+src[LOOSE] = '^' + LOOSEPLAIN + '$'
+
+var GTLT = R++
+src[GTLT] = '((?:<|>)?=?)'
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+var XRANGEIDENTIFIERLOOSE = R++
+src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
+var XRANGEIDENTIFIER = R++
+src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
+
+var XRANGEPLAIN = R++
+src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:' + src[PRERELEASE] + ')?' +
+ src[BUILD] + '?' +
+ ')?)?'
+
+var XRANGEPLAINLOOSE = R++
+src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:' + src[PRERELEASELOOSE] + ')?' +
+ src[BUILD] + '?' +
+ ')?)?'
+
+var XRANGE = R++
+src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
+var XRANGELOOSE = R++
+src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+var COERCE = R++
+src[COERCE] = '(?:^|[^\\d])' +
+ '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:$|[^\\d])'
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+var LONETILDE = R++
+src[LONETILDE] = '(?:~>?)'
+
+var TILDETRIM = R++
+src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
+re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
+var tildeTrimReplace = '$1~'
+
+var TILDE = R++
+src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
+var TILDELOOSE = R++
+src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+var LONECARET = R++
+src[LONECARET] = '(?:\\^)'
+
+var CARETTRIM = R++
+src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
+re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
+var caretTrimReplace = '$1^'
+
+var CARET = R++
+src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
+var CARETLOOSE = R++
+src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+var COMPARATORLOOSE = R++
+src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
+var COMPARATOR = R++
+src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+var COMPARATORTRIM = R++
+src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
+ '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
+
+// this one has to use the /g flag
+re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
+var comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+var HYPHENRANGE = R++
+src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[XRANGEPLAIN] + ')' +
+ '\\s*$'
+
+var HYPHENRANGELOOSE = R++
+src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[XRANGEPLAINLOOSE] + ')' +
+ '\\s*$'
+
+// Star ranges basically just allow anything at all.
+var STAR = R++
+src[STAR] = '(<|>)?=?\\s*\\*'
+
+// Compile to actual regexp objects.
+// All are flag-free, unless they were created above with a flag.
+for (var i = 0; i < R; i++) {
+ debug(i, src[i])
+ if (!re[i]) {
+ re[i] = new RegExp(src[i])
+ }
+}
+
+exports.parse = parse
+function parse (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ if (version.length > MAX_LENGTH) {
+ return null
+ }
+
+ var r = options.loose ? re[LOOSE] : re[FULL]
+ if (!r.test(version)) {
+ return null
+ }
+
+ try {
+ return new SemVer(version, options)
+ } catch (er) {
+ return null
+ }
+}
+
+exports.valid = valid
+function valid (version, options) {
+ var v = parse(version, options)
+ return v ? v.version : null
+}
+
+exports.clean = clean
+function clean (version, options) {
+ var s = parse(version.trim().replace(/^[=v]+/, ''), options)
+ return s ? s.version : null
+}
+
+exports.SemVer = SemVer
+
+function SemVer (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+ if (version instanceof SemVer) {
+ if (version.loose === options.loose) {
+ return version
+ } else {
+ version = version.version
+ }
+ } else if (typeof version !== 'string') {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ if (version.length > MAX_LENGTH) {
+ throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
+ }
+
+ if (!(this instanceof SemVer)) {
+ return new SemVer(version, options)
+ }
+
+ debug('SemVer', version, options)
+ this.options = options
+ this.loose = !!options.loose
+
+ var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
+
+ if (!m) {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ this.raw = version
+
+ // these are actually numbers
+ this.major = +m[1]
+ this.minor = +m[2]
+ this.patch = +m[3]
+
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+ throw new TypeError('Invalid major version')
+ }
+
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+ throw new TypeError('Invalid minor version')
+ }
+
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+ throw new TypeError('Invalid patch version')
+ }
+
+ // numberify any prerelease numeric ids
+ if (!m[4]) {
+ this.prerelease = []
+ } else {
+ this.prerelease = m[4].split('.').map(function (id) {
+ if (/^[0-9]+$/.test(id)) {
+ var num = +id
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
+ return num
+ }
+ }
+ return id
+ })
+ }
+
+ this.build = m[5] ? m[5].split('.') : []
+ this.format()
+}
+
+SemVer.prototype.format = function () {
+ this.version = this.major + '.' + this.minor + '.' + this.patch
+ if (this.prerelease.length) {
+ this.version += '-' + this.prerelease.join('.')
+ }
+ return this.version
+}
+
+SemVer.prototype.toString = function () {
+ return this.version
+}
+
+SemVer.prototype.compare = function (other) {
+ debug('SemVer.compare', this.version, this.options, other)
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return this.compareMain(other) || this.comparePre(other)
+}
+
+SemVer.prototype.compareMain = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return compareIdentifiers(this.major, other.major) ||
+ compareIdentifiers(this.minor, other.minor) ||
+ compareIdentifiers(this.patch, other.patch)
+}
+
+SemVer.prototype.comparePre = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ // NOT having a prerelease is > having one
+ if (this.prerelease.length && !other.prerelease.length) {
+ return -1
+ } else if (!this.prerelease.length && other.prerelease.length) {
+ return 1
+ } else if (!this.prerelease.length && !other.prerelease.length) {
+ return 0
+ }
+
+ var i = 0
+ do {
+ var a = this.prerelease[i]
+ var b = other.prerelease[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+}
+
+// preminor will bump the version up to the next minor release, and immediately
+// down to pre-release. premajor and prepatch work the same way.
+SemVer.prototype.inc = function (release, identifier) {
+ switch (release) {
+ case 'premajor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor = 0
+ this.major++
+ this.inc('pre', identifier)
+ break
+ case 'preminor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor++
+ this.inc('pre', identifier)
+ break
+ case 'prepatch':
+ // If this is already a prerelease, it will bump to the next version
+ // drop any prereleases that might already exist, since they are not
+ // relevant at this point.
+ this.prerelease.length = 0
+ this.inc('patch', identifier)
+ this.inc('pre', identifier)
+ break
+ // If the input is a non-prerelease version, this acts the same as
+ // prepatch.
+ case 'prerelease':
+ if (this.prerelease.length === 0) {
+ this.inc('patch', identifier)
+ }
+ this.inc('pre', identifier)
+ break
+
+ case 'major':
+ // If this is a pre-major version, bump up to the same major version.
+ // Otherwise increment major.
+ // 1.0.0-5 bumps to 1.0.0
+ // 1.1.0 bumps to 2.0.0
+ if (this.minor !== 0 ||
+ this.patch !== 0 ||
+ this.prerelease.length === 0) {
+ this.major++
+ }
+ this.minor = 0
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'minor':
+ // If this is a pre-minor version, bump up to the same minor version.
+ // Otherwise increment minor.
+ // 1.2.0-5 bumps to 1.2.0
+ // 1.2.1 bumps to 1.3.0
+ if (this.patch !== 0 || this.prerelease.length === 0) {
+ this.minor++
+ }
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'patch':
+ // If this is not a pre-release version, it will increment the patch.
+ // If it is a pre-release it will bump up to the same patch version.
+ // 1.2.0-5 patches to 1.2.0
+ // 1.2.0 patches to 1.2.1
+ if (this.prerelease.length === 0) {
+ this.patch++
+ }
+ this.prerelease = []
+ break
+ // This probably shouldn't be used publicly.
+ // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+ case 'pre':
+ if (this.prerelease.length === 0) {
+ this.prerelease = [0]
+ } else {
+ var i = this.prerelease.length
+ while (--i >= 0) {
+ if (typeof this.prerelease[i] === 'number') {
+ this.prerelease[i]++
+ i = -2
+ }
+ }
+ if (i === -1) {
+ // didn't increment anything
+ this.prerelease.push(0)
+ }
+ }
+ if (identifier) {
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+ if (this.prerelease[0] === identifier) {
+ if (isNaN(this.prerelease[1])) {
+ this.prerelease = [identifier, 0]
+ }
+ } else {
+ this.prerelease = [identifier, 0]
+ }
+ }
+ break
+
+ default:
+ throw new Error('invalid increment argument: ' + release)
+ }
+ this.format()
+ this.raw = this.version
+ return this
+}
+
+exports.inc = inc
+function inc (version, release, loose, identifier) {
+ if (typeof (loose) === 'string') {
+ identifier = loose
+ loose = undefined
+ }
+
+ try {
+ return new SemVer(version, loose).inc(release, identifier).version
+ } catch (er) {
+ return null
+ }
+}
+
+exports.diff = diff
+function diff (version1, version2) {
+ if (eq(version1, version2)) {
+ return null
+ } else {
+ var v1 = parse(version1)
+ var v2 = parse(version2)
+ var prefix = ''
+ if (v1.prerelease.length || v2.prerelease.length) {
+ prefix = 'pre'
+ var defaultResult = 'prerelease'
+ }
+ for (var key in v1) {
+ if (key === 'major' || key === 'minor' || key === 'patch') {
+ if (v1[key] !== v2[key]) {
+ return prefix + key
+ }
+ }
+ }
+ return defaultResult // may be undefined
+ }
+}
+
+exports.compareIdentifiers = compareIdentifiers
+
+var numeric = /^[0-9]+$/
+function compareIdentifiers (a, b) {
+ var anum = numeric.test(a)
+ var bnum = numeric.test(b)
+
+ if (anum && bnum) {
+ a = +a
+ b = +b
+ }
+
+ return a === b ? 0
+ : (anum && !bnum) ? -1
+ : (bnum && !anum) ? 1
+ : a < b ? -1
+ : 1
+}
+
+exports.rcompareIdentifiers = rcompareIdentifiers
+function rcompareIdentifiers (a, b) {
+ return compareIdentifiers(b, a)
+}
+
+exports.major = major
+function major (a, loose) {
+ return new SemVer(a, loose).major
+}
+
+exports.minor = minor
+function minor (a, loose) {
+ return new SemVer(a, loose).minor
+}
+
+exports.patch = patch
+function patch (a, loose) {
+ return new SemVer(a, loose).patch
+}
+
+exports.compare = compare
+function compare (a, b, loose) {
+ return new SemVer(a, loose).compare(new SemVer(b, loose))
+}
+
+exports.compareLoose = compareLoose
+function compareLoose (a, b) {
+ return compare(a, b, true)
+}
+
+exports.rcompare = rcompare
+function rcompare (a, b, loose) {
+ return compare(b, a, loose)
+}
+
+exports.sort = sort
+function sort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.compare(a, b, loose)
+ })
+}
+
+exports.rsort = rsort
+function rsort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.rcompare(a, b, loose)
+ })
+}
+
+exports.gt = gt
+function gt (a, b, loose) {
+ return compare(a, b, loose) > 0
+}
+
+exports.lt = lt
+function lt (a, b, loose) {
+ return compare(a, b, loose) < 0
+}
+
+exports.eq = eq
+function eq (a, b, loose) {
+ return compare(a, b, loose) === 0
+}
+
+exports.neq = neq
+function neq (a, b, loose) {
+ return compare(a, b, loose) !== 0
+}
+
+exports.gte = gte
+function gte (a, b, loose) {
+ return compare(a, b, loose) >= 0
+}
+
+exports.lte = lte
+function lte (a, b, loose) {
+ return compare(a, b, loose) <= 0
+}
+
+exports.cmp = cmp
+function cmp (a, op, b, loose) {
+ switch (op) {
+ case '===':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a === b
+
+ case '!==':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a !== b
+
+ case '':
+ case '=':
+ case '==':
+ return eq(a, b, loose)
+
+ case '!=':
+ return neq(a, b, loose)
+
+ case '>':
+ return gt(a, b, loose)
+
+ case '>=':
+ return gte(a, b, loose)
+
+ case '<':
+ return lt(a, b, loose)
+
+ case '<=':
+ return lte(a, b, loose)
+
+ default:
+ throw new TypeError('Invalid operator: ' + op)
+ }
+}
+
+exports.Comparator = Comparator
+function Comparator (comp, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (comp instanceof Comparator) {
+ if (comp.loose === !!options.loose) {
+ return comp
+ } else {
+ comp = comp.value
+ }
+ }
+
+ if (!(this instanceof Comparator)) {
+ return new Comparator(comp, options)
+ }
+
+ debug('comparator', comp, options)
+ this.options = options
+ this.loose = !!options.loose
+ this.parse(comp)
+
+ if (this.semver === ANY) {
+ this.value = ''
+ } else {
+ this.value = this.operator + this.semver.version
+ }
+
+ debug('comp', this)
+}
+
+var ANY = {}
+Comparator.prototype.parse = function (comp) {
+ var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+ var m = comp.match(r)
+
+ if (!m) {
+ throw new TypeError('Invalid comparator: ' + comp)
+ }
+
+ this.operator = m[1]
+ if (this.operator === '=') {
+ this.operator = ''
+ }
+
+ // if it literally is just '>' or '' then allow anything.
+ if (!m[2]) {
+ this.semver = ANY
+ } else {
+ this.semver = new SemVer(m[2], this.options.loose)
+ }
+}
+
+Comparator.prototype.toString = function () {
+ return this.value
+}
+
+Comparator.prototype.test = function (version) {
+ debug('Comparator.test', version, this.options.loose)
+
+ if (this.semver === ANY) {
+ return true
+ }
+
+ if (typeof version === 'string') {
+ version = new SemVer(version, this.options)
+ }
+
+ return cmp(version, this.operator, this.semver, this.options)
+}
+
+Comparator.prototype.intersects = function (comp, options) {
+ if (!(comp instanceof Comparator)) {
+ throw new TypeError('a Comparator is required')
+ }
+
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ var rangeTmp
+
+ if (this.operator === '') {
+ rangeTmp = new Range(comp.value, options)
+ return satisfies(this.value, rangeTmp, options)
+ } else if (comp.operator === '') {
+ rangeTmp = new Range(this.value, options)
+ return satisfies(comp.semver, rangeTmp, options)
+ }
+
+ var sameDirectionIncreasing =
+ (this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '>=' || comp.operator === '>')
+ var sameDirectionDecreasing =
+ (this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '<=' || comp.operator === '<')
+ var sameSemVer = this.semver.version === comp.semver.version
+ var differentDirectionsInclusive =
+ (this.operator === '>=' || this.operator === '<=') &&
+ (comp.operator === '>=' || comp.operator === '<=')
+ var oppositeDirectionsLessThan =
+ cmp(this.semver, '<', comp.semver, options) &&
+ ((this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '<=' || comp.operator === '<'))
+ var oppositeDirectionsGreaterThan =
+ cmp(this.semver, '>', comp.semver, options) &&
+ ((this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '>=' || comp.operator === '>'))
+
+ return sameDirectionIncreasing || sameDirectionDecreasing ||
+ (sameSemVer && differentDirectionsInclusive) ||
+ oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
+}
+
+exports.Range = Range
+function Range (range, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (range instanceof Range) {
+ if (range.loose === !!options.loose &&
+ range.includePrerelease === !!options.includePrerelease) {
+ return range
+ } else {
+ return new Range(range.raw, options)
+ }
+ }
+
+ if (range instanceof Comparator) {
+ return new Range(range.value, options)
+ }
+
+ if (!(this instanceof Range)) {
+ return new Range(range, options)
+ }
+
+ this.options = options
+ this.loose = !!options.loose
+ this.includePrerelease = !!options.includePrerelease
+
+ // First, split based on boolean or ||
+ this.raw = range
+ this.set = range.split(/\s*\|\|\s*/).map(function (range) {
+ return this.parseRange(range.trim())
+ }, this).filter(function (c) {
+ // throw out any that are not relevant for whatever reason
+ return c.length
+ })
+
+ if (!this.set.length) {
+ throw new TypeError('Invalid SemVer Range: ' + range)
+ }
+
+ this.format()
+}
+
+Range.prototype.format = function () {
+ this.range = this.set.map(function (comps) {
+ return comps.join(' ').trim()
+ }).join('||').trim()
+ return this.range
+}
+
+Range.prototype.toString = function () {
+ return this.range
+}
+
+Range.prototype.parseRange = function (range) {
+ var loose = this.options.loose
+ range = range.trim()
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+ var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
+ range = range.replace(hr, hyphenReplace)
+ debug('hyphen replace', range)
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+ range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
+ debug('comparator trim', range, re[COMPARATORTRIM])
+
+ // `~ 1.2.3` => `~1.2.3`
+ range = range.replace(re[TILDETRIM], tildeTrimReplace)
+
+ // `^ 1.2.3` => `^1.2.3`
+ range = range.replace(re[CARETTRIM], caretTrimReplace)
+
+ // normalize spaces
+ range = range.split(/\s+/).join(' ')
+
+ // At this point, the range is completely trimmed and
+ // ready to be split into comparators.
+
+ var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+ var set = range.split(' ').map(function (comp) {
+ return parseComparator(comp, this.options)
+ }, this).join(' ').split(/\s+/)
+ if (this.options.loose) {
+ // in loose mode, throw out any that are not valid comparators
+ set = set.filter(function (comp) {
+ return !!comp.match(compRe)
+ })
+ }
+ set = set.map(function (comp) {
+ return new Comparator(comp, this.options)
+ }, this)
+
+ return set
+}
+
+Range.prototype.intersects = function (range, options) {
+ if (!(range instanceof Range)) {
+ throw new TypeError('a Range is required')
+ }
+
+ return this.set.some(function (thisComparators) {
+ return thisComparators.every(function (thisComparator) {
+ return range.set.some(function (rangeComparators) {
+ return rangeComparators.every(function (rangeComparator) {
+ return thisComparator.intersects(rangeComparator, options)
+ })
+ })
+ })
+ })
+}
+
+// Mostly just for testing and legacy API reasons
+exports.toComparators = toComparators
+function toComparators (range, options) {
+ return new Range(range, options).set.map(function (comp) {
+ return comp.map(function (c) {
+ return c.value
+ }).join(' ').trim().split(' ')
+ })
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+function parseComparator (comp, options) {
+ debug('comp', comp, options)
+ comp = replaceCarets(comp, options)
+ debug('caret', comp)
+ comp = replaceTildes(comp, options)
+ debug('tildes', comp)
+ comp = replaceXRanges(comp, options)
+ debug('xrange', comp)
+ comp = replaceStars(comp, options)
+ debug('stars', comp)
+ return comp
+}
+
+function isX (id) {
+ return !id || id.toLowerCase() === 'x' || id === '*'
+}
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+function replaceTildes (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceTilde(comp, options)
+ }).join(' ')
+}
+
+function replaceTilde (comp, options) {
+ var r = options.loose ? re[TILDELOOSE] : re[TILDE]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('tilde', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ // ~1.2 == >=1.2.0 <1.3.0
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else if (pr) {
+ debug('replaceTilde pr', pr)
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ // ~1.2.3 == >=1.2.3 <1.3.0
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+
+ debug('tilde return', ret)
+ return ret
+ })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2.0 --> >=1.2.0 <2.0.0
+function replaceCarets (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceCaret(comp, options)
+ }).join(' ')
+}
+
+function replaceCaret (comp, options) {
+ debug('caret', comp, options)
+ var r = options.loose ? re[CARETLOOSE] : re[CARET]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('caret', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ if (M === '0') {
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
+ }
+ } else if (pr) {
+ debug('replaceCaret pr', pr)
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ } else {
+ debug('no pr')
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ }
+
+ debug('caret return', ret)
+ return ret
+ })
+}
+
+function replaceXRanges (comp, options) {
+ debug('replaceXRanges', comp, options)
+ return comp.split(/\s+/).map(function (comp) {
+ return replaceXRange(comp, options)
+ }).join(' ')
+}
+
+function replaceXRange (comp, options) {
+ comp = comp.trim()
+ var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
+ return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
+ debug('xRange', comp, ret, gtlt, M, m, p, pr)
+ var xM = isX(M)
+ var xm = xM || isX(m)
+ var xp = xm || isX(p)
+ var anyX = xp
+
+ if (gtlt === '=' && anyX) {
+ gtlt = ''
+ }
+
+ if (xM) {
+ if (gtlt === '>' || gtlt === '<') {
+ // nothing is allowed
+ ret = '<0.0.0'
+ } else {
+ // nothing is forbidden
+ ret = '*'
+ }
+ } else if (gtlt && anyX) {
+ // we know patch is an x, because we have any x at all.
+ // replace X with 0
+ if (xm) {
+ m = 0
+ }
+ p = 0
+
+ if (gtlt === '>') {
+ // >1 => >=2.0.0
+ // >1.2 => >=1.3.0
+ // >1.2.3 => >= 1.2.4
+ gtlt = '>='
+ if (xm) {
+ M = +M + 1
+ m = 0
+ p = 0
+ } else {
+ m = +m + 1
+ p = 0
+ }
+ } else if (gtlt === '<=') {
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
+ gtlt = '<'
+ if (xm) {
+ M = +M + 1
+ } else {
+ m = +m + 1
+ }
+ }
+
+ ret = gtlt + M + '.' + m + '.' + p
+ } else if (xm) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (xp) {
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ }
+
+ debug('xRange return', ret)
+
+ return ret
+ })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+function replaceStars (comp, options) {
+ debug('replaceStars', comp, options)
+ // Looseness is ignored here. star is always as loose as it gets!
+ return comp.trim().replace(re[STAR], '')
+}
+
+// This function is passed to string.replace(re[HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0
+function hyphenReplace ($0,
+ from, fM, fm, fp, fpr, fb,
+ to, tM, tm, tp, tpr, tb) {
+ if (isX(fM)) {
+ from = ''
+ } else if (isX(fm)) {
+ from = '>=' + fM + '.0.0'
+ } else if (isX(fp)) {
+ from = '>=' + fM + '.' + fm + '.0'
+ } else {
+ from = '>=' + from
+ }
+
+ if (isX(tM)) {
+ to = ''
+ } else if (isX(tm)) {
+ to = '<' + (+tM + 1) + '.0.0'
+ } else if (isX(tp)) {
+ to = '<' + tM + '.' + (+tm + 1) + '.0'
+ } else if (tpr) {
+ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
+ } else {
+ to = '<=' + to
+ }
+
+ return (from + ' ' + to).trim()
+}
+
+// if ANY of the sets match ALL of its comparators, then pass
+Range.prototype.test = function (version) {
+ if (!version) {
+ return false
+ }
+
+ if (typeof version === 'string') {
+ version = new SemVer(version, this.options)
+ }
+
+ for (var i = 0; i < this.set.length; i++) {
+ if (testSet(this.set[i], version, this.options)) {
+ return true
+ }
+ }
+ return false
+}
+
+function testSet (set, version, options) {
+ for (var i = 0; i < set.length; i++) {
+ if (!set[i].test(version)) {
+ return false
+ }
+ }
+
+ if (version.prerelease.length && !options.includePrerelease) {
+ // Find the set of versions that are allowed to have prereleases
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+ // That should allow `1.2.3-pr.2` to pass.
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
+ // even though it's within the range set by the comparators.
+ for (i = 0; i < set.length; i++) {
+ debug(set[i].semver)
+ if (set[i].semver === ANY) {
+ continue
+ }
+
+ if (set[i].semver.prerelease.length > 0) {
+ var allowed = set[i].semver
+ if (allowed.major === version.major &&
+ allowed.minor === version.minor &&
+ allowed.patch === version.patch) {
+ return true
+ }
+ }
+ }
+
+ // Version has a -pre, but it's not one of the ones we like.
+ return false
+ }
+
+ return true
+}
+
+exports.satisfies = satisfies
+function satisfies (version, range, options) {
+ try {
+ range = new Range(range, options)
+ } catch (er) {
+ return false
+ }
+ return range.test(version)
+}
+
+exports.maxSatisfying = maxSatisfying
+function maxSatisfying (versions, range, options) {
+ var max = null
+ var maxSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!max || maxSV.compare(v) === -1) {
+ // compare(max, v, true)
+ max = v
+ maxSV = new SemVer(max, options)
+ }
+ }
+ })
+ return max
+}
+
+exports.minSatisfying = minSatisfying
+function minSatisfying (versions, range, options) {
+ var min = null
+ var minSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!min || minSV.compare(v) === 1) {
+ // compare(min, v, true)
+ min = v
+ minSV = new SemVer(min, options)
+ }
+ }
+ })
+ return min
+}
+
+exports.minVersion = minVersion
+function minVersion (range, loose) {
+ range = new Range(range, loose)
+
+ var minver = new SemVer('0.0.0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = new SemVer('0.0.0-0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = null
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ comparators.forEach(function (comparator) {
+ // Clone to avoid manipulating the comparator's semver object.
+ var compver = new SemVer(comparator.semver.version)
+ switch (comparator.operator) {
+ case '>':
+ if (compver.prerelease.length === 0) {
+ compver.patch++
+ } else {
+ compver.prerelease.push(0)
+ }
+ compver.raw = compver.format()
+ /* fallthrough */
+ case '':
+ case '>=':
+ if (!minver || gt(minver, compver)) {
+ minver = compver
+ }
+ break
+ case '<':
+ case '<=':
+ /* Ignore maximum versions */
+ break
+ /* istanbul ignore next */
+ default:
+ throw new Error('Unexpected operation: ' + comparator.operator)
+ }
+ })
+ }
+
+ if (minver && range.test(minver)) {
+ return minver
+ }
+
+ return null
+}
+
+exports.validRange = validRange
+function validRange (range, options) {
+ try {
+ // Return '*' instead of '' so that truthiness works.
+ // This will throw if it's invalid anyway
+ return new Range(range, options).range || '*'
+ } catch (er) {
+ return null
+ }
+}
+
+// Determine if version is less than all the versions possible in the range
+exports.ltr = ltr
+function ltr (version, range, options) {
+ return outside(version, range, '<', options)
+}
+
+// Determine if version is greater than all the versions possible in the range.
+exports.gtr = gtr
+function gtr (version, range, options) {
+ return outside(version, range, '>', options)
+}
+
+exports.outside = outside
+function outside (version, range, hilo, options) {
+ version = new SemVer(version, options)
+ range = new Range(range, options)
+
+ var gtfn, ltefn, ltfn, comp, ecomp
+ switch (hilo) {
+ case '>':
+ gtfn = gt
+ ltefn = lte
+ ltfn = lt
+ comp = '>'
+ ecomp = '>='
+ break
+ case '<':
+ gtfn = lt
+ ltefn = gte
+ ltfn = gt
+ comp = '<'
+ ecomp = '<='
+ break
+ default:
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
+ }
+
+ // If it satisifes the range it is not outside
+ if (satisfies(version, range, options)) {
+ return false
+ }
+
+ // From now on, variable terms are as if we're in "gtr" mode.
+ // but note that everything is flipped for the "ltr" function.
+
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ var high = null
+ var low = null
+
+ comparators.forEach(function (comparator) {
+ if (comparator.semver === ANY) {
+ comparator = new Comparator('>=0.0.0')
+ }
+ high = high || comparator
+ low = low || comparator
+ if (gtfn(comparator.semver, high.semver, options)) {
+ high = comparator
+ } else if (ltfn(comparator.semver, low.semver, options)) {
+ low = comparator
+ }
+ })
+
+ // If the edge version comparator has a operator then our version
+ // isn't outside it
+ if (high.operator === comp || high.operator === ecomp) {
+ return false
+ }
+
+ // If the lowest version comparator has an operator and our version
+ // is less than it then it isn't higher than the range
+ if ((!low.operator || low.operator === comp) &&
+ ltefn(version, low.semver)) {
+ return false
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+ return false
+ }
+ }
+ return true
+}
+
+exports.prerelease = prerelease
+function prerelease (version, options) {
+ var parsed = parse(version, options)
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+
+exports.intersects = intersects
+function intersects (r1, r2, options) {
+ r1 = new Range(r1, options)
+ r2 = new Range(r2, options)
+ return r1.intersects(r2)
+}
+
+exports.coerce = coerce
+function coerce (version) {
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ var match = version.match(re[COERCE])
+
+ if (match == null) {
+ return null
+ }
+
+ return parse(match[1] +
+ '.' + (match[2] || '0') +
+ '.' + (match[3] || '0'))
+}
diff --git a/node_modules/send/node_modules/ms/package.json b/node_modules/send/node_modules/ms/package.json
index f152ddb..4a55de8 100644
--- a/node_modules/send/node_modules/ms/package.json
+++ b/node_modules/send/node_modules/ms/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"ms@2.1.1",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "ms@2.1.1",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"_spec": "2.1.1",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"bugs": {
"url": "https://github.com/zeit/ms/issues"
},
diff --git a/node_modules/send/package.json b/node_modules/send/package.json
index 96acd04..a61b970 100644
--- a/node_modules/send/package.json
+++ b/node_modules/send/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"send@0.17.1",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "send@0.17.1",
@@ -27,7 +27,7 @@
],
"_resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
"_spec": "0.17.1",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"author": {
"name": "TJ Holowaychuk",
"email": "tj@vision-media.ca"
diff --git a/node_modules/serve-static/package.json b/node_modules/serve-static/package.json
index 506e6d0..82ce314 100644
--- a/node_modules/serve-static/package.json
+++ b/node_modules/serve-static/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"serve-static@1.14.1",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "serve-static@1.14.1",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
"_spec": "1.14.1",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"author": {
"name": "Douglas Christopher Wilson",
"email": "doug@somethingdoug.com"
diff --git a/node_modules/setprototypeof/package.json b/node_modules/setprototypeof/package.json
index 4bc43cd..5148bce 100644
--- a/node_modules/setprototypeof/package.json
+++ b/node_modules/setprototypeof/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"setprototypeof@1.1.1",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "setprototypeof@1.1.1",
@@ -27,7 +27,7 @@
],
"_resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"_spec": "1.1.1",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"author": {
"name": "Wes Todd"
},
diff --git a/node_modules/signal-exit/LICENSE.txt b/node_modules/signal-exit/LICENSE.txt
new file mode 100644
index 0000000..eead04a
--- /dev/null
+++ b/node_modules/signal-exit/LICENSE.txt
@@ -0,0 +1,16 @@
+The ISC License
+
+Copyright (c) 2015, 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.
diff --git a/node_modules/signal-exit/README.md b/node_modules/signal-exit/README.md
new file mode 100644
index 0000000..f9c7c00
--- /dev/null
+++ b/node_modules/signal-exit/README.md
@@ -0,0 +1,39 @@
+# signal-exit
+
+[](https://travis-ci.org/tapjs/signal-exit)
+[](https://coveralls.io/r/tapjs/signal-exit?branch=master)
+[](https://www.npmjs.com/package/signal-exit)
+[](https://github.com/conventional-changelog/standard-version)
+
+When you want to fire an event no matter how a process exits:
+
+* reaching the end of execution.
+* explicitly having `process.exit(code)` called.
+* having `process.kill(pid, sig)` called.
+* receiving a fatal signal from outside the process
+
+Use `signal-exit`.
+
+```js
+var onExit = require('signal-exit')
+
+onExit(function (code, signal) {
+ console.log('process exited!')
+})
+```
+
+## API
+
+`var remove = onExit(function (code, signal) {}, options)`
+
+The return value of the function is a function that will remove the
+handler.
+
+Note that the function *only* fires for signals if the signal would
+cause the process to exit. That is, there are no other listeners, and
+it is a fatal signal.
+
+## Options
+
+* `alwaysLast`: Run this handler after any other signal or exit
+ handlers. This causes `process.emit` to be monkeypatched.
diff --git a/node_modules/signal-exit/index.js b/node_modules/signal-exit/index.js
new file mode 100644
index 0000000..a79b1d2
--- /dev/null
+++ b/node_modules/signal-exit/index.js
@@ -0,0 +1,200 @@
+// Note: since nyc uses this module to output coverage, any lines
+// that are in the direct sync flow of nyc's outputCoverage are
+// ignored, since we can never get coverage for them.
+// grab a reference to node's real process object right away
+var process = global.process
+
+const processOk = function (process) {
+ return process &&
+ typeof process === 'object' &&
+ typeof process.removeListener === 'function' &&
+ typeof process.emit === 'function' &&
+ typeof process.reallyExit === 'function' &&
+ typeof process.listeners === 'function' &&
+ typeof process.kill === 'function' &&
+ typeof process.pid === 'number' &&
+ typeof process.on === 'function'
+}
+
+// some kind of non-node environment, just no-op
+/* istanbul ignore if */
+if (!processOk(process)) {
+ module.exports = function () {}
+} else {
+ var assert = require('assert')
+ var signals = require('./signals.js')
+ var isWin = /^win/i.test(process.platform)
+
+ var EE = require('events')
+ /* istanbul ignore if */
+ if (typeof EE !== 'function') {
+ EE = EE.EventEmitter
+ }
+
+ var emitter
+ if (process.__signal_exit_emitter__) {
+ emitter = process.__signal_exit_emitter__
+ } else {
+ emitter = process.__signal_exit_emitter__ = new EE()
+ emitter.count = 0
+ emitter.emitted = {}
+ }
+
+ // Because this emitter is a global, we have to check to see if a
+ // previous version of this library failed to enable infinite listeners.
+ // I know what you're about to say. But literally everything about
+ // signal-exit is a compromise with evil. Get used to it.
+ if (!emitter.infinite) {
+ emitter.setMaxListeners(Infinity)
+ emitter.infinite = true
+ }
+
+ module.exports = function (cb, opts) {
+ /* istanbul ignore if */
+ if (!processOk(global.process)) {
+ return
+ }
+ assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
+
+ if (loaded === false) {
+ load()
+ }
+
+ var ev = 'exit'
+ if (opts && opts.alwaysLast) {
+ ev = 'afterexit'
+ }
+
+ var remove = function () {
+ emitter.removeListener(ev, cb)
+ if (emitter.listeners('exit').length === 0 &&
+ emitter.listeners('afterexit').length === 0) {
+ unload()
+ }
+ }
+ emitter.on(ev, cb)
+
+ return remove
+ }
+
+ var unload = function unload () {
+ if (!loaded || !processOk(global.process)) {
+ return
+ }
+ loaded = false
+
+ signals.forEach(function (sig) {
+ try {
+ process.removeListener(sig, sigListeners[sig])
+ } catch (er) {}
+ })
+ process.emit = originalProcessEmit
+ process.reallyExit = originalProcessReallyExit
+ emitter.count -= 1
+ }
+ module.exports.unload = unload
+
+ var emit = function emit (event, code, signal) {
+ /* istanbul ignore if */
+ if (emitter.emitted[event]) {
+ return
+ }
+ emitter.emitted[event] = true
+ emitter.emit(event, code, signal)
+ }
+
+ // { : , ... }
+ var sigListeners = {}
+ signals.forEach(function (sig) {
+ sigListeners[sig] = function listener () {
+ /* istanbul ignore if */
+ if (!processOk(global.process)) {
+ return
+ }
+ // If there are no other listeners, an exit is coming!
+ // Simplest way: remove us and then re-send the signal.
+ // We know that this will kill the process, so we can
+ // safely emit now.
+ var listeners = process.listeners(sig)
+ if (listeners.length === emitter.count) {
+ unload()
+ emit('exit', null, sig)
+ /* istanbul ignore next */
+ emit('afterexit', null, sig)
+ /* istanbul ignore next */
+ if (isWin && sig === 'SIGHUP') {
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
+ // so use a supported signal instead
+ sig = 'SIGINT'
+ }
+ /* istanbul ignore next */
+ process.kill(process.pid, sig)
+ }
+ }
+ })
+
+ module.exports.signals = function () {
+ return signals
+ }
+
+ var loaded = false
+
+ var load = function load () {
+ if (loaded || !processOk(global.process)) {
+ return
+ }
+ loaded = true
+
+ // This is the number of onSignalExit's that are in play.
+ // It's important so that we can count the correct number of
+ // listeners on signals, and don't wait for the other one to
+ // handle it instead of us.
+ emitter.count += 1
+
+ signals = signals.filter(function (sig) {
+ try {
+ process.on(sig, sigListeners[sig])
+ return true
+ } catch (er) {
+ return false
+ }
+ })
+
+ process.emit = processEmit
+ process.reallyExit = processReallyExit
+ }
+ module.exports.load = load
+
+ var originalProcessReallyExit = process.reallyExit
+ var processReallyExit = function processReallyExit (code) {
+ /* istanbul ignore if */
+ if (!processOk(global.process)) {
+ return
+ }
+ process.exitCode = code || /* istanbul ignore next */ 0
+ emit('exit', process.exitCode, null)
+ /* istanbul ignore next */
+ emit('afterexit', process.exitCode, null)
+ /* istanbul ignore next */
+ originalProcessReallyExit.call(process, process.exitCode)
+ }
+
+ var originalProcessEmit = process.emit
+ var processEmit = function processEmit (ev, arg) {
+ if (ev === 'exit' && processOk(global.process)) {
+ /* istanbul ignore else */
+ if (arg !== undefined) {
+ process.exitCode = arg
+ }
+ var ret = originalProcessEmit.apply(this, arguments)
+ /* istanbul ignore next */
+ emit('exit', process.exitCode, null)
+ /* istanbul ignore next */
+ emit('afterexit', process.exitCode, null)
+ /* istanbul ignore next */
+ return ret
+ } else {
+ return originalProcessEmit.apply(this, arguments)
+ }
+ }
+}
diff --git a/node_modules/signal-exit/package.json b/node_modules/signal-exit/package.json
new file mode 100644
index 0000000..2f876b7
--- /dev/null
+++ b/node_modules/signal-exit/package.json
@@ -0,0 +1,66 @@
+{
+ "_from": "signal-exit@^3.0.2",
+ "_id": "signal-exit@3.0.6",
+ "_inBundle": false,
+ "_integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==",
+ "_location": "/signal-exit",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "signal-exit@^3.0.2",
+ "name": "signal-exit",
+ "escapedName": "signal-exit",
+ "rawSpec": "^3.0.2",
+ "saveSpec": null,
+ "fetchSpec": "^3.0.2"
+ },
+ "_requiredBy": [
+ "/write-file-atomic"
+ ],
+ "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
+ "_shasum": "24e630c4b0f03fea446a2bd299e62b4a6ca8d0af",
+ "_spec": "signal-exit@^3.0.2",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/write-file-atomic",
+ "author": {
+ "name": "Ben Coe",
+ "email": "ben@npmjs.com"
+ },
+ "bugs": {
+ "url": "https://github.com/tapjs/signal-exit/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "when you want to fire an event no matter how a process exits.",
+ "devDependencies": {
+ "chai": "^3.5.0",
+ "coveralls": "^3.1.1",
+ "nyc": "^15.1.0",
+ "standard-version": "^9.3.1",
+ "tap": "^15.1.1"
+ },
+ "files": [
+ "index.js",
+ "signals.js"
+ ],
+ "homepage": "https://github.com/tapjs/signal-exit",
+ "keywords": [
+ "signal",
+ "exit"
+ ],
+ "license": "ISC",
+ "main": "index.js",
+ "name": "signal-exit",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/tapjs/signal-exit.git"
+ },
+ "scripts": {
+ "postversion": "npm publish",
+ "prepublishOnly": "git push origin --follow-tags",
+ "preversion": "npm test",
+ "snap": "tap",
+ "test": "tap"
+ },
+ "version": "3.0.6"
+}
diff --git a/node_modules/signal-exit/signals.js b/node_modules/signal-exit/signals.js
new file mode 100644
index 0000000..3bd67a8
--- /dev/null
+++ b/node_modules/signal-exit/signals.js
@@ -0,0 +1,53 @@
+// This is not the set of all possible signals.
+//
+// It IS, however, the set of all signals that trigger
+// an exit on either Linux or BSD systems. Linux is a
+// superset of the signal names supported on BSD, and
+// the unknown signals just fail to register, so we can
+// catch that easily enough.
+//
+// Don't bother with SIGKILL. It's uncatchable, which
+// means that we can't fire any callbacks anyway.
+//
+// If a user does happen to register a handler on a non-
+// fatal signal like SIGWINCH or something, and then
+// exit, it'll end up firing `process.emit('exit')`, so
+// the handler will be fired anyway.
+//
+// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
+// artificially, inherently leave the process in a
+// state from which it is not safe to try and enter JS
+// listeners.
+module.exports = [
+ 'SIGABRT',
+ 'SIGALRM',
+ 'SIGHUP',
+ 'SIGINT',
+ 'SIGTERM'
+]
+
+if (process.platform !== 'win32') {
+ module.exports.push(
+ 'SIGVTALRM',
+ 'SIGXCPU',
+ 'SIGXFSZ',
+ 'SIGUSR2',
+ 'SIGTRAP',
+ 'SIGSYS',
+ 'SIGQUIT',
+ 'SIGIOT'
+ // should detect profiler and enable/disable accordingly.
+ // see #21
+ // 'SIGPROF'
+ )
+}
+
+if (process.platform === 'linux') {
+ module.exports.push(
+ 'SIGIO',
+ 'SIGPOLL',
+ 'SIGPWR',
+ 'SIGSTKFLT',
+ 'SIGUNUSED'
+ )
+}
diff --git a/node_modules/source-map-js/LICENSE b/node_modules/source-map-js/LICENSE
new file mode 100644
index 0000000..ed1b7cf
--- /dev/null
+++ b/node_modules/source-map-js/LICENSE
@@ -0,0 +1,28 @@
+
+Copyright (c) 2009-2011, Mozilla Foundation and 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:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* 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.
+
+* Neither the names of the Mozilla Foundation nor the names of project
+ 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.
diff --git a/node_modules/source-map-js/README.md b/node_modules/source-map-js/README.md
new file mode 100644
index 0000000..ba200e6
--- /dev/null
+++ b/node_modules/source-map-js/README.md
@@ -0,0 +1,29 @@
+# Source Map JS
+
+[](https://www.npmjs.com/package/source-map-js)
+
+Difference between original [source-map](https://github.com/mozilla/source-map):
+
+> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations.
+
+This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async.
+
+It's still a major block for many libraries like PostCSS or Webpack for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times.
+
+
+
+More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all.
+
+[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation.
+
+I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map.
+
+---------
+
+This is a library to generate and consume the source map format
+[described here][format].
+
+[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
+
+## Docs
+Read **[full docs](https://github.com/7rulnik/source-map#readme)** on GitHub.
diff --git a/node_modules/source-map-js/lib/array-set.js b/node_modules/source-map-js/lib/array-set.js
new file mode 100644
index 0000000..fbd5c81
--- /dev/null
+++ b/node_modules/source-map-js/lib/array-set.js
@@ -0,0 +1,121 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = require('./util');
+var has = Object.prototype.hasOwnProperty;
+var hasNativeMap = typeof Map !== "undefined";
+
+/**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+function ArraySet() {
+ this._array = [];
+ this._set = hasNativeMap ? new Map() : Object.create(null);
+}
+
+/**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet();
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+};
+
+/**
+ * Return how many unique items are in this ArraySet. If duplicates have been
+ * added, than those do not count towards the size.
+ *
+ * @returns Number
+ */
+ArraySet.prototype.size = function ArraySet_size() {
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
+};
+
+/**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ if (hasNativeMap) {
+ this._set.set(aStr, idx);
+ } else {
+ this._set[sStr] = idx;
+ }
+ }
+};
+
+/**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.has = function ArraySet_has(aStr) {
+ if (hasNativeMap) {
+ return this._set.has(aStr);
+ } else {
+ var sStr = util.toSetString(aStr);
+ return has.call(this._set, sStr);
+ }
+};
+
+/**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (hasNativeMap) {
+ var idx = this._set.get(aStr);
+ if (idx >= 0) {
+ return idx;
+ }
+ } else {
+ var sStr = util.toSetString(aStr);
+ if (has.call(this._set, sStr)) {
+ return this._set[sStr];
+ }
+ }
+
+ throw new Error('"' + aStr + '" is not in the set.');
+};
+
+/**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+};
+
+/**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ArraySet.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+};
+
+exports.ArraySet = ArraySet;
diff --git a/node_modules/source-map-js/lib/base64-vlq.js b/node_modules/source-map-js/lib/base64-vlq.js
new file mode 100644
index 0000000..612b404
--- /dev/null
+++ b/node_modules/source-map-js/lib/base64-vlq.js
@@ -0,0 +1,140 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. 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
+ * OWNER 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.
+ */
+
+var base64 = require('./base64');
+
+// A single base 64 digit can contain 6 bits of data. For the base 64 variable
+// length quantities we use in the source map spec, the first bit is the sign,
+// the next four bits are the actual value, and the 6th bit is the
+// continuation bit. The continuation bit tells us whether there are more
+// digits in this value following this digit.
+//
+// Continuation
+// | Sign
+// | |
+// V V
+// 101011
+
+var VLQ_BASE_SHIFT = 5;
+
+// binary: 100000
+var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+// binary: 011111
+var VLQ_BASE_MASK = VLQ_BASE - 1;
+
+// binary: 100000
+var VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+/**
+ * Converts from a two-complement value to a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+}
+
+/**
+ * Converts to a two-complement value from a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative
+ ? -shifted
+ : shifted;
+}
+
+/**
+ * Returns the base 64 VLQ encoded value.
+ */
+exports.encode = function base64VLQ_encode(aValue) {
+ var encoded = "";
+ var digit;
+
+ var vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+};
+
+/**
+ * Decodes the next base 64 VLQ value from the given string and returns the
+ * value and the rest of the string via the out parameter.
+ */
+exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+
+ do {
+ if (aIndex >= strLen) {
+ throw new Error("Expected more digits in base 64 VLQ value.");
+ }
+
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
+ if (digit === -1) {
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
+ }
+
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+
+ aOutParam.value = fromVLQSigned(result);
+ aOutParam.rest = aIndex;
+};
diff --git a/node_modules/source-map-js/lib/base64.js b/node_modules/source-map-js/lib/base64.js
new file mode 100644
index 0000000..8aa86b3
--- /dev/null
+++ b/node_modules/source-map-js/lib/base64.js
@@ -0,0 +1,67 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
+
+/**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+exports.encode = function (number) {
+ if (0 <= number && number < intToCharMap.length) {
+ return intToCharMap[number];
+ }
+ throw new TypeError("Must be between 0 and 63: " + number);
+};
+
+/**
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
+ * failure.
+ */
+exports.decode = function (charCode) {
+ var bigA = 65; // 'A'
+ var bigZ = 90; // 'Z'
+
+ var littleA = 97; // 'a'
+ var littleZ = 122; // 'z'
+
+ var zero = 48; // '0'
+ var nine = 57; // '9'
+
+ var plus = 43; // '+'
+ var slash = 47; // '/'
+
+ var littleOffset = 26;
+ var numberOffset = 52;
+
+ // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ if (bigA <= charCode && charCode <= bigZ) {
+ return (charCode - bigA);
+ }
+
+ // 26 - 51: abcdefghijklmnopqrstuvwxyz
+ if (littleA <= charCode && charCode <= littleZ) {
+ return (charCode - littleA + littleOffset);
+ }
+
+ // 52 - 61: 0123456789
+ if (zero <= charCode && charCode <= nine) {
+ return (charCode - zero + numberOffset);
+ }
+
+ // 62: +
+ if (charCode == plus) {
+ return 62;
+ }
+
+ // 63: /
+ if (charCode == slash) {
+ return 63;
+ }
+
+ // Invalid base64 digit.
+ return -1;
+};
diff --git a/node_modules/source-map-js/lib/binary-search.js b/node_modules/source-map-js/lib/binary-search.js
new file mode 100644
index 0000000..010ac94
--- /dev/null
+++ b/node_modules/source-map-js/lib/binary-search.js
@@ -0,0 +1,111 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+exports.GREATEST_LOWER_BOUND = 1;
+exports.LEAST_UPPER_BOUND = 2;
+
+/**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ */
+function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the index of
+ // the next-closest element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element than the one we are searching for, so we return -1.
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return mid;
+ }
+ else if (cmp > 0) {
+ // Our needle is greater than aHaystack[mid].
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return aHigh < aHaystack.length ? aHigh : -1;
+ } else {
+ return mid;
+ }
+ }
+ else {
+ // Our needle is less than aHaystack[mid].
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return mid;
+ } else {
+ return aLow < 0 ? -1 : aLow;
+ }
+ }
+}
+
+/**
+ * This is an implementation of binary search which will always try and return
+ * the index of the closest element if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
+ */
+exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
+ if (aHaystack.length === 0) {
+ return -1;
+ }
+
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
+ aCompare, aBias || exports.GREATEST_LOWER_BOUND);
+ if (index < 0) {
+ return -1;
+ }
+
+ // We have found either the exact element, or the next-closest element than
+ // the one we are searching for. However, there may be more than one such
+ // element. Make sure we always return the smallest of these.
+ while (index - 1 >= 0) {
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
+ break;
+ }
+ --index;
+ }
+
+ return index;
+};
diff --git a/node_modules/source-map-js/lib/mapping-list.js b/node_modules/source-map-js/lib/mapping-list.js
new file mode 100644
index 0000000..06d1274
--- /dev/null
+++ b/node_modules/source-map-js/lib/mapping-list.js
@@ -0,0 +1,79 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = require('./util');
+
+/**
+ * Determine whether mappingB is after mappingA with respect to generated
+ * position.
+ */
+function generatedPositionAfter(mappingA, mappingB) {
+ // Optimized for most common case
+ var lineA = mappingA.generatedLine;
+ var lineB = mappingB.generatedLine;
+ var columnA = mappingA.generatedColumn;
+ var columnB = mappingB.generatedColumn;
+ return lineB > lineA || lineB == lineA && columnB >= columnA ||
+ util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+}
+
+/**
+ * A data structure to provide a sorted view of accumulated mappings in a
+ * performance conscious manner. It trades a neglibable overhead in general
+ * case for a large speedup in case of mappings being added in order.
+ */
+function MappingList() {
+ this._array = [];
+ this._sorted = true;
+ // Serves as infimum
+ this._last = {generatedLine: -1, generatedColumn: 0};
+}
+
+/**
+ * Iterate through internal items. This method takes the same arguments that
+ * `Array.prototype.forEach` takes.
+ *
+ * NOTE: The order of the mappings is NOT guaranteed.
+ */
+MappingList.prototype.unsortedForEach =
+ function MappingList_forEach(aCallback, aThisArg) {
+ this._array.forEach(aCallback, aThisArg);
+ };
+
+/**
+ * Add the given source mapping.
+ *
+ * @param Object aMapping
+ */
+MappingList.prototype.add = function MappingList_add(aMapping) {
+ if (generatedPositionAfter(this._last, aMapping)) {
+ this._last = aMapping;
+ this._array.push(aMapping);
+ } else {
+ this._sorted = false;
+ this._array.push(aMapping);
+ }
+};
+
+/**
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
+ * generated position.
+ *
+ * WARNING: This method returns internal data without copying, for
+ * performance. The return value must NOT be mutated, and should be treated as
+ * an immutable borrow. If you want to take ownership, you must make your own
+ * copy.
+ */
+MappingList.prototype.toArray = function MappingList_toArray() {
+ if (!this._sorted) {
+ this._array.sort(util.compareByGeneratedPositionsInflated);
+ this._sorted = true;
+ }
+ return this._array;
+};
+
+exports.MappingList = MappingList;
diff --git a/node_modules/source-map-js/lib/quick-sort.js b/node_modules/source-map-js/lib/quick-sort.js
new file mode 100644
index 0000000..23f9eda
--- /dev/null
+++ b/node_modules/source-map-js/lib/quick-sort.js
@@ -0,0 +1,132 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+// It turns out that some (most?) JavaScript engines don't self-host
+// `Array.prototype.sort`. This makes sense because C++ will likely remain
+// faster than JS when doing raw CPU-intensive sorting. However, when using a
+// custom comparator function, calling back and forth between the VM's C++ and
+// JIT'd JS is rather slow *and* loses JIT type information, resulting in
+// worse generated code for the comparator function than would be optimal. In
+// fact, when sorting with a comparator, these costs outweigh the benefits of
+// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
+// a ~3500ms mean speed-up in `bench/bench.html`.
+
+function SortTemplate(comparator) {
+
+/**
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
+ *
+ * @param {Array} ary
+ * The array.
+ * @param {Number} x
+ * The index of the first item.
+ * @param {Number} y
+ * The index of the second item.
+ */
+function swap(ary, x, y) {
+ var temp = ary[x];
+ ary[x] = ary[y];
+ ary[y] = temp;
+}
+
+/**
+ * Returns a random integer within the range `low .. high` inclusive.
+ *
+ * @param {Number} low
+ * The lower bound on the range.
+ * @param {Number} high
+ * The upper bound on the range.
+ */
+function randomIntInRange(low, high) {
+ return Math.round(low + (Math.random() * (high - low)));
+}
+
+/**
+ * The Quick Sort algorithm.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ * @param {Number} p
+ * Start index of the array
+ * @param {Number} r
+ * End index of the array
+ */
+function doQuickSort(ary, comparator, p, r) {
+ // If our lower bound is less than our upper bound, we (1) partition the
+ // array into two pieces and (2) recurse on each half. If it is not, this is
+ // the empty array and our base case.
+
+ if (p < r) {
+ // (1) Partitioning.
+ //
+ // The partitioning chooses a pivot between `p` and `r` and moves all
+ // elements that are less than or equal to the pivot to the before it, and
+ // all the elements that are greater than it after it. The effect is that
+ // once partition is done, the pivot is in the exact place it will be when
+ // the array is put in sorted order, and it will not need to be moved
+ // again. This runs in O(n) time.
+
+ // Always choose a random pivot so that an input array which is reverse
+ // sorted does not cause O(n^2) running time.
+ var pivotIndex = randomIntInRange(p, r);
+ var i = p - 1;
+
+ swap(ary, pivotIndex, r);
+ var pivot = ary[r];
+
+ // Immediately after `j` is incremented in this loop, the following hold
+ // true:
+ //
+ // * Every element in `ary[p .. i]` is less than or equal to the pivot.
+ //
+ // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
+ for (var j = p; j < r; j++) {
+ if (comparator(ary[j], pivot, false) <= 0) {
+ i += 1;
+ swap(ary, i, j);
+ }
+ }
+
+ swap(ary, i + 1, j);
+ var q = i + 1;
+
+ // (2) Recurse on each half.
+
+ doQuickSort(ary, comparator, p, q - 1);
+ doQuickSort(ary, comparator, q + 1, r);
+ }
+}
+
+ return doQuickSort;
+}
+
+function cloneSort(comparator) {
+ let template = SortTemplate.toString();
+ let templateFn = new Function(`return ${template}`)();
+ return templateFn(comparator);
+}
+
+/**
+ * Sort the given array in-place with the given comparator function.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ */
+
+let sortCache = new WeakMap();
+exports.quickSort = function (ary, comparator, start = 0) {
+ let doQuickSort = sortCache.get(comparator);
+ if (doQuickSort === void 0) {
+ doQuickSort = cloneSort(comparator);
+ sortCache.set(comparator, doQuickSort);
+ }
+ doQuickSort(ary, comparator, start, ary.length - 1);
+};
diff --git a/node_modules/source-map-js/lib/source-map-consumer.js b/node_modules/source-map-js/lib/source-map-consumer.js
new file mode 100644
index 0000000..4bd7a4a
--- /dev/null
+++ b/node_modules/source-map-js/lib/source-map-consumer.js
@@ -0,0 +1,1184 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = require('./util');
+var binarySearch = require('./binary-search');
+var ArraySet = require('./array-set').ArraySet;
+var base64VLQ = require('./base64-vlq');
+var quickSort = require('./quick-sort').quickSort;
+
+function SourceMapConsumer(aSourceMap, aSourceMapURL) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = util.parseSourceMapInput(aSourceMap);
+ }
+
+ return sourceMap.sections != null
+ ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
+ : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
+}
+
+SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
+}
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+SourceMapConsumer.prototype._version = 3;
+
+// `__generatedMappings` and `__originalMappings` are arrays that hold the
+// parsed mapping coordinates from the source map's "mappings" attribute. They
+// are lazily instantiated, accessed via the `_generatedMappings` and
+// `_originalMappings` getters respectively, and we only parse the mappings
+// and create these arrays once queried for a source location. We jump through
+// these hoops because there can be many thousands of mappings, and parsing
+// them is expensive, so we only want to do it if we must.
+//
+// Each object in the arrays is of the form:
+//
+// {
+// generatedLine: The line number in the generated code,
+// generatedColumn: The column number in the generated code,
+// source: The path to the original source file that generated this
+// chunk of code,
+// originalLine: The line number in the original source that
+// corresponds to this chunk of generated code,
+// originalColumn: The column number in the original source that
+// corresponds to this chunk of generated code,
+// name: The name of the original symbol which generated this chunk of
+// code.
+// }
+//
+// All properties except for `generatedLine` and `generatedColumn` can be
+// `null`.
+//
+// `_generatedMappings` is ordered by the generated positions.
+//
+// `_originalMappings` is ordered by the original positions.
+
+SourceMapConsumer.prototype.__generatedMappings = null;
+Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ configurable: true,
+ enumerable: true,
+ get: function () {
+ if (!this.__generatedMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappings;
+ }
+});
+
+SourceMapConsumer.prototype.__originalMappings = null;
+Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ configurable: true,
+ enumerable: true,
+ get: function () {
+ if (!this.__originalMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappings;
+ }
+});
+
+SourceMapConsumer.prototype._charIsMappingSeparator =
+ function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
+ var c = aStr.charAt(index);
+ return c === ";" || c === ",";
+ };
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+SourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ throw new Error("Subclasses must implement _parseMappings");
+ };
+
+SourceMapConsumer.GENERATED_ORDER = 1;
+SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
+SourceMapConsumer.LEAST_UPPER_BOUND = 2;
+
+/**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+SourceMapConsumer.prototype.eachMapping =
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ var sourceRoot = this.sourceRoot;
+ var boundCallback = aCallback.bind(context);
+ var names = this._names;
+ var sources = this._sources;
+ var sourceMapURL = this._sourceMapURL;
+
+ for (var i = 0, n = mappings.length; i < n; i++) {
+ var mapping = mappings[i];
+ var source = mapping.source === null ? null : sources.at(mapping.source);
+ source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
+ boundCallback({
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name === null ? null : names.at(mapping.name)
+ });
+ }
+ };
+
+/**
+ * Returns all generated line and column information for the original source,
+ * line, and column provided. If no column is provided, returns all mappings
+ * corresponding to a either the line we are searching for or the next
+ * closest line that has any mappings. Otherwise, returns all mappings
+ * corresponding to the given line and either the column we are searching for
+ * or the next closest column that has any offsets.
+ *
+ * The only argument is an object with the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source. The line number is 1-based.
+ * - column: Optional. the column number in the original source.
+ * The column number is 0-based.
+ *
+ * and an array of objects is returned, each with the following properties:
+ *
+ * - line: The line number in the generated source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the generated source, or null.
+ * The column number is 0-based.
+ */
+SourceMapConsumer.prototype.allGeneratedPositionsFor =
+ function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
+ var line = util.getArg(aArgs, 'line');
+
+ // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
+ // returns the index of the closest mapping less than the needle. By
+ // setting needle.originalColumn to 0, we thus find the last mapping for
+ // the given line, provided such a mapping exists.
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: line,
+ originalColumn: util.getArg(aArgs, 'column', 0)
+ };
+
+ needle.source = this._findSourceIndex(needle.source);
+ if (needle.source < 0) {
+ return [];
+ }
+
+ var mappings = [];
+
+ var index = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions,
+ binarySearch.LEAST_UPPER_BOUND);
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (aArgs.column === undefined) {
+ var originalLine = mapping.originalLine;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we found. Since
+ // mappings are sorted, this is guaranteed to find all mappings for
+ // the line we found.
+ while (mapping && mapping.originalLine === originalLine) {
+ mappings.push({
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ } else {
+ var originalColumn = mapping.originalColumn;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we were searching for.
+ // Since mappings are sorted, this is guaranteed to find all mappings for
+ // the line we are searching for.
+ while (mapping &&
+ mapping.originalLine === line &&
+ mapping.originalColumn == originalColumn) {
+ mappings.push({
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ }
+ }
+
+ return mappings;
+ };
+
+exports.SourceMapConsumer = SourceMapConsumer;
+
+/**
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The first parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referrenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * The second parameter, if given, is a string whose value is the URL
+ * at which the source map was found. This URL is used to compute the
+ * sources array.
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = util.parseSourceMapInput(aSourceMap);
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sources = util.getArg(sourceMap, 'sources');
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ var names = util.getArg(sourceMap, 'names', []);
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util.getArg(sourceMap, 'mappings');
+ var file = util.getArg(sourceMap, 'file', null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ if (sourceRoot) {
+ sourceRoot = util.normalize(sourceRoot);
+ }
+
+ sources = sources
+ .map(String)
+ // Some source maps produce relative source paths like "./foo.js" instead of
+ // "foo.js". Normalize these first so that future comparisons will succeed.
+ // See bugzil.la/1090768.
+ .map(util.normalize)
+ // Always ensure that absolute sources are internally stored relative to
+ // the source root, if the source root is absolute. Not doing this would
+ // be particularly problematic when the source root is a prefix of the
+ // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
+ .map(function (source) {
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
+ ? util.relative(sourceRoot, source)
+ : source;
+ });
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ this._names = ArraySet.fromArray(names.map(String), true);
+ this._sources = ArraySet.fromArray(sources, true);
+
+ this._absoluteSources = this._sources.toArray().map(function (s) {
+ return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
+ });
+
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this._sourceMapURL = aSourceMapURL;
+ this.file = file;
+}
+
+BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
+
+/**
+ * Utility function to find the index of a source. Returns -1 if not
+ * found.
+ */
+BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
+ var relativeSource = aSource;
+ if (this.sourceRoot != null) {
+ relativeSource = util.relative(this.sourceRoot, relativeSource);
+ }
+
+ if (this._sources.has(relativeSource)) {
+ return this._sources.indexOf(relativeSource);
+ }
+
+ // Maybe aSource is an absolute URL as returned by |sources|. In
+ // this case we can't simply undo the transform.
+ var i;
+ for (i = 0; i < this._absoluteSources.length; ++i) {
+ if (this._absoluteSources[i] == aSource) {
+ return i;
+ }
+ }
+
+ return -1;
+};
+
+/**
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @param String aSourceMapURL
+ * The URL at which the source map can be found (optional)
+ * @returns BasicSourceMapConsumer
+ */
+BasicSourceMapConsumer.fromSourceMap =
+ function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
+
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
+ smc.sourceRoot);
+ smc.file = aSourceMap._file;
+ smc._sourceMapURL = aSourceMapURL;
+ smc._absoluteSources = smc._sources.toArray().map(function (s) {
+ return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
+ });
+
+ // Because we are modifying the entries (by converting string sources and
+ // names to indices into the sources and names ArraySets), we have to make
+ // a copy of the entry or else bad things happen. Shared mutable state
+ // strikes again! See github issue #191.
+
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
+ var destGeneratedMappings = smc.__generatedMappings = [];
+ var destOriginalMappings = smc.__originalMappings = [];
+
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
+ var srcMapping = generatedMappings[i];
+ var destMapping = new Mapping;
+ destMapping.generatedLine = srcMapping.generatedLine;
+ destMapping.generatedColumn = srcMapping.generatedColumn;
+
+ if (srcMapping.source) {
+ destMapping.source = sources.indexOf(srcMapping.source);
+ destMapping.originalLine = srcMapping.originalLine;
+ destMapping.originalColumn = srcMapping.originalColumn;
+
+ if (srcMapping.name) {
+ destMapping.name = names.indexOf(srcMapping.name);
+ }
+
+ destOriginalMappings.push(destMapping);
+ }
+
+ destGeneratedMappings.push(destMapping);
+ }
+
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
+
+ return smc;
+ };
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+BasicSourceMapConsumer.prototype._version = 3;
+
+/**
+ * The list of original sources.
+ */
+Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._absoluteSources.slice();
+ }
+});
+
+/**
+ * Provide the JIT with a nice shape / hidden class.
+ */
+function Mapping() {
+ this.generatedLine = 0;
+ this.generatedColumn = 0;
+ this.source = null;
+ this.originalLine = null;
+ this.originalColumn = null;
+ this.name = null;
+}
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+
+const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;
+function sortGenerated(array, start) {
+ let l = array.length;
+ let n = array.length - start;
+ if (n <= 1) {
+ return;
+ } else if (n == 2) {
+ let a = array[start];
+ let b = array[start + 1];
+ if (compareGenerated(a, b) > 0) {
+ array[start] = b;
+ array[start + 1] = a;
+ }
+ } else if (n < 20) {
+ for (let i = start; i < l; i++) {
+ for (let j = i; j > start; j--) {
+ let a = array[j - 1];
+ let b = array[j];
+ if (compareGenerated(a, b) <= 0) {
+ break;
+ }
+ array[j - 1] = b;
+ array[j] = a;
+ }
+ }
+ } else {
+ quickSort(array, compareGenerated, start);
+ }
+}
+BasicSourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var length = aStr.length;
+ var index = 0;
+ var cachedSegments = {};
+ var temp = {};
+ var originalMappings = [];
+ var generatedMappings = [];
+ var mapping, str, segment, end, value;
+
+ let subarrayStart = 0;
+ while (index < length) {
+ if (aStr.charAt(index) === ';') {
+ generatedLine++;
+ index++;
+ previousGeneratedColumn = 0;
+
+ sortGenerated(generatedMappings, subarrayStart);
+ subarrayStart = generatedMappings.length;
+ }
+ else if (aStr.charAt(index) === ',') {
+ index++;
+ }
+ else {
+ mapping = new Mapping();
+ mapping.generatedLine = generatedLine;
+
+ for (end = index; end < length; end++) {
+ if (this._charIsMappingSeparator(aStr, end)) {
+ break;
+ }
+ }
+ str = aStr.slice(index, end);
+
+ segment = [];
+ while (index < end) {
+ base64VLQ.decode(aStr, index, temp);
+ value = temp.value;
+ index = temp.rest;
+ segment.push(value);
+ }
+
+ if (segment.length === 2) {
+ throw new Error('Found a source, but no line and column');
+ }
+
+ if (segment.length === 3) {
+ throw new Error('Found a source and line, but no column');
+ }
+
+ // Generated column.
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (segment.length > 1) {
+ // Original source.
+ mapping.source = previousSource + segment[1];
+ previousSource += segment[1];
+
+ // Original line.
+ mapping.originalLine = previousOriginalLine + segment[2];
+ previousOriginalLine = mapping.originalLine;
+ // Lines are stored 0-based
+ mapping.originalLine += 1;
+
+ // Original column.
+ mapping.originalColumn = previousOriginalColumn + segment[3];
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (segment.length > 4) {
+ // Original name.
+ mapping.name = previousName + segment[4];
+ previousName += segment[4];
+ }
+ }
+
+ generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ let currentSource = mapping.source;
+ while (originalMappings.length <= currentSource) {
+ originalMappings.push(null);
+ }
+ if (originalMappings[currentSource] === null) {
+ originalMappings[currentSource] = [];
+ }
+ originalMappings[currentSource].push(mapping);
+ }
+ }
+ }
+
+ sortGenerated(generatedMappings, subarrayStart);
+ this.__generatedMappings = generatedMappings;
+
+ for (var i = 0; i < originalMappings.length; i++) {
+ if (originalMappings[i] != null) {
+ quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);
+ }
+ }
+ this.__originalMappings = [].concat(...originalMappings);
+ };
+
+/**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+BasicSourceMapConsumer.prototype._findMapping =
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator, aBias) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got '
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got '
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
+ };
+
+/**
+ * Compute the last column for each generated mapping. The last column is
+ * inclusive.
+ */
+BasicSourceMapConsumer.prototype.computeColumnSpans =
+ function SourceMapConsumer_computeColumnSpans() {
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
+ var mapping = this._generatedMappings[index];
+
+ // Mappings do not contain a field for the last generated columnt. We
+ // can come up with an optimistic estimate, however, by assuming that
+ // mappings are contiguous (i.e. given two consecutive mappings, the
+ // first mapping ends where the second one starts).
+ if (index + 1 < this._generatedMappings.length) {
+ var nextMapping = this._generatedMappings[index + 1];
+
+ if (mapping.generatedLine === nextMapping.generatedLine) {
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
+ continue;
+ }
+ }
+
+ // The last mapping for each line spans the entire line.
+ mapping.lastGeneratedColumn = Infinity;
+ }
+ };
+
+/**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source. The line number
+ * is 1-based.
+ * - column: The column number in the generated source. The column
+ * number is 0-based.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the original source, or null. The
+ * column number is 0-based.
+ * - name: The original identifier, or null.
+ */
+BasicSourceMapConsumer.prototype.originalPositionFor =
+ function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._generatedMappings,
+ "generatedLine",
+ "generatedColumn",
+ util.compareByGeneratedPositionsDeflated,
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._generatedMappings[index];
+
+ if (mapping.generatedLine === needle.generatedLine) {
+ var source = util.getArg(mapping, 'source', null);
+ if (source !== null) {
+ source = this._sources.at(source);
+ source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
+ }
+ var name = util.getArg(mapping, 'name', null);
+ if (name !== null) {
+ name = this._names.at(name);
+ }
+ return {
+ source: source,
+ line: util.getArg(mapping, 'originalLine', null),
+ column: util.getArg(mapping, 'originalColumn', null),
+ name: name
+ };
+ }
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+
+/**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function BasicSourceMapConsumer_hasContentsOfAllSources() {
+ if (!this.sourcesContent) {
+ return false;
+ }
+ return this.sourcesContent.length >= this._sources.size() &&
+ !this.sourcesContent.some(function (sc) { return sc == null; });
+ };
+
+/**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+BasicSourceMapConsumer.prototype.sourceContentFor =
+ function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ var index = this._findSourceIndex(aSource);
+ if (index >= 0) {
+ return this.sourcesContent[index];
+ }
+
+ var relativeSource = aSource;
+ if (this.sourceRoot != null) {
+ relativeSource = util.relative(this.sourceRoot, relativeSource);
+ }
+
+ var url;
+ if (this.sourceRoot != null
+ && (url = util.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + relativeSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
+ }
+ }
+
+ // This function is used recursively from
+ // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
+ // don't want to throw if we can't find the source - we just want to
+ // return null, so we provide a flag to exit gracefully.
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + relativeSource + '" is not in the SourceMap.');
+ }
+ };
+
+/**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source. The line number
+ * is 1-based.
+ * - column: The column number in the original source. The column
+ * number is 0-based.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the generated source, or null.
+ * The column number is 0-based.
+ */
+BasicSourceMapConsumer.prototype.generatedPositionFor =
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var source = util.getArg(aArgs, 'source');
+ source = this._findSourceIndex(source);
+ if (source < 0) {
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ }
+
+ var needle = {
+ source: source,
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: util.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions,
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (mapping.source === needle.source) {
+ return {
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ };
+ }
+ }
+
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ };
+
+exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
+
+/**
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
+ * we can query for information. It differs from BasicSourceMapConsumer in
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
+ * input.
+ *
+ * The first parameter is a raw source map (either as a JSON string, or already
+ * parsed to an object). According to the spec for indexed source maps, they
+ * have the following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - file: Optional. The generated file this source map is associated with.
+ * - sections: A list of section definitions.
+ *
+ * Each value under the "sections" field has two fields:
+ * - offset: The offset into the original specified at which this section
+ * begins to apply, defined as an object with a "line" and "column"
+ * field.
+ * - map: A source map definition. This source map could also be indexed,
+ * but doesn't have to be.
+ *
+ * Instead of the "map" field, it's also possible to have a "url" field
+ * specifying a URL to retrieve a source map from, but that's currently
+ * unsupported.
+ *
+ * Here's an example source map, taken from the source map spec[0], but
+ * modified to omit a section which uses the "url" field.
+ *
+ * {
+ * version : 3,
+ * file: "app.js",
+ * sections: [{
+ * offset: {line:100, column:10},
+ * map: {
+ * version : 3,
+ * file: "section.js",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AAAA,E;;ABCDE;"
+ * }
+ * }],
+ * }
+ *
+ * The second parameter, if given, is a string whose value is the URL
+ * at which the source map was found. This URL is used to compute the
+ * sources array.
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
+ */
+function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = util.parseSourceMapInput(aSourceMap);
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sections = util.getArg(sourceMap, 'sections');
+
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+
+ var lastOffset = {
+ line: -1,
+ column: 0
+ };
+ this._sections = sections.map(function (s) {
+ if (s.url) {
+ // The url field will require support for asynchronicity.
+ // See https://github.com/mozilla/source-map/issues/16
+ throw new Error('Support for url field in sections not implemented.');
+ }
+ var offset = util.getArg(s, 'offset');
+ var offsetLine = util.getArg(offset, 'line');
+ var offsetColumn = util.getArg(offset, 'column');
+
+ if (offsetLine < lastOffset.line ||
+ (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
+ throw new Error('Section offsets must be ordered and non-overlapping.');
+ }
+ lastOffset = offset;
+
+ return {
+ generatedOffset: {
+ // The offset fields are 0-based, but we use 1-based indices when
+ // encoding/decoding from VLQ.
+ generatedLine: offsetLine + 1,
+ generatedColumn: offsetColumn + 1
+ },
+ consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
+ }
+ });
+}
+
+IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+IndexedSourceMapConsumer.prototype._version = 3;
+
+/**
+ * The list of original sources.
+ */
+Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ var sources = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
+ sources.push(this._sections[i].consumer.sources[j]);
+ }
+ }
+ return sources;
+ }
+});
+
+/**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source. The line number
+ * is 1-based.
+ * - column: The column number in the generated source. The column
+ * number is 0-based.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the original source, or null. The
+ * column number is 0-based.
+ * - name: The original identifier, or null.
+ */
+IndexedSourceMapConsumer.prototype.originalPositionFor =
+ function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ // Find the section containing the generated position we're trying to map
+ // to an original position.
+ var sectionIndex = binarySearch.search(needle, this._sections,
+ function(needle, section) {
+ var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return (needle.generatedColumn -
+ section.generatedOffset.generatedColumn);
+ });
+ var section = this._sections[sectionIndex];
+
+ if (!section) {
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ }
+
+ return section.consumer.originalPositionFor({
+ line: needle.generatedLine -
+ (section.generatedOffset.generatedLine - 1),
+ column: needle.generatedColumn -
+ (section.generatedOffset.generatedLine === needle.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ bias: aArgs.bias
+ });
+ };
+
+/**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function IndexedSourceMapConsumer_hasContentsOfAllSources() {
+ return this._sections.every(function (s) {
+ return s.consumer.hasContentsOfAllSources();
+ });
+ };
+
+/**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+IndexedSourceMapConsumer.prototype.sourceContentFor =
+ function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ var content = section.consumer.sourceContentFor(aSource, true);
+ if (content) {
+ return content;
+ }
+ }
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+ };
+
+/**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source. The line number
+ * is 1-based.
+ * - column: The column number in the original source. The column
+ * number is 0-based.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null. The
+ * line number is 1-based.
+ * - column: The column number in the generated source, or null.
+ * The column number is 0-based.
+ */
+IndexedSourceMapConsumer.prototype.generatedPositionFor =
+ function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ // Only consider this section if the requested source is in the list of
+ // sources of the consumer.
+ if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {
+ continue;
+ }
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
+ if (generatedPosition) {
+ var ret = {
+ line: generatedPosition.line +
+ (section.generatedOffset.generatedLine - 1),
+ column: generatedPosition.column +
+ (section.generatedOffset.generatedLine === generatedPosition.line
+ ? section.generatedOffset.generatedColumn - 1
+ : 0)
+ };
+ return ret;
+ }
+ }
+
+ return {
+ line: null,
+ column: null
+ };
+ };
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+IndexedSourceMapConsumer.prototype._parseMappings =
+ function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+ var sectionMappings = section.consumer._generatedMappings;
+ for (var j = 0; j < sectionMappings.length; j++) {
+ var mapping = sectionMappings[j];
+
+ var source = section.consumer._sources.at(mapping.source);
+ source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
+ this._sources.add(source);
+ source = this._sources.indexOf(source);
+
+ var name = null;
+ if (mapping.name) {
+ name = section.consumer._names.at(mapping.name);
+ this._names.add(name);
+ name = this._names.indexOf(name);
+ }
+
+ // The mappings coming from the consumer for the section have
+ // generated positions relative to the start of the section, so we
+ // need to offset them to be relative to the start of the concatenated
+ // generated file.
+ var adjustedMapping = {
+ source: source,
+ generatedLine: mapping.generatedLine +
+ (section.generatedOffset.generatedLine - 1),
+ generatedColumn: mapping.generatedColumn +
+ (section.generatedOffset.generatedLine === mapping.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: name
+ };
+
+ this.__generatedMappings.push(adjustedMapping);
+ if (typeof adjustedMapping.originalLine === 'number') {
+ this.__originalMappings.push(adjustedMapping);
+ }
+ }
+ }
+
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
+ };
+
+exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
diff --git a/node_modules/source-map-js/lib/source-map-generator.js b/node_modules/source-map-js/lib/source-map-generator.js
new file mode 100644
index 0000000..508bcfb
--- /dev/null
+++ b/node_modules/source-map-js/lib/source-map-generator.js
@@ -0,0 +1,425 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var base64VLQ = require('./base64-vlq');
+var util = require('./util');
+var ArraySet = require('./array-set').ArraySet;
+var MappingList = require('./mapping-list').MappingList;
+
+/**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: A root for all relative URLs in this source map.
+ */
+function SourceMapGenerator(aArgs) {
+ if (!aArgs) {
+ aArgs = {};
+ }
+ this._file = util.getArg(aArgs, 'file', null);
+ this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
+ this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = new MappingList();
+ this._sourcesContents = null;
+}
+
+SourceMapGenerator.prototype._version = 3;
+
+/**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+SourceMapGenerator.fromSourceMap =
+ function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source != null) {
+ newMapping.source = mapping.source;
+ if (sourceRoot != null) {
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name != null) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var sourceRelative = sourceFile;
+ if (sourceRoot !== null) {
+ sourceRelative = util.relative(sourceRoot, sourceFile);
+ }
+
+ if (!generator._sources.has(sourceRelative)) {
+ generator._sources.add(sourceRelative);
+ }
+
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+
+/**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+SourceMapGenerator.prototype.addMapping =
+ function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util.getArg(aArgs, 'generated');
+ var original = util.getArg(aArgs, 'original', null);
+ var source = util.getArg(aArgs, 'source', null);
+ var name = util.getArg(aArgs, 'name', null);
+
+ if (!this._skipValidation) {
+ this._validateMapping(generated, original, source, name);
+ }
+
+ if (source != null) {
+ source = String(source);
+ if (!this._sources.has(source)) {
+ this._sources.add(source);
+ }
+ }
+
+ if (name != null) {
+ name = String(name);
+ if (!this._names.has(name)) {
+ this._names.add(name);
+ }
+ }
+
+ this._mappings.add({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+
+/**
+ * Set the source content for a source file.
+ */
+SourceMapGenerator.prototype.setSourceContent =
+ function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot != null) {
+ source = util.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent != null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = Object.create(null);
+ }
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
+ } else if (this._sourcesContents) {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+
+/**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
+ * This parameter is needed when the two source maps aren't in the same
+ * directory, and the source map to be applied contains relative source
+ * paths. If so, those relative source paths need to be rewritten
+ * relative to the SourceMapGenerator.
+ */
+SourceMapGenerator.prototype.applySourceMap =
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+ var sourceFile = aSourceFile;
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (aSourceFile == null) {
+ if (aSourceMapConsumer.file == null) {
+ throw new Error(
+ 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
+ 'or the source map\'s "file" property. Both were omitted.'
+ );
+ }
+ sourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ // Make "sourceFile" relative if an absolute Url is passed.
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
+
+ // Find mappings for the "sourceFile"
+ this._mappings.unsortedForEach(function (mapping) {
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source != null) {
+ // Copy mapping
+ mapping.source = original.source;
+ if (aSourceMapPath != null) {
+ mapping.source = util.join(aSourceMapPath, mapping.source)
+ }
+ if (sourceRoot != null) {
+ mapping.source = util.relative(sourceRoot, mapping.source);
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name != null) {
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ var source = mapping.source;
+ if (source != null && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ var name = mapping.name;
+ if (name != null && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aSourceMapPath != null) {
+ sourceFile = util.join(aSourceMapPath, sourceFile);
+ }
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+
+/**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+SourceMapGenerator.prototype._validateMapping =
+ function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
+ aName) {
+ // When aOriginal is truthy but has empty values for .line and .column,
+ // it is most likely a programmer error. In this case we throw a very
+ // specific error message to try to guide them the right way.
+ // For example: https://github.com/Polymer/polymer-bundler/pull/519
+ if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
+ throw new Error(
+ 'original.line and original.column are not numbers -- you probably meant to omit ' +
+ 'the original mapping entirely and only map the generated position. If so, pass ' +
+ 'null for the original mapping instead of an object with empty or null values.'
+ );
+ }
+
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) {
+ // Case 1.
+ return;
+ }
+ else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aOriginal && 'line' in aOriginal && 'column' in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) {
+ // Cases 2 and 3.
+ return;
+ }
+ else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ };
+
+/**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+SourceMapGenerator.prototype._serializeMappings =
+ function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var next;
+ var mapping;
+ var nameIdx;
+ var sourceIdx;
+
+ var mappings = this._mappings.toArray();
+ for (var i = 0, len = mappings.length; i < len; i++) {
+ mapping = mappings[i];
+ next = ''
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ next += ';';
+ previousGeneratedLine++;
+ }
+ }
+ else {
+ if (i > 0) {
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
+ continue;
+ }
+ next += ',';
+ }
+ }
+
+ next += base64VLQ.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source != null) {
+ sourceIdx = this._sources.indexOf(mapping.source);
+ next += base64VLQ.encode(sourceIdx - previousSource);
+ previousSource = sourceIdx;
+
+ // lines are stored 0-based in SourceMap spec version 3
+ next += base64VLQ.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ next += base64VLQ.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name != null) {
+ nameIdx = this._names.indexOf(mapping.name);
+ next += base64VLQ.encode(nameIdx - previousName);
+ previousName = nameIdx;
+ }
+ }
+
+ result += next;
+ }
+
+ return result;
+ };
+
+SourceMapGenerator.prototype._generateSourcesContent =
+ function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot != null) {
+ source = util.relative(aSourceRoot, source);
+ }
+ var key = util.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ };
+
+/**
+ * Externalize the source map.
+ */
+SourceMapGenerator.prototype.toJSON =
+ function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._file != null) {
+ map.file = this._file;
+ }
+ if (this._sourceRoot != null) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ };
+
+/**
+ * Render the source map being generated to a string.
+ */
+SourceMapGenerator.prototype.toString =
+ function SourceMapGenerator_toString() {
+ return JSON.stringify(this.toJSON());
+ };
+
+exports.SourceMapGenerator = SourceMapGenerator;
diff --git a/node_modules/source-map-js/lib/source-node.js b/node_modules/source-map-js/lib/source-node.js
new file mode 100644
index 0000000..8bcdbe3
--- /dev/null
+++ b/node_modules/source-map-js/lib/source-node.js
@@ -0,0 +1,413 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
+var util = require('./util');
+
+// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+// operating systems these days (capturing the result).
+var REGEX_NEWLINE = /(\r?\n)/;
+
+// Newline character code for charCodeAt() comparisons
+var NEWLINE_CODE = 10;
+
+// Private symbol for identifying `SourceNode`s when multiple versions of
+// the source-map library are loaded. This MUST NOT CHANGE across
+// versions!
+var isSourceNode = "$$$isSourceNode$$$";
+
+/**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine == null ? null : aLine;
+ this.column = aColumn == null ? null : aColumn;
+ this.source = aSource == null ? null : aSource;
+ this.name = aName == null ? null : aName;
+ this[isSourceNode] = true;
+ if (aChunks != null) this.add(aChunks);
+}
+
+/**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ * @param aRelativePath Optional. The path that relative sources in the
+ * SourceMapConsumer should be relative to.
+ */
+SourceNode.fromStringWithSourceMap =
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ var node = new SourceNode();
+
+ // All even indices of this array are one line of the generated code,
+ // while all odd indices are the newlines between two adjacent lines
+ // (since `REGEX_NEWLINE` captures its match).
+ // Processed fragments are accessed by calling `shiftNextLine`.
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+ var remainingLinesIndex = 0;
+ var shiftNextLine = function() {
+ var lineContents = getNextLine();
+ // The last line of a file might not have a newline.
+ var newLine = getNextLine() || "";
+ return lineContents + newLine;
+
+ function getNextLine() {
+ return remainingLinesIndex < remainingLines.length ?
+ remainingLines[remainingLinesIndex++] : undefined;
+ }
+ };
+
+ // We need to remember the position of "remainingLines"
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ var lastMapping = null;
+
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping !== null) {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ // Associate first line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ // The remaining code is added without mapping
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ var nextLine = remainingLines[remainingLinesIndex] || '';
+ var code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ // No more remaining code, continue
+ lastMapping = mapping;
+ return;
+ }
+ }
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(shiftNextLine());
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[remainingLinesIndex] || '';
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ if (remainingLinesIndex < remainingLines.length) {
+ if (lastMapping) {
+ // Associate the remaining code in the current line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ }
+ // and add the remaining lines without any mapping
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
+ }
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aRelativePath != null) {
+ sourceFile = util.join(aRelativePath, sourceFile);
+ }
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ var source = aRelativePath
+ ? util.join(aRelativePath, mapping.source)
+ : mapping.source;
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ source,
+ code,
+ mapping.name));
+ }
+ }
+ };
+
+/**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+};
+
+/**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length-1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+};
+
+/**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk[isSourceNode]) {
+ chunk.walk(aFn);
+ }
+ else {
+ if (chunk !== '') {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+};
+
+/**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len-1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+};
+
+/**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild[isSourceNode]) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ }
+ else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ }
+ else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+};
+
+/**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+SourceNode.prototype.setSourceContent =
+ function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+
+/**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+SourceNode.prototype.walkSourceContents =
+ function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i][isSourceNode]) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+
+/**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = "";
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+};
+
+/**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if(lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ for (var idx = 0, length = chunk.length; idx < length; idx++) {
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
+ generated.line++;
+ generated.column = 0;
+ // Mappings end at eol
+ if (idx + 1 === length) {
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ } else {
+ generated.column++;
+ }
+ }
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map: map };
+};
+
+exports.SourceNode = SourceNode;
diff --git a/node_modules/source-map-js/lib/util.js b/node_modules/source-map-js/lib/util.js
new file mode 100644
index 0000000..430e2d0
--- /dev/null
+++ b/node_modules/source-map-js/lib/util.js
@@ -0,0 +1,594 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+}
+exports.getArg = getArg;
+
+var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
+var dataUrlRegexp = /^data:.+\,.+$/;
+
+function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[2],
+ host: match[3],
+ port: match[4],
+ path: match[5]
+ };
+}
+exports.urlParse = urlParse;
+
+function urlGenerate(aParsedUrl) {
+ var url = '';
+ if (aParsedUrl.scheme) {
+ url += aParsedUrl.scheme + ':';
+ }
+ url += '//';
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + '@';
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+}
+exports.urlGenerate = urlGenerate;
+
+var MAX_CACHED_INPUTS = 32;
+
+/**
+ * Takes some function `f(input) -> result` and returns a memoized version of
+ * `f`.
+ *
+ * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
+ * memoization is a dumb-simple, linear least-recently-used cache.
+ */
+function lruMemoize(f) {
+ var cache = [];
+
+ return function(input) {
+ for (var i = 0; i < cache.length; i++) {
+ if (cache[i].input === input) {
+ var temp = cache[0];
+ cache[0] = cache[i];
+ cache[i] = temp;
+ return cache[0].result;
+ }
+ }
+
+ var result = f(input);
+
+ cache.unshift({
+ input,
+ result,
+ });
+
+ if (cache.length > MAX_CACHED_INPUTS) {
+ cache.pop();
+ }
+
+ return result;
+ };
+}
+
+/**
+ * Normalizes a path, or the path portion of a URL:
+ *
+ * - Replaces consecutive slashes with one slash.
+ * - Removes unnecessary '.' parts.
+ * - Removes unnecessary '/..' parts.
+ *
+ * Based on code in the Node.js 'path' core module.
+ *
+ * @param aPath The path or url to normalize.
+ */
+var normalize = lruMemoize(function normalize(aPath) {
+ var path = aPath;
+ var url = urlParse(aPath);
+ if (url) {
+ if (!url.path) {
+ return aPath;
+ }
+ path = url.path;
+ }
+ var isAbsolute = exports.isAbsolute(path);
+ // Split the path into parts between `/` characters. This is much faster than
+ // using `.split(/\/+/g)`.
+ var parts = [];
+ var start = 0;
+ var i = 0;
+ while (true) {
+ start = i;
+ i = path.indexOf("/", start);
+ if (i === -1) {
+ parts.push(path.slice(start));
+ break;
+ } else {
+ parts.push(path.slice(start, i));
+ while (i < path.length && path[i] === "/") {
+ i++;
+ }
+ }
+ }
+
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
+ part = parts[i];
+ if (part === '.') {
+ parts.splice(i, 1);
+ } else if (part === '..') {
+ up++;
+ } else if (up > 0) {
+ if (part === '') {
+ // The first part is blank if the path is absolute. Trying to go
+ // above the root is a no-op. Therefore we can remove all '..' parts
+ // directly after the root.
+ parts.splice(i + 1, up);
+ up = 0;
+ } else {
+ parts.splice(i, 2);
+ up--;
+ }
+ }
+ }
+ path = parts.join('/');
+
+ if (path === '') {
+ path = isAbsolute ? '/' : '.';
+ }
+
+ if (url) {
+ url.path = path;
+ return urlGenerate(url);
+ }
+ return path;
+});
+exports.normalize = normalize;
+
+/**
+ * Joins two paths/URLs.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be joined with the root.
+ *
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
+ * first.
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
+ * is updated with the result and aRoot is returned. Otherwise the result
+ * is returned.
+ * - If aPath is absolute, the result is aPath.
+ * - Otherwise the two paths are joined with a slash.
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
+ */
+function join(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+ if (aPath === "") {
+ aPath = ".";
+ }
+ var aPathUrl = urlParse(aPath);
+ var aRootUrl = urlParse(aRoot);
+ if (aRootUrl) {
+ aRoot = aRootUrl.path || '/';
+ }
+
+ // `join(foo, '//www.example.org')`
+ if (aPathUrl && !aPathUrl.scheme) {
+ if (aRootUrl) {
+ aPathUrl.scheme = aRootUrl.scheme;
+ }
+ return urlGenerate(aPathUrl);
+ }
+
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ // `join('http://', 'www.example.com')`
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
+ aRootUrl.host = aPath;
+ return urlGenerate(aRootUrl);
+ }
+
+ var joined = aPath.charAt(0) === '/'
+ ? aPath
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
+
+ if (aRootUrl) {
+ aRootUrl.path = joined;
+ return urlGenerate(aRootUrl);
+ }
+ return joined;
+}
+exports.join = join;
+
+exports.isAbsolute = function (aPath) {
+ return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
+};
+
+/**
+ * Make a path relative to a URL or another path.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be made relative to aRoot.
+ */
+function relative(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+
+ aRoot = aRoot.replace(/\/$/, '');
+
+ // It is possible for the path to be above the root. In this case, simply
+ // checking whether the root is a prefix of the path won't work. Instead, we
+ // need to remove components from the root one by one, until either we find
+ // a prefix that fits, or we run out of components to remove.
+ var level = 0;
+ while (aPath.indexOf(aRoot + '/') !== 0) {
+ var index = aRoot.lastIndexOf("/");
+ if (index < 0) {
+ return aPath;
+ }
+
+ // If the only part of the root that is left is the scheme (i.e. http://,
+ // file:///, etc.), one or more slashes (/), or simply nothing at all, we
+ // have exhausted all components, so the path is not relative to the root.
+ aRoot = aRoot.slice(0, index);
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
+ return aPath;
+ }
+
+ ++level;
+ }
+
+ // Make sure we add a "../" for each component we removed from the root.
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
+}
+exports.relative = relative;
+
+var supportsNullProto = (function () {
+ var obj = Object.create(null);
+ return !('__proto__' in obj);
+}());
+
+function identity (s) {
+ return s;
+}
+
+/**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+function toSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return '$' + aStr;
+ }
+
+ return aStr;
+}
+exports.toSetString = supportsNullProto ? identity : toSetString;
+
+function fromSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return aStr.slice(1);
+ }
+
+ return aStr;
+}
+exports.fromSetString = supportsNullProto ? identity : fromSetString;
+
+function isProtoString(s) {
+ if (!s) {
+ return false;
+ }
+
+ var length = s.length;
+
+ if (length < 9 /* "__proto__".length */) {
+ return false;
+ }
+
+ if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 2) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 4) !== 116 /* 't' */ ||
+ s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
+ s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
+ s.charCodeAt(length - 8) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 9) !== 95 /* '_' */) {
+ return false;
+ }
+
+ for (var i = length - 10; i >= 0; i--) {
+ if (s.charCodeAt(i) !== 36 /* '$' */) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0 || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByOriginalPositions = compareByOriginalPositions;
+
+function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0 || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
+
+/**
+ * Comparator between two mappings with deflated source and name indices where
+ * the generated positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0 || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
+
+function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0 || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
+
+function strcmp(aStr1, aStr2) {
+ if (aStr1 === aStr2) {
+ return 0;
+ }
+
+ if (aStr1 === null) {
+ return 1; // aStr2 !== null
+ }
+
+ if (aStr2 === null) {
+ return -1; // aStr1 !== null
+ }
+
+ if (aStr1 > aStr2) {
+ return 1;
+ }
+
+ return -1;
+}
+
+/**
+ * Comparator between two mappings with inflated source and name strings where
+ * the generated positions are compared.
+ */
+function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
+
+/**
+ * Strip any JSON XSSI avoidance prefix from the string (as documented
+ * in the source maps specification), and then parse the string as
+ * JSON.
+ */
+function parseSourceMapInput(str) {
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
+}
+exports.parseSourceMapInput = parseSourceMapInput;
+
+/**
+ * Compute the URL of a source given the the source root, the source's
+ * URL, and the source map's URL.
+ */
+function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
+ sourceURL = sourceURL || '';
+
+ if (sourceRoot) {
+ // This follows what Chrome does.
+ if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
+ sourceRoot += '/';
+ }
+ // The spec says:
+ // Line 4: An optional source root, useful for relocating source
+ // files on a server or removing repeated values in the
+ // “sources” entry. This value is prepended to the individual
+ // entries in the “source” field.
+ sourceURL = sourceRoot + sourceURL;
+ }
+
+ // Historically, SourceMapConsumer did not take the sourceMapURL as
+ // a parameter. This mode is still somewhat supported, which is why
+ // this code block is conditional. However, it's preferable to pass
+ // the source map URL to SourceMapConsumer, so that this function
+ // can implement the source URL resolution algorithm as outlined in
+ // the spec. This block is basically the equivalent of:
+ // new URL(sourceURL, sourceMapURL).toString()
+ // ... except it avoids using URL, which wasn't available in the
+ // older releases of node still supported by this library.
+ //
+ // The spec says:
+ // If the sources are not absolute URLs after prepending of the
+ // “sourceRoot”, the sources are resolved relative to the
+ // SourceMap (like resolving script src in a html document).
+ if (sourceMapURL) {
+ var parsed = urlParse(sourceMapURL);
+ if (!parsed) {
+ throw new Error("sourceMapURL could not be parsed");
+ }
+ if (parsed.path) {
+ // Strip the last path component, but keep the "/".
+ var index = parsed.path.lastIndexOf('/');
+ if (index >= 0) {
+ parsed.path = parsed.path.substring(0, index + 1);
+ }
+ }
+ sourceURL = join(urlGenerate(parsed), sourceURL);
+ }
+
+ return normalize(sourceURL);
+}
+exports.computeSourceURL = computeSourceURL;
diff --git a/node_modules/source-map-js/package.json b/node_modules/source-map-js/package.json
new file mode 100644
index 0000000..5a3e2e4
--- /dev/null
+++ b/node_modules/source-map-js/package.json
@@ -0,0 +1,203 @@
+{
+ "_from": "source-map-js@^1.0.1",
+ "_id": "source-map-js@1.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==",
+ "_location": "/source-map-js",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "source-map-js@^1.0.1",
+ "name": "source-map-js",
+ "escapedName": "source-map-js",
+ "rawSpec": "^1.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.1"
+ },
+ "_requiredBy": [
+ "/postcss"
+ ],
+ "_resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz",
+ "_shasum": "a1741c131e3c77d048252adfa24e23b908670caf",
+ "_spec": "source-map-js@^1.0.1",
+ "_where": "/Users/parksewon/Desktop/HiAlcohol_server/node_modules/postcss",
+ "author": {
+ "name": "Valentin 7rulnik Semirulnik",
+ "email": "v7rulnik@gmail.com"
+ },
+ "bugs": {
+ "url": "https://github.com/7rulnik/source-map/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Nick Fitzgerald",
+ "email": "nfitzgerald@mozilla.com"
+ },
+ {
+ "name": "Tobias Koppers",
+ "email": "tobias.koppers@googlemail.com"
+ },
+ {
+ "name": "Duncan Beevers",
+ "email": "duncan@dweebd.com"
+ },
+ {
+ "name": "Stephen Crane",
+ "email": "scrane@mozilla.com"
+ },
+ {
+ "name": "Ryan Seddon",
+ "email": "seddon.ryan@gmail.com"
+ },
+ {
+ "name": "Miles Elam",
+ "email": "miles.elam@deem.com"
+ },
+ {
+ "name": "Mihai Bazon",
+ "email": "mihai.bazon@gmail.com"
+ },
+ {
+ "name": "Michael Ficarra",
+ "email": "github.public.email@michael.ficarra.me"
+ },
+ {
+ "name": "Todd Wolfson",
+ "email": "todd@twolfson.com"
+ },
+ {
+ "name": "Alexander Solovyov",
+ "email": "alexander@solovyov.net"
+ },
+ {
+ "name": "Felix Gnass",
+ "email": "fgnass@gmail.com"
+ },
+ {
+ "name": "Conrad Irwin",
+ "email": "conrad.irwin@gmail.com"
+ },
+ {
+ "name": "usrbincc",
+ "email": "usrbincc@yahoo.com"
+ },
+ {
+ "name": "David Glasser",
+ "email": "glasser@davidglasser.net"
+ },
+ {
+ "name": "Chase Douglas",
+ "email": "chase@newrelic.com"
+ },
+ {
+ "name": "Evan Wallace",
+ "email": "evan.exe@gmail.com"
+ },
+ {
+ "name": "Heather Arthur",
+ "email": "fayearthur@gmail.com"
+ },
+ {
+ "name": "Hugh Kennedy",
+ "email": "hughskennedy@gmail.com"
+ },
+ {
+ "name": "David Glasser",
+ "email": "glasser@davidglasser.net"
+ },
+ {
+ "name": "Simon Lydell",
+ "email": "simon.lydell@gmail.com"
+ },
+ {
+ "name": "Jmeas Smith",
+ "email": "jellyes2@gmail.com"
+ },
+ {
+ "name": "Michael Z Goddard",
+ "email": "mzgoddard@gmail.com"
+ },
+ {
+ "name": "azu",
+ "email": "azu@users.noreply.github.com"
+ },
+ {
+ "name": "John Gozde",
+ "email": "john@gozde.ca"
+ },
+ {
+ "name": "Adam Kirkton",
+ "email": "akirkton@truefitinnovation.com"
+ },
+ {
+ "name": "Chris Montgomery",
+ "email": "christopher.montgomery@dowjones.com"
+ },
+ {
+ "name": "J. Ryan Stinnett",
+ "email": "jryans@gmail.com"
+ },
+ {
+ "name": "Jack Herrington",
+ "email": "jherrington@walmartlabs.com"
+ },
+ {
+ "name": "Chris Truter",
+ "email": "jeffpalentine@gmail.com"
+ },
+ {
+ "name": "Daniel Espeset",
+ "email": "daniel@danielespeset.com"
+ },
+ {
+ "name": "Jamie Wong",
+ "email": "jamie.lf.wong@gmail.com"
+ },
+ {
+ "name": "Eddy Bruël",
+ "email": "ejpbruel@mozilla.com"
+ },
+ {
+ "name": "Hawken Rives",
+ "email": "hawkrives@gmail.com"
+ },
+ {
+ "name": "Gilad Peleg",
+ "email": "giladp007@gmail.com"
+ },
+ {
+ "name": "djchie",
+ "email": "djchie.dev@gmail.com"
+ },
+ {
+ "name": "Gary Ye",
+ "email": "garysye@gmail.com"
+ },
+ {
+ "name": "Nicolas Lalevée",
+ "email": "nicolas.lalevee@hibnet.org"
+ }
+ ],
+ "deprecated": false,
+ "description": "Generates and consumes source maps",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "source-map.js",
+ "source-map.d.ts",
+ "lib/"
+ ],
+ "homepage": "https://github.com/7rulnik/source-map",
+ "license": "BSD-3-Clause",
+ "main": "./source-map.js",
+ "name": "source-map-js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/7rulnik/source-map.git"
+ },
+ "typings": "source-map.d.ts",
+ "version": "1.0.1"
+}
diff --git a/node_modules/source-map-js/source-map.d.ts b/node_modules/source-map-js/source-map.d.ts
new file mode 100644
index 0000000..8f972b0
--- /dev/null
+++ b/node_modules/source-map-js/source-map.d.ts
@@ -0,0 +1,98 @@
+export interface StartOfSourceMap {
+ file?: string;
+ sourceRoot?: string;
+}
+
+export interface RawSourceMap extends StartOfSourceMap {
+ version: string;
+ sources: string[];
+ names: string[];
+ sourcesContent?: string[];
+ mappings: string;
+}
+
+export interface Position {
+ line: number;
+ column: number;
+}
+
+export interface LineRange extends Position {
+ lastColumn: number;
+}
+
+export interface FindPosition extends Position {
+ // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
+ bias?: number;
+}
+
+export interface SourceFindPosition extends FindPosition {
+ source: string;
+}
+
+export interface MappedPosition extends Position {
+ source: string;
+ name?: string;
+}
+
+export interface MappingItem {
+ source: string;
+ generatedLine: number;
+ generatedColumn: number;
+ originalLine: number;
+ originalColumn: number;
+ name: string;
+}
+
+export class SourceMapConsumer {
+ static GENERATED_ORDER: number;
+ static ORIGINAL_ORDER: number;
+
+ static GREATEST_LOWER_BOUND: number;
+ static LEAST_UPPER_BOUND: number;
+
+ constructor(rawSourceMap: RawSourceMap);
+ computeColumnSpans(): void;
+ originalPositionFor(generatedPosition: FindPosition): MappedPosition;
+ generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
+ allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
+ hasContentsOfAllSources(): boolean;
+ sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
+ eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
+}
+
+export interface Mapping {
+ generated: Position;
+ original: Position;
+ source: string;
+ name?: string;
+}
+
+export class SourceMapGenerator {
+ constructor(startOfSourceMap?: StartOfSourceMap);
+ static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
+ addMapping(mapping: Mapping): void;
+ setSourceContent(sourceFile: string, sourceContent: string): void;
+ applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
+ toString(): string;
+}
+
+export interface CodeWithSourceMap {
+ code: string;
+ map: SourceMapGenerator;
+}
+
+export class SourceNode {
+ constructor();
+ constructor(line: number, column: number, source: string);
+ constructor(line: number, column: number, source: string, chunk?: string, name?: string);
+ static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
+ add(chunk: string): void;
+ prepend(chunk: string): void;
+ setSourceContent(sourceFile: string, sourceContent: string): void;
+ walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
+ walkSourceContents(fn: (file: string, content: string) => void): void;
+ join(sep: string): SourceNode;
+ replaceRight(pattern: string, replacement: string): SourceNode;
+ toString(): string;
+ toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
+}
diff --git a/node_modules/source-map-js/source-map.js b/node_modules/source-map-js/source-map.js
new file mode 100644
index 0000000..bc88fe8
--- /dev/null
+++ b/node_modules/source-map-js/source-map.js
@@ -0,0 +1,8 @@
+/*
+ * Copyright 2009-2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.txt or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
+exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
+exports.SourceNode = require('./lib/source-node').SourceNode;
diff --git a/node_modules/sqlstring/package.json b/node_modules/sqlstring/package.json
index 2870aac..8b3eff1 100644
--- a/node_modules/sqlstring/package.json
+++ b/node_modules/sqlstring/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"sqlstring@2.3.1",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "sqlstring@2.3.1",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz",
"_spec": "2.3.1",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"bugs": {
"url": "https://github.com/mysqljs/sqlstring/issues"
},
diff --git a/node_modules/statuses/package.json b/node_modules/statuses/package.json
index 60599fd..9b560b0 100644
--- a/node_modules/statuses/package.json
+++ b/node_modules/statuses/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"statuses@1.5.0",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "statuses@1.5.0",
@@ -29,7 +29,7 @@
],
"_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"_spec": "1.5.0",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"bugs": {
"url": "https://github.com/jshttp/statuses/issues"
},
diff --git a/node_modules/string-width/index.d.ts b/node_modules/string-width/index.d.ts
new file mode 100644
index 0000000..12b5309
--- /dev/null
+++ b/node_modules/string-width/index.d.ts
@@ -0,0 +1,29 @@
+declare const stringWidth: {
+ /**
+ Get the visual width of a string - the number of columns required to display it.
+
+ Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
+
+ @example
+ ```
+ import stringWidth = require('string-width');
+
+ stringWidth('a');
+ //=> 1
+
+ stringWidth('古');
+ //=> 2
+
+ stringWidth('\u001B[1m古\u001B[22m');
+ //=> 2
+ ```
+ */
+ (string: string): number;
+
+ // TODO: remove this in the next major version, refactor the whole definition to:
+ // declare function stringWidth(string: string): number;
+ // export = stringWidth;
+ default: typeof stringWidth;
+}
+
+export = stringWidth;
diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js
new file mode 100644
index 0000000..f4d261a
--- /dev/null
+++ b/node_modules/string-width/index.js
@@ -0,0 +1,47 @@
+'use strict';
+const stripAnsi = require('strip-ansi');
+const isFullwidthCodePoint = require('is-fullwidth-code-point');
+const emojiRegex = require('emoji-regex');
+
+const stringWidth = string => {
+ if (typeof string !== 'string' || string.length === 0) {
+ return 0;
+ }
+
+ string = stripAnsi(string);
+
+ if (string.length === 0) {
+ return 0;
+ }
+
+ string = string.replace(emojiRegex(), ' ');
+
+ let width = 0;
+
+ for (let i = 0; i < string.length; i++) {
+ const code = string.codePointAt(i);
+
+ // Ignore control characters
+ if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
+ continue;
+ }
+
+ // Ignore combining characters
+ if (code >= 0x300 && code <= 0x36F) {
+ continue;
+ }
+
+ // Surrogates
+ if (code > 0xFFFF) {
+ i++;
+ }
+
+ width += isFullwidthCodePoint(code) ? 2 : 1;
+ }
+
+ return width;
+};
+
+module.exports = stringWidth;
+// TODO: remove this in the next major version
+module.exports.default = stringWidth;
diff --git a/node_modules/string-width/license b/node_modules/string-width/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/string-width/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.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.
diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json
new file mode 100644
index 0000000..2c912c5
--- /dev/null
+++ b/node_modules/string-width/package.json
@@ -0,0 +1,91 @@
+{
+ "_from": "string-width@^4.2.2",
+ "_id": "string-width@4.2.3",
+ "_inBundle": false,
+ "_integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "_location": "/string-width",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "string-width@^4.2.2",
+ "name": "string-width",
+ "escapedName": "string-width",
+ "rawSpec": "^4.2.2",
+ "saveSpec": null,
+ "fetchSpec": "^4.2.2"
+ },
+ "_requiredBy": [
+ "/ansi-align",
+ "/boxen",
+ "/widest-line",
+ "/wrap-ansi"
+ ],
+ "_resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "_shasum": "269c7117d27b05ad2e536830a8ec895ef9c6d010",
+ "_spec": "string-width@^4.2.2",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/boxen",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/string-width/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "deprecated": false,
+ "description": "Get the visual width of a string - the number of columns required to display it",
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.1",
+ "xo": "^0.24.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "homepage": "https://github.com/sindresorhus/string-width#readme",
+ "keywords": [
+ "string",
+ "character",
+ "unicode",
+ "width",
+ "visual",
+ "column",
+ "columns",
+ "fullwidth",
+ "full-width",
+ "full",
+ "ansi",
+ "escape",
+ "codes",
+ "cli",
+ "command-line",
+ "terminal",
+ "console",
+ "cjk",
+ "chinese",
+ "japanese",
+ "korean",
+ "fixed-width"
+ ],
+ "license": "MIT",
+ "name": "string-width",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/string-width.git"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "version": "4.2.3"
+}
diff --git a/node_modules/string-width/readme.md b/node_modules/string-width/readme.md
new file mode 100644
index 0000000..bdd3141
--- /dev/null
+++ b/node_modules/string-width/readme.md
@@ -0,0 +1,50 @@
+# string-width
+
+> Get the visual width of a string - the number of columns required to display it
+
+Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
+
+Useful to be able to measure the actual width of command-line output.
+
+
+## Install
+
+```
+$ npm install string-width
+```
+
+
+## Usage
+
+```js
+const stringWidth = require('string-width');
+
+stringWidth('a');
+//=> 1
+
+stringWidth('古');
+//=> 2
+
+stringWidth('\u001B[1m古\u001B[22m');
+//=> 2
+```
+
+
+## Related
+
+- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
+- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
+- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
+
+
+---
+
+
diff --git a/node_modules/string_decoder/package.json b/node_modules/string_decoder/package.json
index 8fbcc4c..d28f82e 100644
--- a/node_modules/string_decoder/package.json
+++ b/node_modules/string_decoder/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"string_decoder@1.1.1",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "string_decoder@1.1.1",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"_spec": "1.1.1",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"bugs": {
"url": "https://github.com/nodejs/string_decoder/issues"
},
diff --git a/node_modules/strip-ansi/index.d.ts b/node_modules/strip-ansi/index.d.ts
new file mode 100644
index 0000000..907fccc
--- /dev/null
+++ b/node_modules/strip-ansi/index.d.ts
@@ -0,0 +1,17 @@
+/**
+Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
+
+@example
+```
+import stripAnsi = require('strip-ansi');
+
+stripAnsi('\u001B[4mUnicorn\u001B[0m');
+//=> 'Unicorn'
+
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
+//=> 'Click'
+```
+*/
+declare function stripAnsi(string: string): string;
+
+export = stripAnsi;
diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js
new file mode 100644
index 0000000..9a593df
--- /dev/null
+++ b/node_modules/strip-ansi/index.js
@@ -0,0 +1,4 @@
+'use strict';
+const ansiRegex = require('ansi-regex');
+
+module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/strip-ansi/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.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.
diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json
new file mode 100644
index 0000000..311b69d
--- /dev/null
+++ b/node_modules/strip-ansi/package.json
@@ -0,0 +1,87 @@
+{
+ "_from": "strip-ansi@^6.0.1",
+ "_id": "strip-ansi@6.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "_location": "/strip-ansi",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "strip-ansi@^6.0.1",
+ "name": "strip-ansi",
+ "escapedName": "strip-ansi",
+ "rawSpec": "^6.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^6.0.1"
+ },
+ "_requiredBy": [
+ "/string-width",
+ "/wrap-ansi"
+ ],
+ "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "_shasum": "9e26c63d30f53443e9489495b2105d37b67a85d9",
+ "_spec": "strip-ansi@^6.0.1",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/string-width",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/chalk/strip-ansi/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "deprecated": false,
+ "description": "Strip ANSI escape codes from a string",
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "tsd": "^0.10.0",
+ "xo": "^0.25.3"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "homepage": "https://github.com/chalk/strip-ansi#readme",
+ "keywords": [
+ "strip",
+ "trim",
+ "remove",
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "license": "MIT",
+ "name": "strip-ansi",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/strip-ansi.git"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "version": "6.0.1"
+}
diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md
new file mode 100644
index 0000000..7c4b56d
--- /dev/null
+++ b/node_modules/strip-ansi/readme.md
@@ -0,0 +1,46 @@
+# strip-ansi [](https://travis-ci.org/chalk/strip-ansi)
+
+> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
+
+
+## Install
+
+```
+$ npm install strip-ansi
+```
+
+
+## Usage
+
+```js
+const stripAnsi = require('strip-ansi');
+
+stripAnsi('\u001B[4mUnicorn\u001B[0m');
+//=> 'Unicorn'
+
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
+//=> 'Click'
+```
+
+
+## strip-ansi for enterprise
+
+Available as part of the Tidelift Subscription.
+
+The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
+
+
+## Related
+
+- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
+- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
+- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
+- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
diff --git a/node_modules/strip-json-comments/index.js b/node_modules/strip-json-comments/index.js
new file mode 100644
index 0000000..4e6576e
--- /dev/null
+++ b/node_modules/strip-json-comments/index.js
@@ -0,0 +1,70 @@
+'use strict';
+var singleComment = 1;
+var multiComment = 2;
+
+function stripWithoutWhitespace() {
+ return '';
+}
+
+function stripWithWhitespace(str, start, end) {
+ return str.slice(start, end).replace(/\S/g, ' ');
+}
+
+module.exports = function (str, opts) {
+ opts = opts || {};
+
+ var currentChar;
+ var nextChar;
+ var insideString = false;
+ var insideComment = false;
+ var offset = 0;
+ var ret = '';
+ var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
+
+ for (var i = 0; i < str.length; i++) {
+ currentChar = str[i];
+ nextChar = str[i + 1];
+
+ if (!insideComment && currentChar === '"') {
+ var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\';
+ if (!escaped) {
+ insideString = !insideString;
+ }
+ }
+
+ if (insideString) {
+ continue;
+ }
+
+ if (!insideComment && currentChar + nextChar === '//') {
+ ret += str.slice(offset, i);
+ offset = i;
+ insideComment = singleComment;
+ i++;
+ } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') {
+ i++;
+ insideComment = false;
+ ret += strip(str, offset, i);
+ offset = i;
+ continue;
+ } else if (insideComment === singleComment && currentChar === '\n') {
+ insideComment = false;
+ ret += strip(str, offset, i);
+ offset = i;
+ } else if (!insideComment && currentChar + nextChar === '/*') {
+ ret += str.slice(offset, i);
+ offset = i;
+ insideComment = multiComment;
+ i++;
+ continue;
+ } else if (insideComment === multiComment && currentChar + nextChar === '*/') {
+ i++;
+ insideComment = false;
+ ret += strip(str, offset, i + 1);
+ offset = i + 1;
+ continue;
+ }
+ }
+
+ return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
+};
diff --git a/node_modules/strip-json-comments/license b/node_modules/strip-json-comments/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/strip-json-comments/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus (sindresorhus.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.
diff --git a/node_modules/strip-json-comments/package.json b/node_modules/strip-json-comments/package.json
new file mode 100644
index 0000000..148903e
--- /dev/null
+++ b/node_modules/strip-json-comments/package.json
@@ -0,0 +1,74 @@
+{
+ "_from": "strip-json-comments@~2.0.1",
+ "_id": "strip-json-comments@2.0.1",
+ "_inBundle": false,
+ "_integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "_location": "/strip-json-comments",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "strip-json-comments@~2.0.1",
+ "name": "strip-json-comments",
+ "escapedName": "strip-json-comments",
+ "rawSpec": "~2.0.1",
+ "saveSpec": null,
+ "fetchSpec": "~2.0.1"
+ },
+ "_requiredBy": [
+ "/rc"
+ ],
+ "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "_shasum": "3c531942e908c2697c0ec344858c286c7ca0a60a",
+ "_spec": "strip-json-comments@~2.0.1",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/rc",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/strip-json-comments/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Strip comments from JSON. Lets you use comments in your JSON files!",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/sindresorhus/strip-json-comments#readme",
+ "keywords": [
+ "json",
+ "strip",
+ "remove",
+ "delete",
+ "trim",
+ "comments",
+ "multiline",
+ "parse",
+ "config",
+ "configuration",
+ "conf",
+ "settings",
+ "util",
+ "env",
+ "environment"
+ ],
+ "license": "MIT",
+ "name": "strip-json-comments",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/strip-json-comments.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "2.0.1"
+}
diff --git a/node_modules/strip-json-comments/readme.md b/node_modules/strip-json-comments/readme.md
new file mode 100644
index 0000000..0ee58df
--- /dev/null
+++ b/node_modules/strip-json-comments/readme.md
@@ -0,0 +1,64 @@
+# strip-json-comments [](https://travis-ci.org/sindresorhus/strip-json-comments)
+
+> Strip comments from JSON. Lets you use comments in your JSON files!
+
+This is now possible:
+
+```js
+{
+ // rainbows
+ "unicorn": /* ❤ */ "cake"
+}
+```
+
+It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
+
+Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.
+
+
+## Install
+
+```
+$ npm install --save strip-json-comments
+```
+
+
+## Usage
+
+```js
+const json = '{/*rainbows*/"unicorn":"cake"}';
+
+JSON.parse(stripJsonComments(json));
+//=> {unicorn: 'cake'}
+```
+
+
+## API
+
+### stripJsonComments(input, [options])
+
+#### input
+
+Type: `string`
+
+Accepts a string with JSON and returns a string without comments.
+
+#### options
+
+##### whitespace
+
+Type: `boolean`
+Default: `true`
+
+Replace comments with whitespace instead of stripping them entirely.
+
+
+## Related
+
+- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module
+- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js
new file mode 100644
index 0000000..62afa3a
--- /dev/null
+++ b/node_modules/supports-color/browser.js
@@ -0,0 +1,5 @@
+'use strict';
+module.exports = {
+ stdout: false,
+ stderr: false
+};
diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js
new file mode 100644
index 0000000..1704131
--- /dev/null
+++ b/node_modules/supports-color/index.js
@@ -0,0 +1,131 @@
+'use strict';
+const os = require('os');
+const hasFlag = require('has-flag');
+
+const env = process.env;
+
+let forceColor;
+if (hasFlag('no-color') ||
+ hasFlag('no-colors') ||
+ hasFlag('color=false')) {
+ forceColor = false;
+} else if (hasFlag('color') ||
+ hasFlag('colors') ||
+ hasFlag('color=true') ||
+ hasFlag('color=always')) {
+ forceColor = true;
+}
+if ('FORCE_COLOR' in env) {
+ forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
+}
+
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+
+ return {
+ level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3
+ };
+}
+
+function supportsColor(stream) {
+ if (forceColor === false) {
+ return 0;
+ }
+
+ if (hasFlag('color=16m') ||
+ hasFlag('color=full') ||
+ hasFlag('color=truecolor')) {
+ return 3;
+ }
+
+ if (hasFlag('color=256')) {
+ return 2;
+ }
+
+ if (stream && !stream.isTTY && forceColor !== true) {
+ return 0;
+ }
+
+ const min = forceColor ? 1 : 0;
+
+ if (process.platform === 'win32') {
+ // Node.js 7.5.0 is the first version of Node.js to include a patch to
+ // libuv that enables 256 color output on Windows. Anything earlier and it
+ // won't work. However, here we target Node.js 8 at minimum as it is an LTS
+ // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
+ // release that supports 256 colors. Windows 10 build 14931 is the first release
+ // that supports 16m/TrueColor.
+ const osRelease = os.release().split('.');
+ if (
+ Number(process.versions.node.split('.')[0]) >= 8 &&
+ Number(osRelease[0]) >= 10 &&
+ Number(osRelease[2]) >= 10586
+ ) {
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
+ }
+
+ return 1;
+ }
+
+ if ('CI' in env) {
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
+ return 1;
+ }
+
+ return min;
+ }
+
+ if ('TEAMCITY_VERSION' in env) {
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
+ }
+
+ if (env.COLORTERM === 'truecolor') {
+ return 3;
+ }
+
+ if ('TERM_PROGRAM' in env) {
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+
+ switch (env.TERM_PROGRAM) {
+ case 'iTerm.app':
+ return version >= 3 ? 3 : 2;
+ case 'Apple_Terminal':
+ return 2;
+ // No default
+ }
+ }
+
+ if (/-256(color)?$/i.test(env.TERM)) {
+ return 2;
+ }
+
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
+ return 1;
+ }
+
+ if ('COLORTERM' in env) {
+ return 1;
+ }
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
+
+ return min;
+}
+
+function getSupportLevel(stream) {
+ const level = supportsColor(stream);
+ return translateLevel(level);
+}
+
+module.exports = {
+ supportsColor: getSupportLevel,
+ stdout: getSupportLevel(process.stdout),
+ stderr: getSupportLevel(process.stderr)
+};
diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/supports-color/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.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.
diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json
new file mode 100644
index 0000000..4e860fa
--- /dev/null
+++ b/node_modules/supports-color/package.json
@@ -0,0 +1,85 @@
+{
+ "_from": "supports-color@^5.5.0",
+ "_id": "supports-color@5.5.0",
+ "_inBundle": false,
+ "_integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "_location": "/supports-color",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "supports-color@^5.5.0",
+ "name": "supports-color",
+ "escapedName": "supports-color",
+ "rawSpec": "^5.5.0",
+ "saveSpec": null,
+ "fetchSpec": "^5.5.0"
+ },
+ "_requiredBy": [
+ "/nodemon"
+ ],
+ "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "_shasum": "e2e69a44ac8772f78a1ec0b35b689df6530efc8f",
+ "_spec": "supports-color@^5.5.0",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/nodemon",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "browser": "browser.js",
+ "bugs": {
+ "url": "https://github.com/chalk/supports-color/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "deprecated": false,
+ "description": "Detect whether a terminal supports color",
+ "devDependencies": {
+ "ava": "^0.25.0",
+ "import-fresh": "^2.0.0",
+ "xo": "^0.20.0"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "files": [
+ "index.js",
+ "browser.js"
+ ],
+ "homepage": "https://github.com/chalk/supports-color#readme",
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "ansi",
+ "styles",
+ "tty",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "support",
+ "supports",
+ "capability",
+ "detect",
+ "truecolor",
+ "16m"
+ ],
+ "license": "MIT",
+ "name": "supports-color",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/supports-color.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "5.5.0"
+}
diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md
new file mode 100644
index 0000000..f6e4019
--- /dev/null
+++ b/node_modules/supports-color/readme.md
@@ -0,0 +1,66 @@
+# supports-color [](https://travis-ci.org/chalk/supports-color)
+
+> Detect whether a terminal supports color
+
+
+## Install
+
+```
+$ npm install supports-color
+```
+
+
+## Usage
+
+```js
+const supportsColor = require('supports-color');
+
+if (supportsColor.stdout) {
+ console.log('Terminal stdout supports color');
+}
+
+if (supportsColor.stdout.has256) {
+ console.log('Terminal stdout supports 256 colors');
+}
+
+if (supportsColor.stderr.has16m) {
+ console.log('Terminal stderr supports 16 million colors (truecolor)');
+}
+```
+
+
+## API
+
+Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
+
+The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
+
+- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
+- `.level = 2` and `.has256 = true`: 256 color support
+- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
+
+
+## Info
+
+It obeys the `--color` and `--no-color` CLI flags.
+
+Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
+
+Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
+
+
+## Related
+
+- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
+
+## License
+
+MIT
diff --git a/node_modules/to-readable-stream/index.js b/node_modules/to-readable-stream/index.js
new file mode 100644
index 0000000..554bfa5
--- /dev/null
+++ b/node_modules/to-readable-stream/index.js
@@ -0,0 +1,11 @@
+'use strict';
+const {Readable} = require('stream');
+
+module.exports = input => (
+ new Readable({
+ read() {
+ this.push(input);
+ this.push(null);
+ }
+ })
+);
diff --git a/node_modules/to-readable-stream/license b/node_modules/to-readable-stream/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/to-readable-stream/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.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.
diff --git a/node_modules/to-readable-stream/package.json b/node_modules/to-readable-stream/package.json
new file mode 100644
index 0000000..d5ca64c
--- /dev/null
+++ b/node_modules/to-readable-stream/package.json
@@ -0,0 +1,72 @@
+{
+ "_from": "to-readable-stream@^1.0.0",
+ "_id": "to-readable-stream@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==",
+ "_location": "/to-readable-stream",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "to-readable-stream@^1.0.0",
+ "name": "to-readable-stream",
+ "escapedName": "to-readable-stream",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/got"
+ ],
+ "_resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz",
+ "_shasum": "ce0aa0c2f3df6adf852efb404a783e77c0475771",
+ "_spec": "to-readable-stream@^1.0.0",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/got",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/to-readable-stream/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Convert a string/Buffer/Uint8Array to a readable stream",
+ "devDependencies": {
+ "ava": "*",
+ "get-stream": "^3.0.0",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/sindresorhus/to-readable-stream#readme",
+ "keywords": [
+ "stream",
+ "readablestream",
+ "string",
+ "buffer",
+ "uint8array",
+ "from",
+ "into",
+ "to",
+ "transform",
+ "convert",
+ "readable",
+ "pull"
+ ],
+ "license": "MIT",
+ "name": "to-readable-stream",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/to-readable-stream.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "1.0.0"
+}
diff --git a/node_modules/to-readable-stream/readme.md b/node_modules/to-readable-stream/readme.md
new file mode 100644
index 0000000..fc207c5
--- /dev/null
+++ b/node_modules/to-readable-stream/readme.md
@@ -0,0 +1,42 @@
+# to-readable-stream [](https://travis-ci.org/sindresorhus/to-readable-stream)
+
+> Convert a string/Buffer/Uint8Array to a [readable stream](https://nodejs.org/api/stream.html#stream_readable_streams)
+
+
+## Install
+
+```
+$ npm install to-readable-stream
+```
+
+
+## Usage
+
+```js
+const toReadableStream = require('to-readable-stream');
+
+toReadableStream('🦄🌈').pipe(process.stdout);
+```
+
+
+## API
+
+### toReadableStream(input)
+
+Returns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams).
+
+#### input
+
+Type: `string` `Buffer` `Uint8Array`
+
+Value to convert to a stream.
+
+
+## Related
+
+- [into-stream](https://github.com/sindresorhus/into-stream) - More advanced version of this module
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/to-regex-range/LICENSE b/node_modules/to-regex-range/LICENSE
new file mode 100644
index 0000000..7cccaf9
--- /dev/null
+++ b/node_modules/to-regex-range/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015-present, Jon Schlinkert.
+
+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.
diff --git a/node_modules/to-regex-range/README.md b/node_modules/to-regex-range/README.md
new file mode 100644
index 0000000..38887da
--- /dev/null
+++ b/node_modules/to-regex-range/README.md
@@ -0,0 +1,305 @@
+# to-regex-range [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [](https://www.npmjs.com/package/to-regex-range) [](https://npmjs.org/package/to-regex-range) [](https://npmjs.org/package/to-regex-range) [](https://travis-ci.org/micromatch/to-regex-range)
+
+> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.
+
+Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save to-regex-range
+```
+
+
+What does this do?
+
+
+
+This libary generates the `source` string to be passed to `new RegExp()` for matching a range of numbers.
+
+**Example**
+
+```js
+const toRegexRange = require('to-regex-range');
+const regex = new RegExp(toRegexRange('15', '95'));
+```
+
+A string is returned so that you can do whatever you need with it before passing it to `new RegExp()` (like adding `^` or `$` boundaries, defining flags, or combining it another string).
+
+
+
+
+
+
+Why use this library?
+
+
+
+### Convenience
+
+Creating regular expressions for matching numbers gets deceptively complicated pretty fast.
+
+For example, let's say you need a validation regex for matching part of a user-id, postal code, social security number, tax id, etc:
+
+* regex for matching `1` => `/1/` (easy enough)
+* regex for matching `1` through `5` => `/[1-5]/` (not bad...)
+* regex for matching `1` or `5` => `/(1|5)/` (still easy...)
+* regex for matching `1` through `50` => `/([1-9]|[1-4][0-9]|50)/` (uh-oh...)
+* regex for matching `1` through `55` => `/([1-9]|[1-4][0-9]|5[0-5])/` (no prob, I can do this...)
+* regex for matching `1` through `555` => `/([1-9]|[1-9][0-9]|[1-4][0-9]{2}|5[0-4][0-9]|55[0-5])/` (maybe not...)
+* regex for matching `0001` through `5555` => `/(0{3}[1-9]|0{2}[1-9][0-9]|0[1-9][0-9]{2}|[1-4][0-9]{3}|5[0-4][0-9]{2}|55[0-4][0-9]|555[0-5])/` (okay, I get the point!)
+
+The numbers are contrived, but they're also really basic. In the real world you might need to generate a regex on-the-fly for validation.
+
+**Learn more**
+
+If you're interested in learning more about [character classes](http://www.regular-expressions.info/charclass.html) and other regex features, I personally have always found [regular-expressions.info](http://www.regular-expressions.info/charclass.html) to be pretty useful.
+
+### Heavily tested
+
+As of April 07, 2019, this library runs [>1m test assertions](./test/test.js) against generated regex-ranges to provide brute-force verification that results are correct.
+
+Tests run in ~280ms on my MacBook Pro, 2.5 GHz Intel Core i7.
+
+### Optimized
+
+Generated regular expressions are optimized:
+
+* duplicate sequences and character classes are reduced using quantifiers
+* smart enough to use `?` conditionals when number(s) or range(s) can be positive or negative
+* uses fragment caching to avoid processing the same exact string more than once
+
+
+
+
+
+## Usage
+
+Add this library to your javascript application with the following line of code
+
+```js
+const toRegexRange = require('to-regex-range');
+```
+
+The main export is a function that takes two integers: the `min` value and `max` value (formatted as strings or numbers).
+
+```js
+const source = toRegexRange('15', '95');
+//=> 1[5-9]|[2-8][0-9]|9[0-5]
+
+const regex = new RegExp(`^${source}$`);
+console.log(regex.test('14')); //=> false
+console.log(regex.test('50')); //=> true
+console.log(regex.test('94')); //=> true
+console.log(regex.test('96')); //=> false
+```
+
+## Options
+
+### options.capture
+
+**Type**: `boolean`
+
+**Deafault**: `undefined`
+
+Wrap the returned value in parentheses when there is more than one regex condition. Useful when you're dynamically generating ranges.
+
+```js
+console.log(toRegexRange('-10', '10'));
+//=> -[1-9]|-?10|[0-9]
+
+console.log(toRegexRange('-10', '10', { capture: true }));
+//=> (-[1-9]|-?10|[0-9])
+```
+
+### options.shorthand
+
+**Type**: `boolean`
+
+**Deafault**: `undefined`
+
+Use the regex shorthand for `[0-9]`:
+
+```js
+console.log(toRegexRange('0', '999999'));
+//=> [0-9]|[1-9][0-9]{1,5}
+
+console.log(toRegexRange('0', '999999', { shorthand: true }));
+//=> \d|[1-9]\d{1,5}
+```
+
+### options.relaxZeros
+
+**Type**: `boolean`
+
+**Default**: `true`
+
+This option relaxes matching for leading zeros when when ranges are zero-padded.
+
+```js
+const source = toRegexRange('-0010', '0010');
+const regex = new RegExp(`^${source}$`);
+console.log(regex.test('-10')); //=> true
+console.log(regex.test('-010')); //=> true
+console.log(regex.test('-0010')); //=> true
+console.log(regex.test('10')); //=> true
+console.log(regex.test('010')); //=> true
+console.log(regex.test('0010')); //=> true
+```
+
+When `relaxZeros` is false, matching is strict:
+
+```js
+const source = toRegexRange('-0010', '0010', { relaxZeros: false });
+const regex = new RegExp(`^${source}$`);
+console.log(regex.test('-10')); //=> false
+console.log(regex.test('-010')); //=> false
+console.log(regex.test('-0010')); //=> true
+console.log(regex.test('10')); //=> false
+console.log(regex.test('010')); //=> false
+console.log(regex.test('0010')); //=> true
+```
+
+## Examples
+
+| **Range** | **Result** | **Compile time** |
+| --- | --- | --- |
+| `toRegexRange(-10, 10)` | `-[1-9]\|-?10\|[0-9]` | _132μs_ |
+| `toRegexRange(-100, -10)` | `-1[0-9]\|-[2-9][0-9]\|-100` | _50μs_ |
+| `toRegexRange(-100, 100)` | `-[1-9]\|-?[1-9][0-9]\|-?100\|[0-9]` | _42μs_ |
+| `toRegexRange(001, 100)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|100` | _109μs_ |
+| `toRegexRange(001, 555)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _51μs_ |
+| `toRegexRange(0010, 1000)` | `0{0,2}1[0-9]\|0{0,2}[2-9][0-9]\|0?[1-9][0-9]{2}\|1000` | _31μs_ |
+| `toRegexRange(1, 50)` | `[1-9]\|[1-4][0-9]\|50` | _24μs_ |
+| `toRegexRange(1, 55)` | `[1-9]\|[1-4][0-9]\|5[0-5]` | _23μs_ |
+| `toRegexRange(1, 555)` | `[1-9]\|[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _30μs_ |
+| `toRegexRange(1, 5555)` | `[1-9]\|[1-9][0-9]{1,2}\|[1-4][0-9]{3}\|5[0-4][0-9]{2}\|55[0-4][0-9]\|555[0-5]` | _43μs_ |
+| `toRegexRange(111, 555)` | `11[1-9]\|1[2-9][0-9]\|[2-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _38μs_ |
+| `toRegexRange(29, 51)` | `29\|[34][0-9]\|5[01]` | _24μs_ |
+| `toRegexRange(31, 877)` | `3[1-9]\|[4-9][0-9]\|[1-7][0-9]{2}\|8[0-6][0-9]\|87[0-7]` | _32μs_ |
+| `toRegexRange(5, 5)` | `5` | _8μs_ |
+| `toRegexRange(5, 6)` | `5\|6` | _11μs_ |
+| `toRegexRange(1, 2)` | `1\|2` | _6μs_ |
+| `toRegexRange(1, 5)` | `[1-5]` | _15μs_ |
+| `toRegexRange(1, 10)` | `[1-9]\|10` | _22μs_ |
+| `toRegexRange(1, 100)` | `[1-9]\|[1-9][0-9]\|100` | _25μs_ |
+| `toRegexRange(1, 1000)` | `[1-9]\|[1-9][0-9]{1,2}\|1000` | _31μs_ |
+| `toRegexRange(1, 10000)` | `[1-9]\|[1-9][0-9]{1,3}\|10000` | _34μs_ |
+| `toRegexRange(1, 100000)` | `[1-9]\|[1-9][0-9]{1,4}\|100000` | _36μs_ |
+| `toRegexRange(1, 1000000)` | `[1-9]\|[1-9][0-9]{1,5}\|1000000` | _42μs_ |
+| `toRegexRange(1, 10000000)` | `[1-9]\|[1-9][0-9]{1,6}\|10000000` | _42μs_ |
+
+## Heads up!
+
+**Order of arguments**
+
+When the `min` is larger than the `max`, values will be flipped to create a valid range:
+
+```js
+toRegexRange('51', '29');
+```
+
+Is effectively flipped to:
+
+```js
+toRegexRange('29', '51');
+//=> 29|[3-4][0-9]|5[0-1]
+```
+
+**Steps / increments**
+
+This library does not support steps (increments). A pr to add support would be welcome.
+
+## History
+
+### v2.0.0 - 2017-04-21
+
+**New features**
+
+Adds support for zero-padding!
+
+### v1.0.0
+
+**Optimizations**
+
+Repeating ranges are now grouped using quantifiers. rocessing time is roughly the same, but the generated regex is much smaller, which should result in faster matching.
+
+## Attribution
+
+Inspired by the python library [range-regex](https://github.com/dimka665/range-regex).
+
+## About
+
+
+Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+
+
+
+Running Tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+$ npm install && npm test
+```
+
+
+
+
+Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+
+
+### Related projects
+
+You might also be interested in these projects:
+
+* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by micromatch.")
+* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`")
+* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.")
+* [repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.")
+* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.")
+
+### Contributors
+
+| **Commits** | **Contributor** |
+| --- | --- |
+| 63 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 3 | [doowb](https://github.com/doowb) |
+| 2 | [realityking](https://github.com/realityking) |
+
+### Author
+
+**Jon Schlinkert**
+
+* [GitHub Profile](https://github.com/jonschlinkert)
+* [Twitter Profile](https://twitter.com/jonschlinkert)
+* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
+
+Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)!
+
+
+
+
+
+### License
+
+Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 07, 2019._
\ No newline at end of file
diff --git a/node_modules/to-regex-range/index.js b/node_modules/to-regex-range/index.js
new file mode 100644
index 0000000..77fbace
--- /dev/null
+++ b/node_modules/to-regex-range/index.js
@@ -0,0 +1,288 @@
+/*!
+ * to-regex-range
+ *
+ * Copyright (c) 2015-present, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+'use strict';
+
+const isNumber = require('is-number');
+
+const toRegexRange = (min, max, options) => {
+ if (isNumber(min) === false) {
+ throw new TypeError('toRegexRange: expected the first argument to be a number');
+ }
+
+ if (max === void 0 || min === max) {
+ return String(min);
+ }
+
+ if (isNumber(max) === false) {
+ throw new TypeError('toRegexRange: expected the second argument to be a number.');
+ }
+
+ let opts = { relaxZeros: true, ...options };
+ if (typeof opts.strictZeros === 'boolean') {
+ opts.relaxZeros = opts.strictZeros === false;
+ }
+
+ let relax = String(opts.relaxZeros);
+ let shorthand = String(opts.shorthand);
+ let capture = String(opts.capture);
+ let wrap = String(opts.wrap);
+ let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
+
+ if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
+ return toRegexRange.cache[cacheKey].result;
+ }
+
+ let a = Math.min(min, max);
+ let b = Math.max(min, max);
+
+ if (Math.abs(a - b) === 1) {
+ let result = min + '|' + max;
+ if (opts.capture) {
+ return `(${result})`;
+ }
+ if (opts.wrap === false) {
+ return result;
+ }
+ return `(?:${result})`;
+ }
+
+ let isPadded = hasPadding(min) || hasPadding(max);
+ let state = { min, max, a, b };
+ let positives = [];
+ let negatives = [];
+
+ if (isPadded) {
+ state.isPadded = isPadded;
+ state.maxLen = String(state.max).length;
+ }
+
+ if (a < 0) {
+ let newMin = b < 0 ? Math.abs(b) : 1;
+ negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
+ a = state.a = 0;
+ }
+
+ if (b >= 0) {
+ positives = splitToPatterns(a, b, state, opts);
+ }
+
+ state.negatives = negatives;
+ state.positives = positives;
+ state.result = collatePatterns(negatives, positives, opts);
+
+ if (opts.capture === true) {
+ state.result = `(${state.result})`;
+ } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) {
+ state.result = `(?:${state.result})`;
+ }
+
+ toRegexRange.cache[cacheKey] = state;
+ return state.result;
+};
+
+function collatePatterns(neg, pos, options) {
+ let onlyNegative = filterPatterns(neg, pos, '-', false, options) || [];
+ let onlyPositive = filterPatterns(pos, neg, '', false, options) || [];
+ let intersected = filterPatterns(neg, pos, '-?', true, options) || [];
+ let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
+ return subpatterns.join('|');
+}
+
+function splitToRanges(min, max) {
+ let nines = 1;
+ let zeros = 1;
+
+ let stop = countNines(min, nines);
+ let stops = new Set([max]);
+
+ while (min <= stop && stop <= max) {
+ stops.add(stop);
+ nines += 1;
+ stop = countNines(min, nines);
+ }
+
+ stop = countZeros(max + 1, zeros) - 1;
+
+ while (min < stop && stop <= max) {
+ stops.add(stop);
+ zeros += 1;
+ stop = countZeros(max + 1, zeros) - 1;
+ }
+
+ stops = [...stops];
+ stops.sort(compare);
+ return stops;
+}
+
+/**
+ * Convert a range to a regex pattern
+ * @param {Number} `start`
+ * @param {Number} `stop`
+ * @return {String}
+ */
+
+function rangeToPattern(start, stop, options) {
+ if (start === stop) {
+ return { pattern: start, count: [], digits: 0 };
+ }
+
+ let zipped = zip(start, stop);
+ let digits = zipped.length;
+ let pattern = '';
+ let count = 0;
+
+ for (let i = 0; i < digits; i++) {
+ let [startDigit, stopDigit] = zipped[i];
+
+ if (startDigit === stopDigit) {
+ pattern += startDigit;
+
+ } else if (startDigit !== '0' || stopDigit !== '9') {
+ pattern += toCharacterClass(startDigit, stopDigit, options);
+
+ } else {
+ count++;
+ }
+ }
+
+ if (count) {
+ pattern += options.shorthand === true ? '\\d' : '[0-9]';
+ }
+
+ return { pattern, count: [count], digits };
+}
+
+function splitToPatterns(min, max, tok, options) {
+ let ranges = splitToRanges(min, max);
+ let tokens = [];
+ let start = min;
+ let prev;
+
+ for (let i = 0; i < ranges.length; i++) {
+ let max = ranges[i];
+ let obj = rangeToPattern(String(start), String(max), options);
+ let zeros = '';
+
+ if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
+ if (prev.count.length > 1) {
+ prev.count.pop();
+ }
+
+ prev.count.push(obj.count[0]);
+ prev.string = prev.pattern + toQuantifier(prev.count);
+ start = max + 1;
+ continue;
+ }
+
+ if (tok.isPadded) {
+ zeros = padZeros(max, tok, options);
+ }
+
+ obj.string = zeros + obj.pattern + toQuantifier(obj.count);
+ tokens.push(obj);
+ start = max + 1;
+ prev = obj;
+ }
+
+ return tokens;
+}
+
+function filterPatterns(arr, comparison, prefix, intersection, options) {
+ let result = [];
+
+ for (let ele of arr) {
+ let { string } = ele;
+
+ // only push if _both_ are negative...
+ if (!intersection && !contains(comparison, 'string', string)) {
+ result.push(prefix + string);
+ }
+
+ // or _both_ are positive
+ if (intersection && contains(comparison, 'string', string)) {
+ result.push(prefix + string);
+ }
+ }
+ return result;
+}
+
+/**
+ * Zip strings
+ */
+
+function zip(a, b) {
+ let arr = [];
+ for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
+ return arr;
+}
+
+function compare(a, b) {
+ return a > b ? 1 : b > a ? -1 : 0;
+}
+
+function contains(arr, key, val) {
+ return arr.some(ele => ele[key] === val);
+}
+
+function countNines(min, len) {
+ return Number(String(min).slice(0, -len) + '9'.repeat(len));
+}
+
+function countZeros(integer, zeros) {
+ return integer - (integer % Math.pow(10, zeros));
+}
+
+function toQuantifier(digits) {
+ let [start = 0, stop = ''] = digits;
+ if (stop || start > 1) {
+ return `{${start + (stop ? ',' + stop : '')}}`;
+ }
+ return '';
+}
+
+function toCharacterClass(a, b, options) {
+ return `[${a}${(b - a === 1) ? '' : '-'}${b}]`;
+}
+
+function hasPadding(str) {
+ return /^-?(0+)\d/.test(str);
+}
+
+function padZeros(value, tok, options) {
+ if (!tok.isPadded) {
+ return value;
+ }
+
+ let diff = Math.abs(tok.maxLen - String(value).length);
+ let relax = options.relaxZeros !== false;
+
+ switch (diff) {
+ case 0:
+ return '';
+ case 1:
+ return relax ? '0?' : '0';
+ case 2:
+ return relax ? '0{0,2}' : '00';
+ default: {
+ return relax ? `0{0,${diff}}` : `0{${diff}}`;
+ }
+ }
+}
+
+/**
+ * Cache
+ */
+
+toRegexRange.cache = {};
+toRegexRange.clearCache = () => (toRegexRange.cache = {});
+
+/**
+ * Expose `toRegexRange`
+ */
+
+module.exports = toRegexRange;
diff --git a/node_modules/to-regex-range/package.json b/node_modules/to-regex-range/package.json
new file mode 100644
index 0000000..ee5a7c6
--- /dev/null
+++ b/node_modules/to-regex-range/package.json
@@ -0,0 +1,125 @@
+{
+ "_from": "to-regex-range@^5.0.1",
+ "_id": "to-regex-range@5.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "_location": "/to-regex-range",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "to-regex-range@^5.0.1",
+ "name": "to-regex-range",
+ "escapedName": "to-regex-range",
+ "rawSpec": "^5.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^5.0.1"
+ },
+ "_requiredBy": [
+ "/fill-range"
+ ],
+ "_resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "_shasum": "1648c44aae7c8d988a326018ed72f5b4dd0392e4",
+ "_spec": "to-regex-range@^5.0.1",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/fill-range",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/micromatch/to-regex-range/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Jon Schlinkert",
+ "url": "http://twitter.com/jonschlinkert"
+ },
+ {
+ "name": "Rouven Weßling",
+ "url": "www.rouvenwessling.de"
+ }
+ ],
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "deprecated": false,
+ "description": "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.",
+ "devDependencies": {
+ "fill-range": "^6.0.0",
+ "gulp-format-md": "^2.0.0",
+ "mocha": "^6.0.2",
+ "text-table": "^0.2.0",
+ "time-diff": "^0.3.1"
+ },
+ "engines": {
+ "node": ">=8.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/micromatch/to-regex-range",
+ "keywords": [
+ "bash",
+ "date",
+ "expand",
+ "expansion",
+ "expression",
+ "glob",
+ "match",
+ "match date",
+ "match number",
+ "match numbers",
+ "match year",
+ "matches",
+ "matching",
+ "number",
+ "numbers",
+ "numerical",
+ "range",
+ "ranges",
+ "regex",
+ "regexp",
+ "regular",
+ "regular expression",
+ "sequence"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "to-regex-range",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/micromatch/to-regex-range.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "layout": "default",
+ "toc": false,
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "lint": {
+ "reflinks": true
+ },
+ "helpers": {
+ "examples": {
+ "displayName": "examples"
+ }
+ },
+ "related": {
+ "list": [
+ "expand-range",
+ "fill-range",
+ "micromatch",
+ "repeat-element",
+ "repeat-string"
+ ]
+ }
+ },
+ "version": "5.0.1"
+}
diff --git a/node_modules/toidentifier/package.json b/node_modules/toidentifier/package.json
index 3c978c5..1d5d8b4 100644
--- a/node_modules/toidentifier/package.json
+++ b/node_modules/toidentifier/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"toidentifier@1.0.0",
- "/Users/parksewon/Desktop/HiAlcohol_server"
+ "/Users/kong/Dev/HiAlcohol_server"
]
],
"_from": "toidentifier@1.0.0",
@@ -26,7 +26,7 @@
],
"_resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"_spec": "1.0.0",
- "_where": "/Users/parksewon/Desktop/HiAlcohol_server",
+ "_where": "/Users/kong/Dev/HiAlcohol_server",
"author": {
"name": "Douglas Christopher Wilson",
"email": "doug@somethingdoug.com"
diff --git a/node_modules/touch/LICENSE b/node_modules/touch/LICENSE
new file mode 100644
index 0000000..05eeeb8
--- /dev/null
+++ b/node_modules/touch/LICENSE
@@ -0,0 +1,15 @@
+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.
diff --git a/node_modules/touch/README.md b/node_modules/touch/README.md
new file mode 100644
index 0000000..b5a361e
--- /dev/null
+++ b/node_modules/touch/README.md
@@ -0,0 +1,52 @@
+# node-touch
+
+For all your node touching needs.
+
+## Installing
+
+```bash
+npm install touch
+```
+
+## CLI Usage:
+
+See `man touch`
+
+This package exports a binary called `nodetouch` that works mostly
+like the unix builtin `touch(1)`.
+
+## API Usage:
+
+```javascript
+var touch = require("touch")
+```
+
+Gives you the following functions:
+
+* `touch(filename, options, cb)`
+* `touch.sync(filename, options)`
+* `touch.ftouch(fd, options, cb)`
+* `touch.ftouchSync(fd, options)`
+
+All the `options` objects are optional.
+
+All the async functions return a Promise. If a callback function is
+provided, then it's attached to the Promise.
+
+## Options
+
+* `force` like `touch -f` Boolean
+* `time` like `touch -t ` Can be a Date object, or any parseable
+ Date string, or epoch ms number.
+* `atime` like `touch -a` Can be either a Boolean, or a Date.
+* `mtime` like `touch -m` Can be either a Boolean, or a Date.
+* `ref` like `touch -r ` Must be path to a file.
+* `nocreate` like `touch -c` Boolean
+
+If neither `atime` nor `mtime` are set, then both values are set. If
+one of them is set, then the other is not.
+
+## cli
+
+This package creates a `nodetouch` command line executable that works
+very much like the unix builtin `touch(1)`
diff --git a/node_modules/touch/bin/nodetouch.js b/node_modules/touch/bin/nodetouch.js
new file mode 100755
index 0000000..f78f082
--- /dev/null
+++ b/node_modules/touch/bin/nodetouch.js
@@ -0,0 +1,112 @@
+#!/usr/bin/env node
+const touch = require("../index.js")
+
+const usage = code => {
+ console[code ? 'error' : 'log'](
+ 'usage:\n' +
+ 'touch [-acfm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...'
+ )
+ process.exit(code)
+}
+
+const singleFlags = {
+ a: 'atime',
+ m: 'mtime',
+ c: 'nocreate',
+ f: 'force'
+}
+
+const singleOpts = {
+ r: 'ref',
+ t: 'time'
+}
+
+const files = []
+const args = process.argv.slice(2)
+const options = {}
+for (let i = 0; i < args.length; i++) {
+ const arg = args[i]
+ if (!arg.match(/^-/)) {
+ files.push(arg)
+ continue
+ }
+
+ // expand shorthands
+ if (arg.charAt(1) !== '-') {
+ const expand = []
+ for (let f = 1; f < arg.length; f++) {
+ const fc = arg.charAt(f)
+ const sf = singleFlags[fc]
+ const so = singleOpts[fc]
+ if (sf)
+ expand.push('--' + sf)
+ else if (so) {
+ const soslice = arg.slice(f + 1)
+ const soval = soslice.charAt(0) === '=' ? soslice : '=' + soslice
+ expand.push('--' + so + soval)
+ f = arg.length
+ } else if (arg !== '-' + fc)
+ expand.push('-' + fc)
+ }
+ if (expand.length) {
+ args.splice.apply(args, [i, 1].concat(expand))
+ i--
+ continue
+ }
+ }
+
+ const argsplit = arg.split('=')
+ const key = argsplit.shift().replace(/^\-\-/, '')
+ const val = argsplit.length ? argsplit.join('=') : null
+
+ switch (key) {
+ case 'time':
+ const timestr = val || args[++i]
+ // [-t [[CC]YY]MMDDhhmm[.SS]]
+ const parsedtime = timestr.match(
+ /^(([0-9]{2})?([0-9]{2}))?([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})(\.([0-9]{2}))?$/
+ )
+ if (!parsedtime) {
+ console.error('touch: out of range or illegal ' +
+ 'time specification: ' +
+ '[[CC]YY]MMDDhhmm[.SS]')
+ process.exit(1)
+ } else {
+ const y = +parsedtime[1]
+ const year = parsedtime[2] ? y
+ : y <= 68 ? 2000 + y
+ : 1900 + y
+
+ const MM = +parsedtime[4] - 1
+ const dd = +parsedtime[5]
+ const hh = +parsedtime[6]
+ const mm = +parsedtime[7]
+ const ss = +parsedtime[8]
+
+ options.time = new Date(Date.UTC(year, MM, dd, hh, mm, ss))
+ }
+ continue
+
+ case 'ref':
+ options.ref = val || args[++i]
+ continue
+
+ case 'mtime':
+ case 'nocreate':
+ case 'atime':
+ case 'force':
+ options[key] = true
+ continue
+
+ default:
+ console.error('touch: illegal option -- ' + arg)
+ usage(1)
+ }
+}
+
+if (!files.length)
+ usage()
+
+process.exitCode = 0
+Promise.all(files.map(f => touch(f, options)))
+ .catch(er => process.exitCode = 1)
diff --git a/node_modules/touch/index.js b/node_modules/touch/index.js
new file mode 100644
index 0000000..f942e42
--- /dev/null
+++ b/node_modules/touch/index.js
@@ -0,0 +1,224 @@
+'use strict'
+
+const EE = require('events').EventEmitter
+const cons = require('constants')
+const fs = require('fs')
+
+module.exports = (f, options, cb) => {
+ if (typeof options === 'function')
+ cb = options, options = {}
+
+ const p = new Promise((res, rej) => {
+ new Touch(validOpts(options, f, null))
+ .on('done', res).on('error', rej)
+ })
+
+ return cb ? p.then(res => cb(null, res), cb) : p
+}
+
+module.exports.sync = module.exports.touchSync = (f, options) =>
+ (new TouchSync(validOpts(options, f, null)), undefined)
+
+module.exports.ftouch = (fd, options, cb) => {
+ if (typeof options === 'function')
+ cb = options, options = {}
+
+ const p = new Promise((res, rej) => {
+ new Touch(validOpts(options, null, fd))
+ .on('done', res).on('error', rej)
+ })
+
+ return cb ? p.then(res => cb(null, res), cb) : p
+}
+
+module.exports.ftouchSync = (fd, opt) =>
+ (new TouchSync(validOpts(opt, null, fd)), undefined)
+
+const validOpts = (options, path, fd) => {
+ options = Object.create(options || {})
+ options.fd = fd
+ options.path = path
+
+ // {mtime: true}, {ctime: true}
+ // If set to something else, then treat as epoch ms value
+ const now = parseInt(new Date(options.time || Date.now()).getTime() / 1000)
+ if (!options.atime && !options.mtime)
+ options.atime = options.mtime = now
+ else {
+ if (true === options.atime)
+ options.atime = now
+
+ if (true === options.mtime)
+ options.mtime = now
+ }
+
+ let oflags = 0
+ if (!options.force)
+ oflags = oflags | cons.O_RDWR
+
+ if (!options.nocreate)
+ oflags = oflags | cons.O_CREAT
+
+ options.oflags = oflags
+ return options
+}
+
+class Touch extends EE {
+ constructor (options) {
+ super(options)
+ this.fd = options.fd
+ this.path = options.path
+ this.atime = options.atime
+ this.mtime = options.mtime
+ this.ref = options.ref
+ this.nocreate = !!options.nocreate
+ this.force = !!options.force
+ this.closeAfter = options.closeAfter
+ this.oflags = options.oflags
+ this.options = options
+
+ if (typeof this.fd !== 'number') {
+ this.closeAfter = true
+ this.open()
+ } else
+ this.onopen(null, this.fd)
+ }
+
+ emit (ev, data) {
+ // we only emit when either done or erroring
+ // in both cases, need to close
+ this.close()
+ return super.emit(ev, data)
+ }
+
+ close () {
+ if (typeof this.fd === 'number' && this.closeAfter)
+ fs.close(this.fd, () => {})
+ }
+
+ open () {
+ fs.open(this.path, this.oflags, (er, fd) => this.onopen(er, fd))
+ }
+
+ onopen (er, fd) {
+ if (er) {
+ if (er.code === 'EISDIR')
+ this.onopen(null, null)
+ else if (er.code === 'ENOENT' && this.nocreate)
+ this.emit('done')
+ else
+ this.emit('error', er)
+ } else {
+ this.fd = fd
+ if (this.ref)
+ this.statref()
+ else if (!this.atime || !this.mtime)
+ this.fstat()
+ else
+ this.futimes()
+ }
+ }
+
+ statref () {
+ fs.stat(this.ref, (er, st) => {
+ if (er)
+ this.emit('error', er)
+ else
+ this.onstatref(st)
+ })
+ }
+
+ onstatref (st) {
+ this.atime = this.atime && parseInt(st.atime.getTime()/1000, 10)
+ this.mtime = this.mtime && parseInt(st.mtime.getTime()/1000, 10)
+ if (!this.atime || !this.mtime)
+ this.fstat()
+ else
+ this.futimes()
+ }
+
+ fstat () {
+ const stat = this.fd ? 'fstat' : 'stat'
+ const target = this.fd || this.path
+ fs[stat](target, (er, st) => {
+ if (er)
+ this.emit('error', er)
+ else
+ this.onfstat(st)
+ })
+ }
+
+ onfstat (st) {
+ if (typeof this.atime !== 'number')
+ this.atime = parseInt(st.atime.getTime()/1000, 10)
+
+ if (typeof this.mtime !== 'number')
+ this.mtime = parseInt(st.mtime.getTime()/1000, 10)
+
+ this.futimes()
+ }
+
+ futimes () {
+ const utimes = this.fd ? 'futimes' : 'utimes'
+ const target = this.fd || this.path
+ fs[utimes](target, ''+this.atime, ''+this.mtime, er => {
+ if (er)
+ this.emit('error', er)
+ else
+ this.emit('done')
+ })
+ }
+}
+
+class TouchSync extends Touch {
+ open () {
+ try {
+ this.onopen(null, fs.openSync(this.path, this.oflags))
+ } catch (er) {
+ this.onopen(er)
+ }
+ }
+
+ statref () {
+ let threw = true
+ try {
+ this.onstatref(fs.statSync(this.ref))
+ threw = false
+ } finally {
+ if (threw)
+ this.close()
+ }
+ }
+
+ fstat () {
+ let threw = true
+ const stat = this.fd ? 'fstatSync' : 'statSync'
+ const target = this.fd || this.path
+ try {
+ this.onfstat(fs[stat](target))
+ threw = false
+ } finally {
+ if (threw)
+ this.close()
+ }
+ }
+
+ futimes () {
+ let threw = true
+ const utimes = this.fd ? 'futimesSync' : 'utimesSync'
+ const target = this.fd || this.path
+ try {
+ fs[utimes](target, this.atime, this.mtime)
+ threw = false
+ } finally {
+ if (threw)
+ this.close()
+ }
+ this.emit('done')
+ }
+
+ close () {
+ if (typeof this.fd === 'number' && this.closeAfter)
+ try { fs.closeSync(this.fd) } catch (er) {}
+ }
+}
diff --git a/node_modules/touch/package.json b/node_modules/touch/package.json
new file mode 100644
index 0000000..ca9fcc6
--- /dev/null
+++ b/node_modules/touch/package.json
@@ -0,0 +1,64 @@
+{
+ "_from": "touch@^3.1.0",
+ "_id": "touch@3.1.0",
+ "_inBundle": false,
+ "_integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==",
+ "_location": "/touch",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "touch@^3.1.0",
+ "name": "touch",
+ "escapedName": "touch",
+ "rawSpec": "^3.1.0",
+ "saveSpec": null,
+ "fetchSpec": "^3.1.0"
+ },
+ "_requiredBy": [
+ "/nodemon"
+ ],
+ "_resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
+ "_shasum": "fe365f5f75ec9ed4e56825e0bb76d24ab74af83b",
+ "_spec": "touch@^3.1.0",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/nodemon",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "bin": {
+ "nodetouch": "bin/nodetouch.js"
+ },
+ "bugs": {
+ "url": "https://github.com/isaacs/node-touch/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "nopt": "~1.0.10"
+ },
+ "deprecated": false,
+ "description": "like touch(1) in node",
+ "devDependencies": {
+ "mutate-fs": "^1.1.0",
+ "tap": "^10.7.0"
+ },
+ "files": [
+ "index.js",
+ "bin/nodetouch.js"
+ ],
+ "homepage": "https://github.com/isaacs/node-touch#readme",
+ "license": "ISC",
+ "name": "touch",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-touch.git"
+ },
+ "scripts": {
+ "postpublish": "git push origin --all; git push origin --tags",
+ "postversion": "npm publish",
+ "preversion": "npm test",
+ "test": "tap test/*.js --100 -J"
+ },
+ "version": "3.1.0"
+}
diff --git a/node_modules/type-fest/base.d.ts b/node_modules/type-fest/base.d.ts
new file mode 100644
index 0000000..9005ef9
--- /dev/null
+++ b/node_modules/type-fest/base.d.ts
@@ -0,0 +1,38 @@
+// Types that are compatible with all supported TypeScript versions.
+// It's shared between all TypeScript version-specific definitions.
+
+// Basic
+export * from './source/basic';
+
+// Utilities
+export {Except} from './source/except';
+export {Mutable} from './source/mutable';
+export {Merge} from './source/merge';
+export {MergeExclusive} from './source/merge-exclusive';
+export {RequireAtLeastOne} from './source/require-at-least-one';
+export {RequireExactlyOne} from './source/require-exactly-one';
+export {PartialDeep} from './source/partial-deep';
+export {ReadonlyDeep} from './source/readonly-deep';
+export {LiteralUnion} from './source/literal-union';
+export {Promisable} from './source/promisable';
+export {Opaque} from './source/opaque';
+export {SetOptional} from './source/set-optional';
+export {SetRequired} from './source/set-required';
+export {ValueOf} from './source/value-of';
+export {PromiseValue} from './source/promise-value';
+export {AsyncReturnType} from './source/async-return-type';
+export {ConditionalExcept} from './source/conditional-except';
+export {ConditionalKeys} from './source/conditional-keys';
+export {ConditionalPick} from './source/conditional-pick';
+export {UnionToIntersection} from './source/union-to-intersection';
+export {Stringified} from './source/stringified';
+export {FixedLengthArray} from './source/fixed-length-array';
+export {IterableElement} from './source/iterable-element';
+export {Entry} from './source/entry';
+export {Entries} from './source/entries';
+export {SetReturnType} from './source/set-return-type';
+export {Asyncify} from './source/asyncify';
+
+// Miscellaneous
+export {PackageJson} from './source/package-json';
+export {TsConfigJson} from './source/tsconfig-json';
diff --git a/node_modules/type-fest/index.d.ts b/node_modules/type-fest/index.d.ts
new file mode 100644
index 0000000..206261c
--- /dev/null
+++ b/node_modules/type-fest/index.d.ts
@@ -0,0 +1,2 @@
+// These are all the basic types that's compatible with all supported TypeScript versions.
+export * from './base';
diff --git a/node_modules/type-fest/license b/node_modules/type-fest/license
new file mode 100644
index 0000000..3e4c85a
--- /dev/null
+++ b/node_modules/type-fest/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (https:/sindresorhus.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.
diff --git a/node_modules/type-fest/package.json b/node_modules/type-fest/package.json
new file mode 100644
index 0000000..a63cce8
--- /dev/null
+++ b/node_modules/type-fest/package.json
@@ -0,0 +1,90 @@
+{
+ "_from": "type-fest@^0.20.2",
+ "_id": "type-fest@0.20.2",
+ "_inBundle": false,
+ "_integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+ "_location": "/type-fest",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "type-fest@^0.20.2",
+ "name": "type-fest",
+ "escapedName": "type-fest",
+ "rawSpec": "^0.20.2",
+ "saveSpec": null,
+ "fetchSpec": "^0.20.2"
+ },
+ "_requiredBy": [
+ "/boxen"
+ ],
+ "_resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+ "_shasum": "1bf207f4b28f91583666cb5fbd327887301cd5f4",
+ "_spec": "type-fest@^0.20.2",
+ "_where": "/Users/kong/Dev/HiAlcohol_server/node_modules/boxen",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "https://sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/type-fest/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "A collection of essential TypeScript types",
+ "devDependencies": {
+ "@sindresorhus/tsconfig": "~0.7.0",
+ "tsd": "^0.13.1",
+ "typescript": "^4.1.2",
+ "xo": "^0.35.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "files": [
+ "index.d.ts",
+ "base.d.ts",
+ "source",
+ "ts41"
+ ],
+ "funding": "https://github.com/sponsors/sindresorhus",
+ "homepage": "https://github.com/sindresorhus/type-fest#readme",
+ "keywords": [
+ "typescript",
+ "ts",
+ "types",
+ "utility",
+ "util",
+ "utilities",
+ "omit",
+ "merge",
+ "json"
+ ],
+ "license": "(MIT OR CC0-1.0)",
+ "name": "type-fest",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/type-fest.git"
+ },
+ "scripts": {
+ "//test": "xo && tsd && tsc",
+ "test": "xo && tsc"
+ },
+ "types": "./index.d.ts",
+ "typesVersions": {
+ ">=4.1": {
+ "*": [
+ "ts41/*"
+ ]
+ }
+ },
+ "version": "0.20.2",
+ "xo": {
+ "rules": {
+ "@typescript-eslint/ban-types": "off",
+ "@typescript-eslint/indent": "off",
+ "node/no-unsupported-features/es-builtins": "off"
+ }
+ }
+}
diff --git a/node_modules/type-fest/readme.md b/node_modules/type-fest/readme.md
new file mode 100644
index 0000000..714df78
--- /dev/null
+++ b/node_modules/type-fest/readme.md
@@ -0,0 +1,658 @@
+
+
+
+

+
+
+
A collection of essential TypeScript types
+
+
+
+
+
+
+[](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i)
+
+
+Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
+
+Either add this package as a dependency or copy-paste the needed types. No credit required. 👌
+
+PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first.
+
+## Install
+
+```
+$ npm install type-fest
+```
+
+*Requires TypeScript >=3.4*
+
+## Usage
+
+```ts
+import {Except} from 'type-fest';
+
+type Foo = {
+ unicorn: string;
+ rainbow: boolean;
+};
+
+type FooWithoutRainbow = Except;
+//=> {unicorn: string}
+```
+
+## API
+
+Click the type names for complete docs.
+
+### Basic
+
+- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
+- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
+- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
+- [`JsonObject`](source/basic.d.ts) - Matches a JSON object.
+- [`JsonArray`](source/basic.d.ts) - Matches a JSON array.
+- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value.
+- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
+
+### Utilities
+
+- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type).
+- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly`.
+- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type.
+- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys.
+- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys.
+- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more.
+- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep.
+- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep.
+- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729).
+- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`.
+- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/).
+- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional.
+- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required.
+- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from.
+- [`PromiseValue`](source/promise-value.d.ts) - Returns the type that is wrapped inside a `Promise`.
+- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`.
+- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type.
+- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type.
+- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type.
+- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type.
+- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type.
+- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length.
+- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator.
+- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection.
+- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection.
+- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type.
+- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type.
+
+### Template literal types
+
+*Note:* These require [TypeScript 4.1 or newer](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#template-literal-types).
+
+- [`CamelCase`](ts41/camel-case.d.ts) – Convert a string literal to camel-case (`fooBar`).
+- [`KebabCase`](ts41/kebab-case.d.ts) – Convert a string literal to kebab-case (`foo-bar`).
+- [`PascalCase`](ts41/pascal-case.d.ts) – Converts a string literal to pascal-case (`FooBar`)
+- [`SnakeCase`](ts41/snake-case.d.ts) – Convert a string literal to snake-case (`foo_bar`).
+- [`DelimiterCase`](ts41/delimiter-case.d.ts) – Convert a string literal to a custom string delimiter casing.
+
+### Miscellaneous
+
+- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file).
+- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
+
+## Declined types
+
+*If we decline a type addition, we will make sure to document the better solution here.*
+
+- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider.
+- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now.
+- [`SubType`](https://github.com/sindresorhus/type-fest/issues/22) - The type is powerful, but lacks good use-cases and is prone to misuse.
+- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies.
+
+## Tips
+
+### Built-in types
+
+There are many advanced types most users don't know about.
+
+- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional.
+
+
+ Example
+
+
+ [Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA)
+
+ ```ts
+ interface NodeConfig {
+ appName: string;
+ port: number;
+ }
+
+ class NodeAppBuilder {
+ private configuration: NodeConfig = {
+ appName: 'NodeApp',
+ port: 3000
+ };
+
+ private updateConfig(key: Key, value: NodeConfig[Key]) {
+ this.configuration[key] = value;
+ }
+
+ config(config: Partial) {
+ type NodeConfigKey = keyof NodeConfig;
+
+ for (const key of Object.keys(config) as NodeConfigKey[]) {
+ const updateValue = config[key];
+
+ if (updateValue === undefined) {
+ continue;
+ }
+
+ this.updateConfig(key, updateValue);
+ }
+
+ return this;
+ }
+ }
+
+ // `Partial`` allows us to provide only a part of the
+ // NodeConfig interface.
+ new NodeAppBuilder().config({appName: 'ToDoApp'});
+ ```
+
+
+- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA)
+
+ ```ts
+ interface ContactForm {
+ email?: string;
+ message?: string;
+ }
+
+ function submitContactForm(formData: Required) {
+ // Send the form data to the server.
+ }
+
+ submitContactForm({
+ email: 'ex@mple.com',
+ message: 'Hi! Could you tell me more about…',
+ });
+
+ // TypeScript error: missing property 'message'
+ submitContactForm({
+ email: 'ex@mple.com',
+ });
+ ```
+
+
+- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA)
+
+ ```ts
+ enum LogLevel {
+ Off,
+ Debug,
+ Error,
+ Fatal
+ };
+
+ interface LoggerConfig {
+ name: string;
+ level: LogLevel;
+ }
+
+ class Logger {
+ config: Readonly;
+
+ constructor({name, level}: LoggerConfig) {
+ this.config = {name, level};
+ Object.freeze(this.config);
+ }
+ }
+
+ const config: LoggerConfig = {
+ name: 'MyApp',
+ level: LogLevel.Debug
+ };
+
+ const logger = new Logger(config);
+
+ // TypeScript Error: cannot assign to read-only property.
+ logger.config.level = LogLevel.Error;
+
+ // We are able to edit config variable as we please.
+ config.level = LogLevel.Error;
+ ```
+
+
+- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA)
+
+ ```ts
+ interface Article {
+ title: string;
+ thumbnail: string;
+ content: string;
+ }
+
+ // Creates new type out of the `Article` interface composed
+ // from the Articles' two properties: `title` and `thumbnail`.
+ // `ArticlePreview = {title: string; thumbnail: string}`
+ type ArticlePreview = Pick;
+
+ // Render a list of articles using only title and description.
+ function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement {
+ const articles = document.createElement('div');
+
+ for (const preview of previews) {
+ // Append preview to the articles.
+ }
+
+ return articles;
+ }
+
+ const articles = renderArticlePreviews([
+ {
+ title: 'TypeScript tutorial!',
+ thumbnail: '/assets/ts.jpg'
+ }
+ ]);
+ ```
+
+
+- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA)
+
+ ```ts
+ // Positions of employees in our company.
+ type MemberPosition = 'intern' | 'developer' | 'tech-lead';
+
+ // Interface describing properties of a single employee.
+ interface Employee {
+ firstName: string;
+ lastName: string;
+ yearsOfExperience: number;
+ }
+
+ // Create an object that has all possible `MemberPosition` values set as keys.
+ // Those keys will store a collection of Employees of the same position.
+ const team: Record = {
+ intern: [],
+ developer: [],
+ 'tech-lead': [],
+ };
+
+ // Our team has decided to help John with his dream of becoming Software Developer.
+ team.intern.push({
+ firstName: 'John',
+ lastName: 'Doe',
+ yearsOfExperience: 0
+ });
+
+ // `Record` forces you to initialize all of the property keys.
+ // TypeScript Error: "tech-lead" property is missing
+ const teamEmpty: Record = {
+ intern: null,
+ developer: null,
+ };
+ ```
+
+
+- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA)
+
+ ```ts
+ interface ServerConfig {
+ port: null | string | number;
+ }
+
+ type RequestHandler = (request: Request, response: Response) => void;
+
+ // Exclude `null` type from `null | string | number`.
+ // In case the port is equal to `null`, we will use default value.
+ function getPortValue(port: Exclude): number {
+ if (typeof port === 'string') {
+ return parseInt(port, 10);
+ }
+
+ return port;
+ }
+
+ function startServer(handler: RequestHandler, config: ServerConfig): void {
+ const server = require('http').createServer(handler);
+
+ const port = config.port === null ? 3000 : getPortValue(config.port);
+ server.listen(port);
+ }
+ ```
+
+
+- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA)
+
+ ```ts
+ declare function uniqueId(): number;
+
+ const ID = Symbol('ID');
+
+ interface Person {
+ [ID]: number;
+ name: string;
+ age: number;
+ }
+
+ // Allows changing the person data as long as the property key is of string type.
+ function changePersonData<
+ Obj extends Person,
+ Key extends Extract,
+ Value extends Obj[Key]
+ > (obj: Obj, key: Key, value: Value): void {
+ obj[key] = value;
+ }
+
+ // Tiny Andrew was born.
+ const andrew = {
+ [ID]: uniqueId(),
+ name: 'Andrew',
+ age: 0,
+ };
+
+ // Cool, we're fine with that.
+ changePersonData(andrew, 'name', 'Pony');
+
+ // Goverment didn't like the fact that you wanted to change your identity.
+ changePersonData(andrew, ID, uniqueId());
+ ```
+
+
+- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`.
+
+
+ Example
+
+ Works with strictNullChecks set to true. (Read more here)
+
+ [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA)
+
+ ```ts
+ type PortNumber = string | number | null;
+
+ /** Part of a class definition that is used to build a server */
+ class ServerBuilder {
+ portNumber!: NonNullable;
+
+ port(this: ServerBuilder, port: PortNumber): ServerBuilder {
+ if (port == null) {
+ this.portNumber = 8000;
+ } else {
+ this.portNumber = port;
+ }
+
+ return this;
+ }
+ }
+
+ const serverBuilder = new ServerBuilder();
+
+ serverBuilder
+ .port('8000') // portNumber = '8000'
+ .port(null) // portNumber = 8000
+ .port(3000); // portNumber = 3000
+
+ // TypeScript error
+ serverBuilder.portNumber = null;
+ ```
+
+
+- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA)
+
+ ```ts
+ function shuffle(input: any[]): void {
+ // Mutate array randomly changing its' elements indexes.
+ }
+
+ function callNTimes any> (func: Fn, callCount: number) {
+ // Type that represents the type of the received function parameters.
+ type FunctionParameters = Parameters;
+
+ return function (...args: FunctionParameters) {
+ for (let i = 0; i < callCount; i++) {
+ func(...args);
+ }
+ }
+ }
+
+ const shuffleTwice = callNTimes(shuffle, 2);
+ ```
+
+
+- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA)
+
+ ```ts
+ class ArticleModel {
+ title: string;
+ content?: string;
+
+ constructor(title: string) {
+ this.title = title;
+ }
+ }
+
+ class InstanceCache any)> {
+ private ClassConstructor: T;
+ private cache: Map> = new Map();
+
+ constructor (ctr: T) {
+ this.ClassConstructor = ctr;
+ }
+
+ getInstance (...args: ConstructorParameters): InstanceType {
+ const hash = this.calculateArgumentsHash(...args);
+
+ const existingInstance = this.cache.get(hash);
+ if (existingInstance !== undefined) {
+ return existingInstance;
+ }
+
+ return new this.ClassConstructor(...args);
+ }
+
+ private calculateArgumentsHash(...args: any[]): string {
+ // Calculate hash.
+ return 'hash';
+ }
+ }
+
+ const articleCache = new InstanceCache(ArticleModel);
+ const amazonArticle = articleCache.getInstance('Amazon forests burining!');
+ ```
+
+
+- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)
+
+ ```ts
+ /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */
+ function mapIter<
+ Elem,
+ Func extends (elem: Elem) => any,
+ Ret extends ReturnType
+ >(iter: Iterable, callback: Func): Ret[] {
+ const mapped: Ret[] = [];
+
+ for (const elem of iter) {
+ mapped.push(callback(elem));
+ }
+
+ return mapped;
+ }
+
+ const setObject: Set = new Set();
+ const mapObject: Map = new Map();
+
+ mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[]
+
+ mapIter(mapObject, ([key, value]: [number, string]) => {
+ return key % 2 === 0 ? value : 'Odd';
+ }); // string[]
+ ```
+
+
+- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)
+
+ ```ts
+ class IdleService {
+ doNothing (): void {}
+ }
+
+ class News {
+ title: string;
+ content: string;
+
+ constructor(title: string, content: string) {
+ this.title = title;
+ this.content = content;
+ }
+ }
+
+ const instanceCounter: Map = new Map();
+
+ interface Constructor {
+ new(...args: any[]): any;
+ }
+
+ // Keep track how many instances of `Constr` constructor have been created.
+ function getInstance<
+ Constr extends Constructor,
+ Args extends ConstructorParameters
+ >(constructor: Constr, ...args: Args): InstanceType {
+ let count = instanceCounter.get(constructor) || 0;
+
+ const instance = new constructor(...args);
+
+ instanceCounter.set(constructor, count + 1);
+
+ console.log(`Created ${count + 1} instances of ${Constr.name} class`);
+
+ return instance;
+ }
+
+
+ const idleService = getInstance(IdleService);
+ // Will log: `Created 1 instances of IdleService class`
+ const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...');
+ // Will log: `Created 1 instances of News class`
+ ```
+
+
+- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K.
+
+
+ Example
+
+
+ [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA)
+
+ ```ts
+ interface Animal {
+ imageUrl: string;
+ species: string;
+ images: string[];
+ paragraphs: string[];
+ }
+
+ // Creates new type with all properties of the `Animal` interface
+ // except 'images' and 'paragraphs' properties. We can use this
+ // type to render small hover tooltip for a wiki entry list.
+ type AnimalShortInfo = Omit;
+
+ function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement {
+ const container = document.createElement('div');
+ // Internal implementation.
+ return container;
+ }
+ ```
+
+
+You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types).
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Jarek Radosz](https://github.com/CvX)
+- [Dimitri Benin](https://github.com/BendingBender)
+- [Pelle Wessman](https://github.com/voxpelli)
+
+## License
+
+(MIT OR CC0-1.0)
+
+---
+
+
diff --git a/node_modules/type-fest/source/async-return-type.d.ts b/node_modules/type-fest/source/async-return-type.d.ts
new file mode 100644
index 0000000..79ec1e9
--- /dev/null
+++ b/node_modules/type-fest/source/async-return-type.d.ts
@@ -0,0 +1,23 @@
+import {PromiseValue} from './promise-value';
+
+type AsyncFunction = (...args: any[]) => Promise;
+
+/**
+Unwrap the return type of a function that returns a `Promise`.
+
+There has been [discussion](https://github.com/microsoft/TypeScript/pull/35998) about implementing this type in TypeScript.
+
+@example
+```ts
+import {AsyncReturnType} from 'type-fest';
+import {asyncFunction} from 'api';
+
+// This type resolves to the unwrapped return type of `asyncFunction`.
+type Value = AsyncReturnType;
+
+async function doSomething(value: Value) {}
+
+asyncFunction().then(value => doSomething(value));
+```
+*/
+export type AsyncReturnType = PromiseValue>;
diff --git a/node_modules/type-fest/source/asyncify.d.ts b/node_modules/type-fest/source/asyncify.d.ts
new file mode 100644
index 0000000..455f2eb
--- /dev/null
+++ b/node_modules/type-fest/source/asyncify.d.ts
@@ -0,0 +1,31 @@
+import {PromiseValue} from './promise-value';
+import {SetReturnType} from './set-return-type';
+
+/**
+Create an async version of the given function type, by boxing the return type in `Promise` while keeping the same parameter types.
+
+Use-case: You have two functions, one synchronous and one asynchronous that do the same thing. Instead of having to duplicate the type definition, you can use `Asyncify` to reuse the synchronous type.
+
+@example
+```
+import {Asyncify} from 'type-fest';
+
+// Synchronous function.
+function getFooSync(someArg: SomeType): Foo {
+ // …
+}
+
+type AsyncifiedFooGetter = Asyncify;
+//=> type AsyncifiedFooGetter = (someArg: SomeType) => Promise;
+
+// Same as `getFooSync` but asynchronous.
+const getFooAsync: AsyncifiedFooGetter = (someArg) => {
+ // TypeScript now knows that `someArg` is `SomeType` automatically.
+ // It also knows that this function must return `Promise`.
+ // If you have `@typescript-eslint/promise-function-async` linter rule enabled, it will even report that "Functions that return promises must be async.".
+
+ // …
+}
+```
+*/
+export type Asyncify any> = SetReturnType>>>;
diff --git a/node_modules/type-fest/source/basic.d.ts b/node_modules/type-fest/source/basic.d.ts
new file mode 100644
index 0000000..d380c8b
--- /dev/null
+++ b/node_modules/type-fest/source/basic.d.ts
@@ -0,0 +1,67 @@
+///
+
+// TODO: This can just be `export type Primitive = not object` when the `not` keyword is out.
+/**
+Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
+*/
+export type Primitive =
+ | null
+ | undefined
+ | string
+ | number
+ | boolean
+ | symbol
+ | bigint;
+
+// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default
+/**
+Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
+*/
+export type Class = new(...arguments_: Arguments) => T;
+
+/**
+Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
+*/
+export type TypedArray =
+ | Int8Array
+ | Uint8Array
+ | Uint8ClampedArray
+ | Int16Array
+ | Uint16Array
+ | Int32Array
+ | Uint32Array
+ | Float32Array
+ | Float64Array
+ | BigInt64Array
+ | BigUint64Array;
+
+/**
+Matches a JSON object.
+
+This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
+*/
+export type JsonObject = {[Key in string]?: JsonValue};
+
+/**
+Matches a JSON array.
+*/
+export interface JsonArray extends Array {}
+
+/**
+Matches any valid JSON value.
+*/
+export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
+
+declare global {
+ interface SymbolConstructor {
+ readonly observable: symbol;
+ }
+}
+
+/**
+Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
+*/
+export interface ObservableLike {
+ subscribe(observer: (value: unknown) => void): void;
+ [Symbol.observable](): ObservableLike;
+}
diff --git a/node_modules/type-fest/source/conditional-except.d.ts b/node_modules/type-fest/source/conditional-except.d.ts
new file mode 100644
index 0000000..ac506cc
--- /dev/null
+++ b/node_modules/type-fest/source/conditional-except.d.ts
@@ -0,0 +1,43 @@
+import {Except} from './except';
+import {ConditionalKeys} from './conditional-keys';
+
+/**
+Exclude keys from a shape that matches the given `Condition`.
+
+This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
+
+@example
+```
+import {Primitive, ConditionalExcept} from 'type-fest';
+
+class Awesome {
+ name: string;
+ successes: number;
+ failures: bigint;
+
+ run() {}
+}
+
+type ExceptPrimitivesFromAwesome = ConditionalExcept;
+//=> {run: () => void}
+```
+
+@example
+```
+import {ConditionalExcept} from 'type-fest';
+
+interface Example {
+ a: string;
+ b: string | number;
+ c: () => void;
+ d: {};
+}
+
+type NonStringKeysOnly = ConditionalExcept;
+//=> {b: string | number; c: () => void; d: {}}
+```
+*/
+export type ConditionalExcept = Except<
+ Base,
+ ConditionalKeys
+>;
diff --git a/node_modules/type-fest/source/conditional-keys.d.ts b/node_modules/type-fest/source/conditional-keys.d.ts
new file mode 100644
index 0000000..eb074dc
--- /dev/null
+++ b/node_modules/type-fest/source/conditional-keys.d.ts
@@ -0,0 +1,43 @@
+/**
+Extract the keys from a type where the value type of the key extends the given `Condition`.
+
+Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
+
+@example
+```
+import {ConditionalKeys} from 'type-fest';
+
+interface Example {
+ a: string;
+ b: string | number;
+ c?: string;
+ d: {};
+}
+
+type StringKeysOnly = ConditionalKeys;
+//=> 'a'
+```
+
+To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
+
+@example
+```
+type StringKeysAndUndefined = ConditionalKeys;
+//=> 'a' | 'c'
+```
+*/
+export type ConditionalKeys = NonNullable<
+ // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
+ {
+ // Map through all the keys of the given base type.
+ [Key in keyof Base]:
+ // Pick only keys with types extending the given `Condition` type.
+ Base[Key] extends Condition
+ // Retain this key since the condition passes.
+ ? Key
+ // Discard this key since the condition fails.
+ : never;
+
+ // Convert the produced object into a union type of the keys which passed the conditional test.
+ }[keyof Base]
+>;
diff --git a/node_modules/type-fest/source/conditional-pick.d.ts b/node_modules/type-fest/source/conditional-pick.d.ts
new file mode 100644
index 0000000..cecc3df
--- /dev/null
+++ b/node_modules/type-fest/source/conditional-pick.d.ts
@@ -0,0 +1,42 @@
+import {ConditionalKeys} from './conditional-keys';
+
+/**
+Pick keys from the shape that matches the given `Condition`.
+
+This is useful when you want to create a new type from a specific subset of an existing type. For example, you might want to pick all the primitive properties from a class and form a new automatically derived type.
+
+@example
+```
+import {Primitive, ConditionalPick} from 'type-fest';
+
+class Awesome {
+ name: string;
+ successes: number;
+ failures: bigint;
+
+ run() {}
+}
+
+type PickPrimitivesFromAwesome = ConditionalPick;
+//=> {name: string; successes: number; failures: bigint}
+```
+
+@example
+```
+import {ConditionalPick} from 'type-fest';
+
+interface Example {
+ a: string;
+ b: string | number;
+ c: () => void;
+ d: {};
+}
+
+type StringKeysOnly = ConditionalPick;
+//=> {a: string}
+```
+*/
+export type ConditionalPick = Pick<
+ Base,
+ ConditionalKeys
+>;
diff --git a/node_modules/type-fest/source/entries.d.ts b/node_modules/type-fest/source/entries.d.ts
new file mode 100644
index 0000000..e02237a
--- /dev/null
+++ b/node_modules/type-fest/source/entries.d.ts
@@ -0,0 +1,57 @@
+import {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry';
+
+type ArrayEntries = Array>;
+type MapEntries = Array>;
+type ObjectEntries = Array>;
+type SetEntries> = Array>;
+
+/**
+Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries.
+
+For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable.
+
+@see `Entry` if you want to just access the type of a single entry.
+
+@example
+```
+import {Entries} from 'type-fest';
+
+interface Example {
+ someKey: number;
+}
+
+const manipulatesEntries = (examples: Entries) => examples.map(example => [
+ // Does some arbitrary processing on the key (with type information available)
+ example[0].toUpperCase(),
+
+ // Does some arbitrary processing on the value (with type information available)
+ example[1].toFixed()
+]);
+
+const example: Example = {someKey: 1};
+const entries = Object.entries(example) as Entries;
+const output = manipulatesEntries(entries);
+
+// Objects
+const objectExample = {a: 1};
+const objectEntries: Entries = [['a', 1]];
+
+// Arrays
+const arrayExample = ['a', 1];
+const arrayEntries: Entries = [[0, 'a'], [1, 1]];
+
+// Maps
+const mapExample = new Map([['a', 1]]);
+const mapEntries: Entries = [['a', 1]];
+
+// Sets
+const setExample = new Set(['a', 1]);
+const setEntries: Entries = [['a', 'a'], [1, 1]];
+```
+*/
+export type Entries =
+ BaseType extends Map ? MapEntries
+ : BaseType extends Set ? SetEntries
+ : BaseType extends unknown[] ? ArrayEntries
+ : BaseType extends object ? ObjectEntries
+ : never;
diff --git a/node_modules/type-fest/source/entry.d.ts b/node_modules/type-fest/source/entry.d.ts
new file mode 100644
index 0000000..41a13a9
--- /dev/null
+++ b/node_modules/type-fest/source/entry.d.ts
@@ -0,0 +1,60 @@
+type MapKey = BaseType extends Map ? KeyType : never;
+type MapValue = BaseType extends Map ? ValueType : never;
+
+export type ArrayEntry = [number, BaseType[number]];
+export type MapEntry = [MapKey, MapValue];
+export type ObjectEntry = [keyof BaseType, BaseType[keyof BaseType]];
+export type SetEntry = BaseType extends Set ? [ItemType, ItemType] : never;
+
+/**
+Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry.
+
+For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable.
+
+@see `Entries` if you want to just access the type of the array of entries (which is the return of the `.entries()` method).
+
+@example
+```
+import {Entry} from 'type-fest';
+
+interface Example {
+ someKey: number;
+}
+
+const manipulatesEntry = (example: Entry) => [
+ // Does some arbitrary processing on the key (with type information available)
+ example[0].toUpperCase(),
+
+ // Does some arbitrary processing on the value (with type information available)
+ example[1].toFixed(),
+];
+
+const example: Example = {someKey: 1};
+const entry = Object.entries(example)[0] as Entry;
+const output = manipulatesEntry(entry);
+
+// Objects
+const objectExample = {a: 1};
+const objectEntry: Entry = ['a', 1];
+
+// Arrays
+const arrayExample = ['a', 1];
+const arrayEntryString: Entry = [0, 'a'];
+const arrayEntryNumber: Entry = [1, 1];
+
+// Maps
+const mapExample = new Map([['a', 1]]);
+const mapEntry: Entry = ['a', 1];
+
+// Sets
+const setExample = new Set(['a', 1]);
+const setEntryString: Entry = ['a', 'a'];
+const setEntryNumber: Entry = [1, 1];
+```
+*/
+export type Entry =
+ BaseType extends Map ? MapEntry
+ : BaseType extends Set ? SetEntry
+ : BaseType extends unknown[] ? ArrayEntry
+ : BaseType extends object ? ObjectEntry
+ : never;
diff --git a/node_modules/type-fest/source/except.d.ts b/node_modules/type-fest/source/except.d.ts
new file mode 100644
index 0000000..7dedbaa
--- /dev/null
+++ b/node_modules/type-fest/source/except.d.ts
@@ -0,0 +1,22 @@
+/**
+Create a type from an object type without certain keys.
+
+This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
+
+Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/30825) if you want to have the stricter version as a built-in in TypeScript.
+
+@example
+```
+import {Except} from 'type-fest';
+
+type Foo = {
+ a: number;
+ b: string;
+ c: boolean;
+};
+
+type FooWithoutA = Except;
+//=> {b: string};
+```
+*/
+export type Except = Pick>;
diff --git a/node_modules/type-fest/source/fixed-length-array.d.ts b/node_modules/type-fest/source/fixed-length-array.d.ts
new file mode 100644
index 0000000..e3bc0f4
--- /dev/null
+++ b/node_modules/type-fest/source/fixed-length-array.d.ts
@@ -0,0 +1,38 @@
+/**
+Methods to exclude.
+*/
+type ArrayLengthMutationKeys = 'splice' | 'push' | 'pop' | 'shift' | 'unshift';
+
+/**
+Create a type that represents an array of the given type and length. The array's length and the `Array` prototype methods that manipulate its length are excluded in the resulting type.
+
+Please participate in [this issue](https://github.com/microsoft/TypeScript/issues/26223) if you want to have a similiar type built into TypeScript.
+
+Use-cases:
+- Declaring fixed-length tuples or arrays with a large number of items.
+- Creating a range union (for example, `0 | 1 | 2 | 3 | 4` from the keys of such a type) without having to resort to recursive types.
+- Creating an array of coordinates with a static length, for example, length of 3 for a 3D vector.
+
+@example
+```
+import {FixedLengthArray} from 'type-fest';
+
+type FencingTeam = FixedLengthArray;
+
+const guestFencingTeam: FencingTeam = ['Josh', 'Michael', 'Robert'];
+
+const homeFencingTeam: FencingTeam = ['George', 'John'];
+//=> error TS2322: Type string[] is not assignable to type 'FencingTeam'
+
+guestFencingTeam.push('Sam');
+//=> error TS2339: Property 'push' does not exist on type 'FencingTeam'
+```
+*/
+export type FixedLengthArray = Pick<
+ ArrayPrototype,
+ Exclude
+> & {
+ [index: number]: Element;
+ [Symbol.iterator]: () => IterableIterator;
+ readonly length: Length;
+};
diff --git a/node_modules/type-fest/source/iterable-element.d.ts b/node_modules/type-fest/source/iterable-element.d.ts
new file mode 100644
index 0000000..174cfbf
--- /dev/null
+++ b/node_modules/type-fest/source/iterable-element.d.ts
@@ -0,0 +1,46 @@
+/**
+Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator.
+
+This can be useful, for example, if you want to get the type that is yielded in a generator function. Often the return type of those functions are not specified.
+
+This type works with both `Iterable`s and `AsyncIterable`s, so it can be use with synchronous and asynchronous generators.
+
+Here is an example of `IterableElement` in action with a generator function:
+
+@example
+```
+function * iAmGenerator() {
+ yield 1;
+ yield 2;
+}
+
+type MeNumber = IterableElement>
+```
+
+And here is an example with an async generator:
+
+@example
+```
+async function * iAmGeneratorAsync() {
+ yield 'hi';
+ yield true;
+}
+
+type MeStringOrBoolean = IterableElement>
+```
+
+Many types in JavaScript/TypeScript are iterables. This type works on all types that implement those interfaces. For example, `Array`, `Set`, `Map`, `stream.Readable`, etc.
+
+An example with an array of strings:
+
+@example
+```
+type MeString = IterableElement
+```
+*/
+export type IterableElement =
+ TargetIterable extends Iterable ?
+ ElementType :
+ TargetIterable extends AsyncIterable ?
+ ElementType :
+ never;
diff --git a/node_modules/type-fest/source/literal-union.d.ts b/node_modules/type-fest/source/literal-union.d.ts
new file mode 100644
index 0000000..8debd93
--- /dev/null
+++ b/node_modules/type-fest/source/literal-union.d.ts
@@ -0,0 +1,33 @@
+import {Primitive} from './basic';
+
+/**
+Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
+
+Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
+
+This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
+
+@example
+```
+import {LiteralUnion} from 'type-fest';
+
+// Before
+
+type Pet = 'dog' | 'cat' | string;
+
+const pet: Pet = '';
+// Start typing in your TypeScript-enabled IDE.
+// You **will not** get auto-completion for `dog` and `cat` literals.
+
+// After
+
+type Pet2 = LiteralUnion<'dog' | 'cat', string>;
+
+const pet: Pet2 = '';
+// You **will** get auto-completion for `dog` and `cat` literals.
+```
+ */
+export type LiteralUnion<
+ LiteralType,
+ BaseType extends Primitive
+> = LiteralType | (BaseType & {_?: never});
diff --git a/node_modules/type-fest/source/merge-exclusive.d.ts b/node_modules/type-fest/source/merge-exclusive.d.ts
new file mode 100644
index 0000000..059bd2c
--- /dev/null
+++ b/node_modules/type-fest/source/merge-exclusive.d.ts
@@ -0,0 +1,39 @@
+// Helper type. Not useful on its own.
+type Without = {[KeyType in Exclude]?: never};
+
+/**
+Create a type that has mutually exclusive keys.
+
+This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604).
+
+This type works with a helper type, called `Without`. `Without` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`.
+
+@example
+```
+import {MergeExclusive} from 'type-fest';
+
+interface ExclusiveVariation1 {
+ exclusive1: boolean;
+}
+
+interface ExclusiveVariation2 {
+ exclusive2: string;
+}
+
+type ExclusiveOptions = MergeExclusive;
+
+let exclusiveOptions: ExclusiveOptions;
+
+exclusiveOptions = {exclusive1: true};
+//=> Works
+exclusiveOptions = {exclusive2: 'hi'};
+//=> Works
+exclusiveOptions = {exclusive1: true, exclusive2: 'hi'};
+//=> Error
+```
+*/
+export type MergeExclusive =
+ (FirstType | SecondType) extends object ?
+ (Without & SecondType) | (Without & FirstType) :
+ FirstType | SecondType;
+
diff --git a/node_modules/type-fest/source/merge.d.ts b/node_modules/type-fest/source/merge.d.ts
new file mode 100644
index 0000000..4b3920b
--- /dev/null
+++ b/node_modules/type-fest/source/merge.d.ts
@@ -0,0 +1,22 @@
+import {Except} from './except';
+
+/**
+Merge two types into a new type. Keys of the second type overrides keys of the first type.
+
+@example
+```
+import {Merge} from 'type-fest';
+
+type Foo = {
+ a: number;
+ b: string;
+};
+
+type Bar = {
+ b: number;
+};
+
+const ab: Merge = {a: 1, b: 2};
+```
+*/
+export type Merge = Except> & SecondType;
diff --git a/node_modules/type-fest/source/mutable.d.ts b/node_modules/type-fest/source/mutable.d.ts
new file mode 100644
index 0000000..03d0dda
--- /dev/null
+++ b/node_modules/type-fest/source/mutable.d.ts
@@ -0,0 +1,22 @@
+/**
+Convert an object with `readonly` keys into a mutable object. Inverse of `Readonly`.
+
+This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), and [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509).
+
+@example
+```
+import {Mutable} from 'type-fest';
+
+type Foo = {
+ readonly a: number;
+ readonly b: string;
+};
+
+const mutableFoo: Mutable = {a: 1, b: '2'};
+mutableFoo.a = 3;
+```
+*/
+export type Mutable = {
+ // For each `Key` in the keys of `ObjectType`, make a mapped type by removing the `readonly` modifier from the key.
+ -readonly [KeyType in keyof ObjectType]: ObjectType[KeyType];
+};
diff --git a/node_modules/type-fest/source/opaque.d.ts b/node_modules/type-fest/source/opaque.d.ts
new file mode 100644
index 0000000..20ab964
--- /dev/null
+++ b/node_modules/type-fest/source/opaque.d.ts
@@ -0,0 +1,65 @@
+/**
+Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly.
+
+The generic type parameter can be anything. It doesn't have to be an object.
+
+[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/)
+
+There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward:
+ - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408)
+ - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807)
+
+@example
+```
+import {Opaque} from 'type-fest';
+
+type AccountNumber = Opaque;
+type AccountBalance = Opaque;
+
+// The Token parameter allows the compiler to differentiate between types, whereas "unknown" will not. For example, consider the following structures:
+type ThingOne = Opaque;
+type ThingTwo = Opaque;
+
+// To the compiler, these types are allowed to be cast to each other as they have the same underlying type. They are both `string & { __opaque__: unknown }`.
+// To avoid this behaviour, you would instead pass the "Token" parameter, like so.
+type NewThingOne = Opaque;
+type NewThingTwo = Opaque;
+
+// Now they're completely separate types, so the following will fail to compile.
+function createNewThingOne (): NewThingOne {
+ // As you can see, casting from a string is still allowed. However, you may not cast NewThingOne to NewThingTwo, and vice versa.
+ return 'new thing one' as NewThingOne;
+}
+
+// This will fail to compile, as they are fundamentally different types.
+const thingTwo = createNewThingOne() as NewThingTwo;
+
+// Here's another example of opaque typing.
+function createAccountNumber(): AccountNumber {
+ return 2 as AccountNumber;
+}
+
+function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance {
+ return 4 as AccountBalance;
+}
+
+// This will compile successfully.
+getMoneyForAccount(createAccountNumber());
+
+// But this won't, because it has to be explicitly passed as an `AccountNumber` type.
+getMoneyForAccount(2);
+
+// You can use opaque values like they aren't opaque too.
+const accountNumber = createAccountNumber();
+
+// This will not compile successfully.
+const newAccountNumber = accountNumber + 2;
+
+// As a side note, you can (and should) use recursive types for your opaque types to make them stronger and hopefully easier to type.
+type Person = {
+ id: Opaque;
+ name: string;
+};
+```
+*/
+export type Opaque = Type & {readonly __opaque__: Token};
diff --git a/node_modules/type-fest/source/package-json.d.ts b/node_modules/type-fest/source/package-json.d.ts
new file mode 100644
index 0000000..cf355d0
--- /dev/null
+++ b/node_modules/type-fest/source/package-json.d.ts
@@ -0,0 +1,611 @@
+import {LiteralUnion} from './literal-union';
+
+declare namespace PackageJson {
+ /**
+ A person who has been involved in creating or maintaining the package.
+ */
+ export type Person =
+ | string
+ | {
+ name: string;
+ url?: string;
+ email?: string;
+ };
+
+ export type BugsLocation =
+ | string
+ | {
+ /**
+ The URL to the package's issue tracker.
+ */
+ url?: string;
+
+ /**
+ The email address to which issues should be reported.
+ */
+ email?: string;
+ };
+
+ export interface DirectoryLocations {
+ [directoryType: string]: unknown;
+
+ /**
+ Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder.
+ */
+ bin?: string;
+
+ /**
+ Location for Markdown files.
+ */
+ doc?: string;
+
+ /**
+ Location for example scripts.
+ */
+ example?: string;
+
+ /**
+ Location for the bulk of the library.
+ */
+ lib?: string;
+
+ /**
+ Location for man pages. Sugar to generate a `man` array by walking the folder.
+ */
+ man?: string;
+
+ /**
+ Location for test files.
+ */
+ test?: string;
+ }
+
+ export type Scripts = {
+ /**
+ Run **before** the package is published (Also run on local `npm install` without any arguments).
+ */
+ prepublish?: string;
+
+ /**
+ Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`.
+ */
+ prepare?: string;
+
+ /**
+ Run **before** the package is prepared and packed, **only** on `npm publish`.
+ */
+ prepublishOnly?: string;
+
+ /**
+ Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies).
+ */
+ prepack?: string;
+
+ /**
+ Run **after** the tarball has been generated and moved to its final destination.
+ */
+ postpack?: string;
+
+ /**
+ Run **after** the package is published.
+ */
+ publish?: string;
+
+ /**
+ Run **after** the package is published.
+ */
+ postpublish?: string;
+
+ /**
+ Run **before** the package is installed.
+ */
+ preinstall?: string;
+
+ /**
+ Run **after** the package is installed.
+ */
+ install?: string;
+
+ /**
+ Run **after** the package is installed and after `install`.
+ */
+ postinstall?: string;
+
+ /**
+ Run **before** the package is uninstalled and before `uninstall`.
+ */
+ preuninstall?: string;
+
+ /**
+ Run **before** the package is uninstalled.
+ */
+ uninstall?: string;
+
+ /**
+ Run **after** the package is uninstalled.
+ */
+ postuninstall?: string;
+
+ /**
+ Run **before** bump the package version and before `version`.
+ */
+ preversion?: string;
+
+ /**
+ Run **before** bump the package version.
+ */
+ version?: string;
+
+ /**
+ Run **after** bump the package version.
+ */
+ postversion?: string;
+
+ /**
+ Run with the `npm test` command, before `test`.
+ */
+ pretest?: string;
+
+ /**
+ Run with the `npm test` command.
+ */
+ test?: string;
+
+ /**
+ Run with the `npm test` command, after `test`.
+ */
+ posttest?: string;
+
+ /**
+ Run with the `npm stop` command, before `stop`.
+ */
+ prestop?: string;
+
+ /**
+ Run with the `npm stop` command.
+ */
+ stop?: string;
+
+ /**
+ Run with the `npm stop` command, after `stop`.
+ */
+ poststop?: string;
+
+ /**
+ Run with the `npm start` command, before `start`.
+ */
+ prestart?: string;
+
+ /**
+ Run with the `npm start` command.
+ */
+ start?: string;
+
+ /**
+ Run with the `npm start` command, after `start`.
+ */
+ poststart?: string;
+
+ /**
+ Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
+ */
+ prerestart?: string;
+
+ /**
+ Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
+ */
+ restart?: string;
+
+ /**
+ Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
+ */
+ postrestart?: string;
+ } & Record;
+
+ /**
+ Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL.
+ */
+ export type Dependency = Record;
+
+ /**
+ Conditions which provide a way to resolve a package entry point based on the environment.
+ */
+ export type ExportCondition = LiteralUnion<
+ | 'import'
+ | 'require'
+ | 'node'
+ | 'deno'
+ | 'browser'
+ | 'electron'
+ | 'react-native'
+ | 'default',
+ string
+ >;
+
+ /**
+ Entry points of a module, optionally with conditions and subpath exports.
+ */
+ export type Exports =
+ | string
+ | {[key in ExportCondition]: Exports}
+ | {[key: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
+
+ export interface NonStandardEntryPoints {
+ /**
+ An ECMAScript module ID that is the primary entry point to the program.
+ */
+ module?: string;
+
+ /**
+ A module ID with untranspiled code that is the primary entry point to the program.
+ */
+ esnext?:
+ | string
+ | {
+ [moduleName: string]: string | undefined;
+ main?: string;
+ browser?: string;
+ };
+
+ /**
+ A hint to JavaScript bundlers or component tools when packaging modules for client side use.
+ */
+ browser?:
+ | string
+ | Record;
+
+ /**
+ Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
+
+ [Read more.](https://webpack.js.org/guides/tree-shaking/)
+ */
+ sideEffects?: boolean | string[];
+ }
+
+ export interface TypeScriptConfiguration {
+ /**
+ Location of the bundled TypeScript declaration file.
+ */
+ types?: string;
+
+ /**
+ Location of the bundled TypeScript declaration file. Alias of `types`.
+ */
+ typings?: string;
+ }
+
+ /**
+ An alternative configuration for Yarn workspaces.
+ */
+ export interface WorkspaceConfig {
+ /**
+ An array of workspace pattern strings which contain the workspace packages.
+ */
+ packages?: WorkspacePattern[];
+
+ /**
+ Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns.
+
+ [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/)
+ */
+ nohoist?: WorkspacePattern[];
+ }
+
+ /**
+ A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process.
+
+ The patterns are handled with [minimatch](https://github.com/isaacs/minimatch).
+
+ @example
+ `docs` → Include the docs directory and install its dependencies.
+ `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`.
+ */
+ type WorkspacePattern = string;
+
+ export interface YarnConfiguration {
+ /**
+ Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
+
+ Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass.
+
+ Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
+ */
+ workspaces?: WorkspacePattern[] | WorkspaceConfig;
+
+ /**
+ If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`.
+
+ Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line.
+ */
+ flat?: boolean;
+
+ /**
+ Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
+ */
+ resolutions?: Dependency;
+ }
+
+ export interface JSPMConfiguration {
+ /**
+ JSPM configuration.
+ */
+ jspm?: PackageJson;
+ }
+
+ /**
+ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.
+ */
+ export interface PackageJsonStandard {
+ /**
+ The name of the package.
+ */
+ name?: string;
+
+ /**
+ Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
+ */
+ version?: string;
+
+ /**
+ Package description, listed in `npm search`.
+ */
+ description?: string;
+
+ /**
+ Keywords associated with package, listed in `npm search`.
+ */
+ keywords?: string[];
+
+ /**
+ The URL to the package's homepage.
+ */
+ homepage?: LiteralUnion<'.', string>;
+
+ /**
+ The URL to the package's issue tracker and/or the email address to which issues should be reported.
+ */
+ bugs?: BugsLocation;
+
+ /**
+ The license for the package.
+ */
+ license?: string;
+
+ /**
+ The licenses for the package.
+ */
+ licenses?: Array<{
+ type?: string;
+ url?: string;
+ }>;
+
+ author?: Person;
+
+ /**
+ A list of people who contributed to the package.
+ */
+ contributors?: Person[];
+
+ /**
+ A list of people who maintain the package.
+ */
+ maintainers?: Person[];
+
+ /**
+ The files included in the package.
+ */
+ files?: string[];
+
+ /**
+ Resolution algorithm for importing ".js" files from the package's scope.
+
+ [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
+ */
+ type?: 'module' | 'commonjs';
+
+ /**
+ The module ID that is the primary entry point to the program.
+ */
+ main?: string;
+
+ /**
+ Standard entry points of the package, with enhanced support for ECMAScript Modules.
+
+ [Read more.](https://nodejs.org/api/esm.html#esm_package_entry_points)
+ */
+ exports?: Exports;
+
+ /**
+ The executable files that should be installed into the `PATH`.
+ */
+ bin?:
+ | string
+ | Record;
+
+ /**
+ Filenames to put in place for the `man` program to find.
+ */
+ man?: string | string[];
+
+ /**
+ Indicates the structure of the package.
+ */
+ directories?: DirectoryLocations;
+
+ /**
+ Location for the code repository.
+ */
+ repository?:
+ | string
+ | {
+ type: string;
+ url: string;
+
+ /**
+ Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo).
+
+ [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md)
+ */
+ directory?: string;
+ };
+
+ /**
+ Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
+ */
+ scripts?: Scripts;
+
+ /**
+ Is used to set configuration parameters used in package scripts that persist across upgrades.
+ */
+ config?: Record;
+
+ /**
+ The dependencies of the package.
+ */
+ dependencies?: Dependency;
+
+ /**
+ Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
+ */
+ devDependencies?: Dependency;
+
+ /**
+ Dependencies that are skipped if they fail to install.
+ */
+ optionalDependencies?: Dependency;
+
+ /**
+ Dependencies that will usually be required by the package user directly or via another dependency.
+ */
+ peerDependencies?: Dependency;
+
+ /**
+ Indicate peer dependencies that are optional.
+ */
+ peerDependenciesMeta?: Record;
+
+ /**
+ Package names that are bundled when the package is published.
+ */
+ bundledDependencies?: string[];
+
+ /**
+ Alias of `bundledDependencies`.
+ */
+ bundleDependencies?: string[];
+
+ /**
+ Engines that this package runs on.
+ */
+ engines?: {
+ [EngineName in 'npm' | 'node' | string]: string;
+ };
+
+ /**
+ @deprecated
+ */
+ engineStrict?: boolean;
+
+ /**
+ Operating systems the module runs on.
+ */
+ os?: Array>;
+
+ /**
+ CPU architectures the module runs on.
+ */
+ cpu?: Array>;
+
+ /**
+ If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
+
+ @deprecated
+ */
+ preferGlobal?: boolean;
+
+ /**
+ If set to `true`, then npm will refuse to publish it.
+ */
+ private?: boolean;
+
+ /**
+ A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
+ */
+ publishConfig?: Record;
+
+ /**
+ Describes and notifies consumers of a package's monetary support information.
+
+ [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
+ */
+ funding?: string | {
+ /**
+ The type of funding.
+ */
+ type?: LiteralUnion<
+ | 'github'
+ | 'opencollective'
+ | 'patreon'
+ | 'individual'
+ | 'foundation'
+ | 'corporation',
+ string
+ >;
+
+ /**
+ The URL to the funding page.
+ */
+ url: string;
+ };
+ }
+}
+
+/**
+Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn.
+*/
+export type PackageJson =
+PackageJson.PackageJsonStandard &
+PackageJson.NonStandardEntryPoints &
+PackageJson.TypeScriptConfiguration &
+PackageJson.YarnConfiguration &
+PackageJson.JSPMConfiguration;
diff --git a/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/type-fest/source/partial-deep.d.ts
new file mode 100644
index 0000000..b962b84
--- /dev/null
+++ b/node_modules/type-fest/source/partial-deep.d.ts
@@ -0,0 +1,72 @@
+import {Primitive} from './basic';
+
+/**
+Create a type from another type with all keys and nested keys set to optional.
+
+Use-cases:
+- Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
+- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
+
+@example
+```
+import {PartialDeep} from 'type-fest';
+
+const settings: Settings = {
+ textEditor: {
+ fontSize: 14;
+ fontColor: '#000000';
+ fontWeight: 400;
+ }
+ autocomplete: false;
+ autosave: true;
+};
+
+const applySavedSettings = (savedSettings: PartialDeep) => {
+ return {...settings, ...savedSettings};
+}
+
+settings = applySavedSettings({textEditor: {fontWeight: 500}});
+```
+*/
+export type PartialDeep = T extends Primitive
+ ? Partial
+ : T extends Map
+ ? PartialMapDeep
+ : T extends Set
+ ? PartialSetDeep
+ : T extends ReadonlyMap
+ ? PartialReadonlyMapDeep
+ : T extends ReadonlySet