mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[deps] Autofill: Update prettier to v3.3.3 (#10228)
* [deps] Autofill: Update prettier to v3.3.3 * prettier formatting changes * fix SyntaxError for literal @ inline html --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
@@ -42,7 +42,7 @@ export class CryptoServiceRandomizer implements Randomizer {
|
||||
throw new Error("items must have at least one entry.");
|
||||
}
|
||||
|
||||
const shuffled = options?.copy ?? true ? [...items] : items;
|
||||
const shuffled = (options?.copy ?? true) ? [...items] : items;
|
||||
|
||||
for (let i = shuffled.length - 1; i > 0; i--) {
|
||||
const j = await this.uniform(0, i);
|
||||
|
||||
@@ -39,7 +39,7 @@ export class EmailCalculator {
|
||||
* @returns an email address or `null` if the calculation fails.
|
||||
*/
|
||||
concatenate(username: string, domain: string) {
|
||||
const emailDomain = domain?.startsWith("@") ? domain.substring(1, Infinity) : domain ?? "";
|
||||
const emailDomain = domain?.startsWith("@") ? domain.substring(1, Infinity) : (domain ?? "");
|
||||
if (emailDomain.length < 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export class EmailRandomizer {
|
||||
* is empty, resolves to null instead.
|
||||
*/
|
||||
async randomAsciiCatchall(domain: string, options?: { length?: number }) {
|
||||
const emailDomain = domain?.startsWith("@") ? domain.substring(1, Infinity) : domain ?? "";
|
||||
const emailDomain = domain?.startsWith("@") ? domain.substring(1, Infinity) : (domain ?? "");
|
||||
if (emailDomain.length < 1) {
|
||||
return null;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export class EmailRandomizer {
|
||||
domain: string,
|
||||
options?: { numberOfWords?: number; words?: Array<string> },
|
||||
) {
|
||||
const emailDomain = domain?.startsWith("@") ? domain.substring(1, Infinity) : domain ?? "";
|
||||
const emailDomain = domain?.startsWith("@") ? domain.substring(1, Infinity) : (domain ?? "");
|
||||
if (emailDomain.length < 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export class PassphraseGeneratorOptionsEvaluator
|
||||
const wordSeparator =
|
||||
options.wordSeparator === ""
|
||||
? ""
|
||||
: options.wordSeparator?.[0] ?? DefaultPassphraseGenerationOptions.wordSeparator;
|
||||
: (options.wordSeparator?.[0] ?? DefaultPassphraseGenerationOptions.wordSeparator);
|
||||
|
||||
return {
|
||||
...options,
|
||||
|
||||
@@ -32,11 +32,11 @@ export class EffUsernameGeneratorStrategy
|
||||
// algorithm
|
||||
async generate(options: EffUsernameGenerationOptions) {
|
||||
const casing =
|
||||
options.wordCapitalize ?? DefaultEffUsernameOptions.wordCapitalize
|
||||
(options.wordCapitalize ?? DefaultEffUsernameOptions.wordCapitalize)
|
||||
? "TitleCase"
|
||||
: "lowercase";
|
||||
const digits =
|
||||
options.wordIncludeNumber ?? DefaultEffUsernameOptions.wordIncludeNumber
|
||||
(options.wordIncludeNumber ?? DefaultEffUsernameOptions.wordIncludeNumber)
|
||||
? UsernameDigits.enabled
|
||||
: UsernameDigits.disabled;
|
||||
const word = await this.randomizer.randomWords({ numberOfWords: 1, casing, digits });
|
||||
|
||||
Reference in New Issue
Block a user