Add node modules and compiled JavaScript from main
This commit is contained in:
parent
8bccaeaf7c
commit
4181bfdf50
7465 changed files with 1775003 additions and 2 deletions
5
node_modules/node-notifier/.prettierrc
generated
vendored
Normal file
5
node_modules/node-notifier/.prettierrc
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"printWidth": 80,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none"
|
||||
}
|
328
node_modules/node-notifier/CHANGELOG.md
generated
vendored
Normal file
328
node_modules/node-notifier/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,328 @@
|
|||
# Changelog
|
||||
|
||||
### `v8.0.1`
|
||||
|
||||
- fixes possible injection issue for notify-send
|
||||
|
||||
### `v8.0.0`
|
||||
|
||||
Breaking changes:
|
||||
|
||||
- Expire time for notify-send is made to match macOS and Windows with default time of 10 seconds. The API is changed to take seconds as input and converting it to milliseconds before passing it on to notify-send. See [#341](https://github.com/mikaelbr/node-notifier/pull/341).
|
||||
|
||||
### `v7.0.2`
|
||||
|
||||
- Updates dependencies
|
||||
- Fixes issue with haning Windows notifications when disabled ([#335](https://github.com/mikaelbr/node-notifier/pull/335))
|
||||
|
||||
### `v7.0.1`
|
||||
|
||||
- Fixes import of uuid, removes deprecation warnings
|
||||
|
||||
### `v7.0.0`
|
||||
|
||||
#### Features
|
||||
|
||||
- NotifySend support for app-name ([#299](https://github.com/mikaelbr/node-notifier/pull/299), see docs)
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- All notify messages now have auto bound context to make it easier to pass as variables/arguments ([#306](https://github.com/mikaelbr/node-notifier/pull/306))
|
||||
- Updated snoreToast to version `0.7.0` with new input features ([#293](https://github.com/mikaelbr/node-notifier/pull/293))
|
||||
- Breaking snoreToast: Sanitizing data now changes "timedout" to "timeout"
|
||||
|
||||
### `v6.0.0`
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- Dropped support for node v6. As of v6 we currently support node versions 8, 10, and 12 (latest).
|
||||
- Updated to the latest version of SnoreToast. This removes support for the `wait` option in that environment as it is now always on. Prepares the way for other new features added to the WindowsToaster.
|
||||
|
||||
#### Other
|
||||
|
||||
- Update to latest version of dependencies.
|
||||
|
||||
### `v5.4.3`
|
||||
|
||||
- Reverts breaking dependency upgrades from `v5.4.2` as some dependencies has removed Node 6 which is a breaking change.
|
||||
|
||||
### `v5.4.2`
|
||||
|
||||
- Updates dependencies
|
||||
|
||||
### `v5.4.1`
|
||||
|
||||
- Reverts changes to default timeout as they are causing some issues. See [#271](https://github.com/mikaelbr/node-notifier/pull/271)
|
||||
|
||||
### `v5.4.0`
|
||||
|
||||
- Prevent Spotlight from indexing terminal-notifier.app ([#238](https://github.com/mikaelbr/node-notifier/pull/238))
|
||||
- Changes from legacy url.parse api
|
||||
- Adds default timeout to notification center
|
||||
- Adds mapping from timeout to expire time for linux
|
||||
- Enables the use of WindowsToaster when using WSL ([#260](https://github.com/mikaelbr/node-notifier/pull/260))
|
||||
|
||||
### `v5.3.0`
|
||||
|
||||
- Re-adds `notifu` update.
|
||||
|
||||
### `v5.2.1`
|
||||
|
||||
- Rollback `notifu` update as it triggered Avast virus scan.
|
||||
|
||||
### `v5.2.0`
|
||||
|
||||
- Updates `terminal-notifier` dependency to `v1.7.2`, fixing memory leak. But not to `v1.8.0` as this breaks how icons work.
|
||||
- Updates `notifu` with new subtitle "Notification"
|
||||
- Fix: issue with `appID` by removing default empty string (see README Windows section)
|
||||
- Fix: link notifier time property to notify-send expire-time flag
|
||||
|
||||
- Minor change: use a more specific condition for enabling debug logging ([#171](https://github.com/mikaelbr/node-notifier/pull/171))
|
||||
|
||||
### `v5.1.2`
|
||||
|
||||
- Adds temporary workaround for `terminal-notifier` memory leak as seen in https://github.com/facebook/jest/issues/2999 and https://github.com/julienXX/terminal-notifier/issues/173.
|
||||
- Add appName option and hide snoreToast if not setted ([#158](https://github.com/mikaelbr/node-notifier/pull/158))
|
||||
|
||||
### `v5.0.2`
|
||||
|
||||
Non-obligatory fail. Fixes issue with multiple actions for macOS.
|
||||
|
||||
### `v5.0.1`
|
||||
|
||||
Obligatory fail. Fixes minor issue with non-JSON output for macOS.
|
||||
|
||||
### `v5.0.0`
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
_Note/TL;DR_: If you are just using `node-notifier` with things like `message`, `title` and `icon`, v5 should work just as before.
|
||||
|
||||
1. CLI is now removed. Can be found in separate project: https://github.com/mikaelbr/node-notifier-cli. This means you no longer get the `notify` bin when installing `node-notifier`. To get this do `npm i [-g] node-notifier-cli`
|
||||
2. Changed toaster implementation from `toast.exe` to [Snoretoast](https://github.com/KDE/snoretoast). This means if you are using your custom fork, you need to change. SnoreToast has some better default implemented functionality.
|
||||
3. [terminal-notifier](https://github.com/julienXX/terminal-notifier) dependency has been bumped to `v1.7.1`. With that there can be changes in the API, and supports now reply and buttons. Output has changed to JSON by default, this means the output of some functions of the terminal-notifier has broken. See https://github.com/julienXX/terminal-notifier for more details. See [README](https://github.com/mikaelbr/node-notifier#usage-notificationcenter) for documentation on how to use the new features, or [an example file](https://github.com/mikaelbr/node-notifier/blob/master/example/macInput.js).
|
||||
4. `notify` method will now throw error if second argument is something else than function (still optional): [#138](https://github.com/mikaelbr/node-notifier/pull/138).
|
||||
|
||||
#### Additions
|
||||
|
||||
1. Now supports \*BSD systems: [#142](https://github.com/mikaelbr/node-notifier/pull/142).
|
||||
2. With the new toaster implementation you can do more! For instance customize sound and close notification. See all options:
|
||||
|
||||
```javascript
|
||||
{
|
||||
title: void 0, // String. Required
|
||||
message: void 0, // String. Required if remove is not defined
|
||||
icon: void 0, // String. Absolute path to Icon
|
||||
sound: false, // Bool | String (as defined by http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx)
|
||||
wait: false, // Bool. Wait for User Action against Notification or times out
|
||||
id: void 0, // Number. ID to use for closing notification.
|
||||
appID: void 0, // String. App.ID. Don't create a shortcut but use the provided app id.
|
||||
remove: void 0, // Number. Refer to previously created notification to close.
|
||||
install: void 0 // String (path, application, app id). Creates a shortcut <path> in the start menu which point to the executable <application>, appID used for the notifications.
|
||||
}
|
||||
```
|
||||
|
||||
#### Fixes
|
||||
|
||||
1. Fixes new lines on messages on Windows: [#123](https://github.com/mikaelbr/node-notifier/issues/123)
|
||||
|
||||
#### Technical Changes
|
||||
|
||||
_Internal changes for those who might be interested_.
|
||||
|
||||
1. Dependencies bumped
|
||||
2. Unnecessary dependencies removed (`lodash.deepClone`). Now uses JSON serialize/deserialize instead.
|
||||
3. Project is auto-formatted by [`prettier`](https://github.com/jlongster/prettier).
|
||||
4. [Linting is added](https://github.com/mikaelbr/node-notifier/blob/master/.eslintrc)
|
||||
5. Added way to better debug what is happening by setting `DEBUG` env-var to `true`. See [CONTRIBUTE.md](https://github.com/mikaelbr/node-notifier/blob/master/CONTRIBUTE.md) for more details.
|
||||
|
||||
### `v4.6.1`
|
||||
|
||||
1. Adds npm ignore file, ignoring tests and examples from package.
|
||||
2. Fixes CI builds.
|
||||
|
||||
### `v4.6.0`
|
||||
|
||||
1. Adds support for Icon URL in Growl ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/115))
|
||||
2. Adds options for passing host and port to cli tool ([reported by @el-davo](https://github.com/mikaelbr/node-notifier/issues/106))
|
||||
3. Fixes sanitize response on `notify` callback ([by @MadLittleMods](https://github.com/mikaelbr/node-notifier/commit/a44454a11eff452a8b55f9fbe291e189ed088708))
|
||||
4. Fixes use of new line in messages ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/115))
|
||||
5. Fixes use of `file:///xxx` protocol icon paths for Windows 8.1 ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/118))
|
||||
6. Fixes non-TTY usage and piping messages ([reported by @simensen](https://github.com/mikaelbr/node-notifier/issues/109))
|
||||
7. Updates vendor terminal-notifier version to 1.6.3 ([reported by @kid-icarus](https://github.com/mikaelbr/node-notifier/pull/120))
|
||||
|
||||
### `v4.5.0`
|
||||
|
||||
#### Additions
|
||||
|
||||
1. Adds syntactic sugar for `notify`. Now able to just pass message:
|
||||
|
||||
```js
|
||||
notifier.notify('My message');
|
||||
```
|
||||
|
||||
See [#45](https://github.com/mikaelbr/node-notifier/issues/45) for more info.
|
||||
|
||||
#### Fixes
|
||||
|
||||
1. Improvements to docs and examples
|
||||
2. Updates `semver` dependency to support Webpacking with Electron.
|
||||
|
||||
### `v4.4.0`
|
||||
|
||||
1. Changes to exec terminal-notifier through execFile to allow for asar-packages
|
||||
2. Adds support for remote growl server
|
||||
3. Adds support for win7 with electron asar-package
|
||||
|
||||
### `v4.3.1`
|
||||
|
||||
Obligatory patch fix:
|
||||
|
||||
1. Adds new stdin CLI options to docs
|
||||
|
||||
### `v4.3.0`
|
||||
|
||||
1. Adds support for piping messages in to CLI.
|
||||
(With `node-notifier` installed as a CLI `npm i -g node-notifier`)
|
||||
|
||||
```shell
|
||||
➜ echo "Message" | notify
|
||||
➜ echo "Message" | notify -t "My Title"
|
||||
➜ echo "Some message" | notify -t "My Title" -s
|
||||
```
|
||||
|
||||
### `v4.2.3`
|
||||
|
||||
1. Fixed input arguments to CLI to be strings where they should be strings.
|
||||
|
||||
### `v4.2.2`
|
||||
|
||||
1. Fixed no notification when no message for the CLI. [#58](https://github.com/mikaelbr/node-notifier/pull/58)
|
||||
2. Changes `which` test to be sync, avoiding some edge cases with multiple notifications.
|
||||
|
||||
### `v4.2.1`
|
||||
|
||||
1. Minor fix for docs in CLI usage
|
||||
|
||||
### `v4.2.0`
|
||||
|
||||
1. Adds CLI support.
|
||||
2. Fixes Debug "HRESULT : 0xC00CE508" exception on Win8. PR [#49](https://github.com/mikaelbr/node-notifier/pull/49)
|
||||
|
||||
### `v4.1.2`
|
||||
|
||||
1. Fixes correct terminal-notifier (own fork https://github.com/mikaelbr/terminal-notifier)
|
||||
to support activate / click.
|
||||
|
||||
### `v4.1.1`
|
||||
|
||||
1. Fixes proper error codes for balloon: #42
|
||||
2. Removes unused debug files: #41
|
||||
3. Patches differences between subtitle for notify-send: #43
|
||||
4. Updates terminal-notifier dependency (removing black borders) #44 #18
|
||||
|
||||
### `v4.1.0`
|
||||
|
||||
1. Adds support for changing host and port for Growl.
|
||||
|
||||
### `v4.0.3`
|
||||
|
||||
1. Fixes Notification center issue with multiple callback events.
|
||||
2. Fixes error in source code: Fixes long-spaces to proper spaces
|
||||
|
||||
### `v4.0.2`
|
||||
|
||||
1. Fixes issue with immidiate notifu notifications (with `wait : false`)
|
||||
2. Fixes issue with boolean flags for notifu.
|
||||
3. Restructures directories. Making it easier to require notifiers directly.
|
||||
|
||||
### `v4.0.1`
|
||||
|
||||
1. Fixes issue with optional callback for notify-send
|
||||
|
||||
### `v4.0.0`
|
||||
|
||||
Major changes and breaking API.
|
||||
|
||||
1. require('node-notifier') now returns an instance with fallbackable notifications.
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.notify();
|
||||
```
|
||||
|
||||
2. Introduced a `wait` property (default `false`), to get user input for
|
||||
Notification Center, Windows Toaster, Windows Balloons and Growl. Sadly not
|
||||
for notify-send.
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.notify({ wait: true }, function (err, response) {
|
||||
// response is response after user have interacted
|
||||
// with the notification or the notification has timed out.
|
||||
});
|
||||
```
|
||||
|
||||
3. All notification instances are now event emitters, emitting events
|
||||
`click` or `timeout`. This is only applicable if `{ wait: true }`.
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.on('click', function (notificationObject, options) {
|
||||
// options.someArbitraryData === 'foo'
|
||||
});
|
||||
notifier.notify({ wait: true, someArbitraryData: 'foo' });
|
||||
```
|
||||
|
||||
4. WindowsToaster and NotificationCenter now can have sounds by doing `{ sound: true }`.
|
||||
Default NotificationCenter sound is Bottle. Can still use define sound on
|
||||
Mac:
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.notify({ sound: true });
|
||||
// For mac (same as sound: true on Windows 8)
|
||||
notifier.notify({ sound: 'Morse' });
|
||||
```
|
||||
|
||||
### `v3.4.0`
|
||||
|
||||
1. Adds Growl as priority over Balloons
|
||||
|
||||
### `v3.3.0`
|
||||
|
||||
1. Adds support for native Windows 7 and earlier (through task bar balloons)
|
||||
2. Changes growl implementation. Adds better support for GNTP
|
||||
|
||||
### `v3.2.1`
|
||||
|
||||
1. Fixes support for notifications from folders with spaces on Windows.
|
||||
|
||||
### `v3.2.0`
|
||||
|
||||
1. Adds native Windows 8 support.
|
||||
|
||||
### `v3.1.0`
|
||||
|
||||
1. Adds Growl as fallback for Mac OS X pre 10.8.
|
||||
|
||||
### `v3.0.6`
|
||||
|
||||
1. Fixes typo: Changes Growl app name from `Gulp` to `Node`.
|
||||
|
||||
### `v3.0.5`
|
||||
|
||||
1. Maps common options between the different notifiers. Allowing for common usage with different notifiers.
|
||||
|
||||
### `v3.0.4`
|
||||
|
||||
1. Fixes expires for notify-send (Issue #13)
|
||||
|
||||
### `v3.0.2`
|
||||
|
||||
1. Fixes version check for Mac OS X Yosemite
|
||||
|
||||
### `v3.0.0`
|
||||
|
||||
1. Updates terminal-notifier to version 1.6.0; adding support for appIcon and contentImage
|
||||
2. Removes parsing of output sent from notifier (Notification Center)
|
21
node_modules/node-notifier/LICENSE
generated
vendored
Normal file
21
node_modules/node-notifier/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Mikael Brevik
|
||||
|
||||
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.
|
461
node_modules/node-notifier/README.md
generated
vendored
Normal file
461
node_modules/node-notifier/README.md
generated
vendored
Normal file
|
@ -0,0 +1,461 @@
|
|||
# node-notifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
|
||||
|
||||
Send cross platform native notifications using Node.js. Notification Center for macOS,
|
||||
`notify-osd`/`libnotify-bin` for Linux, Toasters for Windows 8/10, or taskbar balloons for
|
||||
earlier Windows versions. Growl is used if none of these requirements are met.
|
||||
[Works well with Electron](#within-electron-packaging).
|
||||
|
||||

|
||||

|
||||
|
||||
## Input Example macOS Notification Center
|
||||
|
||||

|
||||
|
||||
## Actions Example Windows SnoreToast
|
||||
|
||||

|
||||
|
||||
## Quick Usage
|
||||
|
||||
Show a native notification on macOS, Windows, Linux:
|
||||
|
||||
```javascript
|
||||
const notifier = require('node-notifier');
|
||||
// String
|
||||
notifier.notify('Message');
|
||||
|
||||
// Object
|
||||
notifier.notify({
|
||||
title: 'My notification',
|
||||
message: 'Hello, there!'
|
||||
});
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- **macOS**: >= 10.8 for native notifications, or Growl if earlier.
|
||||
- **Linux**: `notify-osd` or `libnotify-bin` installed (Ubuntu should have this by default)
|
||||
- **Windows**: >= 8, or task bar balloons for Windows < 8. Growl as fallback. Growl takes precedence over Windows balloons.
|
||||
- **General Fallback**: Growl
|
||||
|
||||
See [documentation and flow chart for reporter choice](./DECISION_FLOW.md).
|
||||
|
||||
## Install
|
||||
|
||||
```shell
|
||||
npm install --save node-notifier
|
||||
```
|
||||
|
||||
## <abbr title="Command Line Interface">CLI</abbr>
|
||||
|
||||
<abbr title="Command Line Interface">CLI</abbr> has moved to separate project:
|
||||
<https://github.com/mikaelbr/node-notifier-cli>
|
||||
|
||||
## Cross-Platform Advanced Usage
|
||||
|
||||
Standard usage, with cross-platform fallbacks as defined in the
|
||||
[reporter flow chart](./DECISION_FLOW.md). All of the options
|
||||
below will work in some way or another on most platforms.
|
||||
|
||||
```javascript
|
||||
const notifier = require('node-notifier');
|
||||
const path = require('path');
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: 'My awesome title',
|
||||
message: 'Hello from node, Mr. User!',
|
||||
icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons)
|
||||
sound: true, // Only Notification Center or Windows Toasters
|
||||
wait: true // Wait with callback, until user action is taken against notification, does not apply to Windows Toasters as they always wait or notify-send as it does not support the wait option
|
||||
},
|
||||
function (err, response) {
|
||||
// Response is response from notification
|
||||
}
|
||||
);
|
||||
|
||||
notifier.on('click', function (notifierObject, options, event) {
|
||||
// Triggers if `wait: true` and user clicks notification
|
||||
});
|
||||
|
||||
notifier.on('timeout', function (notifierObject, options) {
|
||||
// Triggers if `wait: true` and notification closes
|
||||
});
|
||||
```
|
||||
|
||||
If you want super fine-grained control, you can customize each reporter individually,
|
||||
allowing you to tune specific options for different systems.
|
||||
|
||||
See below for documentation on each reporter.
|
||||
|
||||
**Example:**
|
||||
|
||||
```javascript
|
||||
const NotificationCenter = require('node-notifier/notifiers/notificationcenter');
|
||||
new NotificationCenter(options).notify();
|
||||
|
||||
const NotifySend = require('node-notifier/notifiers/notifysend');
|
||||
new NotifySend(options).notify();
|
||||
|
||||
const WindowsToaster = require('node-notifier/notifiers/toaster');
|
||||
new WindowsToaster(options).notify();
|
||||
|
||||
const Growl = require('node-notifier/notifiers/growl');
|
||||
new Growl(options).notify();
|
||||
|
||||
const WindowsBalloon = require('node-notifier/notifiers/balloon');
|
||||
new WindowsBalloon(options).notify();
|
||||
```
|
||||
|
||||
Or, if you are using several reporters (or you're lazy):
|
||||
|
||||
```javascript
|
||||
// NOTE: Technically, this takes longer to require
|
||||
const nn = require('node-notifier');
|
||||
|
||||
new nn.NotificationCenter(options).notify();
|
||||
new nn.NotifySend(options).notify();
|
||||
new nn.WindowsToaster(options).notify(options);
|
||||
new nn.WindowsBalloon(options).notify(options);
|
||||
new nn.Growl(options).notify(options);
|
||||
```
|
||||
|
||||
## Contents
|
||||
|
||||
- [Notification Center documentation](#usage-notificationcenter)
|
||||
- [Windows Toaster documentation](#usage-windowstoaster)
|
||||
- [Windows Balloon documentation](#usage-windowsballoon)
|
||||
- [Growl documentation](#usage-growl)
|
||||
- [Notify-send documentation](#usage-notifysend)
|
||||
|
||||
### Usage: `NotificationCenter`
|
||||
|
||||
Same usage and parameter setup as [**`terminal-notifier`**](https://github.com/julienXX/terminal-notifier).
|
||||
|
||||
Native Notification Center requires macOS version 10.8 or higher. If you have
|
||||
an earlier version, Growl will be the fallback. If Growl isn't installed, an
|
||||
error will be returned in the callback.
|
||||
|
||||
#### Example
|
||||
|
||||
Because `node-notifier` wraps around [**`terminal-notifier`**](https://github.com/julienXX/terminal-notifier),
|
||||
you can do anything `terminal-notifier` can, just by passing properties to the `notify`
|
||||
method.
|
||||
|
||||
For example:
|
||||
|
||||
- if `terminal-notifier` says `-message`, you can do `{message: 'Foo'}`
|
||||
- if `terminal-notifier` says `-list ALL`, you can do `{list: 'ALL'}`.
|
||||
|
||||
Notification is the primary focus of this module, so listing and activating do work,
|
||||
but they aren't documented.
|
||||
|
||||
### All notification options with their defaults:
|
||||
|
||||
```javascript
|
||||
const NotificationCenter = require('node-notifier').NotificationCenter;
|
||||
|
||||
var notifier = new NotificationCenter({
|
||||
withFallback: false, // Use Growl Fallback if <= 10.8
|
||||
customPath: undefined // Relative/Absolute path to binary if you want to use your own fork of terminal-notifier
|
||||
});
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: undefined,
|
||||
subtitle: undefined,
|
||||
message: undefined,
|
||||
sound: false, // Case Sensitive string for location of sound file, or use one of macOS' native sounds (see below)
|
||||
icon: 'Terminal Icon', // Absolute Path to Triggering Icon
|
||||
contentImage: undefined, // Absolute Path to Attached Image (Content Image)
|
||||
open: undefined, // URL to open on Click
|
||||
wait: false, // Wait for User Action against Notification or times out. Same as timeout = 5 seconds
|
||||
|
||||
// New in latest version. See `example/macInput.js` for usage
|
||||
timeout: 5, // Takes precedence over wait if both are defined.
|
||||
closeLabel: undefined, // String. Label for cancel button
|
||||
actions: undefined, // String | Array<String>. Action label or list of labels in case of dropdown
|
||||
dropdownLabel: undefined, // String. Label to be used if multiple actions
|
||||
reply: false // Boolean. If notification should take input. Value passed as third argument in callback and event emitter.
|
||||
},
|
||||
function (error, response, metadata) {
|
||||
console.log(response, metadata);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Note:** The `wait` option is shorthand for `timeout: 5`. This just sets a timeout
|
||||
for 5 seconds. It does _not_ make the notification sticky!
|
||||
|
||||
As of Version 6.0 there is a default `timeout` set of `10` to ensure that the application closes properly. In order to remove the `timeout` and have an instantly closing notification (does not support actions), set `timeout` to `false`. If you are using `action` it is recommended to set `timeout` to a high value to ensure the user has time to respond.
|
||||
|
||||
_Exception:_ If `reply` is defined, it's recommended to set `timeout` to a either
|
||||
high value, or to nothing at all.
|
||||
|
||||
---
|
||||
|
||||
**For macOS notifications: `icon`, `contentImage`, and all forms of `reply`/`actions` require macOS 10.9.**
|
||||
|
||||
Sound can be one of these: `Basso`, `Blow`, `Bottle`, `Frog`, `Funk`, `Glass`,
|
||||
`Hero`, `Morse`, `Ping`, `Pop`, `Purr`, `Sosumi`, `Submarine`, `Tink`.
|
||||
|
||||
If `sound` is simply `true`, `Bottle` is used.
|
||||
|
||||
---
|
||||
|
||||
**See Also:**
|
||||
|
||||
- [Example: specific Notification Centers](./example/advanced.js)
|
||||
- [Example: input](./example/macInput.js).
|
||||
|
||||
---
|
||||
|
||||
**Custom Path clarification**
|
||||
|
||||
`customPath` takes a value of a relative or absolute path to the binary of your
|
||||
fork/custom version of **`terminal-notifier`**.
|
||||
|
||||
**Example:** `./vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier`
|
||||
|
||||
**Spotlight clarification**
|
||||
|
||||
`terminal-notifier.app` resides in a `mac.noindex` folder to prevent Spotlight from indexing the app.
|
||||
|
||||
### Usage: `WindowsToaster`
|
||||
|
||||
**Note:** There are some limitations for images in native Windows 8 notifications:
|
||||
|
||||
- The image must be a PNG image
|
||||
- The image must be smaller than 1024×1024 px
|
||||
- The image must be less than 200kb
|
||||
- The image must be specified using an absolute path
|
||||
|
||||
These limitations are due to the Toast notification system. A good tip is to use
|
||||
something like `path.join` or `path.delimiter` to keep your paths cross-platform.
|
||||
|
||||
From [mikaelbr/gulp-notify#90 (comment)](https://github.com/mikaelbr/gulp-notify/issues/90#issuecomment-129333034)
|
||||
|
||||
> You can make it work by going to System > Notifications & Actions. The 'toast'
|
||||
> app needs to have Banners enabled. (You can activate banners by clicking on the
|
||||
> 'toast' app and setting the 'Show notification banners' to On)
|
||||
|
||||
---
|
||||
|
||||
**Windows 10 Fall Creators Update (Version 1709) Note:**
|
||||
|
||||
[**Snoretoast**](https://github.com/KDE/snoretoast) is used to get native Windows Toasts!
|
||||
|
||||
The default behaviour is to have the underlying toaster applicaton as `appID`.
|
||||
This works as expected, but shows `SnoreToast` as text in the notification.
|
||||
|
||||
With the Fall Creators Update, Notifications on Windows 10 will only work as
|
||||
expected if a valid `appID` is specified. Your `appID` must be exactly the same
|
||||
value that was registered during the installation of your app.
|
||||
|
||||
You can find the ID of your App by searching the registry for the `appID` you
|
||||
specified at installation of your app. For example: If you use the squirrel
|
||||
framework, your `appID` will be something like `com.squirrel.your.app`.
|
||||
|
||||
```javascript
|
||||
const WindowsToaster = require('node-notifier').WindowsToaster;
|
||||
|
||||
var notifier = new WindowsToaster({
|
||||
withFallback: false, // Fallback to Growl or Balloons?
|
||||
customPath: undefined // Relative/Absolute path if you want to use your fork of SnoreToast.exe
|
||||
});
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: undefined, // String. Required
|
||||
message: undefined, // String. Required if remove is not defined
|
||||
icon: undefined, // String. Absolute path to Icon
|
||||
sound: false, // Bool | String (as defined by http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx)
|
||||
id: undefined, // Number. ID to use for closing notification.
|
||||
appID: undefined, // String. App.ID and app Name. Defaults to no value, causing SnoreToast text to be visible.
|
||||
remove: undefined, // Number. Refer to previously created notification to close.
|
||||
install: undefined // String (path, application, app id). Creates a shortcut <path> in the start menu which point to the executable <application>, appID used for the notifications.
|
||||
},
|
||||
function (error, response) {
|
||||
console.log(response);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
### Usage: `Growl`
|
||||
|
||||
```javascript
|
||||
const Growl = require('node-notifier').Growl;
|
||||
|
||||
var notifier = new Growl({
|
||||
name: 'Growl Name Used', // Defaults as 'Node'
|
||||
host: 'localhost',
|
||||
port: 23053
|
||||
});
|
||||
|
||||
notifier.notify({
|
||||
title: 'Foo',
|
||||
message: 'Hello World',
|
||||
icon: fs.readFileSync(__dirname + '/coulson.jpg'),
|
||||
wait: false, // Wait for User Action against Notification
|
||||
|
||||
// and other growl options like sticky etc.
|
||||
sticky: false,
|
||||
label: undefined,
|
||||
priority: undefined
|
||||
});
|
||||
```
|
||||
|
||||
See more information about using [growly](https://github.com/theabraham/growly/).
|
||||
|
||||
### Usage: `WindowsBalloon`
|
||||
|
||||
For earlier versions of Windows, taskbar balloons are used (unless
|
||||
fallback is activated and Growl is running). The balloons notifier uses a great
|
||||
project called [**`notifu`**](http://www.paralint.com/projects/notifu/).
|
||||
|
||||
```javascript
|
||||
const WindowsBalloon = require('node-notifier').WindowsBalloon;
|
||||
|
||||
var notifier = new WindowsBalloon({
|
||||
withFallback: false, // Try Windows Toast and Growl first?
|
||||
customPath: undefined // Relative/Absolute path if you want to use your fork of notifu
|
||||
});
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: undefined,
|
||||
message: undefined,
|
||||
sound: false, // true | false.
|
||||
time: 5000, // How long to show balloon in ms
|
||||
wait: false, // Wait for User Action against Notification
|
||||
type: 'info' // The notification type : info | warn | error
|
||||
},
|
||||
function (error, response) {
|
||||
console.log(response);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
See full usage on the [project homepage: **`notifu`**](http://www.paralint.com/projects/notifu/).
|
||||
|
||||
### Usage: `NotifySend`
|
||||
|
||||
**Note:** `notify-send` doesn't support the `wait` flag.
|
||||
|
||||
```javascript
|
||||
const NotifySend = require('node-notifier').NotifySend;
|
||||
|
||||
var notifier = new NotifySend();
|
||||
|
||||
notifier.notify({
|
||||
title: 'Foo',
|
||||
message: 'Hello World',
|
||||
icon: __dirname + '/coulson.jpg',
|
||||
|
||||
wait: false, // Defaults no exipre time set. If true expire time of 5 seconds is used
|
||||
timeout: 10, // Alias for expire-time, time etc. Time before notify-send expires. Defaults to 10 seconds.
|
||||
|
||||
// .. and other notify-send flags:
|
||||
'app-name': 'node-notifier',
|
||||
urgency: undefined,
|
||||
category: undefined,
|
||||
hint: undefined
|
||||
});
|
||||
```
|
||||
|
||||
See flags and options on the man page [`notify-send(1)`](http://manpages.ubuntu.com/manpages/gutsy/man1/notify-send.1.html)
|
||||
|
||||
## Thanks to OSS
|
||||
|
||||
`node-notifier` is made possible through Open Source Software.
|
||||
A very special thanks to all the modules `node-notifier` uses.
|
||||
|
||||
- [`terminal-notifier`](https://github.com/julienXX/terminal-notifier)
|
||||
- [`Snoretoast`](https://github.com/KDE/snoretoast)
|
||||
- [`notifu`](http://www.paralint.com/projects/notifu/)
|
||||
- [`growly`](https://github.com/theabraham/growly/)
|
||||
|
||||
[![NPM downloads][npm-downloads]][npm-url]
|
||||
|
||||
## Common Issues
|
||||
|
||||
### Windows: `SnoreToast` text
|
||||
|
||||
See note on "Windows 10 Fall Creators Update" in Windows section.
|
||||
_**Short answer:** update your `appID`._
|
||||
|
||||
### Use inside tmux session
|
||||
|
||||
When using `node-notifier` within a tmux session, it can cause a hang in the system.
|
||||
This can be solved by following the steps described in [this comment](https://github.com/julienXX/terminal-notifier/issues/115#issuecomment-104214742)
|
||||
|
||||
There’s even more info [here](https://github.com/mikaelbr/node-notifier/issues/61#issuecomment-163560801)
|
||||
<https://github.com/mikaelbr/node-notifier/issues/61#issuecomment-163560801>.
|
||||
|
||||
### macOS: Custom icon without Terminal icon
|
||||
|
||||
Even if you define an icon in the configuration object for `node-notifier`, you will
|
||||
see a small Terminal icon in the notification (see the example at the top of this
|
||||
document).
|
||||
|
||||
This is the way notifications on macOS work. They always show the icon of the
|
||||
parent application initiating the notification. For `node-notifier`, `terminal-notifier`
|
||||
is the initiator, and it has the Terminal icon defined as its icon.
|
||||
|
||||
To define your custom icon, you need to fork `terminal-notifier` and build your
|
||||
custom version with your icon.
|
||||
|
||||
See [Issue #71 for more info](https://github.com/mikaelbr/node-notifier/issues/71)
|
||||
<https://github.com/mikaelbr/node-notifier/issues/71>.
|
||||
|
||||
### Within Electron Packaging
|
||||
|
||||
If packaging your Electron app as an `asar`, you will find `node-notifier` will fail to load.
|
||||
|
||||
Due to the way asar works, you cannot execute a binary from within an `asar`.
|
||||
As a simple solution, when packaging the app into an asar please make sure you
|
||||
`--unpack` the `vendor/` folder of `node-notifier`, so the module still has access to
|
||||
the notification binaries.
|
||||
|
||||
You can do so with the following command:
|
||||
|
||||
```bash
|
||||
asar pack . app.asar --unpack "./node_modules/node-notifier/vendor/**"
|
||||
```
|
||||
|
||||
### Using with pkg
|
||||
|
||||
For issues using with the pkg module. Check this issue out: https://github.com/mikaelbr/node-notifier/issues/220#issuecomment-425963752
|
||||
|
||||
### Using Webpack
|
||||
|
||||
When using `node-notifier` inside of `webpack`, you must add the snippet below to your `webpack.config.js`.
|
||||
|
||||
This is necessary because `node-notifier` loads the notifiers from a binary, so it
|
||||
needs a relative file path. When webpack compiles the modules, it supresses file
|
||||
directories, causing `node-notifier` to error on certain platforms.
|
||||
|
||||
To fix this, you can configure webpack to keep the relative file directories.
|
||||
Do so by append the following code to your `webpack.config.js`:
|
||||
|
||||
```javascript
|
||||
node: {
|
||||
__filename: true,
|
||||
__dirname: true
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This package is licensed using the [MIT License](http://en.wikipedia.org/wiki/MIT_License).
|
||||
|
||||
[SnoreToast](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/vendor/snoreToast/LICENSE) and [Notifu](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/vendor/notifu/LICENSE) have licenses in their vendored versions which do not match the MIT license, LGPL-3 and BSD 3-Clause to be specific. We are not lawyers, but have made our best efforts to conform to the terms in those licenses while releasing this package using the license we chose.
|
||||
|
||||
[npm-url]: https://npmjs.org/package/node-notifier
|
||||
[npm-image]: http://img.shields.io/npm/v/node-notifier.svg?style=flat
|
||||
[npm-downloads]: http://img.shields.io/npm/dm/node-notifier.svg?style=flat
|
||||
[travis-url]: http://travis-ci.org/mikaelbr/node-notifier
|
||||
[travis-image]: http://img.shields.io/travis/mikaelbr/node-notifier.svg?style=flat
|
52
node_modules/node-notifier/index.js
generated
vendored
Normal file
52
node_modules/node-notifier/index.js
generated
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
var os = require('os');
|
||||
var utils = require('./lib/utils');
|
||||
|
||||
// All notifiers
|
||||
var NotifySend = require('./notifiers/notifysend');
|
||||
var NotificationCenter = require('./notifiers/notificationcenter');
|
||||
var WindowsToaster = require('./notifiers/toaster');
|
||||
var Growl = require('./notifiers/growl');
|
||||
var WindowsBalloon = require('./notifiers/balloon');
|
||||
|
||||
var options = { withFallback: true };
|
||||
|
||||
var osType = utils.isWSL() ? 'WSL' : os.type();
|
||||
|
||||
switch (osType) {
|
||||
case 'Linux':
|
||||
module.exports = new NotifySend(options);
|
||||
module.exports.Notification = NotifySend;
|
||||
break;
|
||||
case 'Darwin':
|
||||
module.exports = new NotificationCenter(options);
|
||||
module.exports.Notification = NotificationCenter;
|
||||
break;
|
||||
case 'Windows_NT':
|
||||
if (utils.isLessThanWin8()) {
|
||||
module.exports = new WindowsBalloon(options);
|
||||
module.exports.Notification = WindowsBalloon;
|
||||
} else {
|
||||
module.exports = new WindowsToaster(options);
|
||||
module.exports.Notification = WindowsToaster;
|
||||
}
|
||||
break;
|
||||
case 'WSL':
|
||||
module.exports = new WindowsToaster(options);
|
||||
module.exports.Notification = WindowsToaster;
|
||||
break;
|
||||
default:
|
||||
if (os.type().match(/BSD$/)) {
|
||||
module.exports = new NotifySend(options);
|
||||
module.exports.Notification = NotifySend;
|
||||
} else {
|
||||
module.exports = new Growl(options);
|
||||
module.exports.Notification = Growl;
|
||||
}
|
||||
}
|
||||
|
||||
// Expose notifiers to give full control.
|
||||
module.exports.NotifySend = NotifySend;
|
||||
module.exports.NotificationCenter = NotificationCenter;
|
||||
module.exports.WindowsToaster = WindowsToaster;
|
||||
module.exports.WindowsBalloon = WindowsBalloon;
|
||||
module.exports.Growl = Growl;
|
24
node_modules/node-notifier/lib/checkGrowl.js
generated
vendored
Normal file
24
node_modules/node-notifier/lib/checkGrowl.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
var net = require('net');
|
||||
|
||||
var hasGrowl = false;
|
||||
module.exports = function(growlConfig, cb) {
|
||||
if (typeof cb === 'undefined') {
|
||||
cb = growlConfig;
|
||||
growlConfig = {};
|
||||
}
|
||||
if (hasGrowl) return cb(null, hasGrowl);
|
||||
var port = growlConfig.port || 23053;
|
||||
var host = growlConfig.host || 'localhost';
|
||||
var socket = net.connect(port, host);
|
||||
socket.setTimeout(100);
|
||||
|
||||
socket.once('connect', function() {
|
||||
socket.end();
|
||||
cb(null, true);
|
||||
});
|
||||
|
||||
socket.once('error', function() {
|
||||
socket.end();
|
||||
cb(null, false);
|
||||
});
|
||||
};
|
568
node_modules/node-notifier/lib/utils.js
generated
vendored
Normal file
568
node_modules/node-notifier/lib/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,568 @@
|
|||
var shellwords = require('shellwords');
|
||||
var cp = require('child_process');
|
||||
var semver = require('semver');
|
||||
var isWSL = require('is-wsl');
|
||||
var path = require('path');
|
||||
var url = require('url');
|
||||
var os = require('os');
|
||||
var fs = require('fs');
|
||||
var net = require('net');
|
||||
|
||||
const BUFFER_SIZE = 1024;
|
||||
|
||||
function clone(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
module.exports.clone = clone;
|
||||
|
||||
var escapeQuotes = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
return str.replace(/(["$`\\])/g, '\\$1');
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
var inArray = function (arr, val) {
|
||||
return arr.indexOf(val) !== -1;
|
||||
};
|
||||
|
||||
var notifySendFlags = {
|
||||
u: 'urgency',
|
||||
urgency: 'urgency',
|
||||
t: 'expire-time',
|
||||
time: 'expire-time',
|
||||
timeout: 'expire-time',
|
||||
e: 'expire-time',
|
||||
expire: 'expire-time',
|
||||
'expire-time': 'expire-time',
|
||||
i: 'icon',
|
||||
icon: 'icon',
|
||||
c: 'category',
|
||||
category: 'category',
|
||||
subtitle: 'category',
|
||||
h: 'hint',
|
||||
hint: 'hint',
|
||||
a: 'app-name',
|
||||
'app-name': 'app-name'
|
||||
};
|
||||
|
||||
module.exports.command = function (notifier, options, cb) {
|
||||
notifier = shellwords.escape(notifier);
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (command):');
|
||||
console.info('[notifier path]', notifier);
|
||||
console.info('[notifier options]', options.join(' '));
|
||||
}
|
||||
|
||||
return cp.exec(notifier + ' ' + options.join(' '), function (
|
||||
error,
|
||||
stdout,
|
||||
stderr
|
||||
) {
|
||||
if (error) return cb(error);
|
||||
cb(stderr, stdout);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.fileCommand = function (notifier, options, cb) {
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (fileCommand):');
|
||||
console.info('[notifier path]', notifier);
|
||||
console.info('[notifier options]', options.join(' '));
|
||||
}
|
||||
|
||||
return cp.execFile(notifier, options, function (error, stdout, stderr) {
|
||||
if (error) return cb(error, stdout);
|
||||
cb(stderr, stdout);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.fileCommandJson = function (notifier, options, cb) {
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (fileCommandJson):');
|
||||
console.info('[notifier path]', notifier);
|
||||
console.info('[notifier options]', options.join(' '));
|
||||
}
|
||||
return cp.execFile(notifier, options, function (error, stdout, stderr) {
|
||||
if (error) return cb(error, stdout);
|
||||
if (!stdout) return cb(error, {});
|
||||
|
||||
try {
|
||||
var data = JSON.parse(stdout);
|
||||
cb(!stderr ? null : stderr, data);
|
||||
} catch (e) {
|
||||
cb(e, stdout);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.immediateFileCommand = function (notifier, options, cb) {
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (notifier):');
|
||||
console.info('[notifier path]', notifier);
|
||||
}
|
||||
|
||||
notifierExists(notifier, function (_, exists) {
|
||||
if (!exists) {
|
||||
return cb(new Error('Notifier (' + notifier + ') not found on system.'));
|
||||
}
|
||||
cp.execFile(notifier, options);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
|
||||
function notifierExists(notifier, cb) {
|
||||
return fs.stat(notifier, function (err, stat) {
|
||||
if (!err) return cb(err, stat.isFile());
|
||||
|
||||
// Check if Windows alias
|
||||
if (path.extname(notifier)) {
|
||||
// Has extentioon, no need to check more
|
||||
return cb(err, false);
|
||||
}
|
||||
|
||||
// Check if there is an exe file in the directory
|
||||
return fs.stat(notifier + '.exe', function (err, stat) {
|
||||
if (err) return cb(err, false);
|
||||
cb(err, stat.isFile());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var mapAppIcon = function (options) {
|
||||
if (options.appIcon) {
|
||||
options.icon = options.appIcon;
|
||||
delete options.appIcon;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
var mapText = function (options) {
|
||||
if (options.text) {
|
||||
options.message = options.text;
|
||||
delete options.text;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
var mapIconShorthand = function (options) {
|
||||
if (options.i) {
|
||||
options.icon = options.i;
|
||||
delete options.i;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToNotifySend = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.timeout === false) {
|
||||
delete options.timeout;
|
||||
}
|
||||
if (options.wait === true) {
|
||||
options['expire-time'] = 5; // 5 seconds default time (multipled below)
|
||||
}
|
||||
for (var key in options) {
|
||||
if (key === 'message' || key === 'title') continue;
|
||||
if (options.hasOwnProperty(key) && notifySendFlags[key] !== key) {
|
||||
options[notifySendFlags[key]] = options[key];
|
||||
delete options[key];
|
||||
}
|
||||
}
|
||||
if (typeof options['expire-time'] === 'undefined') {
|
||||
options['expire-time'] = 10 * 1000; // 10 sec timeout by default
|
||||
} else if (typeof options['expire-time'] === 'number') {
|
||||
options['expire-time'] = options['expire-time'] * 1000; // notify send uses milliseconds
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToGrowl = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapIconShorthand(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon && !Buffer.isBuffer(options.icon)) {
|
||||
try {
|
||||
options.icon = fs.readFileSync(options.icon);
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToMac = function (options) {
|
||||
options = mapIconShorthand(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon) {
|
||||
options.appIcon = options.icon;
|
||||
delete options.icon;
|
||||
}
|
||||
|
||||
if (options.sound === true) {
|
||||
options.sound = 'Bottle';
|
||||
}
|
||||
|
||||
if (options.sound === false) {
|
||||
delete options.sound;
|
||||
}
|
||||
|
||||
if (options.sound && options.sound.indexOf('Notification.') === 0) {
|
||||
options.sound = 'Bottle';
|
||||
}
|
||||
|
||||
if (options.wait === true) {
|
||||
if (!options.timeout) {
|
||||
options.timeout = 5;
|
||||
}
|
||||
delete options.wait;
|
||||
}
|
||||
|
||||
if (!options.wait && !options.timeout) {
|
||||
if (options.timeout === false) {
|
||||
delete options.timeout;
|
||||
} else {
|
||||
options.timeout = 10;
|
||||
}
|
||||
}
|
||||
|
||||
options.json = true;
|
||||
return options;
|
||||
};
|
||||
|
||||
function isArray(arr) {
|
||||
return Object.prototype.toString.call(arr) === '[object Array]';
|
||||
}
|
||||
module.exports.isArray = isArray;
|
||||
|
||||
function noop() {}
|
||||
module.exports.actionJackerDecorator = function (emitter, options, fn, mapper) {
|
||||
options = clone(options);
|
||||
fn = fn || noop;
|
||||
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError(
|
||||
'The second argument must be a function callback. You have passed ' +
|
||||
typeof fn
|
||||
);
|
||||
}
|
||||
|
||||
return function (err, data) {
|
||||
var resultantData = data;
|
||||
var metadata = {};
|
||||
// Allow for extra data if resultantData is an object
|
||||
if (resultantData && typeof resultantData === 'object') {
|
||||
metadata = resultantData;
|
||||
resultantData = resultantData.activationType;
|
||||
}
|
||||
|
||||
// Sanitize the data
|
||||
if (resultantData) {
|
||||
resultantData = resultantData.toLowerCase().trim();
|
||||
if (resultantData.match(/^activate|clicked$/)) {
|
||||
resultantData = 'activate';
|
||||
}
|
||||
if (resultantData.match(/^timedout$/)) {
|
||||
resultantData = 'timeout';
|
||||
}
|
||||
}
|
||||
|
||||
fn.apply(emitter, [err, resultantData, metadata]);
|
||||
if (!mapper || !resultantData) return;
|
||||
|
||||
var key = mapper(resultantData);
|
||||
if (!key) return;
|
||||
emitter.emit(key, emitter, options, metadata);
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.constructArgumentList = function (options, extra) {
|
||||
var args = [];
|
||||
extra = extra || {};
|
||||
|
||||
// Massive ugly setup. Default args
|
||||
var initial = extra.initial || [];
|
||||
var keyExtra = extra.keyExtra || '';
|
||||
var allowedArguments = extra.allowedArguments || [];
|
||||
var noEscape = extra.noEscape !== undefined;
|
||||
var checkForAllowed = extra.allowedArguments !== undefined;
|
||||
var explicitTrue = !!extra.explicitTrue;
|
||||
var keepNewlines = !!extra.keepNewlines;
|
||||
var wrapper = extra.wrapper === undefined ? '"' : extra.wrapper;
|
||||
|
||||
var escapeFn = function escapeFn(arg) {
|
||||
if (isArray(arg)) {
|
||||
return removeNewLines(arg.map(escapeFn).join(','));
|
||||
}
|
||||
|
||||
if (!noEscape) {
|
||||
arg = escapeQuotes(arg);
|
||||
}
|
||||
if (typeof arg === 'string' && !keepNewlines) {
|
||||
arg = removeNewLines(arg);
|
||||
}
|
||||
return wrapper + arg + wrapper;
|
||||
};
|
||||
|
||||
initial.forEach(function (val) {
|
||||
args.push(escapeFn(val));
|
||||
});
|
||||
for (var key in options) {
|
||||
if (
|
||||
options.hasOwnProperty(key) &&
|
||||
(!checkForAllowed || inArray(allowedArguments, key))
|
||||
) {
|
||||
if (explicitTrue && options[key] === true) {
|
||||
args.push('-' + keyExtra + key);
|
||||
} else if (explicitTrue && options[key] === false) continue;
|
||||
else args.push('-' + keyExtra + key, escapeFn(options[key]));
|
||||
}
|
||||
}
|
||||
return args;
|
||||
};
|
||||
|
||||
function removeNewLines(str) {
|
||||
var excapedNewline = process.platform === 'win32' ? '\\r\\n' : '\\n';
|
||||
return str.replace(/\r?\n/g, excapedNewline);
|
||||
}
|
||||
|
||||
/*
|
||||
---- Options ----
|
||||
[-t] <title string> | Displayed on the first line of the toast.
|
||||
[-m] <message string> | Displayed on the remaining lines, wrapped.
|
||||
[-b] <button1;button2 string>| Displayed on the bottom line, can list multiple buttons separated by ";"
|
||||
[-tb] | Displayed a textbox on the bottom line, only if buttons are not presented.
|
||||
[-p] <image URI> | Display toast with an image, local files only.
|
||||
[-id] <id> | sets the id for a notification to be able to close it later.
|
||||
[-s] <sound URI> | Sets the sound of the notifications, for possible values see http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx.
|
||||
[-silent] | Don't play a sound file when showing the notifications.
|
||||
[-appID] <App.ID> | Don't create a shortcut but use the provided app id.
|
||||
[-pid] <pid> | Query the appid for the process <pid>, use -appID as fallback. (Only relevant for applications that might be packaged for the store)
|
||||
[-pipeName] <\.\pipe\pipeName\> | Provide a name pipe which is used for callbacks.
|
||||
[-application] <C:\foo.exe> | Provide a application that might be started if the pipe does not exist.
|
||||
-close <id> | Closes a currently displayed notification.
|
||||
*/
|
||||
var allowedToasterFlags = [
|
||||
't',
|
||||
'm',
|
||||
'b',
|
||||
'tb',
|
||||
'p',
|
||||
'id',
|
||||
's',
|
||||
'silent',
|
||||
'appID',
|
||||
'pid',
|
||||
'pipeName',
|
||||
'close',
|
||||
'install'
|
||||
];
|
||||
var toasterSoundPrefix = 'Notification.';
|
||||
var toasterDefaultSound = 'Notification.Default';
|
||||
module.exports.mapToWin8 = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon) {
|
||||
if (/^file:\/+/.test(options.icon)) {
|
||||
// should parse file protocol URL to path
|
||||
options.p = new url.URL(options.icon).pathname
|
||||
.replace(/^\/(\w:\/)/, '$1')
|
||||
.replace(/\//g, '\\');
|
||||
} else {
|
||||
options.p = options.icon;
|
||||
}
|
||||
delete options.icon;
|
||||
}
|
||||
|
||||
if (options.message) {
|
||||
// Remove escape char to debug "HRESULT : 0xC00CE508" exception
|
||||
options.m = options.message.replace(/\x1b/g, '');
|
||||
delete options.message;
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
options.t = options.title;
|
||||
delete options.title;
|
||||
}
|
||||
|
||||
if (options.appName) {
|
||||
options.appID = options.appName;
|
||||
delete options.appName;
|
||||
}
|
||||
|
||||
if (typeof options.remove !== 'undefined') {
|
||||
options.close = options.remove;
|
||||
delete options.remove;
|
||||
}
|
||||
|
||||
if (options.quiet || options.silent) {
|
||||
options.silent = options.quiet || options.silent;
|
||||
delete options.quiet;
|
||||
}
|
||||
|
||||
if (typeof options.sound !== 'undefined') {
|
||||
options.s = options.sound;
|
||||
delete options.sound;
|
||||
}
|
||||
|
||||
if (options.s === false) {
|
||||
options.silent = true;
|
||||
delete options.s;
|
||||
}
|
||||
|
||||
// Silent takes precedence. Remove sound.
|
||||
if (options.s && options.silent) {
|
||||
delete options.s;
|
||||
}
|
||||
|
||||
if (options.s === true) {
|
||||
options.s = toasterDefaultSound;
|
||||
}
|
||||
|
||||
if (options.s && options.s.indexOf(toasterSoundPrefix) !== 0) {
|
||||
options.s = toasterDefaultSound;
|
||||
}
|
||||
|
||||
if (options.actions && isArray(options.actions)) {
|
||||
options.b = options.actions.join(';');
|
||||
delete options.actions;
|
||||
}
|
||||
|
||||
for (var key in options) {
|
||||
// Check if is allowed. If not, delete!
|
||||
if (
|
||||
options.hasOwnProperty(key) &&
|
||||
allowedToasterFlags.indexOf(key) === -1
|
||||
) {
|
||||
delete options[key];
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToNotifu = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon) {
|
||||
options.i = options.icon;
|
||||
delete options.icon;
|
||||
}
|
||||
|
||||
if (options.message) {
|
||||
options.m = options.message;
|
||||
delete options.message;
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
options.p = options.title;
|
||||
delete options.title;
|
||||
}
|
||||
|
||||
if (options.time) {
|
||||
options.d = options.time;
|
||||
delete options.time;
|
||||
}
|
||||
|
||||
if (options.q !== false) {
|
||||
options.q = true;
|
||||
} else {
|
||||
delete options.q;
|
||||
}
|
||||
|
||||
if (options.quiet === false) {
|
||||
delete options.q;
|
||||
delete options.quiet;
|
||||
}
|
||||
|
||||
if (options.sound) {
|
||||
delete options.q;
|
||||
delete options.sound;
|
||||
}
|
||||
|
||||
if (options.t) {
|
||||
options.d = options.t;
|
||||
delete options.t;
|
||||
}
|
||||
|
||||
if (options.type) {
|
||||
options.t = sanitizeNotifuTypeArgument(options.type);
|
||||
delete options.type;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.isMac = function () {
|
||||
return os.type() === 'Darwin';
|
||||
};
|
||||
|
||||
module.exports.isMountainLion = function () {
|
||||
return (
|
||||
os.type() === 'Darwin' &&
|
||||
semver.satisfies(garanteeSemverFormat(os.release()), '>=12.0.0')
|
||||
);
|
||||
};
|
||||
|
||||
module.exports.isWin8 = function () {
|
||||
return (
|
||||
os.type() === 'Windows_NT' &&
|
||||
semver.satisfies(garanteeSemverFormat(os.release()), '>=6.2.9200')
|
||||
);
|
||||
};
|
||||
|
||||
module.exports.isWSL = function () {
|
||||
return isWSL;
|
||||
};
|
||||
|
||||
module.exports.isLessThanWin8 = function () {
|
||||
return (
|
||||
os.type() === 'Windows_NT' &&
|
||||
semver.satisfies(garanteeSemverFormat(os.release()), '<6.2.9200')
|
||||
);
|
||||
};
|
||||
|
||||
function garanteeSemverFormat(version) {
|
||||
if (version.split('.').length === 2) {
|
||||
version += '.0';
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
function sanitizeNotifuTypeArgument(type) {
|
||||
if (typeof type === 'string' || type instanceof String) {
|
||||
if (type.toLowerCase() === 'info') return 'info';
|
||||
if (type.toLowerCase() === 'warn') return 'warn';
|
||||
if (type.toLowerCase() === 'error') return 'error';
|
||||
}
|
||||
|
||||
return 'info';
|
||||
}
|
||||
|
||||
module.exports.createNamedPipe = (server) => {
|
||||
const buf = Buffer.alloc(BUFFER_SIZE);
|
||||
|
||||
return new Promise((resolve) => {
|
||||
server.instance = net.createServer((stream) => {
|
||||
stream.on('data', (c) => {
|
||||
buf.write(c.toString());
|
||||
});
|
||||
stream.on('end', () => {
|
||||
server.instance.close();
|
||||
});
|
||||
});
|
||||
server.instance.listen(server.namedPipe, () => {
|
||||
resolve(buf);
|
||||
});
|
||||
});
|
||||
};
|
15
node_modules/node-notifier/node_modules/semver/LICENSE
generated
vendored
Normal file
15
node_modules/node-notifier/node_modules/semver/LICENSE
generated
vendored
Normal file
|
@ -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.
|
568
node_modules/node-notifier/node_modules/semver/README.md
generated
vendored
Normal file
568
node_modules/node-notifier/node_modules/semver/README.md
generated
vendored
Normal file
|
@ -0,0 +1,568 @@
|
|||
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'
|
||||
```
|
||||
|
||||
You can also just load the module for the function that you care about, if
|
||||
you'd like to minimize your footprint.
|
||||
|
||||
```js
|
||||
// load the whole API at once in a single object
|
||||
const semver = require('semver')
|
||||
|
||||
// or just load the bits you need
|
||||
// all of them listed here, just pick and choose what you want
|
||||
|
||||
// classes
|
||||
const SemVer = require('semver/classes/semver')
|
||||
const Comparator = require('semver/classes/comparator')
|
||||
const Range = require('semver/classes/range')
|
||||
|
||||
// functions for working with versions
|
||||
const semverParse = require('semver/functions/parse')
|
||||
const semverValid = require('semver/functions/valid')
|
||||
const semverClean = require('semver/functions/clean')
|
||||
const semverInc = require('semver/functions/inc')
|
||||
const semverDiff = require('semver/functions/diff')
|
||||
const semverMajor = require('semver/functions/major')
|
||||
const semverMinor = require('semver/functions/minor')
|
||||
const semverPatch = require('semver/functions/patch')
|
||||
const semverPrerelease = require('semver/functions/prerelease')
|
||||
const semverCompare = require('semver/functions/compare')
|
||||
const semverRcompare = require('semver/functions/rcompare')
|
||||
const semverCompareLoose = require('semver/functions/compare-loose')
|
||||
const semverCompareBuild = require('semver/functions/compare-build')
|
||||
const semverSort = require('semver/functions/sort')
|
||||
const semverRsort = require('semver/functions/rsort')
|
||||
|
||||
// low-level comparators between versions
|
||||
const semverGt = require('semver/functions/gt')
|
||||
const semverLt = require('semver/functions/lt')
|
||||
const semverEq = require('semver/functions/eq')
|
||||
const semverNeq = require('semver/functions/neq')
|
||||
const semverGte = require('semver/functions/gte')
|
||||
const semverLte = require('semver/functions/lte')
|
||||
const semverCmp = require('semver/functions/cmp')
|
||||
const semverCoerce = require('semver/functions/coerce')
|
||||
|
||||
// working with ranges
|
||||
const semverSatisfies = require('semver/functions/satisfies')
|
||||
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
|
||||
const semverMinSatisfying = require('semver/ranges/min-satisfying')
|
||||
const semverToComparators = require('semver/ranges/to-comparators')
|
||||
const semverMinVersion = require('semver/ranges/min-version')
|
||||
const semverValidRange = require('semver/ranges/valid')
|
||||
const semverOutside = require('semver/ranges/outside')
|
||||
const semverGtr = require('semver/ranges/gtr')
|
||||
const semverLtr = require('semver/ranges/ltr')
|
||||
const semverIntersects = require('semver/ranges/intersects')
|
||||
const simplifyRange = require('semver/ranges/simplify')
|
||||
const rangeSubset = require('semver/ranges/subset')
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
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>
|
||||
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
|
||||
<https://semver.org/>.
|
||||
|
||||
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-0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.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 non-prerelease version satisfies, unless
|
||||
`includePrerelease` is specified, in which case any version at all
|
||||
satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0-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-0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-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-0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.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.
|
||||
|
||||
#### 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`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.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-0` 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.0.x` := `>=0.0.0 <0.1.0-0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0-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`
|
||||
* `^0.x` := `>=0.0.0 <1.0.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
|
||||
* `simplifyRange(versions, range)`: Return a "simplified" range that
|
||||
matches the same items in `versions` list as the range specified. Note
|
||||
that it does *not* guarantee that it would match the same versions in all
|
||||
cases, only for the set of versions provided. This is useful when
|
||||
generating ranges by joining together multiple versions with `||`
|
||||
programmatically, to provide the user with something a bit more
|
||||
ergonomic. If the provided range is shorter in string-length than the
|
||||
generated range, then that is returned.
|
||||
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
|
||||
entirely contained by the `superRange` range.
|
||||
|
||||
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 `Number.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`
|
||||
|
||||
## Exported Modules
|
||||
|
||||
<!--
|
||||
TODO: Make sure that all of these items are documented (classes aren't,
|
||||
eg), and then pull the module name into the documentation for that specific
|
||||
thing.
|
||||
-->
|
||||
|
||||
You may pull in just the part of this semver utility that you need, if you
|
||||
are sensitive to packing and tree-shaking concerns. The main
|
||||
`require('semver')` export uses getter functions to lazily load the parts
|
||||
of the API that are used.
|
||||
|
||||
The following modules are available:
|
||||
|
||||
* `require('semver')`
|
||||
* `require('semver/classes')`
|
||||
* `require('semver/classes/comparator')`
|
||||
* `require('semver/classes/range')`
|
||||
* `require('semver/classes/semver')`
|
||||
* `require('semver/functions/clean')`
|
||||
* `require('semver/functions/cmp')`
|
||||
* `require('semver/functions/coerce')`
|
||||
* `require('semver/functions/compare')`
|
||||
* `require('semver/functions/compare-build')`
|
||||
* `require('semver/functions/compare-loose')`
|
||||
* `require('semver/functions/diff')`
|
||||
* `require('semver/functions/eq')`
|
||||
* `require('semver/functions/gt')`
|
||||
* `require('semver/functions/gte')`
|
||||
* `require('semver/functions/inc')`
|
||||
* `require('semver/functions/lt')`
|
||||
* `require('semver/functions/lte')`
|
||||
* `require('semver/functions/major')`
|
||||
* `require('semver/functions/minor')`
|
||||
* `require('semver/functions/neq')`
|
||||
* `require('semver/functions/parse')`
|
||||
* `require('semver/functions/patch')`
|
||||
* `require('semver/functions/prerelease')`
|
||||
* `require('semver/functions/rcompare')`
|
||||
* `require('semver/functions/rsort')`
|
||||
* `require('semver/functions/satisfies')`
|
||||
* `require('semver/functions/sort')`
|
||||
* `require('semver/functions/valid')`
|
||||
* `require('semver/ranges/gtr')`
|
||||
* `require('semver/ranges/intersects')`
|
||||
* `require('semver/ranges/ltr')`
|
||||
* `require('semver/ranges/max-satisfying')`
|
||||
* `require('semver/ranges/min-satisfying')`
|
||||
* `require('semver/ranges/min-version')`
|
||||
* `require('semver/ranges/outside')`
|
||||
* `require('semver/ranges/to-comparators')`
|
||||
* `require('semver/ranges/valid')`
|
136
node_modules/node-notifier/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
136
node_modules/node-notifier/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
|
@ -0,0 +1,136 @@
|
|||
const ANY = Symbol('SemVer ANY')
|
||||
// hoisted class for cyclic dependency
|
||||
class Comparator {
|
||||
static get ANY () {
|
||||
return ANY
|
||||
}
|
||||
|
||||
constructor (comp, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (comp instanceof Comparator) {
|
||||
if (comp.loose === !!options.loose) {
|
||||
return comp
|
||||
} else {
|
||||
comp = comp.value
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
parse (comp) {
|
||||
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
|
||||
const 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)
|
||||
}
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.value
|
||||
}
|
||||
|
||||
test (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)
|
||||
}
|
||||
|
||||
intersects (comp, options) {
|
||||
if (!(comp instanceof Comparator)) {
|
||||
throw new TypeError('a Comparator is required')
|
||||
}
|
||||
|
||||
if (!options || typeof options !== 'object') {
|
||||
options = {
|
||||
loose: !!options,
|
||||
includePrerelease: false,
|
||||
}
|
||||
}
|
||||
|
||||
if (this.operator === '') {
|
||||
if (this.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(comp.value, options).test(this.value)
|
||||
} else if (comp.operator === '') {
|
||||
if (comp.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(this.value, options).test(comp.semver)
|
||||
}
|
||||
|
||||
const sameDirectionIncreasing =
|
||||
(this.operator === '>=' || this.operator === '>') &&
|
||||
(comp.operator === '>=' || comp.operator === '>')
|
||||
const sameDirectionDecreasing =
|
||||
(this.operator === '<=' || this.operator === '<') &&
|
||||
(comp.operator === '<=' || comp.operator === '<')
|
||||
const sameSemVer = this.semver.version === comp.semver.version
|
||||
const differentDirectionsInclusive =
|
||||
(this.operator === '>=' || this.operator === '<=') &&
|
||||
(comp.operator === '>=' || comp.operator === '<=')
|
||||
const oppositeDirectionsLessThan =
|
||||
cmp(this.semver, '<', comp.semver, options) &&
|
||||
(this.operator === '>=' || this.operator === '>') &&
|
||||
(comp.operator === '<=' || comp.operator === '<')
|
||||
const oppositeDirectionsGreaterThan =
|
||||
cmp(this.semver, '>', comp.semver, options) &&
|
||||
(this.operator === '<=' || this.operator === '<') &&
|
||||
(comp.operator === '>=' || comp.operator === '>')
|
||||
|
||||
return (
|
||||
sameDirectionIncreasing ||
|
||||
sameDirectionDecreasing ||
|
||||
(sameSemVer && differentDirectionsInclusive) ||
|
||||
oppositeDirectionsLessThan ||
|
||||
oppositeDirectionsGreaterThan
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Comparator
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { re, t } = require('../internal/re')
|
||||
const cmp = require('../functions/cmp')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const Range = require('./range')
|
5
node_modules/node-notifier/node_modules/semver/classes/index.js
generated
vendored
Normal file
5
node_modules/node-notifier/node_modules/semver/classes/index.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
SemVer: require('./semver.js'),
|
||||
Range: require('./range.js'),
|
||||
Comparator: require('./comparator.js'),
|
||||
}
|
519
node_modules/node-notifier/node_modules/semver/classes/range.js
generated
vendored
Normal file
519
node_modules/node-notifier/node_modules/semver/classes/range.js
generated
vendored
Normal file
|
@ -0,0 +1,519 @@
|
|||
// hoisted class for cyclic dependency
|
||||
class Range {
|
||||
constructor (range, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
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) {
|
||||
// just put it in the set and return
|
||||
this.raw = range.value
|
||||
this.set = [[range]]
|
||||
this.format()
|
||||
return this
|
||||
}
|
||||
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
// First, split based on boolean or ||
|
||||
this.raw = range
|
||||
this.set = range
|
||||
.split('||')
|
||||
// map the range to a 2d array of comparators
|
||||
.map(r => this.parseRange(r.trim()))
|
||||
// throw out any comparator lists that are empty
|
||||
// this generally means that it was not a valid range, which is allowed
|
||||
// in loose mode, but will still throw if the WHOLE range is invalid.
|
||||
.filter(c => c.length)
|
||||
|
||||
if (!this.set.length) {
|
||||
throw new TypeError(`Invalid SemVer Range: ${range}`)
|
||||
}
|
||||
|
||||
// if we have any that are not the null set, throw out null sets.
|
||||
if (this.set.length > 1) {
|
||||
// keep the first one, in case they're all null sets
|
||||
const first = this.set[0]
|
||||
this.set = this.set.filter(c => !isNullSet(c[0]))
|
||||
if (this.set.length === 0) {
|
||||
this.set = [first]
|
||||
} else if (this.set.length > 1) {
|
||||
// if we have any that are *, then the range is just *
|
||||
for (const c of this.set) {
|
||||
if (c.length === 1 && isAny(c[0])) {
|
||||
this.set = [c]
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.range = this.set
|
||||
.map((comps) => {
|
||||
return comps.join(' ').trim()
|
||||
})
|
||||
.join('||')
|
||||
.trim()
|
||||
return this.range
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.range
|
||||
}
|
||||
|
||||
parseRange (range) {
|
||||
range = range.trim()
|
||||
|
||||
// memoize range parsing for performance.
|
||||
// this is a very hot path, and fully deterministic.
|
||||
const memoOpts = Object.keys(this.options).join(',')
|
||||
const memoKey = `parseRange:${memoOpts}:${range}`
|
||||
const cached = cache.get(memoKey)
|
||||
if (cached) {
|
||||
return cached
|
||||
}
|
||||
|
||||
const loose = this.options.loose
|
||||
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
||||
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
|
||||
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
|
||||
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)
|
||||
|
||||
// `~ 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.
|
||||
|
||||
let rangeList = range
|
||||
.split(' ')
|
||||
.map(comp => parseComparator(comp, this.options))
|
||||
.join(' ')
|
||||
.split(/\s+/)
|
||||
// >=0.0.0 is equivalent to *
|
||||
.map(comp => replaceGTE0(comp, this.options))
|
||||
|
||||
if (loose) {
|
||||
// in loose mode, throw out any that are not valid comparators
|
||||
rangeList = rangeList.filter(comp => {
|
||||
debug('loose invalid filter', comp, this.options)
|
||||
return !!comp.match(re[t.COMPARATORLOOSE])
|
||||
})
|
||||
}
|
||||
debug('range list', rangeList)
|
||||
|
||||
// if any comparators are the null set, then replace with JUST null set
|
||||
// if more than one comparator, remove any * comparators
|
||||
// also, don't include the same comparator more than once
|
||||
const rangeMap = new Map()
|
||||
const comparators = rangeList.map(comp => new Comparator(comp, this.options))
|
||||
for (const comp of comparators) {
|
||||
if (isNullSet(comp)) {
|
||||
return [comp]
|
||||
}
|
||||
rangeMap.set(comp.value, comp)
|
||||
}
|
||||
if (rangeMap.size > 1 && rangeMap.has('')) {
|
||||
rangeMap.delete('')
|
||||
}
|
||||
|
||||
const result = [...rangeMap.values()]
|
||||
cache.set(memoKey, result)
|
||||
return result
|
||||
}
|
||||
|
||||
intersects (range, options) {
|
||||
if (!(range instanceof Range)) {
|
||||
throw new TypeError('a Range is required')
|
||||
}
|
||||
|
||||
return this.set.some((thisComparators) => {
|
||||
return (
|
||||
isSatisfiable(thisComparators, options) &&
|
||||
range.set.some((rangeComparators) => {
|
||||
return (
|
||||
isSatisfiable(rangeComparators, options) &&
|
||||
thisComparators.every((thisComparator) => {
|
||||
return rangeComparators.every((rangeComparator) => {
|
||||
return thisComparator.intersects(rangeComparator, options)
|
||||
})
|
||||
})
|
||||
)
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// if ANY of the sets match ALL of its comparators, then pass
|
||||
test (version) {
|
||||
if (!version) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof version === 'string') {
|
||||
try {
|
||||
version = new SemVer(version, this.options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.set.length; i++) {
|
||||
if (testSet(this.set[i], version, this.options)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
module.exports = Range
|
||||
|
||||
const LRU = require('lru-cache')
|
||||
const cache = new LRU({ max: 1000 })
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const Comparator = require('./comparator')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const {
|
||||
re,
|
||||
t,
|
||||
comparatorTrimReplace,
|
||||
tildeTrimReplace,
|
||||
caretTrimReplace,
|
||||
} = require('../internal/re')
|
||||
|
||||
const isNullSet = c => c.value === '<0.0.0-0'
|
||||
const isAny = c => c.value === ''
|
||||
|
||||
// take a set of comparators and determine whether there
|
||||
// exists a version which can satisfy it
|
||||
const isSatisfiable = (comparators, options) => {
|
||||
let result = true
|
||||
const remainingComparators = comparators.slice()
|
||||
let testComparator = remainingComparators.pop()
|
||||
|
||||
while (result && remainingComparators.length) {
|
||||
result = remainingComparators.every((otherComparator) => {
|
||||
return testComparator.intersects(otherComparator, options)
|
||||
})
|
||||
|
||||
testComparator = remainingComparators.pop()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
||||
// already replaced the hyphen ranges
|
||||
// turn into a set of JUST comparators.
|
||||
const 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
|
||||
}
|
||||
|
||||
const isX = id => !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-0
|
||||
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
|
||||
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
|
||||
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
|
||||
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
|
||||
const replaceTildes = (comp, options) =>
|
||||
comp.trim().split(/\s+/).map((c) => {
|
||||
return replaceTilde(c, options)
|
||||
}).join(' ')
|
||||
|
||||
const replaceTilde = (comp, options) => {
|
||||
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('tilde', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
// ~1.2 == >=1.2.0 <1.3.0-0
|
||||
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
|
||||
} else if (pr) {
|
||||
debug('replaceTilde pr', pr)
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
// ~1.2.3 == >=1.2.3 <1.3.0-0
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
|
||||
debug('tilde return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
// ^ --> * (any, kinda silly)
|
||||
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
|
||||
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
|
||||
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
|
||||
// ^1.2.3 --> >=1.2.3 <2.0.0-0
|
||||
// ^1.2.0 --> >=1.2.0 <2.0.0-0
|
||||
const replaceCarets = (comp, options) =>
|
||||
comp.trim().split(/\s+/).map((c) => {
|
||||
return replaceCaret(c, options)
|
||||
}).join(' ')
|
||||
|
||||
const replaceCaret = (comp, options) => {
|
||||
debug('caret', comp, options)
|
||||
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
|
||||
const z = options.includePrerelease ? '-0' : ''
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('caret', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
if (M === '0') {
|
||||
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else if (pr) {
|
||||
debug('replaceCaret pr', pr)
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else {
|
||||
debug('no pr')
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
}
|
||||
|
||||
debug('caret return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
const replaceXRanges = (comp, options) => {
|
||||
debug('replaceXRanges', comp, options)
|
||||
return comp.split(/\s+/).map((c) => {
|
||||
return replaceXRange(c, options)
|
||||
}).join(' ')
|
||||
}
|
||||
|
||||
const replaceXRange = (comp, options) => {
|
||||
comp = comp.trim()
|
||||
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
|
||||
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
||||
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
||||
const xM = isX(M)
|
||||
const xm = xM || isX(m)
|
||||
const xp = xm || isX(p)
|
||||
const 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
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
if (gtlt === '<') {
|
||||
pr = '-0'
|
||||
}
|
||||
|
||||
ret = `${gtlt + M}.${m}.${p}${pr}`
|
||||
} else if (xm) {
|
||||
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
|
||||
} else if (xp) {
|
||||
ret = `>=${M}.${m}.0${pr
|
||||
} <${M}.${+m + 1}.0-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.
|
||||
const 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], '')
|
||||
}
|
||||
|
||||
const replaceGTE0 = (comp, options) => {
|
||||
debug('replaceGTE0', comp, options)
|
||||
return comp.trim()
|
||||
.replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
|
||||
}
|
||||
|
||||
// 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-0 Any 3.4.x will do
|
||||
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
||||
const hyphenReplace = incPr => ($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${incPr ? '-0' : ''}`
|
||||
} else if (isX(fp)) {
|
||||
from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
|
||||
} else if (fpr) {
|
||||
from = `>=${from}`
|
||||
} else {
|
||||
from = `>=${from}${incPr ? '-0' : ''}`
|
||||
}
|
||||
|
||||
if (isX(tM)) {
|
||||
to = ''
|
||||
} else if (isX(tm)) {
|
||||
to = `<${+tM + 1}.0.0-0`
|
||||
} else if (isX(tp)) {
|
||||
to = `<${tM}.${+tm + 1}.0-0`
|
||||
} else if (tpr) {
|
||||
to = `<=${tM}.${tm}.${tp}-${tpr}`
|
||||
} else if (incPr) {
|
||||
to = `<${tM}.${tm}.${+tp + 1}-0`
|
||||
} else {
|
||||
to = `<=${to}`
|
||||
}
|
||||
|
||||
return (`${from} ${to}`).trim()
|
||||
}
|
||||
|
||||
const testSet = (set, version, options) => {
|
||||
for (let 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 (let i = 0; i < set.length; i++) {
|
||||
debug(set[i].semver)
|
||||
if (set[i].semver === Comparator.ANY) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (set[i].semver.prerelease.length > 0) {
|
||||
const 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
|
||||
}
|
287
node_modules/node-notifier/node_modules/semver/classes/semver.js
generated
vendored
Normal file
287
node_modules/node-notifier/node_modules/semver/classes/semver.js
generated
vendored
Normal file
|
@ -0,0 +1,287 @@
|
|||
const debug = require('../internal/debug')
|
||||
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
||||
const { re, t } = require('../internal/re')
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { compareIdentifiers } = require('../internal/identifiers')
|
||||
class SemVer {
|
||||
constructor (version, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
if (version.loose === !!options.loose &&
|
||||
version.includePrerelease === !!options.includePrerelease) {
|
||||
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`
|
||||
)
|
||||
}
|
||||
|
||||
debug('SemVer', version, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
// this isn't actually relevant for versions, but keep it so that we
|
||||
// don't run into trouble passing this.options around.
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
const 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((id) => {
|
||||
if (/^[0-9]+$/.test(id)) {
|
||||
const num = +id
|
||||
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
||||
return num
|
||||
}
|
||||
}
|
||||
return id
|
||||
})
|
||||
}
|
||||
|
||||
this.build = m[5] ? m[5].split('.') : []
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.version = `${this.major}.${this.minor}.${this.patch}`
|
||||
if (this.prerelease.length) {
|
||||
this.version += `-${this.prerelease.join('.')}`
|
||||
}
|
||||
return this.version
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.version
|
||||
}
|
||||
|
||||
compare (other) {
|
||||
debug('SemVer.compare', this.version, this.options, other)
|
||||
if (!(other instanceof SemVer)) {
|
||||
if (typeof other === 'string' && other === this.version) {
|
||||
return 0
|
||||
}
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
if (other.version === this.version) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return this.compareMain(other) || this.comparePre(other)
|
||||
}
|
||||
|
||||
compareMain (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)
|
||||
)
|
||||
}
|
||||
|
||||
comparePre (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
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.prerelease[i]
|
||||
const 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)
|
||||
}
|
||||
|
||||
compareBuild (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.build[i]
|
||||
const 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.
|
||||
inc (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 {
|
||||
let 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 (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SemVer
|
6
node_modules/node-notifier/node_modules/semver/functions/clean.js
generated
vendored
Normal file
6
node_modules/node-notifier/node_modules/semver/functions/clean.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
const parse = require('./parse')
|
||||
const clean = (version, options) => {
|
||||
const s = parse(version.trim().replace(/^[=v]+/, ''), options)
|
||||
return s ? s.version : null
|
||||
}
|
||||
module.exports = clean
|
52
node_modules/node-notifier/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
52
node_modules/node-notifier/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
const eq = require('./eq')
|
||||
const neq = require('./neq')
|
||||
const gt = require('./gt')
|
||||
const gte = require('./gte')
|
||||
const lt = require('./lt')
|
||||
const lte = require('./lte')
|
||||
|
||||
const 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}`)
|
||||
}
|
||||
}
|
||||
module.exports = cmp
|
52
node_modules/node-notifier/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
52
node_modules/node-notifier/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const parse = require('./parse')
|
||||
const { re, t } = require('../internal/re')
|
||||
|
||||
const coerce = (version, options) => {
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
|
||||
if (typeof version === 'number') {
|
||||
version = String(version)
|
||||
}
|
||||
|
||||
if (typeof version !== 'string') {
|
||||
return null
|
||||
}
|
||||
|
||||
options = options || {}
|
||||
|
||||
let 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.
|
||||
let 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)
|
||||
}
|
||||
module.exports = coerce
|
7
node_modules/node-notifier/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
7
node_modules/node-notifier/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const compareBuild = (a, b, loose) => {
|
||||
const versionA = new SemVer(a, loose)
|
||||
const versionB = new SemVer(b, loose)
|
||||
return versionA.compare(versionB) || versionA.compareBuild(versionB)
|
||||
}
|
||||
module.exports = compareBuild
|
3
node_modules/node-notifier/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const compareLoose = (a, b) => compare(a, b, true)
|
||||
module.exports = compareLoose
|
5
node_modules/node-notifier/node_modules/semver/functions/compare.js
generated
vendored
Normal file
5
node_modules/node-notifier/node_modules/semver/functions/compare.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const compare = (a, b, loose) =>
|
||||
new SemVer(a, loose).compare(new SemVer(b, loose))
|
||||
|
||||
module.exports = compare
|
23
node_modules/node-notifier/node_modules/semver/functions/diff.js
generated
vendored
Normal file
23
node_modules/node-notifier/node_modules/semver/functions/diff.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
const parse = require('./parse')
|
||||
const eq = require('./eq')
|
||||
|
||||
const diff = (version1, version2) => {
|
||||
if (eq(version1, version2)) {
|
||||
return null
|
||||
} else {
|
||||
const v1 = parse(version1)
|
||||
const v2 = parse(version2)
|
||||
const hasPre = v1.prerelease.length || v2.prerelease.length
|
||||
const prefix = hasPre ? 'pre' : ''
|
||||
const defaultResult = hasPre ? 'prerelease' : ''
|
||||
for (const key in v1) {
|
||||
if (key === 'major' || key === 'minor' || key === 'patch') {
|
||||
if (v1[key] !== v2[key]) {
|
||||
return prefix + key
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultResult // may be undefined
|
||||
}
|
||||
}
|
||||
module.exports = diff
|
3
node_modules/node-notifier/node_modules/semver/functions/eq.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/eq.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const eq = (a, b, loose) => compare(a, b, loose) === 0
|
||||
module.exports = eq
|
3
node_modules/node-notifier/node_modules/semver/functions/gt.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/gt.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const gt = (a, b, loose) => compare(a, b, loose) > 0
|
||||
module.exports = gt
|
3
node_modules/node-notifier/node_modules/semver/functions/gte.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/gte.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const gte = (a, b, loose) => compare(a, b, loose) >= 0
|
||||
module.exports = gte
|
18
node_modules/node-notifier/node_modules/semver/functions/inc.js
generated
vendored
Normal file
18
node_modules/node-notifier/node_modules/semver/functions/inc.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
|
||||
const inc = (version, release, options, identifier) => {
|
||||
if (typeof (options) === 'string') {
|
||||
identifier = options
|
||||
options = undefined
|
||||
}
|
||||
|
||||
try {
|
||||
return new SemVer(
|
||||
version instanceof SemVer ? version.version : version,
|
||||
options
|
||||
).inc(release, identifier).version
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
module.exports = inc
|
3
node_modules/node-notifier/node_modules/semver/functions/lt.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/lt.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const lt = (a, b, loose) => compare(a, b, loose) < 0
|
||||
module.exports = lt
|
3
node_modules/node-notifier/node_modules/semver/functions/lte.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/lte.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const lte = (a, b, loose) => compare(a, b, loose) <= 0
|
||||
module.exports = lte
|
3
node_modules/node-notifier/node_modules/semver/functions/major.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/major.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const major = (a, loose) => new SemVer(a, loose).major
|
||||
module.exports = major
|
3
node_modules/node-notifier/node_modules/semver/functions/minor.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/minor.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const minor = (a, loose) => new SemVer(a, loose).minor
|
||||
module.exports = minor
|
3
node_modules/node-notifier/node_modules/semver/functions/neq.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/neq.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const neq = (a, b, loose) => compare(a, b, loose) !== 0
|
||||
module.exports = neq
|
33
node_modules/node-notifier/node_modules/semver/functions/parse.js
generated
vendored
Normal file
33
node_modules/node-notifier/node_modules/semver/functions/parse.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
const { MAX_LENGTH } = require('../internal/constants')
|
||||
const { re, t } = require('../internal/re')
|
||||
const SemVer = require('../classes/semver')
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const parse = (version, options) => {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
|
||||
if (typeof version !== 'string') {
|
||||
return null
|
||||
}
|
||||
|
||||
if (version.length > MAX_LENGTH) {
|
||||
return null
|
||||
}
|
||||
|
||||
const 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
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = parse
|
3
node_modules/node-notifier/node_modules/semver/functions/patch.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/patch.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const patch = (a, loose) => new SemVer(a, loose).patch
|
||||
module.exports = patch
|
6
node_modules/node-notifier/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
6
node_modules/node-notifier/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
const parse = require('./parse')
|
||||
const prerelease = (version, options) => {
|
||||
const parsed = parse(version, options)
|
||||
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
||||
}
|
||||
module.exports = prerelease
|
3
node_modules/node-notifier/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compare = require('./compare')
|
||||
const rcompare = (a, b, loose) => compare(b, a, loose)
|
||||
module.exports = rcompare
|
3
node_modules/node-notifier/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compareBuild = require('./compare-build')
|
||||
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
|
||||
module.exports = rsort
|
10
node_modules/node-notifier/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
10
node_modules/node-notifier/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
const Range = require('../classes/range')
|
||||
const satisfies = (version, range, options) => {
|
||||
try {
|
||||
range = new Range(range, options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
return range.test(version)
|
||||
}
|
||||
module.exports = satisfies
|
3
node_modules/node-notifier/node_modules/semver/functions/sort.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/sort.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
const compareBuild = require('./compare-build')
|
||||
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
|
||||
module.exports = sort
|
6
node_modules/node-notifier/node_modules/semver/functions/valid.js
generated
vendored
Normal file
6
node_modules/node-notifier/node_modules/semver/functions/valid.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
const parse = require('./parse')
|
||||
const valid = (version, options) => {
|
||||
const v = parse(version, options)
|
||||
return v ? v.version : null
|
||||
}
|
||||
module.exports = valid
|
48
node_modules/node-notifier/node_modules/semver/index.js
generated
vendored
Normal file
48
node_modules/node-notifier/node_modules/semver/index.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
// just pre-load all the stuff that index.js lazily exports
|
||||
const internalRe = require('./internal/re')
|
||||
module.exports = {
|
||||
re: internalRe.re,
|
||||
src: internalRe.src,
|
||||
tokens: internalRe.t,
|
||||
SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,
|
||||
SemVer: require('./classes/semver'),
|
||||
compareIdentifiers: require('./internal/identifiers').compareIdentifiers,
|
||||
rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,
|
||||
parse: require('./functions/parse'),
|
||||
valid: require('./functions/valid'),
|
||||
clean: require('./functions/clean'),
|
||||
inc: require('./functions/inc'),
|
||||
diff: require('./functions/diff'),
|
||||
major: require('./functions/major'),
|
||||
minor: require('./functions/minor'),
|
||||
patch: require('./functions/patch'),
|
||||
prerelease: require('./functions/prerelease'),
|
||||
compare: require('./functions/compare'),
|
||||
rcompare: require('./functions/rcompare'),
|
||||
compareLoose: require('./functions/compare-loose'),
|
||||
compareBuild: require('./functions/compare-build'),
|
||||
sort: require('./functions/sort'),
|
||||
rsort: require('./functions/rsort'),
|
||||
gt: require('./functions/gt'),
|
||||
lt: require('./functions/lt'),
|
||||
eq: require('./functions/eq'),
|
||||
neq: require('./functions/neq'),
|
||||
gte: require('./functions/gte'),
|
||||
lte: require('./functions/lte'),
|
||||
cmp: require('./functions/cmp'),
|
||||
coerce: require('./functions/coerce'),
|
||||
Comparator: require('./classes/comparator'),
|
||||
Range: require('./classes/range'),
|
||||
satisfies: require('./functions/satisfies'),
|
||||
toComparators: require('./ranges/to-comparators'),
|
||||
maxSatisfying: require('./ranges/max-satisfying'),
|
||||
minSatisfying: require('./ranges/min-satisfying'),
|
||||
minVersion: require('./ranges/min-version'),
|
||||
validRange: require('./ranges/valid'),
|
||||
outside: require('./ranges/outside'),
|
||||
gtr: require('./ranges/gtr'),
|
||||
ltr: require('./ranges/ltr'),
|
||||
intersects: require('./ranges/intersects'),
|
||||
simplifyRange: require('./ranges/simplify'),
|
||||
subset: require('./ranges/subset'),
|
||||
}
|
17
node_modules/node-notifier/node_modules/semver/internal/constants.js
generated
vendored
Normal file
17
node_modules/node-notifier/node_modules/semver/internal/constants.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Note: this is the semver.org version of the spec that it implements
|
||||
// Not necessarily the package version of this code.
|
||||
const SEMVER_SPEC_VERSION = '2.0.0'
|
||||
|
||||
const MAX_LENGTH = 256
|
||||
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||
/* istanbul ignore next */ 9007199254740991
|
||||
|
||||
// Max safe segment length for coercion.
|
||||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||
|
||||
module.exports = {
|
||||
SEMVER_SPEC_VERSION,
|
||||
MAX_LENGTH,
|
||||
MAX_SAFE_INTEGER,
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
}
|
9
node_modules/node-notifier/node_modules/semver/internal/debug.js
generated
vendored
Normal file
9
node_modules/node-notifier/node_modules/semver/internal/debug.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
const debug = (
|
||||
typeof process === 'object' &&
|
||||
process.env &&
|
||||
process.env.NODE_DEBUG &&
|
||||
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
||||
) ? (...args) => console.error('SEMVER', ...args)
|
||||
: () => {}
|
||||
|
||||
module.exports = debug
|
23
node_modules/node-notifier/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
23
node_modules/node-notifier/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
const numeric = /^[0-9]+$/
|
||||
const compareIdentifiers = (a, b) => {
|
||||
const anum = numeric.test(a)
|
||||
const 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
|
||||
}
|
||||
|
||||
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
|
||||
|
||||
module.exports = {
|
||||
compareIdentifiers,
|
||||
rcompareIdentifiers,
|
||||
}
|
11
node_modules/node-notifier/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
11
node_modules/node-notifier/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
// parse out just the options we care about so we always get a consistent
|
||||
// obj with keys in a consistent order.
|
||||
const opts = ['includePrerelease', 'loose', 'rtl']
|
||||
const parseOptions = options =>
|
||||
!options ? {}
|
||||
: typeof options !== 'object' ? { loose: true }
|
||||
: opts.filter(k => options[k]).reduce((o, k) => {
|
||||
o[k] = true
|
||||
return o
|
||||
}, {})
|
||||
module.exports = parseOptions
|
182
node_modules/node-notifier/node_modules/semver/internal/re.js
generated
vendored
Normal file
182
node_modules/node-notifier/node_modules/semver/internal/re.js
generated
vendored
Normal file
|
@ -0,0 +1,182 @@
|
|||
const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')
|
||||
const debug = require('./debug')
|
||||
exports = module.exports = {}
|
||||
|
||||
// The actual regexps go on exports.re
|
||||
const re = exports.re = []
|
||||
const src = exports.src = []
|
||||
const t = exports.t = {}
|
||||
let R = 0
|
||||
|
||||
const createToken = (name, value, isGlobal) => {
|
||||
const index = R++
|
||||
debug(name, index, value)
|
||||
t[name] = index
|
||||
src[index] = value
|
||||
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
|
||||
}
|
||||
|
||||
// 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.
|
||||
|
||||
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
|
||||
createToken('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.
|
||||
|
||||
createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*')
|
||||
|
||||
// ## Main Version
|
||||
// Three dot-separated numeric identifiers.
|
||||
|
||||
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})`)
|
||||
|
||||
// ## Pre-release Version Identifier
|
||||
// A numeric identifier, or a non-numeric identifier.
|
||||
|
||||
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
|
||||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
|
||||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||||
|
||||
// ## Pre-release Version
|
||||
// Hyphen, followed by one or more dot-separated pre-release version
|
||||
// identifiers.
|
||||
|
||||
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
|
||||
|
||||
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
|
||||
|
||||
// ## Build Metadata Identifier
|
||||
// Any combination of digits, letters, or hyphens.
|
||||
|
||||
createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')
|
||||
|
||||
// ## Build Metadata
|
||||
// Plus sign, followed by one or more period-separated build metadata
|
||||
// identifiers.
|
||||
|
||||
createToken('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.
|
||||
|
||||
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
|
||||
}${src[t.PRERELEASE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('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.
|
||||
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
|
||||
}${src[t.PRERELEASELOOSE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
|
||||
|
||||
createToken('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.
|
||||
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
|
||||
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
|
||||
|
||||
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:${src[t.PRERELEASE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:${src[t.PRERELEASELOOSE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Coercion.
|
||||
// Extract anything that could conceivably be a part of a valid semver
|
||||
createToken('COERCE', `${'(^|[^\\d])' +
|
||||
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:$|[^\\d])`)
|
||||
createToken('COERCERTL', src[t.COERCE], true)
|
||||
|
||||
// Tilde ranges.
|
||||
// Meaning is "reasonably at or greater than"
|
||||
createToken('LONETILDE', '(?:~>?)')
|
||||
|
||||
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
|
||||
exports.tildeTrimReplace = '$1~'
|
||||
|
||||
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Caret ranges.
|
||||
// Meaning is "at least and backwards compatible with"
|
||||
createToken('LONECARET', '(?:\\^)')
|
||||
|
||||
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
|
||||
exports.caretTrimReplace = '$1^'
|
||||
|
||||
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
||||
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
|
||||
createToken('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`
|
||||
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
|
||||
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
|
||||
exports.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.
|
||||
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s*$`)
|
||||
|
||||
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s*$`)
|
||||
|
||||
// Star ranges basically just allow anything at all.
|
||||
createToken('STAR', '(<|>)?=?\\s*\\*')
|
||||
// >=0.0.0 is like a star
|
||||
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
|
||||
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
|
75
node_modules/node-notifier/node_modules/semver/package.json
generated
vendored
Normal file
75
node_modules/node-notifier/node_modules/semver/package.json
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"name": "semver",
|
||||
"version": "7.3.7",
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"postpublish": "git push origin --follow-tags",
|
||||
"lint": "eslint \"**/*.js\"",
|
||||
"postlint": "template-oss-check",
|
||||
"lintfix": "npm run lint -- --fix",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"posttest": "npm run lint",
|
||||
"template-oss-apply": "template-oss-apply --force"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/eslint-config": "^3.0.1",
|
||||
"@npmcli/template-oss": "3.3.2",
|
||||
"tap": "^16.0.0"
|
||||
},
|
||||
"license": "ISC",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/npm/node-semver.git"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"classes/",
|
||||
"functions/",
|
||||
"internal/",
|
||||
"ranges/",
|
||||
"index.js",
|
||||
"preload.js",
|
||||
"range.bnf"
|
||||
],
|
||||
"tap": {
|
||||
"check-coverage": true,
|
||||
"coverage-map": "map.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"author": "GitHub Inc.",
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"version": "3.3.2",
|
||||
"engines": ">=10",
|
||||
"ciVersions": [
|
||||
"10.0.0",
|
||||
"10.x",
|
||||
"12.x",
|
||||
"14.x",
|
||||
"16.x"
|
||||
],
|
||||
"distPaths": [
|
||||
"bin/",
|
||||
"classes/",
|
||||
"functions/",
|
||||
"internal/",
|
||||
"ranges/",
|
||||
"index.js",
|
||||
"preload.js",
|
||||
"range.bnf"
|
||||
]
|
||||
}
|
||||
}
|
2
node_modules/node-notifier/node_modules/semver/preload.js
generated
vendored
Normal file
2
node_modules/node-notifier/node_modules/semver/preload.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
// XXX remove in v8 or beyond
|
||||
module.exports = require('./index.js')
|
16
node_modules/node-notifier/node_modules/semver/range.bnf
generated
vendored
Normal file
16
node_modules/node-notifier/node_modules/semver/range.bnf
generated
vendored
Normal file
|
@ -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]+
|
4
node_modules/node-notifier/node_modules/semver/ranges/gtr.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/semver/ranges/gtr.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
// Determine if version is greater than all the versions possible in the range.
|
||||
const outside = require('./outside')
|
||||
const gtr = (version, range, options) => outside(version, range, '>', options)
|
||||
module.exports = gtr
|
7
node_modules/node-notifier/node_modules/semver/ranges/intersects.js
generated
vendored
Normal file
7
node_modules/node-notifier/node_modules/semver/ranges/intersects.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
const Range = require('../classes/range')
|
||||
const intersects = (r1, r2, options) => {
|
||||
r1 = new Range(r1, options)
|
||||
r2 = new Range(r2, options)
|
||||
return r1.intersects(r2)
|
||||
}
|
||||
module.exports = intersects
|
4
node_modules/node-notifier/node_modules/semver/ranges/ltr.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/semver/ranges/ltr.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
const outside = require('./outside')
|
||||
// Determine if version is less than all the versions possible in the range
|
||||
const ltr = (version, range, options) => outside(version, range, '<', options)
|
||||
module.exports = ltr
|
25
node_modules/node-notifier/node_modules/semver/ranges/max-satisfying.js
generated
vendored
Normal file
25
node_modules/node-notifier/node_modules/semver/ranges/max-satisfying.js
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
|
||||
const maxSatisfying = (versions, range, options) => {
|
||||
let max = null
|
||||
let maxSV = null
|
||||
let rangeObj = null
|
||||
try {
|
||||
rangeObj = new Range(range, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
versions.forEach((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
|
||||
}
|
||||
module.exports = maxSatisfying
|
24
node_modules/node-notifier/node_modules/semver/ranges/min-satisfying.js
generated
vendored
Normal file
24
node_modules/node-notifier/node_modules/semver/ranges/min-satisfying.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const minSatisfying = (versions, range, options) => {
|
||||
let min = null
|
||||
let minSV = null
|
||||
let rangeObj = null
|
||||
try {
|
||||
rangeObj = new Range(range, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
versions.forEach((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
|
||||
}
|
||||
module.exports = minSatisfying
|
61
node_modules/node-notifier/node_modules/semver/ranges/min-version.js
generated
vendored
Normal file
61
node_modules/node-notifier/node_modules/semver/ranges/min-version.js
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const gt = require('../functions/gt')
|
||||
|
||||
const minVersion = (range, loose) => {
|
||||
range = new Range(range, loose)
|
||||
|
||||
let 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 (let i = 0; i < range.set.length; ++i) {
|
||||
const comparators = range.set[i]
|
||||
|
||||
let setMin = null
|
||||
comparators.forEach((comparator) => {
|
||||
// Clone to avoid manipulating the comparator's semver object.
|
||||
const 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 (!setMin || gt(compver, setMin)) {
|
||||
setMin = compver
|
||||
}
|
||||
break
|
||||
case '<':
|
||||
case '<=':
|
||||
/* Ignore maximum versions */
|
||||
break
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
throw new Error(`Unexpected operation: ${comparator.operator}`)
|
||||
}
|
||||
})
|
||||
if (setMin && (!minver || gt(minver, setMin))) {
|
||||
minver = setMin
|
||||
}
|
||||
}
|
||||
|
||||
if (minver && range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
module.exports = minVersion
|
80
node_modules/node-notifier/node_modules/semver/ranges/outside.js
generated
vendored
Normal file
80
node_modules/node-notifier/node_modules/semver/ranges/outside.js
generated
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
const SemVer = require('../classes/semver')
|
||||
const Comparator = require('../classes/comparator')
|
||||
const { ANY } = Comparator
|
||||
const Range = require('../classes/range')
|
||||
const satisfies = require('../functions/satisfies')
|
||||
const gt = require('../functions/gt')
|
||||
const lt = require('../functions/lt')
|
||||
const lte = require('../functions/lte')
|
||||
const gte = require('../functions/gte')
|
||||
|
||||
const outside = (version, range, hilo, options) => {
|
||||
version = new SemVer(version, options)
|
||||
range = new Range(range, options)
|
||||
|
||||
let 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 satisfies 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 (let i = 0; i < range.set.length; ++i) {
|
||||
const comparators = range.set[i]
|
||||
|
||||
let high = null
|
||||
let low = null
|
||||
|
||||
comparators.forEach((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
|
||||
}
|
||||
|
||||
module.exports = outside
|
47
node_modules/node-notifier/node_modules/semver/ranges/simplify.js
generated
vendored
Normal file
47
node_modules/node-notifier/node_modules/semver/ranges/simplify.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
// given a set of versions and a range, create a "simplified" range
|
||||
// that includes the same versions that the original range does
|
||||
// If the original range is shorter than the simplified one, return that.
|
||||
const satisfies = require('../functions/satisfies.js')
|
||||
const compare = require('../functions/compare.js')
|
||||
module.exports = (versions, range, options) => {
|
||||
const set = []
|
||||
let first = null
|
||||
let prev = null
|
||||
const v = versions.sort((a, b) => compare(a, b, options))
|
||||
for (const version of v) {
|
||||
const included = satisfies(version, range, options)
|
||||
if (included) {
|
||||
prev = version
|
||||
if (!first) {
|
||||
first = version
|
||||
}
|
||||
} else {
|
||||
if (prev) {
|
||||
set.push([first, prev])
|
||||
}
|
||||
prev = null
|
||||
first = null
|
||||
}
|
||||
}
|
||||
if (first) {
|
||||
set.push([first, null])
|
||||
}
|
||||
|
||||
const ranges = []
|
||||
for (const [min, max] of set) {
|
||||
if (min === max) {
|
||||
ranges.push(min)
|
||||
} else if (!max && min === v[0]) {
|
||||
ranges.push('*')
|
||||
} else if (!max) {
|
||||
ranges.push(`>=${min}`)
|
||||
} else if (min === v[0]) {
|
||||
ranges.push(`<=${max}`)
|
||||
} else {
|
||||
ranges.push(`${min} - ${max}`)
|
||||
}
|
||||
}
|
||||
const simplified = ranges.join(' || ')
|
||||
const original = typeof range.raw === 'string' ? range.raw : String(range)
|
||||
return simplified.length < original.length ? simplified : range
|
||||
}
|
244
node_modules/node-notifier/node_modules/semver/ranges/subset.js
generated
vendored
Normal file
244
node_modules/node-notifier/node_modules/semver/ranges/subset.js
generated
vendored
Normal file
|
@ -0,0 +1,244 @@
|
|||
const Range = require('../classes/range.js')
|
||||
const Comparator = require('../classes/comparator.js')
|
||||
const { ANY } = Comparator
|
||||
const satisfies = require('../functions/satisfies.js')
|
||||
const compare = require('../functions/compare.js')
|
||||
|
||||
// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
|
||||
// - Every simple range `r1, r2, ...` is a null set, OR
|
||||
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
|
||||
// some `R1, R2, ...`
|
||||
//
|
||||
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
|
||||
// - If c is only the ANY comparator
|
||||
// - If C is only the ANY comparator, return true
|
||||
// - Else if in prerelease mode, return false
|
||||
// - else replace c with `[>=0.0.0]`
|
||||
// - If C is only the ANY comparator
|
||||
// - if in prerelease mode, return true
|
||||
// - else replace C with `[>=0.0.0]`
|
||||
// - Let EQ be the set of = comparators in c
|
||||
// - If EQ is more than one, return true (null set)
|
||||
// - Let GT be the highest > or >= comparator in c
|
||||
// - Let LT be the lowest < or <= comparator in c
|
||||
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
|
||||
// - If any C is a = range, and GT or LT are set, return false
|
||||
// - If EQ
|
||||
// - If GT, and EQ does not satisfy GT, return true (null set)
|
||||
// - If LT, and EQ does not satisfy LT, return true (null set)
|
||||
// - If EQ satisfies every C, return true
|
||||
// - Else return false
|
||||
// - If GT
|
||||
// - If GT.semver is lower than any > or >= comp in C, return false
|
||||
// - If GT is >=, and GT.semver does not satisfy every C, return false
|
||||
// - If GT.semver has a prerelease, and not in prerelease mode
|
||||
// - If no C has a prerelease and the GT.semver tuple, return false
|
||||
// - If LT
|
||||
// - If LT.semver is greater than any < or <= comp in C, return false
|
||||
// - If LT is <=, and LT.semver does not satisfy every C, return false
|
||||
// - If GT.semver has a prerelease, and not in prerelease mode
|
||||
// - If no C has a prerelease and the LT.semver tuple, return false
|
||||
// - Else return true
|
||||
|
||||
const subset = (sub, dom, options = {}) => {
|
||||
if (sub === dom) {
|
||||
return true
|
||||
}
|
||||
|
||||
sub = new Range(sub, options)
|
||||
dom = new Range(dom, options)
|
||||
let sawNonNull = false
|
||||
|
||||
OUTER: for (const simpleSub of sub.set) {
|
||||
for (const simpleDom of dom.set) {
|
||||
const isSub = simpleSubset(simpleSub, simpleDom, options)
|
||||
sawNonNull = sawNonNull || isSub !== null
|
||||
if (isSub) {
|
||||
continue OUTER
|
||||
}
|
||||
}
|
||||
// the null set is a subset of everything, but null simple ranges in
|
||||
// a complex range should be ignored. so if we saw a non-null range,
|
||||
// then we know this isn't a subset, but if EVERY simple range was null,
|
||||
// then it is a subset.
|
||||
if (sawNonNull) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const simpleSubset = (sub, dom, options) => {
|
||||
if (sub === dom) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (sub.length === 1 && sub[0].semver === ANY) {
|
||||
if (dom.length === 1 && dom[0].semver === ANY) {
|
||||
return true
|
||||
} else if (options.includePrerelease) {
|
||||
sub = [new Comparator('>=0.0.0-0')]
|
||||
} else {
|
||||
sub = [new Comparator('>=0.0.0')]
|
||||
}
|
||||
}
|
||||
|
||||
if (dom.length === 1 && dom[0].semver === ANY) {
|
||||
if (options.includePrerelease) {
|
||||
return true
|
||||
} else {
|
||||
dom = [new Comparator('>=0.0.0')]
|
||||
}
|
||||
}
|
||||
|
||||
const eqSet = new Set()
|
||||
let gt, lt
|
||||
for (const c of sub) {
|
||||
if (c.operator === '>' || c.operator === '>=') {
|
||||
gt = higherGT(gt, c, options)
|
||||
} else if (c.operator === '<' || c.operator === '<=') {
|
||||
lt = lowerLT(lt, c, options)
|
||||
} else {
|
||||
eqSet.add(c.semver)
|
||||
}
|
||||
}
|
||||
|
||||
if (eqSet.size > 1) {
|
||||
return null
|
||||
}
|
||||
|
||||
let gtltComp
|
||||
if (gt && lt) {
|
||||
gtltComp = compare(gt.semver, lt.semver, options)
|
||||
if (gtltComp > 0) {
|
||||
return null
|
||||
} else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
// will iterate one or zero times
|
||||
for (const eq of eqSet) {
|
||||
if (gt && !satisfies(eq, String(gt), options)) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (lt && !satisfies(eq, String(lt), options)) {
|
||||
return null
|
||||
}
|
||||
|
||||
for (const c of dom) {
|
||||
if (!satisfies(eq, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
let higher, lower
|
||||
let hasDomLT, hasDomGT
|
||||
// if the subset has a prerelease, we need a comparator in the superset
|
||||
// with the same tuple and a prerelease, or it's not a subset
|
||||
let needDomLTPre = lt &&
|
||||
!options.includePrerelease &&
|
||||
lt.semver.prerelease.length ? lt.semver : false
|
||||
let needDomGTPre = gt &&
|
||||
!options.includePrerelease &&
|
||||
gt.semver.prerelease.length ? gt.semver : false
|
||||
// exception: <1.2.3-0 is the same as <1.2.3
|
||||
if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
|
||||
lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
|
||||
needDomLTPre = false
|
||||
}
|
||||
|
||||
for (const c of dom) {
|
||||
hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
|
||||
hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
|
||||
if (gt) {
|
||||
if (needDomGTPre) {
|
||||
if (c.semver.prerelease && c.semver.prerelease.length &&
|
||||
c.semver.major === needDomGTPre.major &&
|
||||
c.semver.minor === needDomGTPre.minor &&
|
||||
c.semver.patch === needDomGTPre.patch) {
|
||||
needDomGTPre = false
|
||||
}
|
||||
}
|
||||
if (c.operator === '>' || c.operator === '>=') {
|
||||
higher = higherGT(gt, c, options)
|
||||
if (higher === c && higher !== gt) {
|
||||
return false
|
||||
}
|
||||
} else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (lt) {
|
||||
if (needDomLTPre) {
|
||||
if (c.semver.prerelease && c.semver.prerelease.length &&
|
||||
c.semver.major === needDomLTPre.major &&
|
||||
c.semver.minor === needDomLTPre.minor &&
|
||||
c.semver.patch === needDomLTPre.patch) {
|
||||
needDomLTPre = false
|
||||
}
|
||||
}
|
||||
if (c.operator === '<' || c.operator === '<=') {
|
||||
lower = lowerLT(lt, c, options)
|
||||
if (lower === c && lower !== lt) {
|
||||
return false
|
||||
}
|
||||
} else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// if there was a < or >, and nothing in the dom, then must be false
|
||||
// UNLESS it was limited by another range in the other direction.
|
||||
// Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
|
||||
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
// we needed a prerelease range in a specific tuple, but didn't get one
|
||||
// then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
|
||||
// because it includes prereleases in the 1.2.3 tuple
|
||||
if (needDomGTPre || needDomLTPre) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// >=1.2.3 is lower than >1.2.3
|
||||
const higherGT = (a, b, options) => {
|
||||
if (!a) {
|
||||
return b
|
||||
}
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp > 0 ? a
|
||||
: comp < 0 ? b
|
||||
: b.operator === '>' && a.operator === '>=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
// <=1.2.3 is higher than <1.2.3
|
||||
const lowerLT = (a, b, options) => {
|
||||
if (!a) {
|
||||
return b
|
||||
}
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp < 0 ? a
|
||||
: comp > 0 ? b
|
||||
: b.operator === '<' && a.operator === '<=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
module.exports = subset
|
8
node_modules/node-notifier/node_modules/semver/ranges/to-comparators.js
generated
vendored
Normal file
8
node_modules/node-notifier/node_modules/semver/ranges/to-comparators.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
const Range = require('../classes/range')
|
||||
|
||||
// Mostly just for testing and legacy API reasons
|
||||
const toComparators = (range, options) =>
|
||||
new Range(range, options).set
|
||||
.map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
|
||||
|
||||
module.exports = toComparators
|
11
node_modules/node-notifier/node_modules/semver/ranges/valid.js
generated
vendored
Normal file
11
node_modules/node-notifier/node_modules/semver/ranges/valid.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
const Range = require('../classes/range')
|
||||
const 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
|
||||
}
|
||||
}
|
||||
module.exports = validRange
|
229
node_modules/node-notifier/node_modules/uuid/CHANGELOG.md
generated
vendored
Normal file
229
node_modules/node-notifier/node_modules/uuid/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,229 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [8.3.2](https://github.com/uuidjs/uuid/compare/v8.3.1...v8.3.2) (2020-12-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- lazy load getRandomValues ([#537](https://github.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://github.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#536](https://github.com/uuidjs/uuid/issues/536)
|
||||
|
||||
### [8.3.1](https://github.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- support expo>=39.0.0 ([#515](https://github.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://github.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#375](https://github.com/uuidjs/uuid/issues/375)
|
||||
|
||||
## [8.3.0](https://github.com/uuidjs/uuid/compare/v8.2.0...v8.3.0) (2020-07-27)
|
||||
|
||||
### Features
|
||||
|
||||
- add parse/stringify/validate/version/NIL APIs ([#479](https://github.com/uuidjs/uuid/issues/479)) ([0e6c10b](https://github.com/uuidjs/uuid/commit/0e6c10ba1bf9517796ff23c052fc0468eedfd5f4)), closes [#475](https://github.com/uuidjs/uuid/issues/475) [#478](https://github.com/uuidjs/uuid/issues/478) [#480](https://github.com/uuidjs/uuid/issues/480) [#481](https://github.com/uuidjs/uuid/issues/481) [#180](https://github.com/uuidjs/uuid/issues/180)
|
||||
|
||||
## [8.2.0](https://github.com/uuidjs/uuid/compare/v8.1.0...v8.2.0) (2020-06-23)
|
||||
|
||||
### Features
|
||||
|
||||
- improve performance of v1 string representation ([#453](https://github.com/uuidjs/uuid/issues/453)) ([0ee0b67](https://github.com/uuidjs/uuid/commit/0ee0b67c37846529c66089880414d29f3ae132d5))
|
||||
- remove deprecated v4 string parameter ([#454](https://github.com/uuidjs/uuid/issues/454)) ([88ce3ca](https://github.com/uuidjs/uuid/commit/88ce3ca0ba046f60856de62c7ce03f7ba98ba46c)), closes [#437](https://github.com/uuidjs/uuid/issues/437)
|
||||
- support jspm ([#473](https://github.com/uuidjs/uuid/issues/473)) ([e9f2587](https://github.com/uuidjs/uuid/commit/e9f2587a92575cac31bc1d4ae944e17c09756659))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- prepare package exports for webpack 5 ([#468](https://github.com/uuidjs/uuid/issues/468)) ([8d6e6a5](https://github.com/uuidjs/uuid/commit/8d6e6a5f8965ca9575eb4d92e99a43435f4a58a8))
|
||||
|
||||
## [8.1.0](https://github.com/uuidjs/uuid/compare/v8.0.0...v8.1.0) (2020-05-20)
|
||||
|
||||
### Features
|
||||
|
||||
- improve v4 performance by reusing random number array ([#435](https://github.com/uuidjs/uuid/issues/435)) ([bf4af0d](https://github.com/uuidjs/uuid/commit/bf4af0d711b4d2ed03d1f74fd12ad0baa87dc79d))
|
||||
- optimize V8 performance of bytesToUuid ([#434](https://github.com/uuidjs/uuid/issues/434)) ([e156415](https://github.com/uuidjs/uuid/commit/e156415448ec1af2351fa0b6660cfb22581971f2))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- export package.json required by react-native and bundlers ([#449](https://github.com/uuidjs/uuid/issues/449)) ([be1c8fe](https://github.com/uuidjs/uuid/commit/be1c8fe9a3206c358e0059b52fafd7213aa48a52)), closes [ai/nanoevents#44](https://github.com/ai/nanoevents/issues/44#issuecomment-602010343) [#444](https://github.com/uuidjs/uuid/issues/444)
|
||||
|
||||
## [8.0.0](https://github.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) (2020-04-29)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
- For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export.
|
||||
|
||||
```diff
|
||||
-import uuid from 'uuid';
|
||||
-console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869'
|
||||
+import { v4 as uuidv4 } from 'uuid';
|
||||
+uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
||||
```
|
||||
|
||||
- Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported.
|
||||
|
||||
Instead use the named exports that this module exports.
|
||||
|
||||
For ECMAScript Modules (ESM):
|
||||
|
||||
```diff
|
||||
-import uuidv4 from 'uuid/v4';
|
||||
+import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
For CommonJS:
|
||||
|
||||
```diff
|
||||
-const uuidv4 = require('uuid/v4');
|
||||
+const { v4: uuidv4 } = require('uuid');
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
### Features
|
||||
|
||||
- native Node.js ES Modules (wrapper approach) ([#423](https://github.com/uuidjs/uuid/issues/423)) ([2d9f590](https://github.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#245](https://github.com/uuidjs/uuid/issues/245) [#419](https://github.com/uuidjs/uuid/issues/419) [#342](https://github.com/uuidjs/uuid/issues/342)
|
||||
- remove deep requires ([#426](https://github.com/uuidjs/uuid/issues/426)) ([daf72b8](https://github.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- add CommonJS syntax example to README quickstart section ([#417](https://github.com/uuidjs/uuid/issues/417)) ([e0ec840](https://github.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0))
|
||||
|
||||
### [7.0.3](https://github.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- make deep require deprecation warning work in browsers ([#409](https://github.com/uuidjs/uuid/issues/409)) ([4b71107](https://github.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#408](https://github.com/uuidjs/uuid/issues/408)
|
||||
|
||||
### [7.0.2](https://github.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- make access to msCrypto consistent ([#393](https://github.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://github.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c))
|
||||
- simplify link in deprecation warning ([#391](https://github.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://github.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7))
|
||||
- update links to match content in readme ([#386](https://github.com/uuidjs/uuid/issues/386)) ([44f2f86](https://github.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4))
|
||||
|
||||
### [7.0.1](https://github.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- clean up esm builds for node and browser ([#383](https://github.com/uuidjs/uuid/issues/383)) ([59e6a49](https://github.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc))
|
||||
- provide browser versions independent from module system ([#380](https://github.com/uuidjs/uuid/issues/380)) ([4344a22](https://github.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#378](https://github.com/uuidjs/uuid/issues/378)
|
||||
|
||||
## [7.0.0](https://github.com/uuidjs/uuid/compare/v3.4.0...v7.0.0) (2020-02-24)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
- The default export, which used to be the v4() method but which was already discouraged in v3.x of this library, has been removed.
|
||||
- Explicitly note that deep imports of the different uuid version functions are deprecated and no longer encouraged and that ECMAScript module named imports should be used instead. Emit a deprecation warning for people who deep-require the different algorithm variants.
|
||||
- Remove builtin support for insecure random number generators in the browser. Users who want that will have to supply their own random number generator function.
|
||||
- Remove support for generating v3 and v5 UUIDs in Node.js<4.x
|
||||
- Convert code base to ECMAScript Modules (ESM) and release CommonJS build for node and ESM build for browser bundlers.
|
||||
|
||||
### Features
|
||||
|
||||
- add UMD build to npm package ([#357](https://github.com/uuidjs/uuid/issues/357)) ([4e75adf](https://github.com/uuidjs/uuid/commit/4e75adf435196f28e3fbbe0185d654b5ded7ca2c)), closes [#345](https://github.com/uuidjs/uuid/issues/345)
|
||||
- add various es module and CommonJS examples ([b238510](https://github.com/uuidjs/uuid/commit/b238510bf352463521f74bab175a3af9b7a42555))
|
||||
- ensure that docs are up-to-date in CI ([ee5e77d](https://github.com/uuidjs/uuid/commit/ee5e77db547474f5a8f23d6c857a6d399209986b))
|
||||
- hybrid CommonJS & ECMAScript modules build ([a3f078f](https://github.com/uuidjs/uuid/commit/a3f078faa0baff69ab41aed08e041f8f9c8993d0))
|
||||
- remove insecure fallback random number generator ([3a5842b](https://github.com/uuidjs/uuid/commit/3a5842b141a6e5de0ae338f391661e6b84b167c9)), closes [#173](https://github.com/uuidjs/uuid/issues/173)
|
||||
- remove support for pre Node.js v4 Buffer API ([#356](https://github.com/uuidjs/uuid/issues/356)) ([b59b5c5](https://github.com/uuidjs/uuid/commit/b59b5c5ecad271c5453f1a156f011671f6d35627))
|
||||
- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([c37a518](https://github.com/uuidjs/uuid/commit/c37a518e367ac4b6d0aa62dba1bc6ce9e85020f7)), closes [#338](https://github.com/uuidjs/uuid/issues/338)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- add deep-require proxies for local testing and adjust tests ([#365](https://github.com/uuidjs/uuid/issues/365)) ([7fedc79](https://github.com/uuidjs/uuid/commit/7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48))
|
||||
- add note about removal of default export ([#372](https://github.com/uuidjs/uuid/issues/372)) ([12749b7](https://github.com/uuidjs/uuid/commit/12749b700eb49db8a9759fd306d8be05dbfbd58c)), closes [#370](https://github.com/uuidjs/uuid/issues/370)
|
||||
- deprecated deep requiring of the different algorithm versions ([#361](https://github.com/uuidjs/uuid/issues/361)) ([c0bdf15](https://github.com/uuidjs/uuid/commit/c0bdf15e417639b1aeb0b247b2fb11f7a0a26b23))
|
||||
|
||||
## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16)
|
||||
|
||||
### Features
|
||||
|
||||
- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338)
|
||||
|
||||
## [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- no longer run ci tests on node v4
|
||||
- upgrade dependencies
|
||||
|
||||
## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877))
|
||||
|
||||
## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2))
|
||||
|
||||
# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc))
|
||||
- fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4))
|
||||
- Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331))
|
||||
- mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c))
|
||||
|
||||
### Features
|
||||
|
||||
- enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182))
|
||||
|
||||
## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b))
|
||||
|
||||
# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824))
|
||||
- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b))
|
||||
|
||||
### Features
|
||||
|
||||
- Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726))
|
||||
|
||||
# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183)
|
||||
- Fix typo (#178)
|
||||
- Simple typo fix (#165)
|
||||
|
||||
### Features
|
||||
|
||||
- v5 support in CLI (#197)
|
||||
- V5 support (#188)
|
||||
|
||||
# 3.0.1 (2016-11-28)
|
||||
|
||||
- split uuid versions into separate files
|
||||
|
||||
# 3.0.0 (2016-11-17)
|
||||
|
||||
- remove .parse and .unparse
|
||||
|
||||
# 2.0.0
|
||||
|
||||
- Removed uuid.BufferClass
|
||||
|
||||
# 1.4.0
|
||||
|
||||
- Improved module context detection
|
||||
- Removed public RNG functions
|
||||
|
||||
# 1.3.2
|
||||
|
||||
- Improve tests and handling of v1() options (Issue #24)
|
||||
- Expose RNG option to allow for perf testing with different generators
|
||||
|
||||
# 1.3.0
|
||||
|
||||
- Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
|
||||
- Support for node.js crypto API
|
||||
- De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
|
18
node_modules/node-notifier/node_modules/uuid/CONTRIBUTING.md
generated
vendored
Normal file
18
node_modules/node-notifier/node_modules/uuid/CONTRIBUTING.md
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Contributing
|
||||
|
||||
Please feel free to file GitHub Issues or propose Pull Requests. We're always happy to discuss improvements to this library!
|
||||
|
||||
## Testing
|
||||
|
||||
```shell
|
||||
npm test
|
||||
```
|
||||
|
||||
## Releasing
|
||||
|
||||
Releases are supposed to be done from master, version bumping is automated through [`standard-version`](https://github.com/conventional-changelog/standard-version):
|
||||
|
||||
```shell
|
||||
npm run release -- --dry-run # verify output manually
|
||||
npm run release # follow the instructions from the output of this command
|
||||
```
|
9
node_modules/node-notifier/node_modules/uuid/LICENSE.md
generated
vendored
Normal file
9
node_modules/node-notifier/node_modules/uuid/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
505
node_modules/node-notifier/node_modules/uuid/README.md
generated
vendored
Normal file
505
node_modules/node-notifier/node_modules/uuid/README.md
generated
vendored
Normal file
|
@ -0,0 +1,505 @@
|
|||
<!--
|
||||
-- This file is auto-generated from README_js.md. Changes should be made there.
|
||||
-->
|
||||
|
||||
# uuid [](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser)
|
||||
|
||||
For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
|
||||
|
||||
- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs
|
||||
- **Cross-platform** - Support for ...
|
||||
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
|
||||
- Node 8, 10, 12, 14
|
||||
- Chrome, Safari, Firefox, Edge, IE 11 browsers
|
||||
- Webpack and rollup.js module bundlers
|
||||
- [React Native / Expo](#react-native--expo)
|
||||
- **Secure** - Cryptographically-strong random values
|
||||
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
|
||||
- **CLI** - Includes the [`uuid` command line](#command-line) utility
|
||||
|
||||
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
|
||||
|
||||
## Quickstart
|
||||
|
||||
To create a random UUID...
|
||||
|
||||
**1. Install**
|
||||
|
||||
```shell
|
||||
npm install uuid
|
||||
```
|
||||
|
||||
**2. Create a UUID** (ES6 module syntax)
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
||||
```
|
||||
|
||||
... or using CommonJS syntax:
|
||||
|
||||
```javascript
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
```
|
||||
|
||||
For timestamp UUIDs, namespace UUIDs, and other options read on ...
|
||||
|
||||
## API Summary
|
||||
|
||||
| | | |
|
||||
| --- | --- | --- |
|
||||
| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` |
|
||||
| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` |
|
||||
| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` |
|
||||
| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | |
|
||||
| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | |
|
||||
| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | |
|
||||
| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | |
|
||||
| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` |
|
||||
| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` |
|
||||
|
||||
## API
|
||||
|
||||
### uuid.NIL
|
||||
|
||||
The nil UUID string (all zeros).
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { NIL as NIL_UUID } from 'uuid';
|
||||
|
||||
NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000'
|
||||
```
|
||||
|
||||
### uuid.parse(str)
|
||||
|
||||
Convert UUID string to array of bytes
|
||||
|
||||
| | |
|
||||
| --------- | ---------------------------------------- |
|
||||
| `str` | A valid UUID `String` |
|
||||
| _returns_ | `Uint8Array[16]` |
|
||||
| _throws_ | `TypeError` if `str` is not a valid UUID |
|
||||
|
||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { parse as uuidParse } from 'uuid';
|
||||
|
||||
// Parse a UUID
|
||||
const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b');
|
||||
|
||||
// Convert to hex strings to show byte order (for documentation purposes)
|
||||
[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨
|
||||
// [
|
||||
// '6e', 'c0', 'bd', '7f',
|
||||
// '11', 'c0', '43', 'da',
|
||||
// '97', '5e', '2a', '8a',
|
||||
// 'd9', 'eb', 'ae', '0b'
|
||||
// ]
|
||||
```
|
||||
|
||||
### uuid.stringify(arr[, offset])
|
||||
|
||||
Convert array of bytes to UUID string
|
||||
|
||||
| | |
|
||||
| -------------- | ---------------------------------------------------------------------------- |
|
||||
| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. |
|
||||
| [`offset` = 0] | `Number` Starting index in the Array |
|
||||
| _returns_ | `String` |
|
||||
| _throws_ | `TypeError` if a valid UUID string cannot be generated |
|
||||
|
||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { stringify as uuidStringify } from 'uuid';
|
||||
|
||||
const uuidBytes = [
|
||||
0x6e,
|
||||
0xc0,
|
||||
0xbd,
|
||||
0x7f,
|
||||
0x11,
|
||||
0xc0,
|
||||
0x43,
|
||||
0xda,
|
||||
0x97,
|
||||
0x5e,
|
||||
0x2a,
|
||||
0x8a,
|
||||
0xd9,
|
||||
0xeb,
|
||||
0xae,
|
||||
0x0b,
|
||||
];
|
||||
|
||||
uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'
|
||||
```
|
||||
|
||||
### uuid.v1([options[, buffer[, offset]]])
|
||||
|
||||
Create an RFC version 1 (timestamp) UUID
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| [`options`] | `Object` with one or more of the following properties: |
|
||||
| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
|
||||
| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
|
||||
| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
|
||||
| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) |
|
||||
| [`options.random`] | `Array` of 16 random bytes (0-255) |
|
||||
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
|
||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
| _throws_ | `Error` if more than 10M UUIDs/sec are requested |
|
||||
|
||||
Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
|
||||
|
||||
Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { v1 as uuidv1 } from 'uuid';
|
||||
|
||||
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
|
||||
```
|
||||
|
||||
Example using `options`:
|
||||
|
||||
```javascript
|
||||
import { v1 as uuidv1 } from 'uuid';
|
||||
|
||||
const v1options = {
|
||||
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
||||
clockseq: 0x1234,
|
||||
msecs: new Date('2011-11-01').getTime(),
|
||||
nsecs: 5678,
|
||||
};
|
||||
uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
|
||||
```
|
||||
|
||||
### uuid.v3(name, namespace[, buffer[, offset]])
|
||||
|
||||
Create an RFC version 3 (namespace w/ MD5) UUID
|
||||
|
||||
API is identical to `v5()`, but uses "v3" instead.
|
||||
|
||||
⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
|
||||
|
||||
### uuid.v4([options[, buffer[, offset]]])
|
||||
|
||||
Create an RFC version 4 (random) UUID
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| [`options`] | `Object` with one or more of the following properties: |
|
||||
| [`options.random`] | `Array` of 16 random bytes (0-255) |
|
||||
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
|
||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
```
|
||||
|
||||
Example using predefined `random` values:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
const v4options = {
|
||||
random: [
|
||||
0x10,
|
||||
0x91,
|
||||
0x56,
|
||||
0xbe,
|
||||
0xc4,
|
||||
0xfb,
|
||||
0xc1,
|
||||
0xea,
|
||||
0x71,
|
||||
0xb4,
|
||||
0xef,
|
||||
0xe1,
|
||||
0x67,
|
||||
0x1c,
|
||||
0x58,
|
||||
0x36,
|
||||
],
|
||||
};
|
||||
uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836'
|
||||
```
|
||||
|
||||
### uuid.v5(name, namespace[, buffer[, offset]])
|
||||
|
||||
Create an RFC version 5 (namespace w/ SHA-1) UUID
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| `name` | `String \| Array` |
|
||||
| `namespace` | `String \| Array[16]` Namespace UUID |
|
||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
|
||||
Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`.
|
||||
|
||||
Example with custom namespace:
|
||||
|
||||
```javascript
|
||||
import { v5 as uuidv5 } from 'uuid';
|
||||
|
||||
// Define a custom namespace. Readers, create your own using something like
|
||||
// https://www.uuidgenerator.net/
|
||||
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
|
||||
|
||||
uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681'
|
||||
```
|
||||
|
||||
Example with RFC `URL` namespace:
|
||||
|
||||
```javascript
|
||||
import { v5 as uuidv5 } from 'uuid';
|
||||
|
||||
uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1'
|
||||
```
|
||||
|
||||
### uuid.validate(str)
|
||||
|
||||
Test a string to see if it is a valid UUID
|
||||
|
||||
| | |
|
||||
| --------- | --------------------------------------------------- |
|
||||
| `str` | `String` to validate |
|
||||
| _returns_ | `true` if string is a valid UUID, `false` otherwise |
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { validate as uuidValidate } from 'uuid';
|
||||
|
||||
uuidValidate('not a UUID'); // ⇨ false
|
||||
uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true
|
||||
```
|
||||
|
||||
Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds.
|
||||
|
||||
```javascript
|
||||
import { version as uuidVersion } from 'uuid';
|
||||
import { validate as uuidValidate } from 'uuid';
|
||||
|
||||
function uuidValidateV4(uuid) {
|
||||
return uuidValidate(uuid) && uuidVersion(uuid) === 4;
|
||||
}
|
||||
|
||||
const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210';
|
||||
const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836';
|
||||
|
||||
uuidValidateV4(v4Uuid); // ⇨ true
|
||||
uuidValidateV4(v1Uuid); // ⇨ false
|
||||
```
|
||||
|
||||
### uuid.version(str)
|
||||
|
||||
Detect RFC version of a UUID
|
||||
|
||||
| | |
|
||||
| --------- | ---------------------------------------- |
|
||||
| `str` | A valid UUID `String` |
|
||||
| _returns_ | `Number` The RFC version of the UUID |
|
||||
| _throws_ | `TypeError` if `str` is not a valid UUID |
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { version as uuidVersion } from 'uuid';
|
||||
|
||||
uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1
|
||||
uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4
|
||||
```
|
||||
|
||||
## Command Line
|
||||
|
||||
UUIDs can be generated from the command line using `uuid`.
|
||||
|
||||
```shell
|
||||
$ uuid
|
||||
ddeb27fb-d9a0-4624-be4d-4615062daed4
|
||||
```
|
||||
|
||||
The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details:
|
||||
|
||||
```shell
|
||||
$ uuid --help
|
||||
|
||||
Usage:
|
||||
uuid
|
||||
uuid v1
|
||||
uuid v3 <name> <namespace uuid>
|
||||
uuid v4
|
||||
uuid v5 <name> <namespace uuid>
|
||||
uuid --help
|
||||
|
||||
Note: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs
|
||||
defined by RFC4122
|
||||
```
|
||||
|
||||
## ECMAScript Modules
|
||||
|
||||
This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments).
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
```
|
||||
|
||||
To run the examples you must first create a dist build of this library in the module root:
|
||||
|
||||
```shell
|
||||
npm run build
|
||||
```
|
||||
|
||||
## CDN Builds
|
||||
|
||||
### ECMAScript Modules
|
||||
|
||||
To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/):
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { v4 as uuidv4 } from 'https://jspm.dev/uuid';
|
||||
console.log(uuidv4()); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
</script>
|
||||
```
|
||||
|
||||
### UMD
|
||||
|
||||
To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs:
|
||||
|
||||
**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**:
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/uuid@latest/dist/umd/uuidv4.min.js"></script>
|
||||
```
|
||||
|
||||
**Using [jsDelivr](https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/)**:
|
||||
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/uuidv4.min.js"></script>
|
||||
```
|
||||
|
||||
**Using [cdnjs](https://cdnjs.com/libraries/uuid)**:
|
||||
|
||||
```html
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/uuid/8.1.0/uuidv4.min.js"></script>
|
||||
```
|
||||
|
||||
These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method:
|
||||
|
||||
```html
|
||||
<script>
|
||||
uuidv4(); // ⇨ '55af1e37-0734-46d8-b070-a1e42e4fc392'
|
||||
</script>
|
||||
```
|
||||
|
||||
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
|
||||
|
||||
## "getRandomValues() not supported"
|
||||
|
||||
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
|
||||
|
||||
### React Native / Expo
|
||||
|
||||
1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
|
||||
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:
|
||||
|
||||
```javascript
|
||||
import 'react-native-get-random-values';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
```
|
||||
|
||||
Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`.
|
||||
|
||||
### Web Workers / Service Workers (Edge <= 18)
|
||||
|
||||
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
|
||||
|
||||
## Upgrading From `uuid@7.x`
|
||||
|
||||
### Only Named Exports Supported When Using with Node.js ESM
|
||||
|
||||
`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
|
||||
|
||||
Instead of doing:
|
||||
|
||||
```javascript
|
||||
import uuid from 'uuid';
|
||||
uuid.v4();
|
||||
```
|
||||
|
||||
you will now have to use the named exports:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
### Deep Requires No Longer Supported
|
||||
|
||||
Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported.
|
||||
|
||||
## Upgrading From `uuid@3.x`
|
||||
|
||||
"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_"
|
||||
|
||||
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
|
||||
|
||||
### Deep Requires Now Deprecated
|
||||
|
||||
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:
|
||||
|
||||
```javascript
|
||||
const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
... or for CommonJS:
|
||||
|
||||
```javascript
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
### Default Export Removed
|
||||
|
||||
`uuid@3.x` was exporting the Version 4 UUID method as a default export:
|
||||
|
||||
```javascript
|
||||
const uuid = require('uuid'); // <== REMOVED!
|
||||
```
|
||||
|
||||
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
|
||||
|
||||
----
|
||||
Markdown generated from [README_js.md](README_js.md) by [](https://github.com/broofa/runmd)
|
9
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/index.js
generated
vendored
Normal file
9
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/index.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
export { default as v1 } from './v1.js';
|
||||
export { default as v3 } from './v3.js';
|
||||
export { default as v4 } from './v4.js';
|
||||
export { default as v5 } from './v5.js';
|
||||
export { default as NIL } from './nil.js';
|
||||
export { default as version } from './version.js';
|
||||
export { default as validate } from './validate.js';
|
||||
export { default as stringify } from './stringify.js';
|
||||
export { default as parse } from './parse.js';
|
215
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/md5.js
generated
vendored
Normal file
215
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/md5.js
generated
vendored
Normal file
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
* Browser-compatible JavaScript MD5
|
||||
*
|
||||
* Modification of JavaScript MD5
|
||||
* https://github.com/blueimp/JavaScript-MD5
|
||||
*
|
||||
* Copyright 2011, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*
|
||||
* Based on
|
||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
* Digest Algorithm, as defined in RFC 1321.
|
||||
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||
* Distributed under the BSD License
|
||||
* See http://pajhome.org.uk/crypt/md5 for more info.
|
||||
*/
|
||||
function md5(bytes) {
|
||||
if (typeof bytes === 'string') {
|
||||
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||
|
||||
bytes = new Uint8Array(msg.length);
|
||||
|
||||
for (var i = 0; i < msg.length; ++i) {
|
||||
bytes[i] = msg.charCodeAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
|
||||
}
|
||||
/*
|
||||
* Convert an array of little-endian words to an array of bytes
|
||||
*/
|
||||
|
||||
|
||||
function md5ToHexEncodedArray(input) {
|
||||
var output = [];
|
||||
var length32 = input.length * 32;
|
||||
var hexTab = '0123456789abcdef';
|
||||
|
||||
for (var i = 0; i < length32; i += 8) {
|
||||
var x = input[i >> 5] >>> i % 32 & 0xff;
|
||||
var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
|
||||
output.push(hex);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
/**
|
||||
* Calculate output length with padding and bit length
|
||||
*/
|
||||
|
||||
|
||||
function getOutputLength(inputLength8) {
|
||||
return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
|
||||
}
|
||||
/*
|
||||
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
||||
*/
|
||||
|
||||
|
||||
function wordsToMd5(x, len) {
|
||||
/* append padding */
|
||||
x[len >> 5] |= 0x80 << len % 32;
|
||||
x[getOutputLength(len) - 1] = len;
|
||||
var a = 1732584193;
|
||||
var b = -271733879;
|
||||
var c = -1732584194;
|
||||
var d = 271733878;
|
||||
|
||||
for (var i = 0; i < x.length; i += 16) {
|
||||
var olda = a;
|
||||
var oldb = b;
|
||||
var oldc = c;
|
||||
var oldd = d;
|
||||
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
||||
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
||||
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
||||
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
||||
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
||||
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
||||
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
||||
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
||||
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
||||
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
||||
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
||||
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
||||
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
||||
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
||||
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
||||
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
||||
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
||||
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
||||
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
||||
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
||||
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
||||
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
||||
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
||||
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
||||
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
||||
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
||||
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
||||
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
||||
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
||||
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
||||
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
||||
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
||||
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
||||
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
||||
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
||||
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
||||
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
||||
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
||||
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
||||
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
||||
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
||||
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
||||
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
||||
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
||||
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
||||
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
||||
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
||||
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
||||
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
||||
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
||||
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
||||
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
||||
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
||||
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
||||
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
||||
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
||||
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
||||
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
||||
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
||||
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
||||
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
||||
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
||||
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
||||
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
||||
a = safeAdd(a, olda);
|
||||
b = safeAdd(b, oldb);
|
||||
c = safeAdd(c, oldc);
|
||||
d = safeAdd(d, oldd);
|
||||
}
|
||||
|
||||
return [a, b, c, d];
|
||||
}
|
||||
/*
|
||||
* Convert an array bytes to an array of little-endian words
|
||||
* Characters >255 have their high-byte silently ignored.
|
||||
*/
|
||||
|
||||
|
||||
function bytesToWords(input) {
|
||||
if (input.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var length8 = input.length * 8;
|
||||
var output = new Uint32Array(getOutputLength(length8));
|
||||
|
||||
for (var i = 0; i < length8; i += 8) {
|
||||
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
/*
|
||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||
* to work around bugs in some JS interpreters.
|
||||
*/
|
||||
|
||||
|
||||
function safeAdd(x, y) {
|
||||
var lsw = (x & 0xffff) + (y & 0xffff);
|
||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||
return msw << 16 | lsw & 0xffff;
|
||||
}
|
||||
/*
|
||||
* Bitwise rotate a 32-bit number to the left.
|
||||
*/
|
||||
|
||||
|
||||
function bitRotateLeft(num, cnt) {
|
||||
return num << cnt | num >>> 32 - cnt;
|
||||
}
|
||||
/*
|
||||
* These functions implement the four basic operations the algorithm uses.
|
||||
*/
|
||||
|
||||
|
||||
function md5cmn(q, a, b, x, s, t) {
|
||||
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
||||
}
|
||||
|
||||
function md5ff(a, b, c, d, x, s, t) {
|
||||
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
||||
}
|
||||
|
||||
function md5gg(a, b, c, d, x, s, t) {
|
||||
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
||||
}
|
||||
|
||||
function md5hh(a, b, c, d, x, s, t) {
|
||||
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
||||
}
|
||||
|
||||
function md5ii(a, b, c, d, x, s, t) {
|
||||
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
||||
}
|
||||
|
||||
export default md5;
|
1
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/nil.js
generated
vendored
Normal file
1
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/nil.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export default '00000000-0000-0000-0000-000000000000';
|
35
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/parse.js
generated
vendored
Normal file
35
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/parse.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import validate from './validate.js';
|
||||
|
||||
function parse(uuid) {
|
||||
if (!validate(uuid)) {
|
||||
throw TypeError('Invalid UUID');
|
||||
}
|
||||
|
||||
var v;
|
||||
var arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
||||
|
||||
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
||||
arr[1] = v >>> 16 & 0xff;
|
||||
arr[2] = v >>> 8 & 0xff;
|
||||
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
||||
|
||||
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
||||
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
||||
|
||||
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
||||
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
||||
|
||||
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
||||
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
||||
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
||||
|
||||
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
||||
arr[11] = v / 0x100000000 & 0xff;
|
||||
arr[12] = v >>> 24 & 0xff;
|
||||
arr[13] = v >>> 16 & 0xff;
|
||||
arr[14] = v >>> 8 & 0xff;
|
||||
arr[15] = v & 0xff;
|
||||
return arr;
|
||||
}
|
||||
|
||||
export default parse;
|
1
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/regex.js
generated
vendored
Normal file
1
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/regex.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
19
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/rng.js
generated
vendored
Normal file
19
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/rng.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
||||
// require the crypto API and do not support built-in fallback to lower quality random number
|
||||
// generators (like Math.random()).
|
||||
var getRandomValues;
|
||||
var rnds8 = new Uint8Array(16);
|
||||
export default function rng() {
|
||||
// lazy load so that environments that need to polyfill have a chance to do so
|
||||
if (!getRandomValues) {
|
||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
||||
// find the complete implementation of crypto (msCrypto) on IE11.
|
||||
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
||||
|
||||
if (!getRandomValues) {
|
||||
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
||||
}
|
||||
}
|
||||
|
||||
return getRandomValues(rnds8);
|
||||
}
|
96
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/sha1.js
generated
vendored
Normal file
96
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/sha1.js
generated
vendored
Normal file
|
@ -0,0 +1,96 @@
|
|||
// Adapted from Chris Veness' SHA1 code at
|
||||
// http://www.movable-type.co.uk/scripts/sha1.html
|
||||
function f(s, x, y, z) {
|
||||
switch (s) {
|
||||
case 0:
|
||||
return x & y ^ ~x & z;
|
||||
|
||||
case 1:
|
||||
return x ^ y ^ z;
|
||||
|
||||
case 2:
|
||||
return x & y ^ x & z ^ y & z;
|
||||
|
||||
case 3:
|
||||
return x ^ y ^ z;
|
||||
}
|
||||
}
|
||||
|
||||
function ROTL(x, n) {
|
||||
return x << n | x >>> 32 - n;
|
||||
}
|
||||
|
||||
function sha1(bytes) {
|
||||
var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
||||
var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
||||
|
||||
if (typeof bytes === 'string') {
|
||||
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||
|
||||
bytes = [];
|
||||
|
||||
for (var i = 0; i < msg.length; ++i) {
|
||||
bytes.push(msg.charCodeAt(i));
|
||||
}
|
||||
} else if (!Array.isArray(bytes)) {
|
||||
// Convert Array-like to Array
|
||||
bytes = Array.prototype.slice.call(bytes);
|
||||
}
|
||||
|
||||
bytes.push(0x80);
|
||||
var l = bytes.length / 4 + 2;
|
||||
var N = Math.ceil(l / 16);
|
||||
var M = new Array(N);
|
||||
|
||||
for (var _i = 0; _i < N; ++_i) {
|
||||
var arr = new Uint32Array(16);
|
||||
|
||||
for (var j = 0; j < 16; ++j) {
|
||||
arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];
|
||||
}
|
||||
|
||||
M[_i] = arr;
|
||||
}
|
||||
|
||||
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
||||
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
||||
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
||||
|
||||
for (var _i2 = 0; _i2 < N; ++_i2) {
|
||||
var W = new Uint32Array(80);
|
||||
|
||||
for (var t = 0; t < 16; ++t) {
|
||||
W[t] = M[_i2][t];
|
||||
}
|
||||
|
||||
for (var _t = 16; _t < 80; ++_t) {
|
||||
W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);
|
||||
}
|
||||
|
||||
var a = H[0];
|
||||
var b = H[1];
|
||||
var c = H[2];
|
||||
var d = H[3];
|
||||
var e = H[4];
|
||||
|
||||
for (var _t2 = 0; _t2 < 80; ++_t2) {
|
||||
var s = Math.floor(_t2 / 20);
|
||||
var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;
|
||||
e = d;
|
||||
d = c;
|
||||
c = ROTL(b, 30) >>> 0;
|
||||
b = a;
|
||||
a = T;
|
||||
}
|
||||
|
||||
H[0] = H[0] + a >>> 0;
|
||||
H[1] = H[1] + b >>> 0;
|
||||
H[2] = H[2] + c >>> 0;
|
||||
H[3] = H[3] + d >>> 0;
|
||||
H[4] = H[4] + e >>> 0;
|
||||
}
|
||||
|
||||
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
||||
}
|
||||
|
||||
export default sha1;
|
30
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/stringify.js
generated
vendored
Normal file
30
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/stringify.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import validate from './validate.js';
|
||||
/**
|
||||
* Convert array of 16 byte values to UUID string format of the form:
|
||||
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
||||
*/
|
||||
|
||||
var byteToHex = [];
|
||||
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
byteToHex.push((i + 0x100).toString(16).substr(1));
|
||||
}
|
||||
|
||||
function stringify(arr) {
|
||||
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
||||
// Note: Be careful editing this code! It's been tuned for performance
|
||||
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
||||
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
||||
// of the following:
|
||||
// - One or more input array values don't map to a hex octet (leading to
|
||||
// "undefined" in the uuid)
|
||||
// - Invalid input values for the RFC `version` or `variant` fields
|
||||
|
||||
if (!validate(uuid)) {
|
||||
throw TypeError('Stringified UUID is invalid');
|
||||
}
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
||||
export default stringify;
|
95
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v1.js
generated
vendored
Normal file
95
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v1.js
generated
vendored
Normal file
|
@ -0,0 +1,95 @@
|
|||
import rng from './rng.js';
|
||||
import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**
|
||||
//
|
||||
// Inspired by https://github.com/LiosK/UUID.js
|
||||
// and http://docs.python.org/library/uuid.html
|
||||
|
||||
var _nodeId;
|
||||
|
||||
var _clockseq; // Previous uuid creation time
|
||||
|
||||
|
||||
var _lastMSecs = 0;
|
||||
var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
||||
|
||||
function v1(options, buf, offset) {
|
||||
var i = buf && offset || 0;
|
||||
var b = buf || new Array(16);
|
||||
options = options || {};
|
||||
var node = options.node || _nodeId;
|
||||
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
||||
// specified. We do this lazily to minimize issues related to insufficient
|
||||
// system entropy. See #189
|
||||
|
||||
if (node == null || clockseq == null) {
|
||||
var seedBytes = options.random || (options.rng || rng)();
|
||||
|
||||
if (node == null) {
|
||||
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
||||
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
||||
}
|
||||
|
||||
if (clockseq == null) {
|
||||
// Per 4.2.2, randomize (14 bit) clockseq
|
||||
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
||||
}
|
||||
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
||||
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
||||
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
||||
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
||||
|
||||
|
||||
var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
||||
// cycle to simulate higher resolution clock
|
||||
|
||||
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
||||
|
||||
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
||||
|
||||
if (dt < 0 && options.clockseq === undefined) {
|
||||
clockseq = clockseq + 1 & 0x3fff;
|
||||
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
||||
// time interval
|
||||
|
||||
|
||||
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
||||
nsecs = 0;
|
||||
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
||||
|
||||
|
||||
if (nsecs >= 10000) {
|
||||
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
||||
}
|
||||
|
||||
_lastMSecs = msecs;
|
||||
_lastNSecs = nsecs;
|
||||
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
||||
|
||||
msecs += 12219292800000; // `time_low`
|
||||
|
||||
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
||||
b[i++] = tl >>> 24 & 0xff;
|
||||
b[i++] = tl >>> 16 & 0xff;
|
||||
b[i++] = tl >>> 8 & 0xff;
|
||||
b[i++] = tl & 0xff; // `time_mid`
|
||||
|
||||
var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
||||
b[i++] = tmh >>> 8 & 0xff;
|
||||
b[i++] = tmh & 0xff; // `time_high_and_version`
|
||||
|
||||
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
||||
|
||||
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
||||
|
||||
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
||||
|
||||
b[i++] = clockseq & 0xff; // `node`
|
||||
|
||||
for (var n = 0; n < 6; ++n) {
|
||||
b[i + n] = node[n];
|
||||
}
|
||||
|
||||
return buf || stringify(b);
|
||||
}
|
||||
|
||||
export default v1;
|
4
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v3.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v3.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import v35 from './v35.js';
|
||||
import md5 from './md5.js';
|
||||
var v3 = v35('v3', 0x30, md5);
|
||||
export default v3;
|
64
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v35.js
generated
vendored
Normal file
64
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v35.js
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
import stringify from './stringify.js';
|
||||
import parse from './parse.js';
|
||||
|
||||
function stringToBytes(str) {
|
||||
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
||||
|
||||
var bytes = [];
|
||||
|
||||
for (var i = 0; i < str.length; ++i) {
|
||||
bytes.push(str.charCodeAt(i));
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
||||
export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
||||
export default function (name, version, hashfunc) {
|
||||
function generateUUID(value, namespace, buf, offset) {
|
||||
if (typeof value === 'string') {
|
||||
value = stringToBytes(value);
|
||||
}
|
||||
|
||||
if (typeof namespace === 'string') {
|
||||
namespace = parse(namespace);
|
||||
}
|
||||
|
||||
if (namespace.length !== 16) {
|
||||
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
||||
} // Compute hash of namespace and value, Per 4.3
|
||||
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
||||
// hashfunc([...namespace, ... value])`
|
||||
|
||||
|
||||
var bytes = new Uint8Array(16 + value.length);
|
||||
bytes.set(namespace);
|
||||
bytes.set(value, namespace.length);
|
||||
bytes = hashfunc(bytes);
|
||||
bytes[6] = bytes[6] & 0x0f | version;
|
||||
bytes[8] = bytes[8] & 0x3f | 0x80;
|
||||
|
||||
if (buf) {
|
||||
offset = offset || 0;
|
||||
|
||||
for (var i = 0; i < 16; ++i) {
|
||||
buf[offset + i] = bytes[i];
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
return stringify(bytes);
|
||||
} // Function#name is not settable on some platforms (#270)
|
||||
|
||||
|
||||
try {
|
||||
generateUUID.name = name; // eslint-disable-next-line no-empty
|
||||
} catch (err) {} // For CommonJS default export support
|
||||
|
||||
|
||||
generateUUID.DNS = DNS;
|
||||
generateUUID.URL = URL;
|
||||
return generateUUID;
|
||||
}
|
24
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v4.js
generated
vendored
Normal file
24
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v4.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
import rng from './rng.js';
|
||||
import stringify from './stringify.js';
|
||||
|
||||
function v4(options, buf, offset) {
|
||||
options = options || {};
|
||||
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
||||
|
||||
rnds[6] = rnds[6] & 0x0f | 0x40;
|
||||
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
||||
|
||||
if (buf) {
|
||||
offset = offset || 0;
|
||||
|
||||
for (var i = 0; i < 16; ++i) {
|
||||
buf[offset + i] = rnds[i];
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
return stringify(rnds);
|
||||
}
|
||||
|
||||
export default v4;
|
4
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v5.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/v5.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import v35 from './v35.js';
|
||||
import sha1 from './sha1.js';
|
||||
var v5 = v35('v5', 0x50, sha1);
|
||||
export default v5;
|
7
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/validate.js
generated
vendored
Normal file
7
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/validate.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
import REGEX from './regex.js';
|
||||
|
||||
function validate(uuid) {
|
||||
return typeof uuid === 'string' && REGEX.test(uuid);
|
||||
}
|
||||
|
||||
export default validate;
|
11
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/version.js
generated
vendored
Normal file
11
node_modules/node-notifier/node_modules/uuid/dist/esm-browser/version.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
import validate from './validate.js';
|
||||
|
||||
function version(uuid) {
|
||||
if (!validate(uuid)) {
|
||||
throw TypeError('Invalid UUID');
|
||||
}
|
||||
|
||||
return parseInt(uuid.substr(14, 1), 16);
|
||||
}
|
||||
|
||||
export default version;
|
9
node_modules/node-notifier/node_modules/uuid/dist/esm-node/index.js
generated
vendored
Normal file
9
node_modules/node-notifier/node_modules/uuid/dist/esm-node/index.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
export { default as v1 } from './v1.js';
|
||||
export { default as v3 } from './v3.js';
|
||||
export { default as v4 } from './v4.js';
|
||||
export { default as v5 } from './v5.js';
|
||||
export { default as NIL } from './nil.js';
|
||||
export { default as version } from './version.js';
|
||||
export { default as validate } from './validate.js';
|
||||
export { default as stringify } from './stringify.js';
|
||||
export { default as parse } from './parse.js';
|
13
node_modules/node-notifier/node_modules/uuid/dist/esm-node/md5.js
generated
vendored
Normal file
13
node_modules/node-notifier/node_modules/uuid/dist/esm-node/md5.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
import crypto from 'crypto';
|
||||
|
||||
function md5(bytes) {
|
||||
if (Array.isArray(bytes)) {
|
||||
bytes = Buffer.from(bytes);
|
||||
} else if (typeof bytes === 'string') {
|
||||
bytes = Buffer.from(bytes, 'utf8');
|
||||
}
|
||||
|
||||
return crypto.createHash('md5').update(bytes).digest();
|
||||
}
|
||||
|
||||
export default md5;
|
1
node_modules/node-notifier/node_modules/uuid/dist/esm-node/nil.js
generated
vendored
Normal file
1
node_modules/node-notifier/node_modules/uuid/dist/esm-node/nil.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export default '00000000-0000-0000-0000-000000000000';
|
35
node_modules/node-notifier/node_modules/uuid/dist/esm-node/parse.js
generated
vendored
Normal file
35
node_modules/node-notifier/node_modules/uuid/dist/esm-node/parse.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import validate from './validate.js';
|
||||
|
||||
function parse(uuid) {
|
||||
if (!validate(uuid)) {
|
||||
throw TypeError('Invalid UUID');
|
||||
}
|
||||
|
||||
let v;
|
||||
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
||||
|
||||
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
||||
arr[1] = v >>> 16 & 0xff;
|
||||
arr[2] = v >>> 8 & 0xff;
|
||||
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
||||
|
||||
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
||||
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
||||
|
||||
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
||||
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
||||
|
||||
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
||||
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
||||
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
||||
|
||||
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
||||
arr[11] = v / 0x100000000 & 0xff;
|
||||
arr[12] = v >>> 24 & 0xff;
|
||||
arr[13] = v >>> 16 & 0xff;
|
||||
arr[14] = v >>> 8 & 0xff;
|
||||
arr[15] = v & 0xff;
|
||||
return arr;
|
||||
}
|
||||
|
||||
export default parse;
|
1
node_modules/node-notifier/node_modules/uuid/dist/esm-node/regex.js
generated
vendored
Normal file
1
node_modules/node-notifier/node_modules/uuid/dist/esm-node/regex.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
12
node_modules/node-notifier/node_modules/uuid/dist/esm-node/rng.js
generated
vendored
Normal file
12
node_modules/node-notifier/node_modules/uuid/dist/esm-node/rng.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
import crypto from 'crypto';
|
||||
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
|
||||
|
||||
let poolPtr = rnds8Pool.length;
|
||||
export default function rng() {
|
||||
if (poolPtr > rnds8Pool.length - 16) {
|
||||
crypto.randomFillSync(rnds8Pool);
|
||||
poolPtr = 0;
|
||||
}
|
||||
|
||||
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
||||
}
|
13
node_modules/node-notifier/node_modules/uuid/dist/esm-node/sha1.js
generated
vendored
Normal file
13
node_modules/node-notifier/node_modules/uuid/dist/esm-node/sha1.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
import crypto from 'crypto';
|
||||
|
||||
function sha1(bytes) {
|
||||
if (Array.isArray(bytes)) {
|
||||
bytes = Buffer.from(bytes);
|
||||
} else if (typeof bytes === 'string') {
|
||||
bytes = Buffer.from(bytes, 'utf8');
|
||||
}
|
||||
|
||||
return crypto.createHash('sha1').update(bytes).digest();
|
||||
}
|
||||
|
||||
export default sha1;
|
29
node_modules/node-notifier/node_modules/uuid/dist/esm-node/stringify.js
generated
vendored
Normal file
29
node_modules/node-notifier/node_modules/uuid/dist/esm-node/stringify.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
import validate from './validate.js';
|
||||
/**
|
||||
* Convert array of 16 byte values to UUID string format of the form:
|
||||
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
||||
*/
|
||||
|
||||
const byteToHex = [];
|
||||
|
||||
for (let i = 0; i < 256; ++i) {
|
||||
byteToHex.push((i + 0x100).toString(16).substr(1));
|
||||
}
|
||||
|
||||
function stringify(arr, offset = 0) {
|
||||
// Note: Be careful editing this code! It's been tuned for performance
|
||||
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
||||
const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
||||
// of the following:
|
||||
// - One or more input array values don't map to a hex octet (leading to
|
||||
// "undefined" in the uuid)
|
||||
// - Invalid input values for the RFC `version` or `variant` fields
|
||||
|
||||
if (!validate(uuid)) {
|
||||
throw TypeError('Stringified UUID is invalid');
|
||||
}
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
||||
export default stringify;
|
95
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v1.js
generated
vendored
Normal file
95
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v1.js
generated
vendored
Normal file
|
@ -0,0 +1,95 @@
|
|||
import rng from './rng.js';
|
||||
import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**
|
||||
//
|
||||
// Inspired by https://github.com/LiosK/UUID.js
|
||||
// and http://docs.python.org/library/uuid.html
|
||||
|
||||
let _nodeId;
|
||||
|
||||
let _clockseq; // Previous uuid creation time
|
||||
|
||||
|
||||
let _lastMSecs = 0;
|
||||
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
||||
|
||||
function v1(options, buf, offset) {
|
||||
let i = buf && offset || 0;
|
||||
const b = buf || new Array(16);
|
||||
options = options || {};
|
||||
let node = options.node || _nodeId;
|
||||
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
||||
// specified. We do this lazily to minimize issues related to insufficient
|
||||
// system entropy. See #189
|
||||
|
||||
if (node == null || clockseq == null) {
|
||||
const seedBytes = options.random || (options.rng || rng)();
|
||||
|
||||
if (node == null) {
|
||||
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
||||
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
||||
}
|
||||
|
||||
if (clockseq == null) {
|
||||
// Per 4.2.2, randomize (14 bit) clockseq
|
||||
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
||||
}
|
||||
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
||||
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
||||
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
||||
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
||||
|
||||
|
||||
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
||||
// cycle to simulate higher resolution clock
|
||||
|
||||
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
||||
|
||||
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
||||
|
||||
if (dt < 0 && options.clockseq === undefined) {
|
||||
clockseq = clockseq + 1 & 0x3fff;
|
||||
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
||||
// time interval
|
||||
|
||||
|
||||
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
||||
nsecs = 0;
|
||||
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
||||
|
||||
|
||||
if (nsecs >= 10000) {
|
||||
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
||||
}
|
||||
|
||||
_lastMSecs = msecs;
|
||||
_lastNSecs = nsecs;
|
||||
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
||||
|
||||
msecs += 12219292800000; // `time_low`
|
||||
|
||||
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
||||
b[i++] = tl >>> 24 & 0xff;
|
||||
b[i++] = tl >>> 16 & 0xff;
|
||||
b[i++] = tl >>> 8 & 0xff;
|
||||
b[i++] = tl & 0xff; // `time_mid`
|
||||
|
||||
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
||||
b[i++] = tmh >>> 8 & 0xff;
|
||||
b[i++] = tmh & 0xff; // `time_high_and_version`
|
||||
|
||||
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
||||
|
||||
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
||||
|
||||
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
||||
|
||||
b[i++] = clockseq & 0xff; // `node`
|
||||
|
||||
for (let n = 0; n < 6; ++n) {
|
||||
b[i + n] = node[n];
|
||||
}
|
||||
|
||||
return buf || stringify(b);
|
||||
}
|
||||
|
||||
export default v1;
|
4
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v3.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v3.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import v35 from './v35.js';
|
||||
import md5 from './md5.js';
|
||||
const v3 = v35('v3', 0x30, md5);
|
||||
export default v3;
|
64
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v35.js
generated
vendored
Normal file
64
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v35.js
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
import stringify from './stringify.js';
|
||||
import parse from './parse.js';
|
||||
|
||||
function stringToBytes(str) {
|
||||
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
||||
|
||||
const bytes = [];
|
||||
|
||||
for (let i = 0; i < str.length; ++i) {
|
||||
bytes.push(str.charCodeAt(i));
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
||||
export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
||||
export default function (name, version, hashfunc) {
|
||||
function generateUUID(value, namespace, buf, offset) {
|
||||
if (typeof value === 'string') {
|
||||
value = stringToBytes(value);
|
||||
}
|
||||
|
||||
if (typeof namespace === 'string') {
|
||||
namespace = parse(namespace);
|
||||
}
|
||||
|
||||
if (namespace.length !== 16) {
|
||||
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
||||
} // Compute hash of namespace and value, Per 4.3
|
||||
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
||||
// hashfunc([...namespace, ... value])`
|
||||
|
||||
|
||||
let bytes = new Uint8Array(16 + value.length);
|
||||
bytes.set(namespace);
|
||||
bytes.set(value, namespace.length);
|
||||
bytes = hashfunc(bytes);
|
||||
bytes[6] = bytes[6] & 0x0f | version;
|
||||
bytes[8] = bytes[8] & 0x3f | 0x80;
|
||||
|
||||
if (buf) {
|
||||
offset = offset || 0;
|
||||
|
||||
for (let i = 0; i < 16; ++i) {
|
||||
buf[offset + i] = bytes[i];
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
return stringify(bytes);
|
||||
} // Function#name is not settable on some platforms (#270)
|
||||
|
||||
|
||||
try {
|
||||
generateUUID.name = name; // eslint-disable-next-line no-empty
|
||||
} catch (err) {} // For CommonJS default export support
|
||||
|
||||
|
||||
generateUUID.DNS = DNS;
|
||||
generateUUID.URL = URL;
|
||||
return generateUUID;
|
||||
}
|
24
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v4.js
generated
vendored
Normal file
24
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v4.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
import rng from './rng.js';
|
||||
import stringify from './stringify.js';
|
||||
|
||||
function v4(options, buf, offset) {
|
||||
options = options || {};
|
||||
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
||||
|
||||
rnds[6] = rnds[6] & 0x0f | 0x40;
|
||||
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
||||
|
||||
if (buf) {
|
||||
offset = offset || 0;
|
||||
|
||||
for (let i = 0; i < 16; ++i) {
|
||||
buf[offset + i] = rnds[i];
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
return stringify(rnds);
|
||||
}
|
||||
|
||||
export default v4;
|
4
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v5.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/uuid/dist/esm-node/v5.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import v35 from './v35.js';
|
||||
import sha1 from './sha1.js';
|
||||
const v5 = v35('v5', 0x50, sha1);
|
||||
export default v5;
|
7
node_modules/node-notifier/node_modules/uuid/dist/esm-node/validate.js
generated
vendored
Normal file
7
node_modules/node-notifier/node_modules/uuid/dist/esm-node/validate.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
import REGEX from './regex.js';
|
||||
|
||||
function validate(uuid) {
|
||||
return typeof uuid === 'string' && REGEX.test(uuid);
|
||||
}
|
||||
|
||||
export default validate;
|
11
node_modules/node-notifier/node_modules/uuid/dist/esm-node/version.js
generated
vendored
Normal file
11
node_modules/node-notifier/node_modules/uuid/dist/esm-node/version.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
import validate from './validate.js';
|
||||
|
||||
function version(uuid) {
|
||||
if (!validate(uuid)) {
|
||||
throw TypeError('Invalid UUID');
|
||||
}
|
||||
|
||||
return parseInt(uuid.substr(14, 1), 16);
|
||||
}
|
||||
|
||||
export default version;
|
79
node_modules/node-notifier/node_modules/uuid/dist/index.js
generated
vendored
Normal file
79
node_modules/node-notifier/node_modules/uuid/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "v1", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _v.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "v3", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _v2.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "v4", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _v3.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "v5", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _v4.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "NIL", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _nil.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "version", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _version.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "validate", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _validate.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "stringify", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _stringify.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "parse", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parse.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _v = _interopRequireDefault(require("./v1.js"));
|
||||
|
||||
var _v2 = _interopRequireDefault(require("./v3.js"));
|
||||
|
||||
var _v3 = _interopRequireDefault(require("./v4.js"));
|
||||
|
||||
var _v4 = _interopRequireDefault(require("./v5.js"));
|
||||
|
||||
var _nil = _interopRequireDefault(require("./nil.js"));
|
||||
|
||||
var _version = _interopRequireDefault(require("./version.js"));
|
||||
|
||||
var _validate = _interopRequireDefault(require("./validate.js"));
|
||||
|
||||
var _stringify = _interopRequireDefault(require("./stringify.js"));
|
||||
|
||||
var _parse = _interopRequireDefault(require("./parse.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
223
node_modules/node-notifier/node_modules/uuid/dist/md5-browser.js
generated
vendored
Normal file
223
node_modules/node-notifier/node_modules/uuid/dist/md5-browser.js
generated
vendored
Normal file
|
@ -0,0 +1,223 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
/*
|
||||
* Browser-compatible JavaScript MD5
|
||||
*
|
||||
* Modification of JavaScript MD5
|
||||
* https://github.com/blueimp/JavaScript-MD5
|
||||
*
|
||||
* Copyright 2011, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*
|
||||
* Based on
|
||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
* Digest Algorithm, as defined in RFC 1321.
|
||||
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||
* Distributed under the BSD License
|
||||
* See http://pajhome.org.uk/crypt/md5 for more info.
|
||||
*/
|
||||
function md5(bytes) {
|
||||
if (typeof bytes === 'string') {
|
||||
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||
|
||||
bytes = new Uint8Array(msg.length);
|
||||
|
||||
for (let i = 0; i < msg.length; ++i) {
|
||||
bytes[i] = msg.charCodeAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
|
||||
}
|
||||
/*
|
||||
* Convert an array of little-endian words to an array of bytes
|
||||
*/
|
||||
|
||||
|
||||
function md5ToHexEncodedArray(input) {
|
||||
const output = [];
|
||||
const length32 = input.length * 32;
|
||||
const hexTab = '0123456789abcdef';
|
||||
|
||||
for (let i = 0; i < length32; i += 8) {
|
||||
const x = input[i >> 5] >>> i % 32 & 0xff;
|
||||
const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
|
||||
output.push(hex);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
/**
|
||||
* Calculate output length with padding and bit length
|
||||
*/
|
||||
|
||||
|
||||
function getOutputLength(inputLength8) {
|
||||
return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
|
||||
}
|
||||
/*
|
||||
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
||||
*/
|
||||
|
||||
|
||||
function wordsToMd5(x, len) {
|
||||
/* append padding */
|
||||
x[len >> 5] |= 0x80 << len % 32;
|
||||
x[getOutputLength(len) - 1] = len;
|
||||
let a = 1732584193;
|
||||
let b = -271733879;
|
||||
let c = -1732584194;
|
||||
let d = 271733878;
|
||||
|
||||
for (let i = 0; i < x.length; i += 16) {
|
||||
const olda = a;
|
||||
const oldb = b;
|
||||
const oldc = c;
|
||||
const oldd = d;
|
||||
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
||||
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
||||
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
||||
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
||||
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
||||
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
||||
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
||||
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
||||
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
||||
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
||||
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
||||
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
||||
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
||||
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
||||
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
||||
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
||||
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
||||
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
||||
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
||||
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
||||
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
||||
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
||||
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
||||
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
||||
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
||||
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
||||
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
||||
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
||||
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
||||
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
||||
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
||||
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
||||
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
||||
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
||||
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
||||
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
||||
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
||||
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
||||
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
||||
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
||||
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
||||
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
||||
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
||||
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
||||
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
||||
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
||||
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
||||
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
||||
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
||||
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
||||
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
||||
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
||||
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
||||
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
||||
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
||||
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
||||
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
||||
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
||||
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
||||
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
||||
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
||||
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
||||
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
||||
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
||||
a = safeAdd(a, olda);
|
||||
b = safeAdd(b, oldb);
|
||||
c = safeAdd(c, oldc);
|
||||
d = safeAdd(d, oldd);
|
||||
}
|
||||
|
||||
return [a, b, c, d];
|
||||
}
|
||||
/*
|
||||
* Convert an array bytes to an array of little-endian words
|
||||
* Characters >255 have their high-byte silently ignored.
|
||||
*/
|
||||
|
||||
|
||||
function bytesToWords(input) {
|
||||
if (input.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const length8 = input.length * 8;
|
||||
const output = new Uint32Array(getOutputLength(length8));
|
||||
|
||||
for (let i = 0; i < length8; i += 8) {
|
||||
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
/*
|
||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||
* to work around bugs in some JS interpreters.
|
||||
*/
|
||||
|
||||
|
||||
function safeAdd(x, y) {
|
||||
const lsw = (x & 0xffff) + (y & 0xffff);
|
||||
const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||
return msw << 16 | lsw & 0xffff;
|
||||
}
|
||||
/*
|
||||
* Bitwise rotate a 32-bit number to the left.
|
||||
*/
|
||||
|
||||
|
||||
function bitRotateLeft(num, cnt) {
|
||||
return num << cnt | num >>> 32 - cnt;
|
||||
}
|
||||
/*
|
||||
* These functions implement the four basic operations the algorithm uses.
|
||||
*/
|
||||
|
||||
|
||||
function md5cmn(q, a, b, x, s, t) {
|
||||
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
||||
}
|
||||
|
||||
function md5ff(a, b, c, d, x, s, t) {
|
||||
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
||||
}
|
||||
|
||||
function md5gg(a, b, c, d, x, s, t) {
|
||||
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
||||
}
|
||||
|
||||
function md5hh(a, b, c, d, x, s, t) {
|
||||
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
||||
}
|
||||
|
||||
function md5ii(a, b, c, d, x, s, t) {
|
||||
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
||||
}
|
||||
|
||||
var _default = md5;
|
||||
exports.default = _default;
|
23
node_modules/node-notifier/node_modules/uuid/dist/md5.js
generated
vendored
Normal file
23
node_modules/node-notifier/node_modules/uuid/dist/md5.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _crypto = _interopRequireDefault(require("crypto"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function md5(bytes) {
|
||||
if (Array.isArray(bytes)) {
|
||||
bytes = Buffer.from(bytes);
|
||||
} else if (typeof bytes === 'string') {
|
||||
bytes = Buffer.from(bytes, 'utf8');
|
||||
}
|
||||
|
||||
return _crypto.default.createHash('md5').update(bytes).digest();
|
||||
}
|
||||
|
||||
var _default = md5;
|
||||
exports.default = _default;
|
8
node_modules/node-notifier/node_modules/uuid/dist/nil.js
generated
vendored
Normal file
8
node_modules/node-notifier/node_modules/uuid/dist/nil.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = '00000000-0000-0000-0000-000000000000';
|
||||
exports.default = _default;
|
45
node_modules/node-notifier/node_modules/uuid/dist/parse.js
generated
vendored
Normal file
45
node_modules/node-notifier/node_modules/uuid/dist/parse.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _validate = _interopRequireDefault(require("./validate.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function parse(uuid) {
|
||||
if (!(0, _validate.default)(uuid)) {
|
||||
throw TypeError('Invalid UUID');
|
||||
}
|
||||
|
||||
let v;
|
||||
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
||||
|
||||
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
||||
arr[1] = v >>> 16 & 0xff;
|
||||
arr[2] = v >>> 8 & 0xff;
|
||||
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
||||
|
||||
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
||||
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
||||
|
||||
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
||||
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
||||
|
||||
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
||||
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
||||
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
||||
|
||||
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
||||
arr[11] = v / 0x100000000 & 0xff;
|
||||
arr[12] = v >>> 24 & 0xff;
|
||||
arr[13] = v >>> 16 & 0xff;
|
||||
arr[14] = v >>> 8 & 0xff;
|
||||
arr[15] = v & 0xff;
|
||||
return arr;
|
||||
}
|
||||
|
||||
var _default = parse;
|
||||
exports.default = _default;
|
8
node_modules/node-notifier/node_modules/uuid/dist/regex.js
generated
vendored
Normal file
8
node_modules/node-notifier/node_modules/uuid/dist/regex.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
||||
exports.default = _default;
|
26
node_modules/node-notifier/node_modules/uuid/dist/rng-browser.js
generated
vendored
Normal file
26
node_modules/node-notifier/node_modules/uuid/dist/rng-browser.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = rng;
|
||||
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
||||
// require the crypto API and do not support built-in fallback to lower quality random number
|
||||
// generators (like Math.random()).
|
||||
let getRandomValues;
|
||||
const rnds8 = new Uint8Array(16);
|
||||
|
||||
function rng() {
|
||||
// lazy load so that environments that need to polyfill have a chance to do so
|
||||
if (!getRandomValues) {
|
||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
||||
// find the complete implementation of crypto (msCrypto) on IE11.
|
||||
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
||||
|
||||
if (!getRandomValues) {
|
||||
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
||||
}
|
||||
}
|
||||
|
||||
return getRandomValues(rnds8);
|
||||
}
|
24
node_modules/node-notifier/node_modules/uuid/dist/rng.js
generated
vendored
Normal file
24
node_modules/node-notifier/node_modules/uuid/dist/rng.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = rng;
|
||||
|
||||
var _crypto = _interopRequireDefault(require("crypto"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
|
||||
|
||||
let poolPtr = rnds8Pool.length;
|
||||
|
||||
function rng() {
|
||||
if (poolPtr > rnds8Pool.length - 16) {
|
||||
_crypto.default.randomFillSync(rnds8Pool);
|
||||
|
||||
poolPtr = 0;
|
||||
}
|
||||
|
||||
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
||||
}
|
104
node_modules/node-notifier/node_modules/uuid/dist/sha1-browser.js
generated
vendored
Normal file
104
node_modules/node-notifier/node_modules/uuid/dist/sha1-browser.js
generated
vendored
Normal file
|
@ -0,0 +1,104 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
// Adapted from Chris Veness' SHA1 code at
|
||||
// http://www.movable-type.co.uk/scripts/sha1.html
|
||||
function f(s, x, y, z) {
|
||||
switch (s) {
|
||||
case 0:
|
||||
return x & y ^ ~x & z;
|
||||
|
||||
case 1:
|
||||
return x ^ y ^ z;
|
||||
|
||||
case 2:
|
||||
return x & y ^ x & z ^ y & z;
|
||||
|
||||
case 3:
|
||||
return x ^ y ^ z;
|
||||
}
|
||||
}
|
||||
|
||||
function ROTL(x, n) {
|
||||
return x << n | x >>> 32 - n;
|
||||
}
|
||||
|
||||
function sha1(bytes) {
|
||||
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
||||
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
||||
|
||||
if (typeof bytes === 'string') {
|
||||
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||
|
||||
bytes = [];
|
||||
|
||||
for (let i = 0; i < msg.length; ++i) {
|
||||
bytes.push(msg.charCodeAt(i));
|
||||
}
|
||||
} else if (!Array.isArray(bytes)) {
|
||||
// Convert Array-like to Array
|
||||
bytes = Array.prototype.slice.call(bytes);
|
||||
}
|
||||
|
||||
bytes.push(0x80);
|
||||
const l = bytes.length / 4 + 2;
|
||||
const N = Math.ceil(l / 16);
|
||||
const M = new Array(N);
|
||||
|
||||
for (let i = 0; i < N; ++i) {
|
||||
const arr = new Uint32Array(16);
|
||||
|
||||
for (let j = 0; j < 16; ++j) {
|
||||
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
||||
}
|
||||
|
||||
M[i] = arr;
|
||||
}
|
||||
|
||||
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
||||
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
||||
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
||||
|
||||
for (let i = 0; i < N; ++i) {
|
||||
const W = new Uint32Array(80);
|
||||
|
||||
for (let t = 0; t < 16; ++t) {
|
||||
W[t] = M[i][t];
|
||||
}
|
||||
|
||||
for (let t = 16; t < 80; ++t) {
|
||||
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
||||
}
|
||||
|
||||
let a = H[0];
|
||||
let b = H[1];
|
||||
let c = H[2];
|
||||
let d = H[3];
|
||||
let e = H[4];
|
||||
|
||||
for (let t = 0; t < 80; ++t) {
|
||||
const s = Math.floor(t / 20);
|
||||
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
||||
e = d;
|
||||
d = c;
|
||||
c = ROTL(b, 30) >>> 0;
|
||||
b = a;
|
||||
a = T;
|
||||
}
|
||||
|
||||
H[0] = H[0] + a >>> 0;
|
||||
H[1] = H[1] + b >>> 0;
|
||||
H[2] = H[2] + c >>> 0;
|
||||
H[3] = H[3] + d >>> 0;
|
||||
H[4] = H[4] + e >>> 0;
|
||||
}
|
||||
|
||||
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
||||
}
|
||||
|
||||
var _default = sha1;
|
||||
exports.default = _default;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue