Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
388649659c | |||
e8ff289a9a | |||
a5deb25bfb | |||
ce2d1b278b | |||
aa16e5d5bb | |||
f221e9c0fa | |||
9935396f2d | |||
1bc379daa5 | |||
f9b81fc801 | |||
6d8e39f11b | |||
cff5b5a7f4 | |||
f6be9b71f1 | |||
9c2d584170 | |||
10bff069c1 | |||
8f6272eca4 | |||
f02df7789c | |||
d720b8b084 | |||
6bca8557f9 | |||
f0a5e18335 | |||
57fbdb4a70 |
19
.gitignore
vendored
19
.gitignore
vendored
@ -1,5 +1,22 @@
|
|||||||
.nogit/
|
.nogit/
|
||||||
node_modules/
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
public/
|
public/
|
||||||
pages/
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_web/
|
||||||
|
dist_serve/
|
||||||
|
dist_ts_web/
|
||||||
|
|
||||||
|
# custom
|
@ -1,4 +1,4 @@
|
|||||||
# gitzone standard
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
@ -37,18 +37,6 @@ snyk:
|
|||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
testLEGACY:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install legacy
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
testLTS:
|
testLTS:
|
||||||
stage: test
|
stage: test
|
||||||
@ -90,19 +78,11 @@ release:
|
|||||||
# ====================
|
# ====================
|
||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
image: docker:stable
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
script:
|
script:
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
- npmci command npm install -g tslint typescript
|
||||||
- docker run
|
- npmci npm install
|
||||||
--env SOURCE_CODE="$PWD"
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
--volume "$PWD":/code
|
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
|
||||||
artifacts:
|
|
||||||
paths: [codeclimate.json]
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- priv
|
- priv
|
||||||
@ -121,10 +101,10 @@ pages:
|
|||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-node:npmci
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g typedoc typescript
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
@ -135,13 +115,3 @@ pages:
|
|||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
windowsCompatibility:
|
|
||||||
image: stefanscherer/node-windows:10-build-tools
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npm install & npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- windows
|
|
||||||
allow_failure: true
|
|
||||||
|
@ -2,5 +2,15 @@
|
|||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [],
|
"npmGlobalTools": [],
|
||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "smarttime",
|
||||||
|
"shortDescription": "handle time in smart ways",
|
||||||
|
"npmPackagename": "@pushrocks/smarttime",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
1436
package-lock.json
generated
1436
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
38
package.json
38
package.json
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarttime",
|
"name": "@pushrocks/smarttime",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "3.0.1",
|
"version": "3.0.10",
|
||||||
"description": "handle timeformats in smart ways",
|
"description": "handle time in smart ways",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
@ -12,17 +12,29 @@
|
|||||||
"build": "(tsbuild)"
|
"build": "(tsbuild)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.1.11",
|
||||||
"@gitzone/tsrun": "^1.1.13",
|
"@gitzone/tsrun": "^1.2.6",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.24",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.9",
|
||||||
"@types/node": "^10.12.0",
|
"@types/node": "^12.0.8",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.17.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@types/luxon": "^1.4.0",
|
"@types/cron": "^1.7.1",
|
||||||
"luxon": "^1.4.3"
|
"@types/luxon": "^1.15.1",
|
||||||
}
|
"cron": "^1.7.1",
|
||||||
|
"luxon": "^1.16.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/*",
|
||||||
|
"ts_web/*",
|
||||||
|
"dist/*",
|
||||||
|
"dist_web/*",
|
||||||
|
"assets/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
58
readme.md
58
readme.md
@ -1,24 +1,20 @@
|
|||||||
# smarttime
|
# @pushrocks/smarttime
|
||||||
|
handle time in smart ways
|
||||||
|
|
||||||
handle timeformats in smart ways
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smarttime)
|
||||||
## Availabililty
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smarttime)
|
||||||
|
* [github.com (source mirror)](https://github.com/pushrocks/smarttime)
|
||||||
[](https://www.npmjs.com/package/smarttime)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smarttime/)
|
||||||
[](https://GitLab.com/pushrocks/smarttime)
|
|
||||||
[](https://github.com/pushrocks/smarttime)
|
|
||||||
[](https://pushrocks.gitlab.io/smarttime/)
|
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
[](https://gitlab.com/pushrocks/smarttime/commits/master)
|
||||||
[](https://GitLab.com/pushrocks/smarttime/commits/master)
|
[](https://gitlab.com/pushrocks/smarttime/commits/master)
|
||||||
[](https://GitLab.com/pushrocks/smarttime/commits/master)
|
[](https://www.npmjs.com/package/@pushrocks/smarttime)
|
||||||
[](https://www.npmjs.com/package/smarttime)
|
[](https://snyk.io/test/npm/@pushrocks/smarttime)
|
||||||
[](https://david-dm.org/pushrocks/smarttime)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://www.bithound.io/github/pushrocks/smarttime/master/dependencies/npm)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://www.bithound.io/github/pushrocks/smarttime)
|
[](https://prettier.io/)
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -26,9 +22,29 @@ Use TypeScript for best in class instellisense.
|
|||||||
|
|
||||||
Smarttime offers smart ways to deal with time.
|
Smarttime offers smart ways to deal with time.
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
### class CronManager
|
||||||
|
This class provides scheduling of functions with a cron syntax
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { CronManager } from '@pushrocks/smarrtime';
|
||||||
|
const cronManagerInstance = new CronManager();
|
||||||
|
cronManagerInstance.addConrjob('* * * * * *', async () => {
|
||||||
|
console.log('hello'); // will log 'hello' to console once every second;
|
||||||
|
})
|
||||||
|
cronManagerInstance.start();
|
||||||
|
```
|
||||||
|
|
||||||
|
### class ExtendedDate
|
||||||
|
This class offers static functions to create zone specific JavaScript dates from European formated time strings.
|
||||||
|
|
||||||
|
```TypeScript
|
||||||
|
import { ExtendedDate } from '@pushrocks/smarttime'
|
||||||
|
const myDate: Date = ExtendedDate.fromEuropeanDate('8.6.2018')
|
||||||
|
```
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [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)
|
||||||
|
|
||||||
[](https://push.rocks)
|
[](https://maintainedby.lossless.com)
|
||||||
|
27
test/test.cronmanager.ts
Normal file
27
test/test.cronmanager.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { tap, expect } from '@pushrocks/tapbundle';
|
||||||
|
|
||||||
|
import * as smarttime from '../ts/index';
|
||||||
|
|
||||||
|
let testCronManager: smarttime.CronManager;
|
||||||
|
|
||||||
|
tap.test('should create a valid instance of cronmanager', async () => {
|
||||||
|
testCronManager = new smarttime.CronManager();
|
||||||
|
expect(testCronManager).to.be.instanceOf(smarttime.CronManager);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should create a valid cronJon', async tools => {
|
||||||
|
const done = tools.defer();
|
||||||
|
let counter = 0;
|
||||||
|
testCronManager.addCronjob('* * * * * *', () => {
|
||||||
|
if (counter === 10) {
|
||||||
|
done.resolve();
|
||||||
|
}
|
||||||
|
counter++;
|
||||||
|
console.log(`hey ${counter}`);
|
||||||
|
});
|
||||||
|
testCronManager.start();
|
||||||
|
await done.promise;
|
||||||
|
testCronManager.stop();
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.start();
|
@ -3,13 +3,17 @@ import { expect, tap } from '@pushrocks/tapbundle';
|
|||||||
import * as smarttime from '../ts/index';
|
import * as smarttime from '../ts/index';
|
||||||
|
|
||||||
tap.test('should create a valid JavaScript Date from European TimeStamp', async () => {
|
tap.test('should create a valid JavaScript Date from European TimeStamp', async () => {
|
||||||
const extendedDate = smarttime.ExtendedDate.fromEuropeanDate('10.10.2018');
|
const extendedDate = smarttime.ExtendedDate.fromEuropeanDate('1.6.2018');
|
||||||
console.log(extendedDate);
|
console.log(extendedDate);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should create a date and time with European Format', async () => {
|
tap.test('should create a date and time with European Format', async () => {
|
||||||
const extendedDate = smarttime.ExtendedDate.fromEuropeanDateAndTime('10.10.2018', '08:00:00', 'Europe/Berlin');
|
const extendedDate = smarttime.ExtendedDate.fromEuropeanDateAndTime(
|
||||||
|
'9.8.2018',
|
||||||
|
'08:00:00',
|
||||||
|
'Europe/Berlin'
|
||||||
|
);
|
||||||
console.log(extendedDate);
|
console.log(extendedDate);
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
@ -15,4 +15,12 @@ tap.test('should start timer', async () => {
|
|||||||
await testTimer.completed;
|
await testTimer.completed;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should reset a timer', async () => {
|
||||||
|
testTimer.reset();
|
||||||
|
testTimer.start();
|
||||||
|
testTimer.reset();
|
||||||
|
testTimer.start();
|
||||||
|
await testTimer.completed;
|
||||||
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import * as plugins from './smarttime.plugins';
|
import * as plugins from './smarttime.plugins';
|
||||||
|
|
||||||
export * from './smarttime.classes.date';
|
export * from './smarttime.classes.cronmanager';
|
||||||
|
export * from './smarttime.classes.extendeddate';
|
||||||
export * from './smarttime.classes.hrtmeasurement';
|
export * from './smarttime.classes.hrtmeasurement';
|
||||||
export * from './smarttime.classes.timer';
|
export * from './smarttime.classes.timer';
|
||||||
export * from './smarttime.classes.timestamp';
|
export * from './smarttime.classes.timestamp';
|
||||||
|
35
ts/smarttime.classes.cronmanager.ts
Normal file
35
ts/smarttime.classes.cronmanager.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import * as plugins from './smarttime.plugins';
|
||||||
|
|
||||||
|
export class CronManager {
|
||||||
|
public status: 'started' | 'stopped' = 'stopped';
|
||||||
|
|
||||||
|
public cronjobs: plugins.cron.CronJob[] = [];
|
||||||
|
|
||||||
|
public addCronjob(cronIdentifierArg: string, cronFunctionArg: plugins.cron.CronCommand) {
|
||||||
|
const newCronJob = new plugins.cron.CronJob(cronIdentifierArg, cronFunctionArg);
|
||||||
|
if (this.status === 'started') {
|
||||||
|
newCronJob.start();
|
||||||
|
}
|
||||||
|
this.cronjobs.push(newCronJob);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* starts the cronjob
|
||||||
|
*/
|
||||||
|
public start() {
|
||||||
|
this.status = 'started';
|
||||||
|
for (const cron of this.cronjobs) {
|
||||||
|
cron.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stops all cronjobs
|
||||||
|
*/
|
||||||
|
public stop() {
|
||||||
|
this.status = 'stopped';
|
||||||
|
for (const cron of this.cronjobs) {
|
||||||
|
cron.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,10 @@ import * as plugins from './smarttime.plugins';
|
|||||||
export type TAvailableZone = 'Europe/Berlin';
|
export type TAvailableZone = 'Europe/Berlin';
|
||||||
|
|
||||||
export class ExtendedDate extends Date {
|
export class ExtendedDate extends Date {
|
||||||
|
public static fromMillis(milliSeconds: number) {
|
||||||
|
return new ExtendedDate(milliSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
public static fromEuropeanDate(europeanDate: string) {
|
public static fromEuropeanDate(europeanDate: string) {
|
||||||
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDate);
|
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDate);
|
||||||
const luxonDate = plugins.luxon.DateTime.utc(
|
const luxonDate = plugins.luxon.DateTime.utc(
|
||||||
@ -15,9 +19,19 @@ export class ExtendedDate extends Date {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
public static fromEuropeanDateAndTime(europeanDateArg: string, timeArg: string, zoneArg: TAvailableZone) {
|
public static fromEuropeanDateAndTime(
|
||||||
|
europeanDateArg: string,
|
||||||
|
timeArg: string = '12:00:00',
|
||||||
|
zoneArg: TAvailableZone = 'Europe/Berlin'
|
||||||
|
) {
|
||||||
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDateArg);
|
const dateArray = /(.*)\.(.*)\.(.*)/.exec(europeanDateArg);
|
||||||
const luxonDate = plugins.luxon.DateTime.fromISO(`${dateArray[3]}-${dateArray[2]}-${dateArray[1]}T${timeArg}`, {
|
const sliceDate = (dateString: string) => {
|
||||||
|
return `0${dateString}`.slice(-2);
|
||||||
|
};
|
||||||
|
const dateTimeString = `${dateArray[3]}-${sliceDate(dateArray[2])}-${sliceDate(
|
||||||
|
dateArray[1]
|
||||||
|
)}T${timeArg}`;
|
||||||
|
const luxonDate = plugins.luxon.DateTime.fromISO(dateTimeString, {
|
||||||
zone: zoneArg
|
zone: zoneArg
|
||||||
});
|
});
|
||||||
const unixMilli = luxonDate.toMillis();
|
const unixMilli = luxonDate.toMillis();
|
@ -4,8 +4,8 @@ import * as process from 'process';
|
|||||||
* easy high resolution time measurement
|
* easy high resolution time measurement
|
||||||
*/
|
*/
|
||||||
export class HrtMeasurement {
|
export class HrtMeasurement {
|
||||||
nanoSeconds: number = null;
|
public nanoSeconds: number = null;
|
||||||
milliSeconds: number = null;
|
public milliSeconds: number = null;
|
||||||
private _hrTimeStart = null;
|
private _hrTimeStart = null;
|
||||||
private _hrTimeStopDiff = null;
|
private _hrTimeStopDiff = null;
|
||||||
private _started: boolean = false;
|
private _started: boolean = false;
|
||||||
@ -13,7 +13,7 @@ export class HrtMeasurement {
|
|||||||
/**
|
/**
|
||||||
* start the measurement
|
* start the measurement
|
||||||
*/
|
*/
|
||||||
start() {
|
public start() {
|
||||||
this._started = true;
|
this._started = true;
|
||||||
this._hrTimeStart = process.hrtime();
|
this._hrTimeStart = process.hrtime();
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ export class HrtMeasurement {
|
|||||||
/**
|
/**
|
||||||
* stop the measurement
|
* stop the measurement
|
||||||
*/
|
*/
|
||||||
stop() {
|
public stop() {
|
||||||
if (this._started === false) {
|
if (this._started === false) {
|
||||||
console.log("Hasn't started yet");
|
console.log("Hasn't started yet");
|
||||||
return;
|
return;
|
||||||
@ -35,7 +35,7 @@ export class HrtMeasurement {
|
|||||||
/**
|
/**
|
||||||
* reset the measurement
|
* reset the measurement
|
||||||
*/
|
*/
|
||||||
reset() {
|
public reset() {
|
||||||
this.nanoSeconds = null;
|
this.nanoSeconds = null;
|
||||||
this.milliSeconds = null;
|
this.milliSeconds = null;
|
||||||
this._hrTimeStart = null;
|
this._hrTimeStart = null;
|
||||||
|
@ -61,8 +61,11 @@ export class Timer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public pause() {
|
public pause() {
|
||||||
clearTimeout(this.currentTimeout);
|
if (this.startedAt) {
|
||||||
this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt);
|
clearTimeout(this.currentTimeout);
|
||||||
|
this.currentTimeout = null;
|
||||||
|
this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public resume() {
|
public resume() {
|
||||||
@ -70,6 +73,14 @@ export class Timer {
|
|||||||
this.currentTimeout = setTimeout(() => {
|
this.currentTimeout = setTimeout(() => {
|
||||||
this.completedDeferred.resolve();
|
this.completedDeferred.resolve();
|
||||||
}, this.timeLeft);
|
}, this.timeLeft);
|
||||||
|
} else {
|
||||||
|
throw new Error('timer has NOT been started before. Please use .start() instead');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public reset() {
|
||||||
|
this.pause();
|
||||||
|
this.startedAt = null;
|
||||||
|
this.pausedAt = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,11 @@ export class TimeStamp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns a boolean for wether a timestamp is younger
|
||||||
|
* @param TimeStampArg
|
||||||
|
* @param tresholdTimeArg
|
||||||
|
*/
|
||||||
public isYoungerThanOtherTimeStamp(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {
|
public isYoungerThanOtherTimeStamp(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) {
|
||||||
if (this.milliSeconds > TimeStampArg.milliSeconds + tresholdTimeArg) {
|
if (this.milliSeconds > TimeStampArg.milliSeconds + tresholdTimeArg) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -5,5 +5,6 @@ export { smartpromise };
|
|||||||
|
|
||||||
// third parties
|
// third parties
|
||||||
import * as luxon from 'luxon';
|
import * as luxon from 'luxon';
|
||||||
|
import * as cron from 'cron';
|
||||||
|
|
||||||
export { luxon };
|
export { luxon, cron };
|
||||||
|
19
tslint.json
19
tslint.json
@ -1,6 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": [
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
"tslint:latest",
|
"rules": {
|
||||||
"tslint-config-prettier"
|
"semicolon": [true, "always"],
|
||||||
]
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"member-ordering": {
|
||||||
|
"options":{
|
||||||
|
"order": [
|
||||||
|
"static-method"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user