now has working intake
This commit is contained in:
parent
cd05c5c8d7
commit
eb2d3e1b25
4
dist/index.d.ts
vendored
4
dist/index.d.ts
vendored
@ -1,3 +1,5 @@
|
|||||||
export declare let standardExport: string;
|
export declare let standardExport: string;
|
||||||
export * from './smartrx.classes.observablemap';
|
export * from './smartrx.classes.observablemap';
|
||||||
export * from './smartrx.classes.observable';
|
export * from './smartrx.classes.observableintake';
|
||||||
|
import * as rxjs from 'rxjs';
|
||||||
|
export { rxjs };
|
||||||
|
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -5,5 +5,7 @@ function __export(m) {
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.standardExport = 'Hi there! :) This is a exported string';
|
exports.standardExport = 'Hi there! :) This is a exported string';
|
||||||
__export(require("./smartrx.classes.observablemap"));
|
__export(require("./smartrx.classes.observablemap"));
|
||||||
__export(require("./smartrx.classes.observable"));
|
__export(require("./smartrx.classes.observableintake"));
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUVXLFFBQUEsY0FBYyxHQUFHLHdDQUF3QyxDQUFBO0FBQ3BFLHFEQUErQztBQUMvQyxrREFBNEMifQ==
|
const rxjs = require("rxjs");
|
||||||
|
exports.rxjs = rxjs;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUVXLFFBQUEsY0FBYyxHQUFHLHdDQUF3QyxDQUFBO0FBQ3BFLHFEQUErQztBQUMvQyx3REFBa0Q7QUFFbEQsNkJBQTRCO0FBRzFCLG9CQUFJIn0=
|
5
dist/smartrx.classes.observable.d.ts
vendored
5
dist/smartrx.classes.observable.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
import { Observable as rxjsObservable } from 'rxjs';
|
|
||||||
export { rxjsObservable };
|
|
||||||
export declare class Observable<T> extends rxjsObservable<T> {
|
|
||||||
static fromIntake(): void;
|
|
||||||
}
|
|
9
dist/smartrx.classes.observable.js
vendored
9
dist/smartrx.classes.observable.js
vendored
@ -1,9 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const rxjs_1 = require("rxjs");
|
|
||||||
exports.rxjsObservable = rxjs_1.Observable;
|
|
||||||
class Observable extends rxjs_1.Observable {
|
|
||||||
static fromIntake() { }
|
|
||||||
}
|
|
||||||
exports.Observable = Observable;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyeC5jbGFzc2VzLm9ic2VydmFibGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHJ4LmNsYXNzZXMub2JzZXJ2YWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLCtCQUFtRDtBQUVqRCx5QkFGcUIsaUJBQWMsQ0FFckI7QUFHaEIsZ0JBQTJCLFNBQVEsaUJBQWlCO0lBQ2xELE1BQU0sQ0FBQyxVQUFVLEtBQUssQ0FBQztDQUN4QjtBQUZELGdDQUVDIn0=
|
|
15
dist/smartrx.classes.observableintake.d.ts
vendored
Normal file
15
dist/smartrx.classes.observableintake.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { Observable, Subscription } from 'rxjs';
|
||||||
|
/**
|
||||||
|
* ObservableIntake
|
||||||
|
*/
|
||||||
|
export declare class ObservableIntake<T> {
|
||||||
|
observable: Observable<T>;
|
||||||
|
completed: Promise<void>;
|
||||||
|
private completedDeffered;
|
||||||
|
private observableFunctions;
|
||||||
|
constructor();
|
||||||
|
setObservable(observableFunc: any): void;
|
||||||
|
push(payloadArg: T): void;
|
||||||
|
subscribe(...args: any[]): Subscription;
|
||||||
|
signalComplete(): void;
|
||||||
|
}
|
44
dist/smartrx.classes.observableintake.js
vendored
Normal file
44
dist/smartrx.classes.observableintake.js
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const plugins = require("./smartrx.plugins");
|
||||||
|
const rxjs_1 = require("rxjs");
|
||||||
|
/**
|
||||||
|
* ObservableIntake
|
||||||
|
*/
|
||||||
|
class ObservableIntake {
|
||||||
|
constructor() {
|
||||||
|
this.observableFunctions = {
|
||||||
|
next: (payloadArg) => {
|
||||||
|
// nothing
|
||||||
|
},
|
||||||
|
complete: (payloadArg) => {
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.observable = rxjs_1.Observable.create((observerArg) => {
|
||||||
|
this.observableFunctions.next = (...args) => {
|
||||||
|
return observerArg.next(...args);
|
||||||
|
};
|
||||||
|
this.observableFunctions.complete = (...args) => {
|
||||||
|
this.completedDeffered.resolve();
|
||||||
|
return observerArg.complete(...args);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.completedDeffered = plugins.smartq.defer();
|
||||||
|
this.completed = this.completedDeffered.promise;
|
||||||
|
}
|
||||||
|
setObservable(observableFunc) {
|
||||||
|
this.observable = observableFunc();
|
||||||
|
}
|
||||||
|
push(payloadArg) {
|
||||||
|
this.observableFunctions.next(payloadArg);
|
||||||
|
}
|
||||||
|
subscribe(...args) {
|
||||||
|
return this.observable.subscribe(...args);
|
||||||
|
}
|
||||||
|
signalComplete() {
|
||||||
|
this.observableFunctions.complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.ObservableIntake = ObservableIntake;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJza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SyxFQUFFLENBQUE7UUFDL0MsSUFBSSxDQUFDLFNBQVMsR0FBRyxJQUFJLENBQUMsaUJBQWlCLENBQUMsT0FBTyxDQUFBO0lBQ2pELENBQUM7SUFFRCxhQUFhLENBQUUsY0FBYztRQUMzQixJQUFJLENBQUMsVUFBVSxHQUFHLGNBQWMsRUFBRSxDQUFBO0lBQ3BDLENBQUM7SUFFRCxJQUFJLENBQUUsVUFBYTtRQUNqQixJQUFJLENBQUMsbUJBQW1CLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFBO0lBQzNDLENBQUM7SUFFRCxTQUFTLENBQUUsR0FBRyxJQUFJO1FBQ2hCLE1BQU0sQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLFNBQVMsQ0FBQyxHQUFHLElBQUksQ0FBQyxDQUFBO0lBQzNDLENBQUM7SUFFRCxjQUFjO1FBQ1osSUFBSSxDQUFDLG1CQUFtQixDQUFDLFFBQVEsRUFBRSxDQUFBO0lBQ3JDLENBQUM7Q0FDRjtBQTFDRCw0Q0EwQ0MifQ==
|
4
dist/smartrx.classes.observablemap.d.ts
vendored
4
dist/smartrx.classes.observablemap.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
/// <reference types="node" />
|
/// <reference types="node" />
|
||||||
import * as plugins from './smartrx.plugins';
|
import * as plugins from './smartrx.plugins';
|
||||||
import { rxjsObservable } from './smartrx.classes.observable';
|
import { Observable } from 'rxjs';
|
||||||
import { Objectmap } from 'lik';
|
import { Objectmap } from 'lik';
|
||||||
/**
|
/**
|
||||||
* bundles an observable with an emitter
|
* bundles an observable with an emitter
|
||||||
@ -19,5 +19,5 @@ export declare class Observablemap {
|
|||||||
* creates a new observable if not yet registered for the same event.
|
* creates a new observable if not yet registered for the same event.
|
||||||
* In case event has been registered before the same observable is returned.
|
* In case event has been registered before the same observable is returned.
|
||||||
*/
|
*/
|
||||||
getObservableForEmitterEvent(emitterArg: plugins.events.EventEmitter, eventArg: string): rxjsObservable<any>;
|
getObservableForEmitterEvent(emitterArg: plugins.events.EventEmitter, eventArg: string): Observable<any>;
|
||||||
}
|
}
|
||||||
|
2
dist/smartrx.classes.observablemap.js
vendored
2
dist/smartrx.classes.observablemap.js
vendored
@ -32,4 +32,4 @@ class Observablemap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.Observablemap = Observablemap;
|
exports.Observablemap = Observablemap;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyeC5jbGFzc2VzLm9ic2VydmFibGVtYXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHJ4LmNsYXNzZXMub2JzZXJ2YWJsZW1hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZDQUE0QztBQUc1Qyw2QkFBK0I7QUFZL0I7O0dBRUc7QUFDSDtJQUFBO1FBQ0UscUNBQWdDLEdBQUcsSUFBSSxlQUFTLEVBQTJCLENBQUE7SUFzQjdFLENBQUM7SUFwQkM7OztPQUdHO0lBQ0gsNEJBQTRCLENBQUUsVUFBdUMsRUFBRSxRQUFnQjtRQUNyRixJQUFJLGNBQWMsR0FBRyxJQUFJLENBQUMsZ0NBQWdDLENBQUMsSUFBSSxDQUFDLENBQUMsU0FBUyxFQUFFLEVBQUU7WUFDNUUsTUFBTSxDQUFDLENBQUMsU0FBUyxDQUFDLE9BQU8sS0FBSyxVQUFVLElBQUksU0FBUyxDQUFDLEtBQUssS0FBSyxRQUFRLENBQUMsQ0FBQTtRQUMzRSxDQUFDLENBQUMsQ0FBQTtRQUNGLEVBQUUsQ0FBQyxDQUFDLGNBQWMsQ0FBQyxDQUFDLENBQUM7WUFDbkIsTUFBTSxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUE7UUFDbEMsQ0FBQztRQUFDLElBQUksQ0FBQyxDQUFDO1lBQ04sSUFBSSxpQkFBaUIsR0FBRyxPQUFPLENBQUM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SxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUE7UUFDbEMsQ0FBQztRQUFDLElBQUksQ0FBQyxDQUFDO1lBQ04sSUFBSSxpQkFBaUIsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxTQUFTLENBQUMsVUFBVSxFQUFFLFFBQVEsQ0FBQyxDQUFBO1lBQy9FLElBQUksQ0FBQyxnQ0FBZ0MsQ0FBQyxHQUFHLENBQUM7Z0JBQ3hDLFVBQVUsRUFBRSxpQkFBaUI7Z0JBQzdCLE9BQU8sRUFBRSxVQUFVO2dCQUNuQixLQUFLLEVBQUUsUUFBUTthQUNoQixDQUFDLENBQUE7WUFDRixNQUFNLENBQUMsaUJBQWlCLENBQUE7UUFDMUIsQ0FBQztJQUNILENBQUM7Q0FDRjtBQXZCRCxzQ0F1QkMifQ==
|
5
dist/smartrx.plugins.d.ts
vendored
5
dist/smartrx.plugins.d.ts
vendored
@ -2,4 +2,7 @@ import 'typings-global';
|
|||||||
import * as events from 'events';
|
import * as events from 'events';
|
||||||
import * as lik from 'lik';
|
import * as lik from 'lik';
|
||||||
import * as rxjs from 'rxjs';
|
import * as rxjs from 'rxjs';
|
||||||
export { events, lik, rxjs };
|
import * as smartevent from 'smartevent';
|
||||||
|
import * as smartq from 'smartq';
|
||||||
|
import 'typings-global';
|
||||||
|
export { events, lik, rxjs, smartevent, smartq };
|
||||||
|
7
dist/smartrx.plugins.js
vendored
7
dist/smartrx.plugins.js
vendored
@ -7,4 +7,9 @@ const lik = require("lik");
|
|||||||
exports.lik = lik;
|
exports.lik = lik;
|
||||||
const rxjs = require("rxjs");
|
const rxjs = require("rxjs");
|
||||||
exports.rxjs = rxjs;
|
exports.rxjs = rxjs;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyeC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRyeC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMEJBQXVCO0FBQ3ZCLGlDQUFnQztBQUs5Qix3QkFBTTtBQUpSLDJCQUEwQjtBQUt4QixrQkFBRztBQUpMLDZCQUE0QjtBQUsxQixvQkFBSSJ9
|
const smartevent = require("smartevent");
|
||||||
|
exports.smartevent = smartevent;
|
||||||
|
const smartq = require("smartq");
|
||||||
|
exports.smartq = smartq;
|
||||||
|
require("typings-global");
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyeC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRyeC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMEJBQXVCO0FBQ3ZCLGlDQUFnQztBQVE5Qix3QkFBTTtBQVBSLDJCQUEwQjtBQVF4QixrQkFBRztBQVBMLDZCQUE0QjtBQVExQixvQkFBSTtBQVBOLHlDQUF3QztBQVF0QyxnQ0FBVTtBQVBaLGlDQUFnQztBQVE5Qix3QkFBTTtBQVBSLDBCQUF1QiJ9
|
@ -10,12 +10,13 @@
|
|||||||
"test": "(npmts)"
|
"test": "(npmts)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"tapbundle": "^1.0.13"
|
"tapbundle": "^1.1.8"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lik": "^1.0.43",
|
"lik": "^2.0.1",
|
||||||
"rxjs": "^5.5.2",
|
"rxjs": "^5.5.2",
|
||||||
|
"smartevent": "^1.0.1",
|
||||||
"smartq": "^1.1.6",
|
"smartq": "^1.1.6",
|
||||||
"typings-global": "^1.0.16"
|
"typings-global": "^1.0.23"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
21
test/test.observableintake.ts
Normal file
21
test/test.observableintake.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { tap, expect } from 'tapbundle'
|
||||||
|
|
||||||
|
import * as smartrx from '../ts/index'
|
||||||
|
|
||||||
|
tap.test('should create a valid instance of observableinstake', async () => {
|
||||||
|
const testObservableIntake = new smartrx.ObservableIntake()
|
||||||
|
expect(testObservableIntake).to.be.instanceOf(smartrx.ObservableIntake)
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.test('expect testObserservableIntake to be lazy', async (tools) => {
|
||||||
|
const testObserservableIntake = new smartrx.ObservableIntake()
|
||||||
|
testObserservableIntake.subscribe(value => {
|
||||||
|
console.log(value)
|
||||||
|
})
|
||||||
|
|
||||||
|
testObserservableIntake.push('hi')
|
||||||
|
testObserservableIntake.signalComplete()
|
||||||
|
await testObserservableIntake.completed
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.start()
|
@ -27,10 +27,8 @@ tap.test('should accept a new emitter', async () => {
|
|||||||
})
|
})
|
||||||
testObservable2 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event1')
|
testObservable2 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event1')
|
||||||
testObservable3 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event2')
|
testObservable3 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event2')
|
||||||
// tslint:disable-next-line:no-unused-expression
|
expect(testObservable1 === testObservable2).be.true()
|
||||||
expect(testObservable1 === testObservable2).be.true
|
expect(testObservable1 === testObservable3).be.false()
|
||||||
// tslint:disable-next-line:no-unused-expression
|
|
||||||
expect(testObservable1 === testObservable3).be.false
|
|
||||||
testEmitter.emit('event1')
|
testEmitter.emit('event1')
|
||||||
await done.promise
|
await done.promise
|
||||||
})
|
})
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
import { expect, tap } from 'tapbundle'
|
|
||||||
import * as smartrx from '../ts/index'
|
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
|
||||||
console.log(smartrx.standardExport)
|
|
||||||
})
|
|
||||||
|
|
||||||
tap.start()
|
|
@ -2,4 +2,10 @@ import * as plugins from './smartrx.plugins'
|
|||||||
|
|
||||||
export let standardExport = 'Hi there! :) This is a exported string'
|
export let standardExport = 'Hi there! :) This is a exported string'
|
||||||
export * from './smartrx.classes.observablemap'
|
export * from './smartrx.classes.observablemap'
|
||||||
export * from './smartrx.classes.observable'
|
export * from './smartrx.classes.observableintake'
|
||||||
|
|
||||||
|
import * as rxjs from 'rxjs'
|
||||||
|
|
||||||
|
export {
|
||||||
|
rxjs
|
||||||
|
}
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
import { Observable as rxjsObservable } from 'rxjs'
|
|
||||||
export {
|
|
||||||
rxjsObservable
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Observable<T> extends rxjsObservable<T> {
|
|
||||||
static fromIntake () {}
|
|
||||||
}
|
|
50
ts/smartrx.classes.observableintake.ts
Normal file
50
ts/smartrx.classes.observableintake.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import * as plugins from './smartrx.plugins'
|
||||||
|
import { Observable, Subscription } from 'rxjs'
|
||||||
|
import { Deferred } from 'smartq'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ObservableIntake
|
||||||
|
*/
|
||||||
|
export class ObservableIntake<T> {
|
||||||
|
observable: Observable<T>
|
||||||
|
completed: Promise<void>
|
||||||
|
private completedDeffered: Deferred<void>
|
||||||
|
private observableFunctions: any = {
|
||||||
|
next: (payloadArg) => {
|
||||||
|
// nothing
|
||||||
|
},
|
||||||
|
complete: (payloadArg) => {
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor () {
|
||||||
|
this.observable = Observable.create((observerArg) => {
|
||||||
|
this.observableFunctions.next = (...args) => {
|
||||||
|
return observerArg.next(...args)
|
||||||
|
}
|
||||||
|
this.observableFunctions.complete = (...args) => {
|
||||||
|
this.completedDeffered.resolve()
|
||||||
|
return observerArg.complete(...args)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.completedDeffered = plugins.smartq.defer()
|
||||||
|
this.completed = this.completedDeffered.promise
|
||||||
|
}
|
||||||
|
|
||||||
|
setObservable (observableFunc) {
|
||||||
|
this.observable = observableFunc()
|
||||||
|
}
|
||||||
|
|
||||||
|
push (payloadArg: T) {
|
||||||
|
this.observableFunctions.next(payloadArg)
|
||||||
|
}
|
||||||
|
|
||||||
|
subscribe (...args) {
|
||||||
|
return this.observable.subscribe(...args)
|
||||||
|
}
|
||||||
|
|
||||||
|
signalComplete () {
|
||||||
|
this.observableFunctions.complete()
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,5 @@
|
|||||||
import * as plugins from './smartrx.plugins'
|
import * as plugins from './smartrx.plugins'
|
||||||
import { Observable, rxjsObservable } from './smartrx.classes.observable'
|
import { Observable } from 'rxjs'
|
||||||
|
|
||||||
import { Objectmap } from 'lik'
|
import { Objectmap } from 'lik'
|
||||||
import { Stringmap } from 'lik'
|
import { Stringmap } from 'lik'
|
||||||
|
|
||||||
|
@ -2,9 +2,14 @@ import 'typings-global'
|
|||||||
import * as events from 'events'
|
import * as events from 'events'
|
||||||
import * as lik from 'lik'
|
import * as lik from 'lik'
|
||||||
import * as rxjs from 'rxjs'
|
import * as rxjs from 'rxjs'
|
||||||
|
import * as smartevent from 'smartevent'
|
||||||
|
import * as smartq from 'smartq'
|
||||||
|
import 'typings-global'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
events,
|
events,
|
||||||
lik,
|
lik,
|
||||||
rxjs
|
rxjs,
|
||||||
|
smartevent,
|
||||||
|
smartq
|
||||||
}
|
}
|
||||||
|
24
yarn.lock
24
yarn.lock
@ -193,15 +193,14 @@ left-pad@^1.1.3:
|
|||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
|
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
|
||||||
|
|
||||||
lik@^1.0.43:
|
lik@^2.0.1:
|
||||||
version "1.0.43"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/lik/-/lik-1.0.43.tgz#e81709290fb85ff61dabfa008791ba9ffed0c666"
|
resolved "https://registry.yarnpkg.com/lik/-/lik-2.0.1.tgz#828be73de3e356d12ee020d1499b9a99538cfa3d"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/lodash" "^4.14.74"
|
"@types/lodash" "^4.14.74"
|
||||||
"@types/minimatch" "3.x.x"
|
"@types/minimatch" "3.x.x"
|
||||||
lodash "^4.17.4"
|
lodash "^4.17.4"
|
||||||
minimatch "^3.0.4"
|
minimatch "^3.0.4"
|
||||||
rxjs "^5.4.3"
|
|
||||||
smartq "^1.1.6"
|
smartq "^1.1.6"
|
||||||
typings-global "^1.0.20"
|
typings-global "^1.0.20"
|
||||||
|
|
||||||
@ -271,7 +270,7 @@ resolve@^1.1.6:
|
|||||||
dependencies:
|
dependencies:
|
||||||
path-parse "^1.0.5"
|
path-parse "^1.0.5"
|
||||||
|
|
||||||
rxjs@^5.4.3, rxjs@^5.5.2:
|
rxjs@^5.5.2:
|
||||||
version "5.5.2"
|
version "5.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.2.tgz#28d403f0071121967f18ad665563255d54236ac3"
|
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.2.tgz#28d403f0071121967f18ad665563255d54236ac3"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -304,6 +303,13 @@ smartdelay@^1.0.3:
|
|||||||
smartq "^1.1.1"
|
smartq "^1.1.1"
|
||||||
typings-global "^1.0.16"
|
typings-global "^1.0.16"
|
||||||
|
|
||||||
|
smartevent@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartevent/-/smartevent-1.0.1.tgz#13d2bf2cf094ebdf17813fa0d46041f817a302aa"
|
||||||
|
dependencies:
|
||||||
|
smartq "^1.1.1"
|
||||||
|
typings-global "^1.0.16"
|
||||||
|
|
||||||
smartq@^1.1.1, smartq@^1.1.6:
|
smartq@^1.1.1, smartq@^1.1.6:
|
||||||
version "1.1.6"
|
version "1.1.6"
|
||||||
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
|
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
|
||||||
@ -326,7 +332,7 @@ symbol-observable@^1.0.1:
|
|||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
|
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
|
||||||
|
|
||||||
tapbundle@^1.0.13:
|
tapbundle@^1.1.8:
|
||||||
version "1.1.8"
|
version "1.1.8"
|
||||||
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.8.tgz#e08aee0e100a830d8a26a583a85d37ce53312e02"
|
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.8.tgz#e08aee0e100a830d8a26a583a85d37ce53312e02"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -338,9 +344,9 @@ tapbundle@^1.0.13:
|
|||||||
smartq "^1.1.1"
|
smartq "^1.1.1"
|
||||||
typings-global "^1.0.19"
|
typings-global "^1.0.19"
|
||||||
|
|
||||||
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19, typings-global@^1.0.20:
|
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19, typings-global@^1.0.20, typings-global@^1.0.23:
|
||||||
version "1.0.20"
|
version "1.0.23"
|
||||||
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.20.tgz#3da769c54db538247c5d877d1d9e97eb2ec981ff"
|
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.23.tgz#cdd085803049dd07d95b2e1475243c6b2db378ab"
|
||||||
dependencies:
|
dependencies:
|
||||||
semver "^5.3.0"
|
semver "^5.3.0"
|
||||||
smartshell "^1.0.6"
|
smartshell "^1.0.6"
|
||||||
|
Loading…
Reference in New Issue
Block a user