Skip to content

Commit

Permalink
Remove types from JSDoc
Browse files Browse the repository at this point in the history
Removed all unnecessary labels and typings in JSDoc comments.
commit_hash:3ed188e82951be2865f1f4371281b580b7dffabe
  • Loading branch information
sabio committed Oct 11, 2024
1 parent 2442724 commit 3536d51
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 56 deletions.
1 change: 0 additions & 1 deletion src/middleware/watchSyncFlags/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const getDefaultFlags = memo(() =>

/**
* Constructs a middleware that fills in brInfo and telemetry
* @param {Array<string>} [inputFlags]
*/
export const watchSyncFlags =
(inputFlags?: string[]): MiddlewareGetter =>
Expand Down
3 changes: 1 addition & 2 deletions src/providers/firstPartyMethod/process/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions src/providers/firstPartyMethod/process/phone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const hasLettersRegex = /[a-zа-яё,.]/gi;
* For invalid input returns undefined.
*
* @param {Pick<Window, 'isFinite' | 'isNaN'>} 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,
Expand Down
22 changes: 2 additions & 20 deletions src/storage/cookie/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/utils/array/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ export const exclude = <T>(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 = <T extends string | unknown[] | { length: number }>(
array: T,
Expand All @@ -71,6 +68,6 @@ export const last = <T>(arrayOrString: ArrayLike<T>): 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 = <T>(array: T[]) => array.splice(0, array.length);
23 changes: 12 additions & 11 deletions src/utils/dom/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 0 additions & 6 deletions src/utils/errorLogger/errorLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <FN extends (...args: any) => ReturnType<FN>>(
ctx: Window,
scopeName: string,
Expand Down
5 changes: 1 addition & 4 deletions src/utils/number/random.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions src/utils/object/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export const len = ctxPath('length') as <T>(
) => T extends ArrayLike<unknown> ? 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) {
Expand Down
3 changes: 0 additions & 3 deletions src/utils/telemetry/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3536d51

Please sign in to comment.