Skip to content

Commit 42373e7

Browse files
committed
all: fix eslint
1 parent 615e53b commit 42373e7

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

src/BatchEventAttributes.ts

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
import { Log } from './helpers/Logger';
22
import { isBoolean, isNumber, isObject, isObjectArray, isString, isStringArray } from './helpers/TypeHelpers';
3-
4-
export const Consts = {
5-
AttributeKeyRegexp: /^[a-zA-Z0-9_]{1,30}$/,
6-
EventDataMaxTags: 10,
7-
EventDataMaxValues: 15,
8-
EventDataStringMaxLength: 64,
9-
EventDataURLMaxLength: 2048,
10-
};
11-
123
export enum TypedEventAttributeType {
134
String = 'string',
145
Boolean = 'boolean',
@@ -21,7 +12,7 @@ export enum TypedEventAttributeType {
2112
Object = 'object',
2213
}
2314

24-
export type TypedEventAttributeValue = string | boolean | number | TypedEventAttributes | Array<string | TypedEventAttributes>;
15+
export type TypedEventAttributeValue = string | boolean | number | string[] | TypedEventAttributes | TypedEventAttributes[];
2516

2617
export type TypedEventAttributes = { [key: string]: ITypedEventAttribute };
2718

@@ -64,7 +55,7 @@ export class BatchEventAttributes {
6455

6556
public put(
6657
key: string,
67-
value: string | number | boolean | Array<string | BatchEventAttributes> | BatchEventAttributes
58+
value: string | number | boolean | string[] | BatchEventAttributes | BatchEventAttributes[]
6859
): BatchEventAttributes {
6960
key = this.prepareAttributeKey(key);
7061

src/BatchProfileAttributeEditor.ts

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ interface IUserSettingsRemoveFromArrayAction {
6464
value: string | string[];
6565
}
6666

67-
6867
type IUserSettingsAction =
6968
| IUserSettingsSetAttributeAction
7069
| IUserSettingsRemoveAttributeAction

src/helpers/TypeHelpers.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ export const isObject = (value: unknown): value is BatchEventAttributes => {
1616
return value instanceof BatchEventAttributes;
1717
};
1818

19-
export function isArray(value: unknown): value is Array<unknown> {
19+
export function isArray(value: unknown): value is unknown[] {
2020
return Array.isArray(value);
2121
}
2222

23-
export function isStringArray(value: unknown): value is Array<string> {
23+
export function isStringArray(value: unknown): value is string[] {
2424
return isArray(value) && value.every(it => isString(it));
2525
}
2626

27-
export function isObjectArray(value: unknown): value is Array<BatchEventAttributes> {
27+
export function isObjectArray(value: unknown): value is BatchEventAttributes[] {
2828
return isArray(value) && value.every(it => isObject(it));
2929
}

0 commit comments

Comments
 (0)