diff --git a/src/middleware/watchSyncFlags/index.ts b/src/middleware/watchSyncFlags/index.ts index 7ed5b05..b401ffb 100644 --- a/src/middleware/watchSyncFlags/index.ts +++ b/src/middleware/watchSyncFlags/index.ts @@ -18,7 +18,6 @@ const getDefaultFlags = memo(() => /** * Constructs a middleware that fills in brInfo and telemetry - * @param {Array} [inputFlags] */ export const watchSyncFlags = (inputFlags?: string[]): MiddlewareGetter => diff --git a/src/providers/firstPartyMethod/process/email.ts b/src/providers/firstPartyMethod/process/email.ts index 3f5a7ca..db342d5 100644 --- a/src/providers/firstPartyMethod/process/email.ts +++ b/src/providers/firstPartyMethod/process/email.ts @@ -103,8 +103,7 @@ const checkEmailLength = (email: string): string | undefined => { * Validates and normalizes an email. * For invalid input returns undefined. * - * @param {string} origEmail email - * @returns {string | undefined} + * @param origEmail email */ export const processEmail = (origEmail: string): string | undefined => { const email = trimText(origEmail).replace(/^\++/gm, '').toLowerCase(); diff --git a/src/providers/firstPartyMethod/process/phone.ts b/src/providers/firstPartyMethod/process/phone.ts index 0a2aa74..7e634f7 100644 --- a/src/providers/firstPartyMethod/process/phone.ts +++ b/src/providers/firstPartyMethod/process/phone.ts @@ -19,8 +19,7 @@ const hasLettersRegex = /[a-zа-яё,.]/gi; * For invalid input returns undefined. * * @param {Pick} ctx global object that provides isFinite and isNan functions. - * @param {string} origPhone - phone number - * @returns {string | undefined} + * @param origPhone - phone number */ export const processPhoneNumber = ( ctx: Window, diff --git a/src/storage/cookie/cookie.ts b/src/storage/cookie/cookie.ts index e0f1653..e6060da 100644 --- a/src/storage/cookie/cookie.ts +++ b/src/storage/cookie/cookie.ts @@ -46,13 +46,7 @@ export const getCookie: CookieGetter = (ctx: Window, name: string) => { const PORT_REGEXP = /:\d+$/; /** - * Ставим куки на домен - * @param ctx - * @param name - * @param val - * @param {number} [minutes] - * @param {string} [domain] - * @param {string} [path] + * Set cookie for a domain. */ export const setCookie = ( ctx: Window, @@ -89,13 +83,7 @@ export const setCookie = ( } } }; -/** - * - * @param {Object} ctx - * @param {string} name - * @param {string} [domain] - * @param {string} [path] - */ + function deleteCookie( ctx: Window, name: string, @@ -106,12 +94,6 @@ function deleteCookie( return setCookie(ctx, name, '', -100, domain, path, ignoreState); } -/** - * - * @param ctx - * @param {string} [domain] - * @param {string} [path] - */ export const checkCookie = (ctx: Window, domain?: string, path?: string) => { const checkName = ENABLED_COOKIE_KEY; setCookie(ctx, checkName, '1', 0, domain, path, true); diff --git a/src/utils/array/utils.ts b/src/utils/array/utils.ts index 716eb2e..5c7c96d 100644 --- a/src/utils/array/utils.ts +++ b/src/utils/array/utils.ts @@ -49,9 +49,6 @@ export const exclude = (from: T[] | readonly T[], what: T[]) => { /** * Checks length property of an array-like and returns a boolean. - * - * @param {T extends string | unknown[] } array - * @returns {boolean} */ export const isEmptyArray = ( array: T, @@ -71,6 +68,6 @@ export const last = (arrayOrString: ArrayLike): T | undefined => /** * Removes all elements from an array returning the deleted elements. * - * @returns — An array containing the elements that were deleted. + * @returns An array containing the elements that were deleted. */ export const clearArray = (array: T[]) => array.splice(0, array.length); diff --git a/src/utils/dom/element.ts b/src/utils/dom/element.ts index 220a6d0..947440b 100644 --- a/src/utils/dom/element.ts +++ b/src/utils/dom/element.ts @@ -79,13 +79,15 @@ export const getElementSize = (ctx: Window, element: HTMLElement) => { }; /** - * Возвращает позицию и размеры элемента. + * @param ctx window element + * @param el element to process * - * @param {HTMLElement} el - * - * @returns {Array} Массив вида [left, top, width, height]. + * @returns Position and size of an element. */ -export const getElementRegion = (ctx: Window, el: HTMLElement) => { +export const getElementRegion = ( + ctx: Window, + el: HTMLElement, +): [left: number, top: number, width: number, height: number] => { const { left, top } = getElementXY(ctx, el); const [width, height] = getElementSize(ctx, el); @@ -264,18 +266,17 @@ export const getElementsByClassName = ( }; /** - * Возвращает массив детей элемента, пропуская hidden элементы формы. + * @param ctx + * @param el + * @param nodeName An optional name of a node used for filtering the result * - * @param {HTMLElement} el - * @param {String} [nodeName] Если указан этот параметр, то выбираются только дети с таким nodeName. - * - * @returns {Array} + * @returns An array of element children except hidden form elements */ export const getElementChildren = ( ctx: Window, el?: HTMLElement | null, nodeName?: string, -) => { +): ChildNode[] => { const result = []; if (el) { diff --git a/src/utils/errorLogger/errorLogger.ts b/src/utils/errorLogger/errorLogger.ts index 4738630..181004e 100644 --- a/src/utils/errorLogger/errorLogger.ts +++ b/src/utils/errorLogger/errorLogger.ts @@ -5,12 +5,6 @@ import { handleError } from './handleError'; import { throwFunction } from './throwFunction'; import { executionTimeErrorDecorator } from './executionTimeErrorDecorator'; -/** - * @param {Object} ctx - * @param {string} scopeName - * @param {function(...?): ?} [fn] - * @param {function (...?): ?} [errorCatch] - */ export const errorLogger = ReturnType>( ctx: Window, scopeName: string, diff --git a/src/utils/number/random.ts b/src/utils/number/random.ts index 2bf14e7..8584734 100644 --- a/src/utils/number/random.ts +++ b/src/utils/number/random.ts @@ -4,10 +4,7 @@ export const RND_MAX = 1073741824; export const RND_MIN = 1; /** - * Генерим рандомное число - * @param {Object} ctx - * @param {number} [rawMin] - * @param {number} [rawMax] + * Generate a random number in a given frame */ export const getRandom = (ctx: Window, rawMin?: number, rawMax?: number) => { let min: number; diff --git a/src/utils/object/path.ts b/src/utils/object/path.ts index ad440c0..23d0336 100644 --- a/src/utils/object/path.ts +++ b/src/utils/object/path.ts @@ -59,9 +59,7 @@ export const len = ctxPath('length') as ( ) => T extends ArrayLike ? number : unknown; /** - * Получаем из списка [1,2,3] объект {1: {2: 3}} - * @param {string} path - * @param {Object} [origCtx] + * Transform a list `[1,2,3]` into an object `{1: {2: 3}}` */ export const genPath = (path: (string | number)[], origCtx: any = {}) => { if (!path || path.length < 1) { diff --git a/src/utils/telemetry/telemetry.ts b/src/utils/telemetry/telemetry.ts index 6302872..6fe3613 100644 --- a/src/utils/telemetry/telemetry.ts +++ b/src/utils/telemetry/telemetry.ts @@ -3,9 +3,6 @@ import { entries, isNull } from 'src/utils/object'; import { flagStorage, FlagStorage } from '../flagsStorage/flagsStorage'; import { arrayJoin, cMap } from '../array'; -/** - * @param {Object} [ctx] - */ export const telemetry = flagStorage((flags) => { const flagEntries = entries(flags); return arrayJoin(