update to latest standards

This commit is contained in:
Philipp Kunz 2018-03-11 16:44:32 +01:00
parent 0dc3c1af46
commit ccce9dc04d
25 changed files with 477 additions and 399 deletions

View File

@ -7,53 +7,77 @@ cache:
key: "$CI_BUILD_STAGE" key: "$CI_BUILD_STAGE"
stages: stages:
- security
- test - test
- release - release
- trigger - trigger
- pages - pages
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
snyk:
stage: security
script:
- npmci command yarn global add snyk
- npmci command yarn install --ignore-scripts
- npmci command snyk test
tags:
- docker
testLEGACY: testLEGACY:
stage: test stage: test
script: script:
- npmci test legacy - npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
allow_failure: true allow_failure: true
testLTS: testLTS:
stage: test stage: test
script: script:
- npmci test lts - npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
testSTABLE: testSTABLE:
stage: test stage: test
script: script:
- npmci test stable - npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
release: release:
stage: release stage: release
script: script:
- npmci publish - npmci npm prepare
- npmci npm publish
only: only:
- tags - tags
tags: tags:
- docker - docker
trigger: trigger:
stage: trigger stage: trigger
script: script:
- npmci trigger - npmci trigger
only: only:
- tags - tags
tags: tags:
- docker - docker
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci

View File

@ -1,4 +0,0 @@
module.name: smartmodule
module.description: a smart description
module.author: Lossless GmbH
module.license: MIT

1
dist/index.d.ts vendored
View File

@ -1,4 +1,5 @@
export * from './smarttime.classes.hrtmeasurement'; export * from './smarttime.classes.hrtmeasurement';
export * from './smarttime.classes.timer';
export * from './smarttime.classes.timestamp'; export * from './smarttime.classes.timestamp';
export * from './smarttime.units'; export * from './smarttime.units';
export { moment } from './smarttime.plugins'; export { moment } from './smarttime.plugins';

3
dist/index.js vendored
View File

@ -4,8 +4,9 @@ function __export(m) {
} }
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./smarttime.classes.hrtmeasurement")); __export(require("./smarttime.classes.hrtmeasurement"));
__export(require("./smarttime.classes.timer"));
__export(require("./smarttime.classes.timestamp")); __export(require("./smarttime.classes.timestamp"));
__export(require("./smarttime.units")); __export(require("./smarttime.units"));
var smarttime_plugins_1 = require("./smarttime.plugins"); var smarttime_plugins_1 = require("./smarttime.plugins");
exports.moment = smarttime_plugins_1.moment; exports.moment = smarttime_plugins_1.moment;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUVBLHdEQUFrRDtBQUNsRCxtREFBNkM7QUFDN0MsdUNBQWlDO0FBRWpDLHlEQUE0QztBQUFuQyxxQ0FBQSxNQUFNLENBQUEifQ== //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUVBLHdEQUFtRDtBQUNuRCwrQ0FBMEM7QUFDMUMsbURBQThDO0FBQzlDLHVDQUFrQztBQUVsQyx5REFBNkM7QUFBcEMscUNBQUEsTUFBTSxDQUFBIn0=

View File

@ -24,11 +24,11 @@ class HrtMeasurement {
*/ */
stop() { stop() {
if (this._started === false) { if (this._started === false) {
console.log('Hasn\'t started yet'); console.log("Hasn't started yet");
return; return;
} }
this._hrTimeStopDiff = process.hrtime(this._hrTimeStart); this._hrTimeStopDiff = process.hrtime(this._hrTimeStart);
this.nanoSeconds = (this._hrTimeStopDiff[0] * 1e9) + this._hrTimeStopDiff[1]; this.nanoSeconds = this._hrTimeStopDiff[0] * 1e9 + this._hrTimeStopDiff[1];
this.milliSeconds = this.nanoSeconds / 1000000; this.milliSeconds = this.nanoSeconds / 1000000;
return this; return this;
} }
@ -44,4 +44,4 @@ class HrtMeasurement {
} }
} }
exports.HrtMeasurement = HrtMeasurement; exports.HrtMeasurement = HrtMeasurement;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR0aW1lLmNsYXNzZXMuaHJ0bWVhc3VyZW1lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHRpbWUuY2xhc3Nlcy5ocnRtZWFzdXJlbWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLG1DQUFrQztBQUVsQzs7R0FFRztBQUNIO0lBQUE7UUFDRSxnQkFBVyxHQUFXLElBQUksQ0FBQTtRQUMxQixpQkFBWSxHQUFXLElBQUksQ0FBQTtRQUNuQixpQkFBWSxHQUFHLElBQUksQ0FBQTtRQUNuQixvQkFBZSxHQUFHLElBQUksQ0FBQTtRQUN0QixhQUFRLEdBQVksS0FBSyxDQUFBO0lBa0NuQyxDQUFDO0lBaENDOztPQUVHO0lBQ0gsS0FBSztRQUNILElBQUksQ0FBQyxRQUFRLEdBQUcsSUFBSSxDQUFBO1FBQ3BCLElBQUksQ0FBQyxZQUFZLEdBQUcsT0FBTyxDQUFDLE1BQU0sRUFBRSxDQUFBO0lBQ3RDLENBQUM7SUFFRDs7T0FFRztJQUNILElBQUk7UUFDRixFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxLQUFLLEtBQUssQ0FBQyxDQUFDLENBQUM7WUFDNUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxxQkFBcUIsQ0FBQyxDQUFBO1lBQ2xDLE1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JLENBQUM7UUFDNUIsSUFBSSxDQUFDLFFBQVEsR0FBRyxLQUFLLENBQUM7SUFDeEIsQ0FBQztDQUNGO0FBdkNELHdDQXVDQyJ9

37
dist/smarttime.classes.timer.d.ts vendored Normal file
View File

@ -0,0 +1,37 @@
import { TimeStamp } from './smarttime.classes.timestamp';
export declare type TimerState = 'initiated' | 'started' | 'paused' | 'completed';
export declare class Timer {
/**
* the original amount of milliseconds for this Timer
*/
timeInMilliseconds: number;
/**
* the state of the timer
*/
state: TimerState;
/**
* completed Promise
*/
completed: Promise<void>;
/**
* a reference to when the Timeout started
*/
startedAt: TimeStamp;
/**
* a reference to when a Timer has been potentially paused
*/
pausedAt: TimeStamp;
readonly timeLeft: number;
/**
* the current timeout the needs to be canceled when this Timer is stopped
*/
private currentTimeout;
private completedDeferred;
constructor(timeInMillisecondsArg: number);
/**
* starts the timer
*/
start(): void;
pause(): void;
resume(): void;
}

46
dist/smarttime.classes.timer.js vendored Normal file
View File

@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smarttime.plugins");
const smarttime_classes_timestamp_1 = require("./smarttime.classes.timestamp");
class Timer {
constructor(timeInMillisecondsArg) {
/**
* the state of the timer
*/
this.state = 'initiated';
// a deferred triggeted when Timer has completed
this.completedDeferred = plugins.smartq.defer();
this.timeInMilliseconds = timeInMillisecondsArg;
this.completed = this.completedDeferred.promise;
}
get timeLeft() {
return this.timeInMilliseconds - this.pausedAt.change;
}
/**
* starts the timer
*/
start() {
if (!this.startedAt) {
this.currentTimeout = setTimeout(() => {
this.completedDeferred.resolve();
}, this.timeInMilliseconds);
this.startedAt = new smarttime_classes_timestamp_1.TimeStamp();
}
else {
throw new Error('timer has been started before. Please use resume instead');
}
}
pause() {
clearTimeout(this.currentTimeout);
this.pausedAt = smarttime_classes_timestamp_1.TimeStamp.fromTimeStamp(this.startedAt);
}
resume() {
if (this.startedAt) {
this.currentTimeout = setTimeout(() => {
this.completedDeferred.resolve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FBQztRQUNuQyxDQUFDO1FBQUMsSUFBSSxDQUFDLENBQUM7WUFDTixNQUFNLElBQUksS0FBSyxDQUFDLDBEQUEwRCxDQUFDLENBQUM7UUFDOUUsQ0FBQztJQUNILENBQUM7SUFFTSxLQUFLO1FBQ1YsWUFBWSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQztRQUNsQyxJQUFJLENBQUMsUUFBUSxHQUFHLHVDQUFTLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQztJQUMxRCxDQUFDO0lBRU0sTUFBTTtRQUNYLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDO1lBQ25CLElBQUksQ0FBQyxjQUFjLEdBQUcsVUFBVSxDQUFDLEdBQUcsRUFBRTtnQkFDcEMsSUFBSSxDQUFDLGlCQUFpQixDQUFDLE9BQU8sRUFBRSxDQUFDO1lBQ25DLENBQUMsRUFBRSxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUM7UUFDcEIsQ0FBQztJQUNILENBQUM7Q0FDRjtBQXBFRCxzQkFvRUMifQ==

View File

@ -3,6 +3,15 @@
* smart timestamp * smart timestamp
*/ */
export declare class TimeStamp { export declare class TimeStamp {
/**
* returns new TimeStamp from milliseconds
*/
static fromMilliSeconds(milliSecondsArg: any): TimeStamp;
/**
* returns new TimeStamp for now with change set
* @param timeStampArg
*/
static fromTimeStamp(timeStampArg: TimeStamp): TimeStamp;
/** /**
* The standard JavaScript Date * The standard JavaScript Date
*/ */
@ -21,15 +30,6 @@ export declare class TimeStamp {
*/ */
change: number; change: number;
constructor(creatorArg?: number); constructor(creatorArg?: number);
/**
* returns new TimeStamp from milliseconds
*/
static fromMilliSeconds(milliSecondsArg: any): TimeStamp;
/**
* returns new TimeStamp for now with change set
* @param timeStampArg
*/
static fromTimeStamp(timeStampArg: TimeStamp): TimeStamp;
/** /**
* Is the current instance older than the argument * Is the current instance older than the argument
* @param TimeStampArg * @param TimeStampArg

View File

@ -39,7 +39,7 @@ class TimeStamp {
* @param TimeStampArg * @param TimeStampArg
*/ */
isOlderThan(TimeStampArg, tresholdTimeArg = 0) { isOlderThan(TimeStampArg, tresholdTimeArg = 0) {
if ((this.milliSeconds + tresholdTimeArg) < TimeStampArg.milliSeconds) { if (this.milliSeconds + tresholdTimeArg < TimeStampArg.milliSeconds) {
return true; return true;
} }
else { else {
@ -47,7 +47,7 @@ class TimeStamp {
} }
} }
isYoungerThan(TimeStampArg, tresholdTimeArg = 0) { isYoungerThan(TimeStampArg, tresholdTimeArg = 0) {
if (this.milliSeconds > (TimeStampArg.milliSeconds + tresholdTimeArg)) { if (this.milliSeconds > TimeStampArg.milliSeconds + tresholdTimeArg) {
return true; return true;
} }
else { else {
@ -56,4 +56,4 @@ class TimeStamp {
} }
} }
exports.TimeStamp = TimeStamp; exports.TimeStamp = TimeStamp;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR0aW1lLmNsYXNzZXMudGltZXN0YW1wLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR0aW1lLmNsYXNzZXMudGltZXN0YW1wLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUE7OztHQUdHO0FBQ0g7SUFzQkUsWUFBYSxVQUFtQjtRQUxoQzs7V0FFRztRQUNILFdBQU0sR0FBVyxJQUFJLENBQUE7UUFHbkIsRUFBRSxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO1lBQ2hCLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxJQUFJLEVBQUUsQ0FBQTtRQUN4QixDQUFDO1FBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLE9BQU8sVUFBVSxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUM7WUFDMUMsSUFBSSxDQUFDLElBQUksR0FBR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RCw4QkFvRUMifQ==

View File

@ -1,3 +1,3 @@
import 'typings-global';
import * as moment from 'moment'; import * as moment from 'moment';
export { moment }; import * as smartq from 'smartq';
export { moment, smartq };

View File

@ -1,6 +1,7 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
const moment = require("moment"); const moment = require("moment");
exports.moment = moment; exports.moment = moment;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR0aW1lLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHRpbWUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUV2QixpQ0FBZ0M7QUFHOUIsd0JBQU0ifQ== const smartq = require("smartq");
exports.smartq = smartq;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR0aW1lLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHRpbWUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGlDQUFpQztBQUd4Qix3QkFBTTtBQUZmLGlDQUFpQztBQUVoQix3QkFBTSJ9

View File

@ -2,19 +2,19 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.units = { exports.units = {
years: (timesArg = 1) => { years: (timesArg = 1) => {
return timesArg * 3.154e+10; return timesArg * 3.154e10;
}, },
months: (timesArg = 1) => { months: (timesArg = 1) => {
return timesArg * 2.628e+9; return timesArg * 2.628e9;
}, },
weeks: (timesArg = 1) => { weeks: (timesArg = 1) => {
return timesArg * 6.048e+8; return timesArg * 6.048e8;
}, },
days: (timesArg = 1) => { days: (timesArg = 1) => {
return timesArg * 8.64e+7; return timesArg * 8.64e7;
}, },
hours: (timesArg = 1) => { hours: (timesArg = 1) => {
return timesArg * 3.6e+6; return timesArg * 3.6e6;
}, },
minutes: (timesArg = 1) => { minutes: (timesArg = 1) => {
return timesArg * 60000; return timesArg * 60000;
@ -22,7 +22,7 @@ exports.units = {
}; };
exports.getMilliSecondsFromUnits = (combinationArg) => { exports.getMilliSecondsFromUnits = (combinationArg) => {
let timeInMilliseconds = 0; let timeInMilliseconds = 0;
let addMilliSeconds = (milliSecondsArg) => { let addMilliSeconds = milliSecondsArg => {
timeInMilliseconds = timeInMilliseconds + milliSecondsArg; timeInMilliseconds = timeInMilliseconds + milliSecondsArg;
}; };
if (combinationArg.years) { if (combinationArg.years) {
@ -45,4 +45,4 @@ exports.getMilliSecondsFromUnits = (combinationArg) => {
} }
return timeInMilliseconds; return timeInMilliseconds;
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR0aW1lLnVuaXRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR0aW1lLnVuaXRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQVcsUUFBQSxLQUFLLEdBQUc7SUFDakIsS0FBSyxFQUFFLENBQUMsUUFBUSxHQUFHLENBQUM7UUFDbEIsTUFBTSxDQUFDLFFBQVEsR0FBRyxTQUFTLENBQUE7SUFDN0IsQ0FBQztJQUNELE1BQU0sRUFBRSxDQUFDLFFBQVEsR0FBRyxDQUFDO1FBQ25CLE1BQU0sQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFBO0lBQzVCLENBQUM7SUFDRCxLQUFLLEVBQUUsQ0FBQyxRQUFRLEdBQUcsQ0FBQztRQUNsQixNQUFNLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQTtJQUM1QixDQUFDO0lBQ0QsSUFBSSxFQUFFLENBQUMsUUFBUSxHQUFHLENBQUM7UUFDakIsTUFBTSxDQUFDLFFBQV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xDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7UUFDekIsZUFBZSxDQUFDLGFBQUssQ0FBQyxLQUFLLENBQUMsY0FBYyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7SUFDckQsQ0FBQztJQUNELEVBQUUsQ0FBQyxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO1FBQ3hCLGVBQWUsQ0FBQyxhQUFLLENBQUMsSUFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO0lBQ25ELENBQUM7SUFDRCxFQUFFLENBQUMsQ0FBQyxjQUFjLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQztRQUN6QixlQUFlLENBQUMsYUFBSyxDQUFDLEtBQUssQ0FBQyxjQUFjLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQztJQUNyRCxDQUFDO0lBQ0QsRUFBRSxDQUFDLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7UUFDM0IsZUFBZSxDQUFDLGFBQUssQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7SUFDekQsQ0FBQztJQUVELE1BQU0sQ0FBQyxrQkFBa0IsQ0FBQztBQUM1QixDQUFDLENBQUMifQ==

View File

@ -1,13 +1,16 @@
# smarttime # smarttime
handle timeformats in smart ways handle timeformats in smart ways
## Availabililty ## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smarttime) [![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smarttime)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smarttime) [![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smarttime)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smarttime) [![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smarttime)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smarttime/) [![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smarttime/)
## Status for master ## Status for master
[![build status](https://GitLab.com/pushrocks/smarttime/badges/master/build.svg)](https://GitLab.com/pushrocks/smarttime/commits/master) [![build status](https://GitLab.com/pushrocks/smarttime/badges/master/build.svg)](https://GitLab.com/pushrocks/smarttime/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smarttime/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smarttime/commits/master) [![coverage report](https://GitLab.com/pushrocks/smarttime/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smarttime/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smarttime.svg)](https://www.npmjs.com/package/smarttime) [![npm downloads per month](https://img.shields.io/npm/dm/smarttime.svg)](https://www.npmjs.com/package/smarttime)
@ -19,11 +22,12 @@ handle timeformats in smart ways
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage ## Usage
Use TypeScript for best in class instellisense. Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) > | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@ -10,10 +10,12 @@
"test": "(npmts)" "test": "(npmts)"
}, },
"devDependencies": { "devDependencies": {
"tapbundle": "^1.0.13" "@types/node": "^9.4.7",
"tapbundle": "^2.0.0"
}, },
"dependencies": { "dependencies": {
"moment": "^2.18.1", "moment": "^2.21.0",
"typings-global": "^1.0.16" "smartdelay": "^1.0.4",
"smartq": "^1.1.6"
} }
} }

View File

@ -1,13 +1,16 @@
# smarttime # smarttime
handle timeformats in smart ways handle timeformats in smart ways
## Availabililty ## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smarttime) [![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smarttime)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smarttime) [![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smarttime)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smarttime) [![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smarttime)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smarttime/) [![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smarttime/)
## Status for master ## Status for master
[![build status](https://GitLab.com/pushrocks/smarttime/badges/master/build.svg)](https://GitLab.com/pushrocks/smarttime/commits/master) [![build status](https://GitLab.com/pushrocks/smarttime/badges/master/build.svg)](https://GitLab.com/pushrocks/smarttime/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smarttime/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smarttime/commits/master) [![coverage report](https://GitLab.com/pushrocks/smarttime/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smarttime/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smarttime.svg)](https://www.npmjs.com/package/smarttime) [![npm downloads per month](https://img.shields.io/npm/dm/smarttime.svg)](https://www.npmjs.com/package/smarttime)
@ -19,11 +22,12 @@ handle timeformats in smart ways
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage ## Usage
Use TypeScript for best in class instellisense. Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) > | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

18
test/test.timer.ts Normal file
View File

@ -0,0 +1,18 @@
// tslint:disable-next-line:no-implicit-dependencies
import { expect, tap } from 'tapbundle';
import { Timer } from '../ts/index';
let testTimer: Timer;
tap.test('should create a valid timer', async () => {
testTimer = new Timer(1000);
expect(testTimer).to.be.instanceof(Timer)
})
tap.test('should start timer', async () => {
testTimer.start()
await testTimer.completed;
})
tap.start()

View File

@ -1,36 +1,35 @@
import { expect, tap } from 'tapbundle' import { expect, tap } from 'tapbundle';
import * as smarttime from '../ts/index' import * as smarttime from '../ts/index';
// Test TimeStamp class // Test TimeStamp class
let testTimeStamp: smarttime.TimeStamp let testTimeStamp: smarttime.TimeStamp;
let testTimeStamp2: smarttime.TimeStamp let testTimeStamp2: smarttime.TimeStamp;
tap.test('should create valid testTimeStamp instance', async (tools) => { tap.test('should create valid testTimeStamp instance', async tools => {
testTimeStamp = new smarttime.TimeStamp() testTimeStamp = new smarttime.TimeStamp();
await tools.delayFor(2) await tools.delayFor(2);
testTimeStamp2 = new smarttime.TimeStamp() testTimeStamp2 = new smarttime.TimeStamp();
expect(testTimeStamp).to.be.instanceof(smarttime.TimeStamp) expect(testTimeStamp).to.be.instanceof(smarttime.TimeStamp);
expect(testTimeStamp).to.be.instanceof(smarttime.TimeStamp) expect(testTimeStamp).to.be.instanceof(smarttime.TimeStamp);
}) });
tap.test('should have valid linuxtime', async () => { tap.test('should have valid linuxtime', async () => {
// tslint:disable-next-line:no-unused-expression // tslint:disable-next-line:no-unused-expression
expect(testTimeStamp.isOlderThan(testTimeStamp2)).to.be.true expect(testTimeStamp.isOlderThan(testTimeStamp2)).to.be.true;
// tslint:disable-next-line:no-unused-expression // tslint:disable-next-line:no-unused-expression
expect(testTimeStamp.isYoungerThan(testTimeStamp2)).to.be.false expect(testTimeStamp.isYoungerThan(testTimeStamp2)).to.be.false;
}) });
let testHrtMeasurement: smarttime.HrtMeasurement let testHrtMeasurement: smarttime.HrtMeasurement;
// Test HrtMeasurement // Test HrtMeasurement
tap.test('should create valid HrtMeasurements', async (tools) => { tap.test('should create valid HrtMeasurements', async tools => {
testHrtMeasurement = new smarttime.HrtMeasurement() testHrtMeasurement = new smarttime.HrtMeasurement();
testHrtMeasurement.start() testHrtMeasurement.start();
await tools.delayFor(20) await tools.delayFor(20);
testHrtMeasurement.stop() testHrtMeasurement.stop();
expect(testHrtMeasurement.milliSeconds).to.be.greaterThan(19) expect(testHrtMeasurement.milliSeconds).to.be.greaterThan(19);
expect(testHrtMeasurement.milliSeconds).to.be.lessThan(25) expect(testHrtMeasurement.milliSeconds).to.be.lessThan(25);
}) });
// check units // check units
tap.test('should combine units', async () => { tap.test('should combine units', async () => {
@ -41,8 +40,8 @@ tap.test('should combine units', async () => {
days: 2, days: 2,
hours: 2, hours: 2,
minutes: 2 minutes: 2
}) });
console.log(computedTime) console.log(computedTime);
}) });
tap.start() tap.start();

View File

@ -1,7 +1,8 @@
import * as plugins from './smarttime.plugins' import * as plugins from './smarttime.plugins';
export * from './smarttime.classes.hrtmeasurement' export * from './smarttime.classes.hrtmeasurement';
export * from './smarttime.classes.timestamp' export * from './smarttime.classes.timer';
export * from './smarttime.units' export * from './smarttime.classes.timestamp';
export * from './smarttime.units';
export { moment } from './smarttime.plugins' export { moment } from './smarttime.plugins';

View File

@ -1,45 +1,45 @@
import * as process from 'process' import * as process from 'process';
/** /**
* easy high resolution time measurement * easy high resolution time measurement
*/ */
export class HrtMeasurement { export class HrtMeasurement {
nanoSeconds: number = null nanoSeconds: number = null;
milliSeconds: number = null milliSeconds: number = null;
private _hrTimeStart = null private _hrTimeStart = null;
private _hrTimeStopDiff = null private _hrTimeStopDiff = null;
private _started: boolean = false private _started: boolean = false;
/** /**
* start the measurement * start the measurement
*/ */
start () { start() {
this._started = true this._started = true;
this._hrTimeStart = process.hrtime() this._hrTimeStart = process.hrtime();
} }
/** /**
* stop the measurement * stop the measurement
*/ */
stop () { stop() {
if (this._started === false) { if (this._started === false) {
console.log('Hasn\'t started yet') console.log("Hasn't started yet");
return return;
} }
this._hrTimeStopDiff = process.hrtime(this._hrTimeStart) this._hrTimeStopDiff = process.hrtime(this._hrTimeStart);
this.nanoSeconds = (this._hrTimeStopDiff[0] * 1e9) + this._hrTimeStopDiff[1] this.nanoSeconds = this._hrTimeStopDiff[0] * 1e9 + this._hrTimeStopDiff[1];
this.milliSeconds = this.nanoSeconds / 1000000 this.milliSeconds = this.nanoSeconds / 1000000;
return this return this;
} }
/** /**
* reset the measurement * reset the measurement
*/ */
reset () { reset() {
this.nanoSeconds = null this.nanoSeconds = null;
this.milliSeconds = null this.milliSeconds = null;
this._hrTimeStart = null this._hrTimeStart = null;
this._hrTimeStopDiff = null this._hrTimeStopDiff = null;
this._started = false this._started = false;
} }
} }

View File

@ -0,0 +1,75 @@
import * as plugins from './smarttime.plugins';
import { TimeStamp } from './smarttime.classes.timestamp';
export type TimerState = 'initiated' | 'started' | 'paused' | 'completed';
export class Timer {
/**
* the original amount of milliseconds for this Timer
*/
public timeInMilliseconds: number;
/**
* the state of the timer
*/
public state: TimerState = 'initiated';
/**
* completed Promise
*/
public completed: Promise<void>;
/**
* a reference to when the Timeout started
*/
public startedAt: TimeStamp;
/**
* a reference to when a Timer has been potentially paused
*/
public pausedAt: TimeStamp;
get timeLeft(): number {
return this.timeInMilliseconds - this.pausedAt.change;
}
/**
* the current timeout the needs to be canceled when this Timer is stopped
*/
private currentTimeout: NodeJS.Timer;
// a deferred triggeted when Timer has completed
private completedDeferred = plugins.smartq.defer<void>();
constructor(timeInMillisecondsArg: number) {
this.timeInMilliseconds = timeInMillisecondsArg;
this.completed = this.completedDeferred.promise;
}
/**
* starts the timer
*/
public start() {
if (!this.startedAt) {
this.currentTimeout = setTimeout(() => {
this.completedDeferred.resolve();
}, this.timeInMilliseconds);
this.startedAt = new TimeStamp();
} else {
throw new Error('timer has been started before. Please use resume instead');
}
}
public pause() {
clearTimeout(this.currentTimeout);
this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt);
}
public resume() {
if (this.startedAt) {
this.currentTimeout = setTimeout(() => {
this.completedDeferred.resolve();
}, this.timeLeft);
}
}
}

View File

@ -1,75 +1,75 @@
import * as plugins from './smarttime.plugins' import * as plugins from './smarttime.plugins';
/** /**
* TimeStamp * TimeStamp
* smart timestamp * smart timestamp
*/ */
export class TimeStamp { export class TimeStamp {
/**
* The standard JavaScript Date
*/
date: Date
/**
* The time as linux time (milliseconds, not seconds though)
* good for comparison
*/
milliSeconds: number
/**
* The standard epoch time in seconds
*/
epochtime: number
/**
* if derived from another TimeStamp points out the change in milliseconds
*/
change: number = null
constructor (creatorArg?: number) {
if (!creatorArg) {
this.date = new Date()
} else if (typeof creatorArg === 'number') {
this.date = new Date(creatorArg)
}
this.milliSeconds = this.date.getTime()
this.epochtime = Math.floor(this.milliSeconds / 1000)
}
/** /**
* returns new TimeStamp from milliseconds * returns new TimeStamp from milliseconds
*/ */
static fromMilliSeconds (milliSecondsArg) { public static fromMilliSeconds(milliSecondsArg) {
return new TimeStamp(milliSecondsArg) return new TimeStamp(milliSecondsArg);
} }
/** /**
* returns new TimeStamp for now with change set * returns new TimeStamp for now with change set
* @param timeStampArg * @param timeStampArg
*/ */
static fromTimeStamp (timeStampArg: TimeStamp) { public static fromTimeStamp(timeStampArg: TimeStamp) {
let localTimeStamp = new TimeStamp() const localTimeStamp = new TimeStamp();
localTimeStamp.change = localTimeStamp.milliSeconds - timeStampArg.milliSeconds localTimeStamp.change = localTimeStamp.milliSeconds - timeStampArg.milliSeconds;
return localTimeStamp return localTimeStamp;
}
/**
* The standard JavaScript Date
*/
public date: Date;
/**
* The time as linux time (milliseconds, not seconds though)
* good for comparison
*/
public milliSeconds: number;
/**
* The standard epoch time in seconds
*/
public epochtime: number;
/**
* if derived from another TimeStamp points out the change in milliseconds
*/
public change: number = null;
constructor(creatorArg?: number) {
if (!creatorArg) {
this.date = new Date();
} else if (typeof creatorArg === 'number') {
this.date = new Date(creatorArg);
}
this.milliSeconds = this.date.getTime();
this.epochtime = Math.floor(this.milliSeconds / 1000);
} }
/** /**
* Is the current instance older than the argument * Is the current instance older than the argument
* @param TimeStampArg * @param TimeStampArg
*/ */
isOlderThan (TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) { public isOlderThan(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {
if ((this.milliSeconds + tresholdTimeArg) < TimeStampArg.milliSeconds) { if (this.milliSeconds + tresholdTimeArg < TimeStampArg.milliSeconds) {
return true return true;
} else { } else {
return false return false;
} }
} }
isYoungerThan (TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) { public isYoungerThan(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {
if (this.milliSeconds > (TimeStampArg.milliSeconds + tresholdTimeArg)) { if (this.milliSeconds > TimeStampArg.milliSeconds + tresholdTimeArg) {
return true return true;
} else { } else {
return false return false;
} }
} }
} }

View File

@ -1,7 +1,4 @@
import 'typings-global' import * as moment from 'moment';
import * as smartq from 'smartq';
import * as moment from 'moment' export { moment, smartq };
export {
moment
}

View File

@ -1,45 +1,56 @@
export let units = { export let units = {
years: (timesArg = 1): number => { years: (timesArg = 1): number => {
return timesArg * 3.154e+10 return timesArg * 3.154e10;
}, },
months: (timesArg = 1): number => { months: (timesArg = 1): number => {
return timesArg * 2.628e+9 return timesArg * 2.628e9;
}, },
weeks: (timesArg = 1) => { weeks: (timesArg = 1) => {
return timesArg * 6.048e+8 return timesArg * 6.048e8;
}, },
days: (timesArg = 1) => { days: (timesArg = 1) => {
return timesArg * 8.64e+7 return timesArg * 8.64e7;
}, },
hours: (timesArg = 1) => { hours: (timesArg = 1) => {
return timesArg * 3.6e+6 return timesArg * 3.6e6;
}, },
minutes: (timesArg = 1) => { minutes: (timesArg = 1) => {
return timesArg * 60000 return timesArg * 60000;
} }
} };
export interface IUnitCombinationArg { export interface IUnitCombinationArg {
years?: number years?: number;
months?: number months?: number;
weeks?: number weeks?: number;
days?: number days?: number;
hours?: number hours?: number;
minutes?: number minutes?: number;
} }
export let getMilliSecondsFromUnits = (combinationArg: IUnitCombinationArg) => { export let getMilliSecondsFromUnits = (combinationArg: IUnitCombinationArg) => {
let timeInMilliseconds = 0 let timeInMilliseconds = 0;
let addMilliSeconds = (milliSecondsArg) => { let addMilliSeconds = milliSecondsArg => {
timeInMilliseconds = timeInMilliseconds + milliSecondsArg timeInMilliseconds = timeInMilliseconds + milliSecondsArg;
};
if (combinationArg.years) {
addMilliSeconds(units.years(combinationArg.years));
}
if (combinationArg.months) {
addMilliSeconds(units.months(combinationArg.months));
}
if (combinationArg.weeks) {
addMilliSeconds(units.weeks(combinationArg.weeks));
}
if (combinationArg.days) {
addMilliSeconds(units.days(combinationArg.days));
}
if (combinationArg.hours) {
addMilliSeconds(units.hours(combinationArg.hours));
}
if (combinationArg.minutes) {
addMilliSeconds(units.minutes(combinationArg.minutes));
} }
if (combinationArg.years) { addMilliSeconds(units.years(combinationArg.years)) }
if (combinationArg.months) { addMilliSeconds(units.months(combinationArg.months)) }
if (combinationArg.weeks) { addMilliSeconds(units.weeks(combinationArg.weeks)) }
if (combinationArg.days) { addMilliSeconds(units.days(combinationArg.days)) }
if (combinationArg.hours) { addMilliSeconds(units.hours(combinationArg.hours)) }
if (combinationArg.minutes) { addMilliSeconds(units.minutes(combinationArg.minutes)) }
return timeInMilliseconds
}
return timeInMilliseconds;
};

View File

@ -1,3 +1,6 @@
{ {
"extends": "tslint-config-standard" "extends": [
"tslint:latest",
"tslint-config-prettier"
]
} }

294
yarn.lock
View File

@ -2,72 +2,37 @@
# yarn lockfile v1 # yarn lockfile v1
"@types/chai-as-promised@0.0.29": "@types/chai-as-promised@^7.1.0":
version "0.0.29" version "7.1.0"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-0.0.29.tgz#43d52892aa998e185a3de3e2477edb8573be1d77" resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.0.tgz#010b04cde78eacfb6e72bfddb3e58fe23c2e78b9"
dependencies:
"@types/chai" "*"
"@types/promises-a-plus" "*"
"@types/chai-string@^1.1.30":
version "1.1.30"
resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.1.30.tgz#4d8744b31a5a2295fc01c981ed1e2d4c8a070f0a"
dependencies: dependencies:
"@types/chai" "*" "@types/chai" "*"
"@types/chai@*": "@types/chai-string@^1.4.0":
version "4.0.3" version "1.4.0"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.3.tgz#6c2264b195cd2bb4c95c108487e13df0c8567c3e" resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.4.0.tgz#c8b78deb9ae53e86c05a446c256138faeaff53c1"
"@types/chai@^3.4.35":
version "3.5.2"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e"
"@types/glob@*":
version "5.0.30"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.30.tgz#1026409c5625a8689074602808d082b2867b8a51"
dependencies: dependencies:
"@types/minimatch" "*" "@types/chai" "*"
"@types/node" "*"
"@types/minimatch@*": "@types/chai@*", "@types/chai@^4.1.2":
version "3.0.0" version "4.1.2"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.0.tgz#a8b68c324817169b6004b432a598478a5d8f025a" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.2.tgz#f1af664769cfb50af805431c407425ed619daa21"
"@types/node@*": "@types/node@^9.4.7":
version "8.0.22" version "9.4.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.22.tgz#9c6bfee1f45f5e9952ff6b487e657ecca48c7777" resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.7.tgz#57d81cd98719df2c9de118f2d5f3b1120dcd7275"
"@types/promises-a-plus@*":
version "0.0.27"
resolved "https://registry.yarnpkg.com/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz#c64651134614c84b8f5d7114ce8901d36a609780"
"@types/shelljs@^0.7.2":
version "0.7.4"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.4.tgz#137b5f31306eaff4de120ffe5b9d74b297809cfc"
dependencies:
"@types/glob" "*"
"@types/node" "*"
"@types/which@^1.0.28":
version "1.0.28"
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
ansi-256-colors@^1.1.0: ansi-256-colors@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a" resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
assertion-error@^1.0.1: assertion-error@^1.0.1:
version "1.0.2" version "1.1.0"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b"
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
beautycolor@^1.0.7: beautycolor@^1.0.7:
version "1.0.7" version "1.0.11"
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.7.tgz#a4715738ac4c8221371e9cbeb5a6cc6d11ecbf7c" resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.11.tgz#71c5568d5a7ed5c144d3a54f753ad1b08862aea5"
dependencies: dependencies:
ansi-256-colors "^1.1.0" ansi-256-colors "^1.1.0"
typings-global "^1.0.14" typings-global "^1.0.14"
@ -76,44 +41,36 @@ bindings@^1.2.1:
version "1.3.0" version "1.3.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
brace-expansion@^1.1.7: chai-as-promised@^7.1.1:
version "1.1.8" version "7.1.1"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
chai-as-promised@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-6.0.0.tgz#1a02a433a6f24dafac63b9c96fa1684db1aa8da6"
dependencies: dependencies:
check-error "^1.0.2" check-error "^1.0.2"
chai-string@^1.3.0: chai-string@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.4.0.tgz#359140c051d36a4e4b1a5fc6b910152f438a8d49" resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.4.0.tgz#359140c051d36a4e4b1a5fc6b910152f438a8d49"
chai@^3.5.0: chai@^4.1.2:
version "3.5.0" version "4.1.2"
resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c"
dependencies: dependencies:
assertion-error "^1.0.1" assertion-error "^1.0.1"
deep-eql "^0.1.3" check-error "^1.0.1"
type-detect "^1.0.0" deep-eql "^3.0.0"
get-func-name "^2.0.0"
pathval "^1.0.0"
type-detect "^4.0.0"
check-error@^1.0.2: check-error@^1.0.1, check-error@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
concat-map@0.0.1: deep-eql@^3.0.0:
version "0.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
deep-eql@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
dependencies: dependencies:
type-detect "0.1.1" type-detect "^4.0.0"
define-properties@^1.1.2: define-properties@^1.1.2:
version "1.1.2" version "1.1.2"
@ -131,11 +88,11 @@ early@^2.1.1:
typings-global "^1.0.16" typings-global "^1.0.16"
es-abstract@^1.5.1: es-abstract@^1.5.1:
version "1.8.0" version "1.10.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.8.0.tgz#3b00385e85729932beffa9163bbea1234e932914" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864"
dependencies: dependencies:
es-to-primitive "^1.1.1" es-to-primitive "^1.1.1"
function-bind "^1.1.0" function-bind "^1.1.1"
has "^1.0.1" has "^1.0.1"
is-callable "^1.1.3" is-callable "^1.1.3"
is-regex "^1.0.4" is-regex "^1.0.4"
@ -149,31 +106,20 @@ es-to-primitive@^1.1.1:
is-symbol "^1.0.1" is-symbol "^1.0.1"
es6-error@^4.0.2: es6-error@^4.0.2:
version "4.0.2" version "4.1.1"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98" resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
foreach@^2.0.5: foreach@^2.0.5:
version "2.0.5" version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
fs.realpath@^1.0.0: function-bind@^1.0.2, function-bind@^1.1.1:
version "1.0.0" version "1.1.1"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
function-bind@^1.0.2, function-bind@^1.1.0: get-func-name@^2.0.0:
version "1.1.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41"
glob@^7.0.0:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
has@^1.0.1: has@^1.0.1:
version "1.0.1" version "1.0.1"
@ -181,21 +127,6 @@ has@^1.0.1:
dependencies: dependencies:
function-bind "^1.0.2" function-bind "^1.0.2"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
interpret@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
is-callable@^1.1.1, is-callable@^1.1.3: is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.3" version "1.1.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
@ -214,10 +145,6 @@ is-symbol@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
leakage@^0.3.0: leakage@^0.3.0:
version "0.3.0" version "0.3.0"
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39" resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
@ -229,8 +156,8 @@ leakage@^0.3.0:
pretty-bytes "^4.0.2" pretty-bytes "^4.0.2"
left-pad@^1.1.3: left-pad@^1.1.3:
version "1.1.3" version "1.2.0"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"
memwatch-next@^0.3.0: memwatch-next@^0.3.0:
version "0.3.0" version "0.3.0"
@ -239,23 +166,17 @@ memwatch-next@^0.3.0:
bindings "^1.2.1" bindings "^1.2.1"
nan "^2.3.2" nan "^2.3.2"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minimist@^1.2.0: minimist@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
moment@^2.18.1: moment@^2.21.0:
version "2.18.1" version "2.21.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f" resolved "https://registry.yarnpkg.com/moment/-/moment-2.21.0.tgz#2a114b51d2a6ec9e6d83cf803f838a878d8a023a"
nan@^2.3.2: nan@^2.3.2:
version "2.6.2" version "2.9.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866"
object-keys@^1.0.8: object-keys@^1.0.8:
version "1.0.11" version "1.0.11"
@ -268,62 +189,28 @@ object.getownpropertydescriptors@^2.0.3:
define-properties "^1.1.2" define-properties "^1.1.2"
es-abstract "^1.5.1" es-abstract "^1.5.1"
once@^1.3.0: pathval@^1.0.0:
version "1.4.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"
dependencies:
wrappy "1"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
pretty-bytes@^4.0.2: pretty-bytes@^4.0.2:
version "4.0.2" version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
rechoir@^0.6.2: smartchai@^2.0.0:
version "0.6.2" version "2.0.1"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-2.0.1.tgz#d20f17221f0e3c6c3473600b78ddfba0ab0ea762"
dependencies: dependencies:
resolve "^1.1.6" "@types/chai" "^4.1.2"
"@types/chai-as-promised" "^7.1.0"
"@types/chai-string" "^1.4.0"
chai "^4.1.2"
chai-as-promised "^7.1.1"
chai-string "^1.4.0"
resolve@^1.1.6: smartdelay@^1.0.3, smartdelay@^1.0.4:
version "1.4.0" version "1.0.4"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.4.tgz#791c1a4ee6770494064c10b1d2d2b8e6f3105b82"
dependencies:
path-parse "^1.0.5"
semver@^5.3.0:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
shelljs@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"
smartchai@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.3.tgz#de6d010bb8b5aef24cb70b31a5f5334e8c41b72f"
dependencies:
"@types/chai" "^3.4.35"
"@types/chai-as-promised" "0.0.29"
"@types/chai-string" "^1.1.30"
chai "^3.5.0"
chai-as-promised "^6.0.0"
chai-string "^1.3.0"
smartdelay@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.3.tgz#5fd44dad77262d110702f0293efa80c072cfb579"
dependencies: dependencies:
smartq "^1.1.1" smartq "^1.1.1"
typings-global "^1.0.16" typings-global "^1.0.16"
@ -335,42 +222,23 @@ smartq@^1.1.1, smartq@^1.1.6:
typings-global "^1.0.19" typings-global "^1.0.19"
util.promisify "^1.0.0" util.promisify "^1.0.0"
smartshell@^1.0.6: tapbundle@^2.0.0:
version "1.0.13" version "2.0.0"
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.13.tgz#277b34e6624df70003e0e3a6c900cd5ebab7eb92" resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-2.0.0.tgz#79fce68ff185c786fabaf6eb589a4afc7d2714b7"
dependencies:
"@types/shelljs" "^0.7.2"
"@types/which" "^1.0.28"
shelljs "^0.7.8"
smartq "^1.1.6"
typings-global "^1.0.19"
which "^1.2.14"
tapbundle@^1.0.13:
version "1.1.1"
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.1.tgz#ec4172c0e82a77b1f6133fef2606311ede28a62d"
dependencies: dependencies:
early "^2.1.1" early "^2.1.1"
leakage "^0.3.0" leakage "^0.3.0"
smartchai "^1.0.3" smartchai "^2.0.0"
smartdelay "^1.0.3" smartdelay "^1.0.3"
smartq "^1.1.1" smartq "^1.1.1"
typings-global "^1.0.19"
type-detect@0.1.1: type-detect@^4.0.0:
version "0.1.1" version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
type-detect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19: typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19:
version "1.0.20" version "1.0.28"
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.28.tgz#e28cc965476564cbc00e438739e0aa0735d323d4"
dependencies:
semver "^5.3.0"
smartshell "^1.0.6"
util.promisify@^1.0.0: util.promisify@^1.0.0:
version "1.0.0" version "1.0.0"
@ -378,13 +246,3 @@ util.promisify@^1.0.0:
dependencies: dependencies:
define-properties "^1.1.2" define-properties "^1.1.2"
object.getownpropertydescriptors "^2.0.3" object.getownpropertydescriptors "^2.0.3"
which@^1.2.14:
version "1.3.0"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
dependencies:
isexe "^2.0.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"