Typescript-eslint 2 (#193)

This commit is contained in:
Jaco Greeff
2019-08-31 09:25:48 +02:00
committed by GitHub
parent 52cc245c37
commit 876410cc8e
20 changed files with 137 additions and 75 deletions
@@ -17,7 +17,7 @@ export default function colors (seeder: Seeder): ColorGen {
Color(hex).rotate(amount)
);
return (alpha: number = 1): string => {
return (alpha = 1): string => {
const index = Math.floor(all.length * seeder());
return all.splice(index, 1)[0]
@@ -3,7 +3,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
export default function container (diameter: number, background: string = 'white', className: string = '', _style: { [index: string]: string } = {}): HTMLElement {
export default function container (diameter: number, background = 'white', className = '', _style: { [index: string]: string } = {}): HTMLElement {
const element = document.createElement('div');
const style = Object.assign({
background,
+1 -1
View File
@@ -24,7 +24,7 @@ function generateIcon (seed: string = encodeAddress(randomAsU8a(32))): void {
console.log(`Icon generated in ${(Date.now() - start)}ms`);
}
function generateIcons (count: number = 512): void {
function generateIcons (count = 512): void {
generateIcon(encodeAddress(new Uint8Array(32)));
for (let index = 1; index < count; index++) {
@@ -10,7 +10,7 @@ import newShape from './shape/circle';
import newElement from './svg/element';
import { SHAPE_COUNT } from './defaults';
export default function identicon (seed: string | Uint8Array, diameter: number = 256, className: string = '', style?: { [index: string]: string }): HTMLElement {
export default function identicon (seed: string | Uint8Array, diameter = 256, className = '', style?: { [index: string]: string }): HTMLElement {
const seeder = newSeeder(seed);
const colorGen = colors(seeder);
const outer = newContainer(diameter, 'white', className, style);
@@ -5,7 +5,7 @@
import createSvg from './svg';
export default function element (size: number, type: string = 'svg', x: number = 0, y: number = 0): Element {
export default function element (size: number, type = 'svg', x = 0, y = 0): Element {
const elem = createSvg(type);
elem.setAttributeNS('', 'x', `${x}`);
+1 -1
View File
@@ -134,7 +134,7 @@ function getColors (address: string): string[] {
/**
* @description Generate a array of the circles that make up an indenticon
*/
export default function generate (address: string, isSixPoint: boolean = false): Circle[] {
export default function generate (address: string, isSixPoint = false): Circle[] {
const colors = getColors(address);
return [OUTER_CIRCLE].concat(