Skip to content

Commit

Permalink
refactor(register): public fx before private
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoon committed Jan 2, 2018
1 parent 8d3df1e commit c453a54
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/register/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,10 @@ export class Register {
);
}

private static isBlackHoleRegister(registerName: string): boolean {
return registerName === '_';
}

private static isClipboardRegister(registerName: string): boolean {
const register = Register.registers[registerName];
return register && register.isClipboardRegister;
}

public static isValidRegisterForMacro(register: string): boolean {
return /^[a-zA-Z0-9]+$/.test(register);
}

private static isValidLowercaseRegister(register: string): boolean {
return /^[a-z]+$/.test(register);
}

private static isValidUppercaseRegister(register: string): boolean {
return /^[A-Z]+$/.test(register);
}

/**
* Puts content in a register. If none is specified, uses the default
* register ".
Expand Down Expand Up @@ -117,6 +100,23 @@ export class Register {
}
}

private static isBlackHoleRegister(registerName: string): boolean {
return registerName === '_';
}

private static isClipboardRegister(registerName: string): boolean {
const register = Register.registers[registerName];
return register && register.isClipboardRegister;
}

private static isValidLowercaseRegister(register: string): boolean {
return /^[a-z]+$/.test(register);
}

private static isValidUppercaseRegister(register: string): boolean {
return /^[A-Z]+$/.test(register);
}

/**
* Puts the content at the specified index of the multicursor Register.
*
Expand Down

0 comments on commit c453a54

Please sign in to comment.