5
6import type CrowdinApi from '@crowdin/crowdin-api-client'
7
8const getProjectId = (isDatabaseString: boolean = false) => 9 isDatabaseString ? projectId.dbContent : projectId.base
10
11export const createCommonFns = (client: CrowdinApi) => {
6 record: AttributeRecord,
7 t: TFunction,
8 locale: string,
9 isEditMode: boolean = false10): SrvFocusAttribReturn => {
11 const lng = locale
12 const { tsKey, icon, tsNs, supplementId: id, active } = record
16
17const AccessLink = ({ link, domainOnly, ...props }: AccessLinkProps) => {
18 if (!isExternal(link)) return null
19 let displayText: string = '' 20 const protocolStrip = /^https?:\/\//i
21 // eslint-disable-next-line no-useless-escape
22 const domainExtract = /https?:\/\/([^:\/\n?]+)/
Explicit types where they can be easily inferred may add unnecessary verbosity for variables or parameters initialized to a number, string, or boolean
const a: bigint = 10n;
const a: bigint = -10n;
const a: bigint = BigInt(10);
const a: bigint = -BigInt(10);
const a: boolean = false;
const a: boolean = true;
const a: boolean = Boolean(null);
const a: boolean = !0;
const a: number = -10;
const a: number = Number('1');
const a: number = +Number('1');
const a: number = -Number('1');
const a: null = null;
const a: RegExp = /a/;
const a: RegExp = RegExp('a');
const a: RegExp = new RegExp('a');
const a: string = 'str';
const a: string = String(1);
const a: symbol = Symbol('a');
const a: undefined = void someValue;
class Foo {
prop: number = 5;
}
function fn(a: number = 5, b: boolean = true) {}
const a = 10n;
const a = -10n;
const a = BigInt(10);
const a = -BigInt(10);
const a = false;
const a = true;
const a = Boolean(null);
const a = !0;
const a = 10;
const a = +10;
const a = -Number('1');
const a = null;
const a = /a/;
const a = RegExp('a');
const a = 'str';
const a = String(1);
const a = Symbol('a');
const a = void someValue;
class Foo {
prop = 5;
}
function fn(a = 5, b = true) {}
function fn(a: number, b: boolean, c: string) {}