fix(core): update
This commit is contained in:
parent
7a231b7686
commit
885b2432a8
9234
package-lock.json
generated
9234
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@ -9,23 +9,23 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest ./test/)",
|
||||
"build": "(tsbuild && tsbundle npm)"
|
||||
"build": "(tsbuild --web && tsbundle npm)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.11",
|
||||
"@gitzone/tsbundle": "^1.0.69",
|
||||
"@gitzone/tsrun": "^1.2.6",
|
||||
"@gitzone/tstest": "^1.0.24",
|
||||
"@pushrocks/tapbundle": "^3.0.9",
|
||||
"@types/node": "^14.0.5",
|
||||
"@gitzone/tsbundle": "^1.0.72",
|
||||
"@gitzone/tsrun": "^1.2.12",
|
||||
"@gitzone/tstest": "^1.0.41",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.0.22",
|
||||
"tslint": "^6.1.2",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartdelay": "^2.0.9",
|
||||
"@pushrocks/smartdelay": "^2.0.10",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"croner": "^1.1.23",
|
||||
"dayjs": "^1.8.27",
|
||||
"dayjs": "^1.8.29",
|
||||
"is-nan": "^1.3.0"
|
||||
},
|
||||
"files": [
|
||||
@ -39,5 +39,8 @@
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
}
|
||||
|
22
readme.md
22
readme.md
@ -8,13 +8,20 @@ handle time in smart ways
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smarttime/)
|
||||
|
||||
## Status for master
|
||||
[![pipeline status](https://gitlab.com/pushrocks/smarttime/badges/master/pipeline.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/@pushrocks/smarttime.svg)](https://www.npmjs.com/package/@pushrocks/smarttime)
|
||||
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smarttime/badge.svg)](https://snyk.io/test/npm/@pushrocks/smarttime)
|
||||
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smarttime/badges/master/pipeline.svg)](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smarttime/badges/master/coverage.svg)](https://lossless.cloud)
|
||||
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smarttime)](https://lossless.cloud)
|
||||
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smarttime)](https://lossless.cloud)
|
||||
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
|
||||
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smarttime)](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smarttime)](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smarttime)](https://lossless.cloud)
|
||||
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
|
||||
|
||||
## Usage
|
||||
|
||||
@ -44,7 +51,6 @@ import { ExtendedDate } from '@pushrocks/smarttime'
|
||||
const myDate: Date = ExtendedDate.fromEuropeanDate('8.6.2018')
|
||||
```
|
||||
|
||||
|
||||
## Contribution
|
||||
|
||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||
|
27
test/test.cronmanager.browser.ts
Normal file
27
test/test.cronmanager.browser.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('*/2 * * * * *', () => {
|
||||
if (counter === 10) {
|
||||
done.resolve();
|
||||
}
|
||||
counter++;
|
||||
console.log(`hey ${counter}`);
|
||||
});
|
||||
testCronManager.start();
|
||||
await done.promise;
|
||||
testCronManager.stop();
|
||||
});
|
||||
|
||||
tap.start();
|
@ -9,7 +9,7 @@ tap.test('should create a valid instance of cronmanager', async () => {
|
||||
expect(testCronManager).to.be.instanceOf(smarttime.CronManager);
|
||||
});
|
||||
|
||||
tap.test('should create a valid cronJon', async tools => {
|
||||
tap.test('should create a valid cronJon', async (tools) => {
|
||||
const done = tools.defer();
|
||||
let counter = 0;
|
||||
testCronManager.addCronjob('*/2 * * * * *', () => {
|
||||
|
@ -5,7 +5,7 @@ import * as smarttime from '../ts/index';
|
||||
// Test TimeStamp class
|
||||
let testTimeStamp: 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();
|
||||
await tools.delayFor(2);
|
||||
testTimeStamp2 = new smarttime.TimeStamp();
|
||||
@ -23,7 +23,7 @@ tap.test('should have valid linuxtime', async () => {
|
||||
let testHrtMeasurement: smarttime.HrtMeasurement;
|
||||
|
||||
// Test HrtMeasurement
|
||||
tap.test('should create valid HrtMeasurements', async tools => {
|
||||
tap.test('should create valid HrtMeasurements', async (tools) => {
|
||||
testHrtMeasurement = new smarttime.HrtMeasurement();
|
||||
testHrtMeasurement.start();
|
||||
await tools.delayFor(20);
|
||||
@ -41,7 +41,7 @@ tap.test('should combine units', async () => {
|
||||
weeks: 2,
|
||||
days: 2,
|
||||
hours: 2,
|
||||
minutes: 2
|
||||
minutes: 2,
|
||||
});
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log(computedTime);
|
||||
|
@ -98,7 +98,7 @@ export class ExtendedDate extends Date {
|
||||
'September',
|
||||
'October',
|
||||
'November',
|
||||
'December'
|
||||
'December',
|
||||
];
|
||||
const daysArray = [
|
||||
'Monday',
|
||||
@ -107,7 +107,7 @@ export class ExtendedDate extends Date {
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday',
|
||||
'Sunday'
|
||||
'Sunday',
|
||||
];
|
||||
return {
|
||||
year: this.getFullYear(),
|
||||
@ -118,7 +118,7 @@ export class ExtendedDate extends Date {
|
||||
day: this.getDate(),
|
||||
dayString: ('0' + this.getDate()).slice(-2),
|
||||
dayOfTheWeek: this.getDay(),
|
||||
dayOfTheWeekName: daysArray[this.getDay()]
|
||||
dayOfTheWeekName: daysArray[this.getDay()],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ export let units = {
|
||||
},
|
||||
minutes: (timesArg = 1) => {
|
||||
return timesArg * 60000;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export interface IUnitCombinationArg {
|
||||
@ -30,7 +30,7 @@ export interface IUnitCombinationArg {
|
||||
|
||||
export let getMilliSecondsFromUnits = (combinationArg: IUnitCombinationArg) => {
|
||||
let timeInMilliseconds = 0;
|
||||
let addMilliSeconds = milliSecondsArg => {
|
||||
let addMilliSeconds = (milliSecondsArg) => {
|
||||
timeInMilliseconds = timeInMilliseconds + milliSecondsArg;
|
||||
};
|
||||
if (combinationArg.years) {
|
||||
|
Loading…
Reference in New Issue
Block a user