mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-12 22:21:05 +00:00
Typescript-eslint 2 (#193)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user