Package Exports
- @kovalenko/is-cron
- @kovalenko/is-cron/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@kovalenko/is-cron) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
IsCron
Typescript property decorator for the crontab config validation
Installation
npm install @kovalenko/is-cronUsage
function IsCron(): PropertyDecorator;
function IsCron(options: InputOptions): PropertyDecorator;
function IsCron(options: ValidationOptions): PropertyDecorator;
function IsCron(cronOptions: InputOptions, options: ValidationOptions): PropertyDecorator;Basic
import {IsCron} from '@kovalenko/is-cron';
export class Foo {
@IsCron()
bar: string;
}
With InputOptions
import {IsCron} from '@kovalenko/is-cron';
import {InputOptions} from 'cron-validate/lib/types';
const cronOptions: InputOptions = {
override: {
useSeconds: true,
},
};
export class Foo {
@IsCron(cronOptions)
baz: string[];
}
With ValidationOptions
import {IsCron} from '@kovalenko/is-cron';
export class Foo {
@IsCron({each: true})
baz: string[];
}
With InputOptions and ValidationOptions
import {IsCron} from '@kovalenko/is-cron';
import {InputOptions} from 'cron-validate/lib/types';
const cronOptions: InputOptions = {
override: {
useSeconds: true,
},
};
export class Foo {
@IsCron(cronOptions, {each: true})
baz: string[];
}