Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import { IHandlersParams, ITemplateParams } from "./helpers/interfaces";

export class UpploadEffect {
type = "effect";
name: string = "";
name = "";
invisible = false;
noRecolor = false;
color = "#000";
icon: string = "";
icon = "";
template: (props: ITemplateParams) => string = () => "";
handlers: (params: IHandlersParams) => void = () => {};
/** Base handler method - meant to be overridden by subclasses */
handlers: (params: IHandlersParams) => void = () => {
// Intentionally empty - base implementation
};
supports: () => boolean = () => true;
}
2 changes: 1 addition & 1 deletion src/effects/flip/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class Flip extends UpploadEffect {
if (!img) return;
this.imageToCanvasBlob(params, x, y).then(blob => {
if (!blob) return;
let file = this.originalFile;
const file = this.originalFile;
file.blob = blob;
params.next(file);
const image = URL.createObjectURL(blob);
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ let i18n: any = {};
export const flattenObject = (ob: any) => {
const toReturn: any = {};
for (const i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if (!Object.prototype.hasOwnProperty.call(ob, i)) continue;
if (typeof ob[i] == "object") {
const flatObject = flattenObject(ob[i]);
for (const x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
if (!Object.prototype.hasOwnProperty.call(flatObject, x)) continue;
toReturn[i + "." + x] = flatObject[x];
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const minifyHTML = (html: string) =>
* @param decimals - The number of decimals to show
* @returns The formatted string
*/
export const formatBytes = (bytes: number, decimals: number = 2) => {
export const formatBytes = (bytes: number, decimals = 2) => {
if (bytes === 0) {
return "0 Bytes";
}
const base: number = 1024;
const base = 1024;
const dm: number = decimals < 0 ? 0 : decimals;
const sizes: string[] = [
"Bytes",
Expand Down
Loading