1 | import { WeekdayStr } from './weekday';
|
2 | export declare const isPresent: <T>(value?: T) => value is T;
|
3 | export declare const isNumber: (value: unknown) => value is number;
|
4 | export declare const isWeekdayStr: (value: unknown) => value is WeekdayStr;
|
5 | export declare const isArray: (arg: any) => arg is any[];
|
6 | /**
|
7 | * Simplified version of python's range()
|
8 | */
|
9 | export declare const range: (start: number, end?: number) => number[];
|
10 | export declare const clone: <T>(array: T[]) => T[];
|
11 | export declare const repeat: <T>(value: T | T[], times: number) => (T | T[])[];
|
12 | export declare const toArray: <T>(item: T | T[]) => T[];
|
13 | export declare function padStart(item: string | number, targetLength: number, padString?: string): string;
|
14 | /**
|
15 | * Python like split
|
16 | */
|
17 | export declare const split: (str: string, sep: string, num: number) => string[];
|
18 | /**
|
19 | * closure/goog/math/math.js:modulo
|
20 | * Copyright 2006 The Closure Library Authors.
|
21 | * The % operator in JavaScript returns the remainder of a / b, but differs from
|
22 | * some other languages in that the result will have the same sign as the
|
23 | * dividend. For example, -1 % 8 == -1, whereas in some other languages
|
24 | * (such as Python) the result would be 7. This function emulates the more
|
25 | * correct modulo behavior, which is useful for certain applications such as
|
26 | * calculating an offset index in a circular list.
|
27 | *
|
28 | * @param {number} a The dividend.
|
29 | * @param {number} b The divisor.
|
30 | * @return {number} a % b where the result is between 0 and b (either 0 <= x < b
|
31 | * or b < x <= 0, depending on the sign of b).
|
32 | */
|
33 | export declare const pymod: (a: number, b: number) => number;
|
34 | /**
|
35 | * @see: <http://docs.python.org/library/functions.html#divmod>
|
36 | */
|
37 | export declare const divmod: (a: number, b: number) => {
|
38 | div: number;
|
39 | mod: number;
|
40 | };
|
41 | export declare const empty: <T>(obj: T[]) => boolean;
|
42 | /**
|
43 | * Python-like boolean
|
44 | *
|
45 | * @return {Boolean} value of an object/primitive, taking into account
|
46 | * the fact that in Python an empty list's/tuple's
|
47 | * boolean value is False, whereas in JS it's true
|
48 | */
|
49 | export declare const notEmpty: <T>(obj: T[]) => obj is T[];
|
50 | /**
|
51 | * Return true if a value is in an array
|
52 | */
|
53 | export declare const includes: <T>(arr: T[], val: T) => boolean;
|
54 | //# sourceMappingURL=helpers.d.ts.map |
\ | No newline at end of file |