@naturalcycles/nodejs-lib 12.81.0 → 12.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  export interface IDebug {
2
2
  (namespace: string): IDebugger;
3
- coerce(val: any): any;
4
- disable(): string;
5
- enable(namespaces: string): void;
6
- enabled(namespaces: string): boolean;
7
- log(...args: any[]): any;
3
+ coerce: (val: any) => any;
4
+ disable: () => string;
5
+ enable: (namespaces: string) => void;
6
+ enabled: (namespaces: string) => boolean;
7
+ log: (...args: any[]) => any;
8
8
  names: RegExp[];
9
9
  skips: RegExp[];
10
10
  formatters: DebugFormatters;
@@ -16,8 +16,8 @@ export interface IDebugger {
16
16
  (...args: any[]): void;
17
17
  color: string;
18
18
  enabled: boolean;
19
- log(...args: any[]): any;
19
+ log: (...args: any[]) => any;
20
20
  namespace: string;
21
- destroy(): boolean;
21
+ destroy: () => boolean;
22
22
  }
23
23
  export declare const Debug: IDebug;
@@ -75,7 +75,7 @@ export interface TransformLogProgressOptions<IN = any> extends TransformOptions
75
75
  *
76
76
  * chunk is undefined for "final" stats, otherwise is defined.
77
77
  */
78
- extra?(chunk: IN | undefined, index: number): AnyObject;
78
+ extra?: (chunk: IN | undefined, index: number) => AnyObject;
79
79
  /**
80
80
  * If specified - will multiply the counter by this number.
81
81
  * Useful e.g when using `transformBuffer({ batchSize: 500 })`, so
@@ -29,7 +29,7 @@ export interface TransformMapOptions<IN = any, OUT = IN> {
29
29
  * If defined - will be called on every error happening in the stream.
30
30
  * Called BEFORE observable will emit error (unless skipErrors is set to true).
31
31
  */
32
- onError?(err: Error, input: IN): any;
32
+ onError?: (err: Error, input: IN) => any;
33
33
  /**
34
34
  * Progress metric
35
35
  *
@@ -27,7 +27,7 @@ export interface TransformMapSyncOptions<IN = any, OUT = IN> {
27
27
  * If defined - will be called on every error happening in the stream.
28
28
  * Called BEFORE observable will emit error (unless skipErrors is set to true).
29
29
  */
30
- onError?(err: Error, input: IN): any;
30
+ onError?: (err: Error, input: IN) => any;
31
31
  /**
32
32
  * Progress metric
33
33
  *
@@ -2,8 +2,8 @@ import * as JoiLib from 'joi';
2
2
  import { ExtendedNumberSchema } from './number.extensions';
3
3
  import { ExtendedStringSchema } from './string.extensions';
4
4
  export interface ExtendedJoi extends JoiLib.Root {
5
- string(): ExtendedStringSchema;
6
- number(): ExtendedNumberSchema;
5
+ string: () => ExtendedStringSchema;
6
+ number: () => ExtendedNumberSchema;
7
7
  }
8
8
  /**
9
9
  * This is the only right place to import Joi from
@@ -2,6 +2,6 @@ import * as Joi from 'joi';
2
2
  import { Extension, NumberSchema } from 'joi';
3
3
  import { AnySchemaTyped } from './joi.model';
4
4
  export interface ExtendedNumberSchema extends NumberSchema, AnySchemaTyped<number> {
5
- dividable(q: number): this;
5
+ dividable: (q: number) => this;
6
6
  }
7
7
  export declare function numberExtensions(joi: typeof Joi): Extension;
@@ -2,7 +2,7 @@ import { Extension, StringSchema } from 'joi';
2
2
  import * as Joi from 'joi';
3
3
  import { AnySchemaTyped } from './joi.model';
4
4
  export interface ExtendedStringSchema extends StringSchema, AnySchemaTyped<string> {
5
- dateString(min?: string, max?: string): this;
5
+ dateString: (min?: string, max?: string) => this;
6
6
  }
7
7
  export interface JoiDateStringOptions {
8
8
  min?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
- "version": "12.81.0",
3
+ "version": "12.81.1",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "docs-serve": "vuepress dev docs",
package/src/log/debug.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  // Types based on @types/debug
2
2
  export interface IDebug {
3
3
  (namespace: string): IDebugger
4
- coerce(val: any): any
5
- disable(): string
6
- enable(namespaces: string): void
7
- enabled(namespaces: string): boolean
8
- log(...args: any[]): any
4
+ coerce: (val: any) => any
5
+ disable: () => string
6
+ enable: (namespaces: string) => void
7
+ enabled: (namespaces: string) => boolean
8
+ log: (...args: any[]) => any
9
9
 
10
10
  names: RegExp[]
11
11
  skips: RegExp[]
@@ -23,9 +23,9 @@ export interface IDebugger {
23
23
 
24
24
  color: string
25
25
  enabled: boolean
26
- log(...args: any[]): any
26
+ log: (...args: any[]) => any
27
27
  namespace: string
28
- destroy(): boolean
28
+ destroy: () => boolean
29
29
  // extend: (namespace: string, delimiter?: string) => IDebugger
30
30
  }
31
31
 
@@ -100,7 +100,7 @@ export interface TransformLogProgressOptions<IN = any> extends TransformOptions
100
100
  *
101
101
  * chunk is undefined for "final" stats, otherwise is defined.
102
102
  */
103
- extra?(chunk: IN | undefined, index: number): AnyObject
103
+ extra?: (chunk: IN | undefined, index: number) => AnyObject
104
104
 
105
105
  /**
106
106
  * If specified - will multiply the counter by this number.
@@ -48,7 +48,7 @@ export interface TransformMapOptions<IN = any, OUT = IN> {
48
48
  * If defined - will be called on every error happening in the stream.
49
49
  * Called BEFORE observable will emit error (unless skipErrors is set to true).
50
50
  */
51
- onError?(err: Error, input: IN): any
51
+ onError?: (err: Error, input: IN) => any
52
52
 
53
53
  /**
54
54
  * Progress metric
@@ -43,7 +43,7 @@ export interface TransformMapSyncOptions<IN = any, OUT = IN> {
43
43
  * If defined - will be called on every error happening in the stream.
44
44
  * Called BEFORE observable will emit error (unless skipErrors is set to true).
45
45
  */
46
- onError?(err: Error, input: IN): any
46
+ onError?: (err: Error, input: IN) => any
47
47
 
48
48
  /**
49
49
  * Progress metric
@@ -5,9 +5,9 @@ import { ExtendedStringSchema, stringExtensions } from './string.extensions'
5
5
 
6
6
  export interface ExtendedJoi extends JoiLib.Root {
7
7
  // eslint-disable-next-line id-blacklist
8
- string(): ExtendedStringSchema
8
+ string: () => ExtendedStringSchema
9
9
  // eslint-disable-next-line id-blacklist
10
- number(): ExtendedNumberSchema
10
+ number: () => ExtendedNumberSchema
11
11
  }
12
12
 
13
13
  /**
@@ -3,7 +3,7 @@ import { Extension, NumberSchema } from 'joi'
3
3
  import { AnySchemaTyped } from './joi.model'
4
4
 
5
5
  export interface ExtendedNumberSchema extends NumberSchema, AnySchemaTyped<number> {
6
- dividable(q: number): this
6
+ dividable: (q: number) => this
7
7
  }
8
8
 
9
9
  export function numberExtensions(joi: typeof Joi): Extension {
@@ -4,7 +4,7 @@ import * as Joi from 'joi'
4
4
  import { AnySchemaTyped } from './joi.model'
5
5
 
6
6
  export interface ExtendedStringSchema extends StringSchema, AnySchemaTyped<string> {
7
- dateString(min?: string, max?: string): this
7
+ dateString: (min?: string, max?: string) => this
8
8
  }
9
9
 
10
10
  export interface JoiDateStringOptions {