new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Immediate } from '../util/Immediate';
|
||||
import { AsyncAction } from './AsyncAction';
|
||||
var AsapAction = /*@__PURE__*/ (function (_super) {
|
||||
tslib_1.__extends(AsapAction, _super);
|
||||
function AsapAction(scheduler, work) {
|
||||
var _this = _super.call(this, scheduler, work) || this;
|
||||
_this.scheduler = scheduler;
|
||||
_this.work = work;
|
||||
return _this;
|
||||
}
|
||||
AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
||||
if (delay === void 0) {
|
||||
delay = 0;
|
||||
}
|
||||
if (delay !== null && delay > 0) {
|
||||
return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
||||
}
|
||||
scheduler.actions.push(this);
|
||||
return scheduler.scheduled || (scheduler.scheduled = Immediate.setImmediate(scheduler.flush.bind(scheduler, null)));
|
||||
};
|
||||
AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
||||
if (delay === void 0) {
|
||||
delay = 0;
|
||||
}
|
||||
if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
|
||||
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
||||
}
|
||||
if (scheduler.actions.length === 0) {
|
||||
Immediate.clearImmediate(id);
|
||||
scheduler.scheduled = undefined;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
return AsapAction;
|
||||
}(AsyncAction));
|
||||
export { AsapAction };
|
||||
//# sourceMappingURL=AsapAction.js.map
|
||||
@@ -0,0 +1 @@
|
||||
import 'rxjs-compat/add/operator/toArray';
|
||||
@@ -0,0 +1,25 @@
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
const BASIC = [
|
||||
'none',
|
||||
'underline',
|
||||
'overline',
|
||||
'line-through',
|
||||
'blink',
|
||||
'inherit',
|
||||
'initial',
|
||||
'unset'
|
||||
]
|
||||
|
||||
class TextDecoration extends Declaration {
|
||||
/**
|
||||
* Do not add prefixes for basic values.
|
||||
*/
|
||||
check (decl) {
|
||||
return decl.value.split(/\s+/).some(i => !BASIC.includes(i))
|
||||
}
|
||||
}
|
||||
|
||||
TextDecoration.names = ['text-decoration']
|
||||
|
||||
module.exports = TextDecoration
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var ReplaySubject_1 = require("../ReplaySubject");
|
||||
var multicast_1 = require("./multicast");
|
||||
function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
|
||||
if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
|
||||
scheduler = selectorOrScheduler;
|
||||
}
|
||||
var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
|
||||
var subject = new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler);
|
||||
return function (source) { return multicast_1.multicast(function () { return subject; }, selector)(source); };
|
||||
}
|
||||
exports.publishReplay = publishReplay;
|
||||
//# sourceMappingURL=publishReplay.js.map
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/race';
|
||||
@@ -0,0 +1,128 @@
|
||||
import { isCommandBuilderCallback } from './command.js';
|
||||
import { assertNotStrictEqual } from './typings/common-types.js';
|
||||
import * as templates from './completion-templates.js';
|
||||
import { isPromise } from './utils/is-promise.js';
|
||||
import { parseCommand } from './parse-command.js';
|
||||
export function completion(yargs, usage, command, shim) {
|
||||
const self = {
|
||||
completionKey: 'get-yargs-completions',
|
||||
};
|
||||
let aliases;
|
||||
self.setParsed = function setParsed(parsed) {
|
||||
aliases = parsed.aliases;
|
||||
};
|
||||
const zshShell = (shim.getEnv('SHELL') && shim.getEnv('SHELL').indexOf('zsh') !== -1) ||
|
||||
(shim.getEnv('ZSH_NAME') && shim.getEnv('ZSH_NAME').indexOf('zsh') !== -1);
|
||||
self.getCompletion = function getCompletion(args, done) {
|
||||
const completions = [];
|
||||
const current = args.length ? args[args.length - 1] : '';
|
||||
const argv = yargs.parse(args, true);
|
||||
const parentCommands = yargs.getContext().commands;
|
||||
function runCompletionFunction(argv) {
|
||||
assertNotStrictEqual(completionFunction, null, shim);
|
||||
if (isSyncCompletionFunction(completionFunction)) {
|
||||
const result = completionFunction(current, argv);
|
||||
if (isPromise(result)) {
|
||||
return result
|
||||
.then(list => {
|
||||
shim.process.nextTick(() => {
|
||||
done(list);
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
shim.process.nextTick(() => {
|
||||
throw err;
|
||||
});
|
||||
});
|
||||
}
|
||||
return done(result);
|
||||
}
|
||||
else {
|
||||
return completionFunction(current, argv, completions => {
|
||||
done(completions);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (completionFunction) {
|
||||
return isPromise(argv)
|
||||
? argv.then(runCompletionFunction)
|
||||
: runCompletionFunction(argv);
|
||||
}
|
||||
const handlers = command.getCommandHandlers();
|
||||
for (let i = 0, ii = args.length; i < ii; ++i) {
|
||||
if (handlers[args[i]] && handlers[args[i]].builder) {
|
||||
const builder = handlers[args[i]].builder;
|
||||
if (isCommandBuilderCallback(builder)) {
|
||||
const y = yargs.reset();
|
||||
builder(y);
|
||||
return y.argv;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!current.match(/^-/) &&
|
||||
parentCommands[parentCommands.length - 1] !== current) {
|
||||
usage.getCommands().forEach(usageCommand => {
|
||||
const commandName = parseCommand(usageCommand[0]).cmd;
|
||||
if (args.indexOf(commandName) === -1) {
|
||||
if (!zshShell) {
|
||||
completions.push(commandName);
|
||||
}
|
||||
else {
|
||||
const desc = usageCommand[1] || '';
|
||||
completions.push(commandName.replace(/:/g, '\\:') + ':' + desc);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (current.match(/^-/) || (current === '' && completions.length === 0)) {
|
||||
const descs = usage.getDescriptions();
|
||||
const options = yargs.getOptions();
|
||||
Object.keys(options.key).forEach(key => {
|
||||
const negable = !!options.configuration['boolean-negation'] &&
|
||||
options.boolean.includes(key);
|
||||
let keyAndAliases = [key].concat(aliases[key] || []);
|
||||
if (negable)
|
||||
keyAndAliases = keyAndAliases.concat(keyAndAliases.map(key => `no-${key}`));
|
||||
function completeOptionKey(key) {
|
||||
const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1);
|
||||
if (notInArgs) {
|
||||
const startsByTwoDashes = (s) => /^--/.test(s);
|
||||
const isShortOption = (s) => /^[^0-9]$/.test(s);
|
||||
const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--';
|
||||
if (!zshShell) {
|
||||
completions.push(dashes + key);
|
||||
}
|
||||
else {
|
||||
const desc = descs[key] || '';
|
||||
completions.push(dashes +
|
||||
`${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
completeOptionKey(key);
|
||||
if (negable && !!options.default[key])
|
||||
completeOptionKey(`no-${key}`);
|
||||
});
|
||||
}
|
||||
done(completions);
|
||||
};
|
||||
self.generateCompletionScript = function generateCompletionScript($0, cmd) {
|
||||
let script = zshShell
|
||||
? templates.completionZshTemplate
|
||||
: templates.completionShTemplate;
|
||||
const name = shim.path.basename($0);
|
||||
if ($0.match(/\.js$/))
|
||||
$0 = `./${$0}`;
|
||||
script = script.replace(/{{app_name}}/g, name);
|
||||
script = script.replace(/{{completion_command}}/g, cmd);
|
||||
return script.replace(/{{app_path}}/g, $0);
|
||||
};
|
||||
let completionFunction = null;
|
||||
self.registerFunction = fn => {
|
||||
completionFunction = fn;
|
||||
};
|
||||
return self;
|
||||
}
|
||||
function isSyncCompletionFunction(completionFunction) {
|
||||
return completionFunction.length < 3;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"switchMapTo.js","sources":["../../src/internal/operators/switchMapTo.ts"],"names":[],"mappings":";;AACA,yCAAwC;AAkDxC,SAAgB,WAAW,CACzB,eAAmC,EACnC,cAA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E,QAAQ,EAAE,GAAG,IAAI,CAAC;YAC1B,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;SACzB;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,mBAAmB,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IACtF,CAAC;CACF"}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/observable/TimerObservable';
|
||||
@@ -0,0 +1 @@
|
||||
export default '00000000-0000-0000-0000-000000000000';
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("rxjs-compat/add/operator/count");
|
||||
//# sourceMappingURL=count.js.map
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/observable/IteratorObservable';
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ReplaySubject.js","sources":["../../src/internal/ReplaySubject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,MAAM,OAAO,aAAiB,SAAQ,OAAU;IAM9C,YAAY,aAAqB,MAAM,CAAC,iBAAiB,EAC7C,aAAqB,MAAM,CAAC,iBAAiB,EACrC,SAAyB;QAC3C,KAAK,EAAE,CAAC;QADU,cAAS,GAAT,SAAS,CAAgB;QAPr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,EAAE;YACzB,UAAU,CAAC,QAAQ,EAAE,CAAC;SACvB;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,OAAO;QACL,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC;IACzC,CAAC;IAEO,wBAAwB;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,MAAM,OAAO,GAAqB,IAAI,CAAC,OAAO,CAAC;QAE/C,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;QACnC,IAAI,WAAW,GAAG,CAAC,CAAC;QAKpB,OAAO,WAAW,GAAG,WAAW,EAAE;YAChC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,EAAE;gBACnD,MAAM;aACP;YACD,WAAW,EAAE,CAAC;SACf;QAED,IAAI,WAAW,GAAG,WAAW,EAAE;YAC7B,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC;SAChE;QAED,IAAI,WAAW,GAAG,CAAC,EAAE;YACnB,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;SAChC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CAEF;AAED,MAAM,WAAW;IACf,YAAmB,IAAY,EAAS,KAAQ;QAA7B,SAAI,GAAJ,IAAI,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAG;IAChD,CAAC;CACF"}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { OperatorFunction } from '../types';
|
||||
export declare function find<T, S extends T>(predicate: (value: T, index: number, source: Observable<T>) => value is S, thisArg?: any): OperatorFunction<T, S | undefined>;
|
||||
export declare function find<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): OperatorFunction<T, T | undefined>;
|
||||
export declare class FindValueOperator<T> implements Operator<T, T | number | undefined> {
|
||||
private predicate;
|
||||
private source;
|
||||
private yieldIndex;
|
||||
private thisArg?;
|
||||
constructor(predicate: (value: T, index: number, source: Observable<T>) => boolean, source: Observable<T>, yieldIndex: boolean, thisArg?: any);
|
||||
call(observer: Subscriber<T>, source: any): any;
|
||||
}
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
export declare class FindValueSubscriber<T> extends Subscriber<T> {
|
||||
private predicate;
|
||||
private source;
|
||||
private yieldIndex;
|
||||
private thisArg?;
|
||||
private index;
|
||||
constructor(destination: Subscriber<T>, predicate: (value: T, index: number, source: Observable<T>) => boolean, source: Observable<T>, yieldIndex: boolean, thisArg?: any);
|
||||
private notifyComplete;
|
||||
protected _next(value: T): void;
|
||||
protected _complete(): void;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"never.js","sources":["../src/observable/never.ts"],"names":[],"mappings":";;;;;AAAA,kDAA6C"}
|
||||
@@ -0,0 +1,341 @@
|
||||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# parse-url
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [](https://github.com/IonicaBizau/ama) [](https://travis-ci.org/IonicaBizau/parse-url/) [](https://www.npmjs.com/package/parse-url) [](https://www.npmjs.com/package/parse-url) [](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
> An advanced url parser supporting git urls too.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
For low-level path parsing, check out [`parse-path`](https://github.com/IonicaBizau/parse-path). This very module is designed to parse urls. By default the urls are normalized.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save parse-url
|
||||
|
||||
# Using yarn
|
||||
yarn add parse-url
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
// Dependencies
|
||||
const parseUrl = require("parse-url")
|
||||
|
||||
console.log(parseUrl("http://ionicabizau.net/blog"))
|
||||
// { protocols: [ 'http' ],
|
||||
// protocol: 'http',
|
||||
// port: null,
|
||||
// resource: 'ionicabizau.net',
|
||||
// user: '',
|
||||
// pathname: '/blog',
|
||||
// hash: '',
|
||||
// search: '',
|
||||
// href: 'http://ionicabizau.net/blog' }
|
||||
|
||||
console.log(parseUrl("http://domain.com/path/name?foo=bar&bar=42#some-hash"))
|
||||
// { protocols: [ 'http' ],
|
||||
// protocol: 'http',
|
||||
// port: null,
|
||||
// resource: 'domain.com',
|
||||
// user: '',
|
||||
// pathname: '/path/name',
|
||||
// hash: 'some-hash',
|
||||
// search: 'foo=bar&bar=42',
|
||||
// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' }
|
||||
|
||||
// If you want to parse fancy Git urls, turn off the automatic url normalization
|
||||
console.log(parseUrl("git+ssh://git@host.xz/path/name.git", false))
|
||||
// { protocols: [ 'git', 'ssh' ],
|
||||
// protocol: 'git',
|
||||
// port: null,
|
||||
// resource: 'host.xz',
|
||||
// user: 'git',
|
||||
// pathname: '/path/name.git',
|
||||
// hash: '',
|
||||
// search: '',
|
||||
// href: 'git+ssh://git@host.xz/path/name.git' }
|
||||
|
||||
console.log(parseUrl("git@github.com:IonicaBizau/git-stats.git", false))
|
||||
// { protocols: [],
|
||||
// protocol: 'ssh',
|
||||
// port: null,
|
||||
// resource: 'github.com',
|
||||
// user: 'git',
|
||||
// pathname: '/IonicaBizau/git-stats.git',
|
||||
// hash: '',
|
||||
// search: '',
|
||||
// href: 'git@github.com:IonicaBizau/git-stats.git' }
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `parseUrl(url, normalize)`
|
||||
Parses the input url.
|
||||
|
||||
**Note**: This *throws* if invalid urls are provided.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String** `url`: The input url.
|
||||
- **Boolean|Object** `normalize`: Wheter to normalize the url or not. Default is `false`. If `true`, the url will
|
||||
be normalized. If an object, it will be the
|
||||
options object sent to [`normalize-url`](https://github.com/sindresorhus/normalize-url).
|
||||
|
||||
For SSH urls, normalize won't work.
|
||||
|
||||
#### Return
|
||||
- **Object** An object containing the following fields:
|
||||
- `protocols` (Array): An array with the url protocols (usually it has one element).
|
||||
- `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`.
|
||||
- `port` (null|Number): The domain port.
|
||||
- `resource` (String): The url domain (including subdomains).
|
||||
- `user` (String): The authentication user (usually for ssh urls).
|
||||
- `pathname` (String): The url pathname.
|
||||
- `hash` (String): The url hash.
|
||||
- `search` (String): The url querystring value.
|
||||
- `href` (String): The input url.
|
||||
- `query` (Object): The url querystring, parsed as object.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||

|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
- `git-up`
|
||||
- `lien`
|
||||
- `stun`
|
||||
- `kakapo`
|
||||
- `@open-wa/wa-automate`
|
||||
- `fuge-runner`
|
||||
- `url-local`
|
||||
- `parse-db-uri`
|
||||
- `warp-api`
|
||||
- `warp-server`
|
||||
- `robots-agent`
|
||||
- `normalize-ssh`
|
||||
- `xl-git-up`
|
||||
- `normalize-id`
|
||||
- `egg-muc-custom-loader`
|
||||
- `hologit`
|
||||
- `vrt-cli`
|
||||
- `native-zip`
|
||||
- `normalize-ssh-url`
|
||||
- `eval-spider`
|
||||
- `ts-scraper`
|
||||
- `microbe.js`
|
||||
- `hubot-will-it-connect`
|
||||
- `deploy-versioning`
|
||||
- `xbuilder-forms`
|
||||
- `tumblr-text`
|
||||
- `ssh-host-manager`
|
||||
- `blitzzz`
|
||||
- `wander-cli`
|
||||
- `graphmilker`
|
||||
- `api-reach-react-native-fix`
|
||||
- `@roshub/api`
|
||||
- `verify-aws-sns-signature`
|
||||
- `@apardellass/react-native-audio-stream`
|
||||
- `l2forlerna`
|
||||
- `react-native-plugpag-wrapper`
|
||||
- `react-native-pulsator-native`
|
||||
- `@hstech/utils`
|
||||
- `react-native-kakao-maps`
|
||||
- `@geeky-apo/react-native-advanced-clipboard`
|
||||
- `native-apple-login`
|
||||
- `native-google-login`
|
||||
- `@jprustv/sulla-hotfix`
|
||||
- `vue-cli-plugin-ice-builder`
|
||||
- `@hemith/react-native-tnk`
|
||||
- `workpad`
|
||||
- `react-native-contact-list`
|
||||
- `@corelmax/react-native-my2c2p-sdk`
|
||||
- `@dataparty/api`
|
||||
- `heroku-wp-environment-sync`
|
||||
- `react-native-responsive-size`
|
||||
- `delta-screen`
|
||||
- `react-native-test-module-hhh`
|
||||
- `react-native-is7`
|
||||
- `@kriblet/wa-automate`
|
||||
- `@mergulhao/wa-automate`
|
||||
- `@jimengio/mocked-proxy`
|
||||
- `cli-live-tutorial`
|
||||
- `@buganto/client`
|
||||
- `@datalogic/react-native-datalogic-module`
|
||||
- `birken-react-native-community-image-editor`
|
||||
- `native-kakao-login`
|
||||
- `react-native-modal-progress-bar`
|
||||
- `@hawkingnetwork/react-native-tab-view`
|
||||
- `miguelcostero-ng2-toasty`
|
||||
- `vue-cli-plugin-ut-builder`
|
||||
- `cv-app-payment-adyen`
|
||||
- `react-native-flyy`
|
||||
- `drowl-base-theme-iconset`
|
||||
- `gitlab-backup-util-harduino`
|
||||
- `loast`
|
||||
- `rn-custom-tabview`
|
||||
- `homebridge-pushcutter`
|
||||
- `soajs.repositories`
|
||||
- `@ntt_app/react-native-custom-notification`
|
||||
- `@ndla/source-map-resolver`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[license]: /LICENSE
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
Reference in New Issue
Block a user