new license file version [CI SKIP]

This commit is contained in:
2023-03-15 13:43:57 +00:00
parent d8a3063735
commit 00359d25c1
5600 changed files with 523898 additions and 2 deletions

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0.00147,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0.00147,"98":0,"99":0,"100":0,"101":0,"102":0.0044,"103":0,"104":0,"105":0,"106":0.00147,"107":0.00293,"108":0.03956,"109":0.02344,"110":0.00293,"111":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00293,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0.00147,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00733,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0.00147,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0.00147,"80":0,"81":0.00586,"83":0.00293,"84":0,"85":0.00147,"86":0.00147,"87":0.00147,"88":0.00147,"89":0,"90":0,"91":0.00147,"92":0.00147,"93":0,"94":0,"95":0.00147,"96":0.00147,"97":0,"98":0.00293,"99":0.00147,"100":0.00147,"101":0.00147,"102":0.0044,"103":0.00293,"104":0.00147,"105":0.00147,"106":0.00586,"107":0.00733,"108":0.17434,"109":0.17287,"110":0,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0.00147,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0.00147,"24":0.01172,"25":0,"26":0.0044,"27":0.00733,"28":0.01905,"29":0,"30":0.01172,"31":0.0044,"32":0.00586,"33":0.00586,"34":0.00147,"35":0.00147,"36":0,"37":0.0044,"38":0.01905,"39":0,"40":0,"41":0.00147,"42":0.05714,"43":0,"44":0,"45":0.0044,"46":0.00733,"47":0.00293,"48":0,"49":0,"50":0.02637,"51":0.00733,"52":0,"53":0,"54":0.0044,"55":0.04542,"56":0.00586,"57":0.00733,"58":0.01758,"60":0.23147,"62":0.00293,"63":0.3516,"64":0.08204,"65":0.03077,"66":0.25931,"67":0.01465,"68":0,"69":0,"70":0,"71":0,"72":0.00293,"73":0.07911,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.00147,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00147,"93":0.00293,"94":0.04102,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0.00586},B:{"12":0.00293,"13":0.00147,"14":0.00147,"15":0.00293,"16":0,"17":0.00147,"18":0.00586,"79":0,"80":0,"81":0,"83":0,"84":0.00147,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0.00147,"91":0,"92":0.00293,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00147,"103":0.00147,"104":0,"105":0.00147,"106":0,"107":0.00293,"108":0.063,"109":0.05128},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0.00147,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.00293,"14.1":0.00293,"15.1":0,"15.2-15.3":0,"15.4":0,"15.5":0,"15.6":0.00293,"16.0":0.00147,"16.1":0.01465,"16.2":0.0044,"16.3":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00081,"6.0-6.1":0,"7.0-7.1":0.00485,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.03149,"10.0-10.2":0,"10.3":0.193,"11.0-11.2":0.00969,"11.3-11.4":0.00727,"12.0-12.1":0.03472,"12.2-12.5":1.89855,"13.0-13.1":0.03553,"13.2":0.04119,"13.3":0.03634,"13.4-13.7":0.17039,"14.0-14.4":0.33513,"14.5-14.8":0.51522,"15.0-15.1":0.31979,"15.2-15.3":0.2996,"15.4":0.28749,"15.5":0.52006,"15.6":0.48615,"16.0":0.49664,"16.1":0.75425,"16.2":0.80917,"16.3":0.11871},P:{"4":0.306,"5.0-5.4":0.12832,"6.2-6.4":0.03948,"7.2-7.4":0.09871,"8.2":0,"9.2":0.04935,"10.1":0,"11.1-11.2":0.02961,"12.0":0,"13.0":0.00987,"14.0":0.02961,"15.0":0.00987,"16.0":0.04935,"17.0":0.03948,"18.0":0.05923,"19.0":0.28626},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00211,"4.2-4.3":0.00919,"4.4":0,"4.4.3-4.4.4":0.04749},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00586,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.06828},Q:{"13.1":0.01707},O:{"0":0.46089},H:{"0":30.0348},L:{"0":53.17797},S:{"2.5":0.19631}};

View File

@@ -0,0 +1,56 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Subject_1 = require("./Subject");
var ObjectUnsubscribedError_1 = require("./util/ObjectUnsubscribedError");
var BehaviorSubject = (function (_super) {
__extends(BehaviorSubject, _super);
function BehaviorSubject(_value) {
var _this = _super.call(this) || this;
_this._value = _value;
return _this;
}
Object.defineProperty(BehaviorSubject.prototype, "value", {
get: function () {
return this.getValue();
},
enumerable: true,
configurable: true
});
BehaviorSubject.prototype._subscribe = function (subscriber) {
var subscription = _super.prototype._subscribe.call(this, subscriber);
if (subscription && !subscription.closed) {
subscriber.next(this._value);
}
return subscription;
};
BehaviorSubject.prototype.getValue = function () {
if (this.hasError) {
throw this.thrownError;
}
else if (this.closed) {
throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
}
else {
return this._value;
}
};
BehaviorSubject.prototype.next = function (value) {
_super.prototype.next.call(this, this._value = value);
};
return BehaviorSubject;
}(Subject_1.Subject));
exports.BehaviorSubject = BehaviorSubject;
//# sourceMappingURL=BehaviorSubject.js.map

View File

@@ -0,0 +1,397 @@
# Release It! 🚀
🚀 Generic CLI tool to automate versioning and package publishing related tasks:
<img align="right" src="./docs/assets/release-it.svg?raw=true" height="280">
- Execute test & build commands
- Bump version (in e.g. `package.json`)
- [Git commit, tag, push](#git)
- [Create release at GitHub](#github-releases) or [GitLab](#gitlab-releases)
- [Generate changelog](#changelog)
- [Publish to npm](#publish-to-npm)
- [Manage pre-releases](#manage-pre-releases)
- [Hooks](#hooks)
- Extend with [plugins](#plugins)
- Release from any [CI/CD environment](./docs/ci.md)
Use release-it for version management and publish to anywhere with its versatile configuration, a powerful plugin
system, and use hooks to execute any command you need to test, build, and/or publish your project.
[![Action Status](https://github.com/release-it/release-it/workflows/Cross-OS%20Tests/badge.svg)](https://github.com/release-it/release-it/actions)
[![npm version](https://badge.fury.io/js/release-it.svg)](https://www.npmjs.com/package/release-it)
[![codecov](https://codecov.io/gh/release-it/release-it/branch/master/graph/badge.svg)](https://codecov.io/gh/release-it/release-it)
## Links
- See [CHANGELOG.md](./CHANGELOG.md) for major/breaking updates, and
[releases](https://github.com/release-it/release-it/releases) for a detailed version history.
- To **contribute**, please read [CONTRIBUTING.md](./.github/CONTRIBUTING.md) first.
- Please [open an issue](https://github.com/release-it/release-it/issues/new) if anything is missing or unclear in this
documentation.
## Installation
Although release-it is a **generic** release tool, installation requires npm. A `package.json` file is not required. The
recommended way to install release-it also adds basic configuration. Answer one or two questions and it's ready:
```bash
npm init release-it
```
Alternatively, install it manually, and add the `release` script to `package.json`:
```bash
npm install --save-dev release-it
```
```json
{
"name": "my-package",
"version": "1.0.0",
"scripts": {
"release": "release-it"
},
"devDependencies": {
"release-it": "*"
}
}
```
Now you can run `npm run release` from the command line (any release-it arguments behind the `--`):
```bash
npm run release
npm run release -- minor --ci
```
### Global usage
Use release-it in any (non-npm) project, take it for a test drive, or install it globally:
```bash
# Run release-it from anywhere (without installation)
npx release-it
# Install globally and run from anywhere
npm install --global release-it
release-it
```
## Usage
Release a new version:
```bash
release-it
```
You will be prompted to select the new version, and more questions will follow based on your setup.
Make sure to run release-it from the root of the project to prevent potential issues.
## Dry Run
To show the interactivity and the commands it _would_ execute:
```bash
release-it --dry-run
```
Note: read-only commands are still executed (`$ ...`), while potentially writing/mutating commands are not (`! ...`):
```bash
$ git rev-parse --git-dir
.git
! git add package.json
! git commit --message="Release 0.8.3"
```
## Configuration
Out of the box, release-it has sane defaults, and [plenty of options](./config/release-it.json) to configure it. Put
(only) the options to override in a configuration file. This is where release-it looks for configuration:
- `.release-it.json`
- `.release-it.js` (or `.cjs`; export the configuration object: `module.exports = {}`)
- `.release-it.yaml` (or `.yml`)
- `.release-it.toml`
- `package.json` (in the `release-it` property)
Use `--config` to use another path for the configuration file. An example `.release-it.json`:
```json
{
"git": {
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true
}
}
```
Or in a `release-it` property in `package.json`:
```json
{
"name": "my-package",
"devDependencies": {
"release-it": "*"
},
"release-it": {
"github": {
"release": true
}
}
}
```
Or use YAML in `.release-it.yml`:
```yaml
git:
requireCleanWorkingDir: false
```
Or TOML in `.release-it.toml`:
```toml
[hooks]
"before:init" = "npm test"
```
Any option can also be set on the command-line, and will have highest priority. Example:
```bash
release-it minor --git.requireBranch=master --github.release
```
Boolean arguments can be negated by using the `no-` prefix:
```bash
release-it --no-npm.publish
```
## Interactive vs. CI mode
By default, release-it is **interactive** and allows you to confirm each task before execution:
<img src="./docs/assets/release-it-interactive.gif?raw=true" height="290">
By using the `--ci` option, the process is fully automated without prompts. The configured tasks will be executed as
demonstrated in the first animation above. On a Continuous Integration (CI) environment, this non-interactive mode is
activated automatically.
Use `--only-version` to use a prompt only to determine the version, and automate the rest.
## Latest version
How does release-it determine the latest version?
1. For projects with a `package.json`, its `version` will be used (see [npm](./docs/npm.md) to skip this).
2. Otherwise, release-it uses the latest Git tag to determine which version should be released.
3. As a last resort, `0.0.0` will be used as the latest version.
Alternatively, a plugin can be used to override this (e.g. to manage a `VERSION` or `composer.json` file):
- [@release-it/bumper](https://github.com/release-it/bumper) to read from or bump the version in any file
- [@release-it/conventional-changelog](https://github.com/release-it/conventional-changelog) to get a recommended bump
based on commit messages
- [release-it-calver-plugin](https://github.com/casmith/release-it-calver-plugin) to use CalVer (Calendar Versioning)
## Git
Git projects are supported well by release-it, automating the tasks to stage, commit, tag and push releases to any Git
remote.
→ See [Git](./docs/git.md) for more details.
## GitHub Releases
The "Releases" tab on GitHub projects links to a page to store the changelog cq. release notes. To add
[GitHub releases](https://help.github.com/articles/creating-releases) in your release-it flow:
- Configure `github.release: true`
- Obtain a [personal access token](https://github.com/settings/tokens/new?scopes=repo&description=release-it)
(release-it only needs "repo" access; no "admin" or other scopes).
- Make sure the token is [available as an environment variable](./docs/environment-variables.md).
→ See [GitHub Releases](./docs/github-releases.md) for more details.
## GitLab Releases
[GitLab releases](https://docs.gitlab.com/ce/user/project/releases/) work just like GitHub releases:
- Configure `gitlab.release: true`
- Obtain a [personal access token](https://gitlab.com/profile/personal_access_tokens) (release-it only needs the "api"
scope).
- Make sure the token is [available as an environment variable](./docs/environment-variables.md).
→ See [GitLab Releases](./docs/gitlab-releases.md) for more details.
## Changelog
By default, release-it generates a changelog, to show and help select a version for the new release. Additionally, this
changelog serves as the release notes for the GitHub or GitLab release.
The [default command](./config/release-it.json) is based on `git log ...`. This setting (`git.changelog`) can be
overridden. To further customize the release notes for the GitHub or GitLab release, there's `github.releaseNotes` or
`gitlab.releaseNotes`. Make sure any of these commands output the changelog to `stdout`. Plugins are available for:
- GitHub and GitLab Releases
- auto-changelog
- Conventional Changelog
- Keep A Changelog
→ See [Changelog](./docs/changelog.md) for more details.
## Publish to npm
With a `package.json` in the current directory, release-it will let `npm` bump the version in `package.json` (and
`package-lock.json` if present), and publish to the npm registry.
→ See [Publish to npm](./docs/npm.md) for more details.
## Manage pre-releases
With release-it, it's easy to create pre-releases: a version of your software that you want to make available, while
it's not in the stable semver range yet. Often "alpha", "beta", and "rc" (release candidate) are used as identifier for
pre-releases. An example pre-release version is `2.0.0-beta.0`.
→ See [Manage pre-releases](./docs/pre-releases.md) for more details.
## Hooks
Use script hooks to run shell commands at any moment during the release process (such as `before:init` or
`after:release`).
The format is `[prefix]:[hook]` or `[prefix]:[plugin]:[hook]`:
| part | value |
| ------ | ------------------------------------------- |
| prefix | `before` or `after` |
| plugin | `version`, `git`, `npm`, `github`, `gitlab` |
| hook | `init`, `bump`, `release` |
Use the optional `:plugin` part in the middle to hook into a life cycle method exactly before or after any plugin.
The core plugins include `version`, `git`, `npm`, `github`, `gitlab`.
Note that hooks like `after:git:release` will not run when either the `git push` failed, or when it is configured not to
be executed (e.g. `git.push: false`). See [execution order](./docs/plugins.md#execution-order) for more details on
execution order of plugin lifecycle methods.
All commands can use configuration variables (like template strings). An array of commands can also be provided, they
will run one after another. Some example release-it configuration:
```json
{
"hooks": {
"before:init": ["npm run lint", "npm test"],
"after:my-plugin:bump": "./bin/my-script.sh",
"after:bump": "npm run build",
"after:git:release": "echo After git push, before github release",
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
}
}
```
The variables can be found in the [default configuration](./config/release-it.json). Additionally, the following
variables are exposed:
```
version
latestVersion
changelog
name
repo.remote, repo.protocol, repo.host, repo.owner, repo.repository, repo.project
```
All variables are available in all hooks. The only exception is that the additional variables listed above are not yet
available in the `init` hook.
Use `--verbose` to log the output of the commands.
For the sake of verbosity, the full list of hooks is actually: `init`, `beforeBump`, `bump`, `beforeRelease`, `release`
or `afterRelease`. However, hooks like `before:beforeRelease` look weird and are usually not useful in practice.
## Plugins
Since v11, release-it can be extended in many, many ways. Here are some plugins:
| Plugin | Description |
| ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| [@release-it/bumper](https://github.com/release-it/bumper) | Read & write the version from/to any file |
| [@release-it/conventional-changelog](https://github.com/release-it/conventional-changelog) | Provides recommended bump, conventional-changelog, and updates `CHANGELOG.md` |
| [@release-it/keep-a-changelog](https://github.com/release-it/keep-a-changelog) | Maintain CHANGELOG.md using the Keep a Changelog standards |
| [release-it-lerna-changelog](https://github.com/rwjblue/release-it-lerna-changelog) | Integrates lerna-changelog into the release-it pipeline |
| [release-it-yarn-workspaces](https://github.com/rwjblue/release-it-yarn-workspaces) | Releases each of your projects configured workspaces |
| [release-it-calver-plugin](https://github.com/casmith/release-it-calver-plugin) | Enables Calendar Versioning (calver) with release-it |
| [@grupoboticario/news-fragments](https://github.com/grupoboticario/news-fragments) | An easy way to generate your changelog file |
| [@j-ulrich/release-it-regex-bumper](https://github.com/j-ulrich/release-it-regex-bumper) | Regular expression based version read/write plugin for release-it |
Internally, release-it uses its own plugin architecture (for Git, GitHub, GitLab, npm).
→ See all [release-it plugins on npm](https://www.npmjs.com/search?q=keywords:release-it-plugin).
→ See [plugins](./docs/plugins.md) for documentation to write plugins.
## Distribution repository
Some projects use a distribution repository. Generated files (such as compiled assets or documentation) can be
distributed to a separate repository. Or to a separate branch, such as a `gh-pages`. Some examples include
[shim repositories](https://github.com/components) and a separate
[packaged Angular.js repository](https://github.com/angular/bower-angular) for distribution on npm and Bower.
The `dist.repo` option was removed in v10, but similar setups can still be achieved. Please see the
[distribution repository](./docs/recipes/distribution-repo.md) recipe for example configurations.
## Metrics
Use `--disable-metrics` to opt-out of sending some anonymous statistical data to Google Analytics. For details, refer to
[lib/metrics.js](./lib/metrics.js). Please consider to not opt-out: more data means more support for future development.
## Troubleshooting & debugging
- With `release-it --verbose` (or `-V`), release-it prints every custom script/hook and its output.
- With `release-it -VV`, release-it also prints every internal command and its output.
- Prepend `DEBUG=release-it:* release-it [...]` to print configuration and more error details.
Use `verbose: 2` in a configuration file to have the equivalent of `-VV` on the command line.
## Use release-it programmatically
While mostly used as a CLI tool, release-it can be used as a dependency to integrate in your own scripts. See
[use release-it programmatically](./docs/recipes/programmatic.md) for example code.
## Example projects using release-it
- [antonmedv/fx](https://github.com/antonmedv/fx)
- [blockchain/blockchain-wallet-v4-frontend](https://github.com/blockchain/blockchain-wallet-v4-frontend)
- [callstack/linaria](https://github.com/callstack/linaria)
- [ember-cli/ember-cli](https://github.com/ember-cli/ember-cli)
[react-native-paper](https://github.com/callstack/react-native-paper)
- [js-cookie/js-cookie](https://github.com/js-cookie/js-cookie)
- [mirumee/saleor](https://github.com/mirumee/saleor)
- [mozilla/readability](https://github.com/mozilla/readability)
- [satya164/react-native-tab-view](https://github.com/satya164/react-native-tab-view)
- [shipshapecode/shepherd](https://github.com/shipshapecode/shepherd)
- [swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui) +
[swagger-editor](https://github.com/swagger-api/swagger-editor)
- [StevenBlack/hosts](https://github.com/StevenBlack/hosts)
- [tabler](https://github.com/tabler/tabler) + [tabler-icons](https://github.com/tabler/tabler-icons)
- [youzan/vant](https://github.com/youzan/vant/search?q=release-it)
- [Repositories that depend on release-it](https://github.com/release-it/release-it/network/dependents)
- GitHub search for [filename:.release-it.json](https://github.com/search?q=filename%3A.release-it.json)
## Resources
- [semver.org](https://semver.org)
- [GitHub Help](https://docs.github.com) (→
[About Releases](https://docs.github.com/free-pro-team@latest/github/administering-a-repository/about-releases))
- [npm Blog: Publishing what you mean to publish](https://blog.npmjs.org/post/165769683050/publishing-what-you-mean-to-publish)
- [npm Documentation: package.json](https://docs.npmjs.com/cli/v6/configuring-npm/package-json)
- [Prereleases and npm](https://medium.com/@mbostock/prereleases-and-npm-e778fc5e2420)
- [Glob Primer (node-glob)](https://github.com/isaacs/node-glob#glob-primer) (release-it uses
[globby](https://github.com/sindresorhus/globby#readme))

View File

@@ -0,0 +1 @@
{"version":3,"file":"mergeAll.js","sources":["../../src/add/operator/mergeAll.ts"],"names":[],"mappings":";;AAAA,6CAA2C"}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","16":"BC","132":"J E F G"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 6 7 8 9 F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC tB I u J E DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"1":"I u J E F G A B C K L H HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"GC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d PC QC RC qB 9B SC rB","16":"G OC"},G:{"1":"F TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","16":"zB"},H:{"1":"nC"},I:{"1":"tB I D qC rC AC sC tC","16":"oC pC"},J:{"1":"E A"},K:{"1":"A B C e qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:4,C:"Element.insertAdjacentHTML()"};

View File

@@ -0,0 +1,138 @@
import { Subject } from './Subject';
import { SchedulerLike } from './types';
import { queue } from './scheduler/queue';
import { Subscriber } from './Subscriber';
import { Subscription } from './Subscription';
import { ObserveOnSubscriber } from './operators/observeOn';
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
import { SubjectSubscription } from './SubjectSubscription';
/**
* A variant of Subject that "replays" or emits old values to new subscribers.
* It buffers a set number of values and will emit those values immediately to
* any new subscribers in addition to emitting new values to existing subscribers.
*
* @class ReplaySubject<T>
*/
export class ReplaySubject<T> extends Subject<T> {
private _events: (ReplayEvent<T> | T)[] = [];
private _bufferSize: number;
private _windowTime: number;
private _infiniteTimeWindow: boolean = false;
constructor(bufferSize: number = Number.POSITIVE_INFINITY,
windowTime: number = Number.POSITIVE_INFINITY,
private scheduler?: SchedulerLike) {
super();
this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
this._windowTime = windowTime < 1 ? 1 : windowTime;
if (windowTime === Number.POSITIVE_INFINITY) {
this._infiniteTimeWindow = true;
this.next = this.nextInfiniteTimeWindow;
} else {
this.next = this.nextTimeWindow;
}
}
private nextInfiniteTimeWindow(value: T): void {
if (!this.isStopped) {
const _events = this._events;
_events.push(value);
// Since this method is invoked in every next() call than the buffer
// can overgrow the max size only by one item
if (_events.length > this._bufferSize) {
_events.shift();
}
}
super.next(value);
}
private nextTimeWindow(value: T): void {
if (!this.isStopped) {
this._events.push(new ReplayEvent(this._getNow(), value));
this._trimBufferThenGetEvents();
}
super.next(value);
}
/** @deprecated This is an internal implementation detail, do not use. */
_subscribe(subscriber: Subscriber<T>): Subscription {
// When `_infiniteTimeWindow === true` then the buffer is already trimmed
const _infiniteTimeWindow = this._infiniteTimeWindow;
const _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
const scheduler = this.scheduler;
const len = _events.length;
let subscription: Subscription;
if (this.closed) {
throw new ObjectUnsubscribedError();
} else if (this.isStopped || this.hasError) {
subscription = Subscription.EMPTY;
} else {
this.observers.push(subscriber);
subscription = new SubjectSubscription(this, subscriber);
}
if (scheduler) {
subscriber.add(subscriber = new ObserveOnSubscriber<T>(subscriber, scheduler));
}
if (_infiniteTimeWindow) {
for (let i = 0; i < len && !subscriber.closed; i++) {
subscriber.next(<T>_events[i]);
}
} else {
for (let i = 0; i < len && !subscriber.closed; i++) {
subscriber.next((<ReplayEvent<T>>_events[i]).value);
}
}
if (this.hasError) {
subscriber.error(this.thrownError);
} else if (this.isStopped) {
subscriber.complete();
}
return subscription;
}
_getNow(): number {
return (this.scheduler || queue).now();
}
private _trimBufferThenGetEvents(): ReplayEvent<T>[] {
const now = this._getNow();
const _bufferSize = this._bufferSize;
const _windowTime = this._windowTime;
const _events = <ReplayEvent<T>[]>this._events;
const eventsCount = _events.length;
let spliceCount = 0;
// Trim events that fall out of the time window.
// Start at the front of the list. Break early once
// we encounter an event that falls within the window.
while (spliceCount < eventsCount) {
if ((now - _events[spliceCount].time) < _windowTime) {
break;
}
spliceCount++;
}
if (eventsCount > _bufferSize) {
spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
}
if (spliceCount > 0) {
_events.splice(0, spliceCount);
}
return _events;
}
}
class ReplayEvent<T> {
constructor(public time: number, public value: T) {
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"delay.js","sources":["../src/operators/delay.ts"],"names":[],"mappings":";;;;;AAAA,iDAA4C"}

View File

@@ -0,0 +1,8 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const VERSION = "6.41.0";
exports.VERSION = VERSION;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"name":"p-locate","version":"5.0.0","files":{"license":{"checkedAt":1678887829613,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1678887829610,"integrity":"sha512-brExehVMRrL6K6wPEuLMo4dsnm0PdPsXNTMCHkI7WpwXTxCidrANrBDRxcgGQvhB+2eHRwWWTG3COlhBHkgaUg==","mode":420,"size":1157},"package.json":{"checkedAt":1678887829610,"integrity":"sha512-H0eUvKthvpUDHGNdgyEIiHcovo3oRPLPiBbRbA+fGQ4j5IMZIdzmZ4rQFfZ/5UAeb3ekkxAfBr2LphEd4L+Oew==","mode":420,"size":942},"readme.md":{"checkedAt":1678887829610,"integrity":"sha512-POZgJNm+q5KAJUReK0Jr2wfaQp78pppmib7NVMFPtkfvN/Aw/7h/dRjnMoucFkOp9X7yxDnUpw7boJRoYofk1Q==","mode":420,"size":2557},"index.d.ts":{"checkedAt":1678887829610,"integrity":"sha512-A80/8QHgP7IOKhdEhkY5lz4j3qR9z3rBNzktnuAOpyGQTfwdTOUHdTfhCTO+/d1G5STvZNVI2wYL66itS9jHSg==","mode":420,"size":1467}}}

View File

@@ -0,0 +1,74 @@
# plugin-rest-endpoint-methods.js
> Octokit plugin adding one method for all of api.github.com REST API endpoints
[![@latest](https://img.shields.io/npm/v/@octokit/plugin-rest-endpoint-methods.svg)](https://www.npmjs.com/package/@octokit/plugin-rest-endpoint-methods)
[![Build Status](https://github.com/octokit/plugin-rest-endpoint-methods.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-rest-endpoint-methods.js/actions?workflow=Test)
## Usage
<table>
<tbody valign=top align=left>
<tr><th>
Browsers
</th><td width=100%>
Load `@octokit/plugin-rest-endpoint-methods` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
```html
<script type="module">
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
import { restEndpointMethods } from "https://cdn.skypack.dev/@octokit/plugin-rest-endpoint-methods";
</script>
```
</td></tr>
<tr><th>
Node
</th><td>
Install with `npm install @octokit/core @octokit/plugin-rest-endpoint-methods`. Optionally replace `@octokit/core` with a compatible module
```js
const { Octokit } = require("@octokit/core");
const {
restEndpointMethods,
} = require("@octokit/plugin-rest-endpoint-methods");
```
</td></tr>
</tbody>
</table>
```js
const MyOctokit = Octokit.plugin(restEndpointMethods);
const octokit = new MyOctokit({ auth: "secret123" });
// https://developer.github.com/v3/users/#get-the-authenticated-user
octokit.rest.users.getAuthenticated();
```
There is one method for each REST API endpoint documented at [https://developer.github.com/v3](https://developer.github.com/v3). All endpoint methods are documented in the [docs/](docs/) folder, e.g. [docs/users/getAuthenticated.md](docs/users/getAuthenticated.md)
## TypeScript
Parameter and response types for all endpoint methods exported as `{ RestEndpointMethodTypes }`.
Example
```ts
import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
type UpdateLabelParameters = RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];
type UpdateLabelResponse = RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
```
In order to get types beyond parameters and responses, check out [`@octokit/openapi-types`](https://github.com/octokit/openapi-types.ts/#readme), which is a direct transpliation from GitHub's official OpenAPI specification.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## License
[MIT](LICENSE)

View File

@@ -0,0 +1,15 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
import { subscribeToIterable } from '../util/subscribeToIterable';
import { scheduleIterable } from '../scheduled/scheduleIterable';
export function fromIterable<T>(input: Iterable<T>, scheduler?: SchedulerLike) {
if (!input) {
throw new Error('Iterable cannot be null');
}
if (!scheduler) {
return new Observable<T>(subscribeToIterable(input));
} else {
return scheduleIterable(input, scheduler);
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"Operator.js","sources":["src/Operator.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"version":3,"file":"race.js","sources":["../../../src/internal/operators/race.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAsBxD,MAAM,UAAU,IAAI,CAAI,GAAG,WAAgD;IACzE,OAAO,SAAS,oBAAoB,CAAC,MAAqB;QAGxD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;YACvD,WAAW,GAAG,WAAW,CAAC,CAAC,CAAoB,CAAC;SACjD;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,GAAI,WAA+B,CAAC,CAAC,CAAC;IACnF,CAAC,CAAC;AACJ,CAAC"}

View File

@@ -0,0 +1,7 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("rxjs-compat/observable/zip"));
//# sourceMappingURL=zip.js.map

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isIPRange;
var _assertString = _interopRequireDefault(require("./util/assertString"));
var _isIP = _interopRequireDefault(require("./isIP"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var subnetMaybe = /^\d{1,2}$/;
function isIPRange(str) {
(0, _assertString.default)(str);
var parts = str.split('/'); // parts[0] -> ip, parts[1] -> subnet
if (parts.length !== 2) {
return false;
}
if (!subnetMaybe.test(parts[1])) {
return false;
} // Disallow preceding 0 i.e. 01, 02, ...
if (parts[1].length > 1 && parts[1].startsWith('0')) {
return false;
}
return (0, _isIP.default)(parts[0], 4) && parts[1] <= 32 && parts[1] >= 0;
}
module.exports = exports.default;
module.exports.default = exports.default;

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("rxjs-compat/add/operator/timestamp");
//# sourceMappingURL=timestamp.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"subscribeOn.js","sources":["../src/operator/subscribeOn.ts"],"names":[],"mappings":";;;;;AAAA,sDAAiD"}

View File

@@ -0,0 +1,67 @@
import assertString from './util/assertString';
import merge from './util/merge';
var default_fqdn_options = {
require_tld: true,
allow_underscores: false,
allow_trailing_dot: false,
allow_numeric_tld: false
};
export default function isFQDN(str, options) {
assertString(str);
options = merge(options, default_fqdn_options);
/* Remove the optional trailing dot before checking validity */
if (options.allow_trailing_dot && str[str.length - 1] === '.') {
str = str.substring(0, str.length - 1);
}
var parts = str.split('.');
var tld = parts[parts.length - 1];
if (options.require_tld) {
// disallow fqdns without tld
if (parts.length < 2) {
return false;
}
if (!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
return false;
} // disallow spaces && special characers
if (/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20\u00A9\uFFFD]/.test(tld)) {
return false;
}
} // reject numeric TLDs
if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
return false;
}
return parts.every(function (part) {
if (part.length > 63) {
return false;
}
if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
return false;
} // disallow full-width chars
if (/[\uff01-\uff5e]/.test(part)) {
return false;
} // disallow parts starting or ending with hyphen
if (/^-|-$/.test(part)) {
return false;
}
if (!options.allow_underscores && /_/.test(part)) {
return false;
}
return true;
});
}

View File

@@ -0,0 +1,136 @@
import assertString from './util/assertString';
/**
* List of country codes with
* corresponding IBAN regular expression
* Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
*/
var ibanRegexThroughCountryCode = {
AD: /^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,
AE: /^(AE[0-9]{2})\d{3}\d{16}$/,
AL: /^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,
AT: /^(AT[0-9]{2})\d{16}$/,
AZ: /^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,
BA: /^(BA[0-9]{2})\d{16}$/,
BE: /^(BE[0-9]{2})\d{12}$/,
BG: /^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,
BH: /^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,
BR: /^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,
BY: /^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,
CH: /^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,
CR: /^(CR[0-9]{2})\d{18}$/,
CY: /^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,
CZ: /^(CZ[0-9]{2})\d{20}$/,
DE: /^(DE[0-9]{2})\d{18}$/,
DK: /^(DK[0-9]{2})\d{14}$/,
DO: /^(DO[0-9]{2})[A-Z]{4}\d{20}$/,
EE: /^(EE[0-9]{2})\d{16}$/,
EG: /^(EG[0-9]{2})\d{25}$/,
ES: /^(ES[0-9]{2})\d{20}$/,
FI: /^(FI[0-9]{2})\d{14}$/,
FO: /^(FO[0-9]{2})\d{14}$/,
FR: /^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
GB: /^(GB[0-9]{2})[A-Z]{4}\d{14}$/,
GE: /^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,
GI: /^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,
GL: /^(GL[0-9]{2})\d{14}$/,
GR: /^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,
GT: /^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,
HR: /^(HR[0-9]{2})\d{17}$/,
HU: /^(HU[0-9]{2})\d{24}$/,
IE: /^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,
IL: /^(IL[0-9]{2})\d{19}$/,
IQ: /^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,
IR: /^(IR[0-9]{2})0\d{2}0\d{18}$/,
IS: /^(IS[0-9]{2})\d{22}$/,
IT: /^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
JO: /^(JO[0-9]{2})[A-Z]{4}\d{22}$/,
KW: /^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,
KZ: /^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,
LB: /^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,
LC: /^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,
LI: /^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,
LT: /^(LT[0-9]{2})\d{16}$/,
LU: /^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,
LV: /^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,
MC: /^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
MD: /^(MD[0-9]{2})[A-Z0-9]{20}$/,
ME: /^(ME[0-9]{2})\d{18}$/,
MK: /^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,
MR: /^(MR[0-9]{2})\d{23}$/,
MT: /^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,
MU: /^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,
NL: /^(NL[0-9]{2})[A-Z]{4}\d{10}$/,
NO: /^(NO[0-9]{2})\d{11}$/,
PK: /^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,
PL: /^(PL[0-9]{2})\d{24}$/,
PS: /^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,
PT: /^(PT[0-9]{2})\d{21}$/,
QA: /^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,
RO: /^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,
RS: /^(RS[0-9]{2})\d{18}$/,
SA: /^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,
SC: /^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,
SE: /^(SE[0-9]{2})\d{20}$/,
SI: /^(SI[0-9]{2})\d{15}$/,
SK: /^(SK[0-9]{2})\d{20}$/,
SM: /^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
SV: /^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,
TL: /^(TL[0-9]{2})\d{19}$/,
TN: /^(TN[0-9]{2})\d{20}$/,
TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,
UA: /^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,
VA: /^(VA[0-9]{2})\d{18}$/,
VG: /^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,
XK: /^(XK[0-9]{2})\d{16}$/
};
/**
* Check whether string has correct universal IBAN format
* The IBAN consists of up to 34 alphanumeric characters, as follows:
* Country Code using ISO 3166-1 alpha-2, two letters
* check digits, two digits and
* Basic Bank Account Number (BBAN), up to 30 alphanumeric characters.
* NOTE: Permitted IBAN characters are: digits [0-9] and the 26 latin alphabetic [A-Z]
*
* @param {string} str - string under validation
* @return {boolean}
*/
function hasValidIbanFormat(str) {
// Strip white spaces and hyphens
var strippedStr = str.replace(/[\s\-]+/gi, '').toUpperCase();
var isoCountryCode = strippedStr.slice(0, 2).toUpperCase();
return isoCountryCode in ibanRegexThroughCountryCode && ibanRegexThroughCountryCode[isoCountryCode].test(strippedStr);
}
/**
* Check whether string has valid IBAN Checksum
* by performing basic mod-97 operation and
* the remainder should equal 1
* -- Start by rearranging the IBAN by moving the four initial characters to the end of the string
* -- Replace each letter in the string with two digits, A -> 10, B = 11, Z = 35
* -- Interpret the string as a decimal integer and
* -- compute the remainder on division by 97 (mod 97)
* Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
*
* @param {string} str
* @return {boolean}
*/
function hasValidIbanChecksum(str) {
var strippedStr = str.replace(/[^A-Z0-9]+/gi, '').toUpperCase(); // Keep only digits and A-Z latin alphabetic
var rearranged = strippedStr.slice(4) + strippedStr.slice(0, 4);
var alphaCapsReplacedWithDigits = rearranged.replace(/[A-Z]/g, function (_char) {
return _char.charCodeAt(0) - 55;
});
var remainder = alphaCapsReplacedWithDigits.match(/\d{1,7}/g).reduce(function (acc, value) {
return Number(acc + value) % 97;
}, '');
return remainder === 1;
}
export default function isIBAN(str) {
assertString(str);
return hasValidIbanFormat(str) && hasValidIbanChecksum(str);
}

View File

@@ -0,0 +1,9 @@
import { RequestOptions, ResponseHeaders, OctokitResponse } from "@octokit/types";
export declare type RequestErrorOptions = {
/** @deprecated set `response` instead */
headers?: ResponseHeaders;
request: RequestOptions;
} | {
response: OctokitResponse<unknown>;
request: RequestOptions;
};

View File

@@ -0,0 +1,64 @@
# import-lazy [![Build Status](https://travis-ci.org/sindresorhus/import-lazy.svg?branch=master)](https://travis-ci.org/sindresorhus/import-lazy)
> Import modules lazily
## Install
```
$ npm install --save import-lazy
```
## Usage
```js
// Pass in `require` or a custom import function
const importLazy = require('import-lazy')(require);
const _ = importLazy('lodash');
// Where you would normally do
_.isNumber(2);
// You now instead call it as a function
_().isNumber(2);
// It's cached on consecutive calls
_().isString('unicorn');
// Extract lazy variations of the props you need
const members = importLazy('lodash')('isNumber', 'isString');
// Useful when using destructuring assignment in ES2015
const {isNumber, isString} = importLazy('lodash')('isNumber', 'isString');
// Works out of the box for functions and regular properties
const stuff = importLazy('./math-lib')('sum', 'PHI');
console.log(stuff.sum(1, 2)); // => 3
console.log(stuff.PHI); // => 1.618033
```
### Proxy support in Node.js 6 or later
If you use Node.js 6 or later, you can take advantage of ES2015 proxies and don't need to call it as a function.
```js
const importLazy = require('import-lazy').proxy(require);
const _ = importLazy('lodash');
// No need to call it as a function but still lazily imported
_.isNumber(2);
```
## Related
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
- [lazy-value](https://github.com/sindresorhus/lazy-value) - Create a lazily evaluated value
- [define-lazy-prop](https://github.com/sindresorhus/define-lazy-prop) - Define a lazily evaluated property on an object
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1,81 @@
/** PURE_IMPORTS_START tslib,_map,_observable_from,_innerSubscribe PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { map } from './map';
import { from } from '../observable/from';
import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';
export function exhaustMap(project, resultSelector) {
if (resultSelector) {
return function (source) { return source.pipe(exhaustMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
}
return function (source) {
return source.lift(new ExhaustMapOperator(project));
};
}
var ExhaustMapOperator = /*@__PURE__*/ (function () {
function ExhaustMapOperator(project) {
this.project = project;
}
ExhaustMapOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
};
return ExhaustMapOperator;
}());
var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(ExhaustMapSubscriber, _super);
function ExhaustMapSubscriber(destination, project) {
var _this = _super.call(this, destination) || this;
_this.project = project;
_this.hasSubscription = false;
_this.hasCompleted = false;
_this.index = 0;
return _this;
}
ExhaustMapSubscriber.prototype._next = function (value) {
if (!this.hasSubscription) {
this.tryNext(value);
}
};
ExhaustMapSubscriber.prototype.tryNext = function (value) {
var result;
var index = this.index++;
try {
result = this.project(value, index);
}
catch (err) {
this.destination.error(err);
return;
}
this.hasSubscription = true;
this._innerSub(result);
};
ExhaustMapSubscriber.prototype._innerSub = function (result) {
var innerSubscriber = new SimpleInnerSubscriber(this);
var destination = this.destination;
destination.add(innerSubscriber);
var innerSubscription = innerSubscribe(result, innerSubscriber);
if (innerSubscription !== innerSubscriber) {
destination.add(innerSubscription);
}
};
ExhaustMapSubscriber.prototype._complete = function () {
this.hasCompleted = true;
if (!this.hasSubscription) {
this.destination.complete();
}
this.unsubscribe();
};
ExhaustMapSubscriber.prototype.notifyNext = function (innerValue) {
this.destination.next(innerValue);
};
ExhaustMapSubscriber.prototype.notifyError = function (err) {
this.destination.error(err);
};
ExhaustMapSubscriber.prototype.notifyComplete = function () {
this.hasSubscription = false;
if (this.hasCompleted) {
this.destination.complete();
}
};
return ExhaustMapSubscriber;
}(SimpleOuterSubscriber));
//# sourceMappingURL=exhaustMap.js.map