From 635df3f9e97dab70a6d0e9f6b05da959bba89d75 Mon Sep 17 00:00:00 2001 From: FlameWolf Date: Mon, 6 May 2024 23:26:18 +0530 Subject: [PATCH] Refactor code; update package version to `3.2.15` --- CallbackStorage.d.ts | 2 +- CallbackStorage.js | 6 +++--- DiscStorage.d.ts | 2 +- DiscStorage.js | 6 +++--- FieldParserWithSchema.d.ts | 2 +- FieldParserWithSchema.js | 6 +++--- package-lock.json | 4 ++-- package.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CallbackStorage.d.ts b/CallbackStorage.d.ts index 4449430..d6b7e5d 100644 --- a/CallbackStorage.d.ts +++ b/CallbackStorage.d.ts @@ -3,7 +3,7 @@ import { FileInfo } from "busboy"; import { FileHandler, StorageOption } from "./index"; export declare class CallbackStorage implements StorageOption { - #callback: FileHandler; + private callback: FileHandler; constructor(callback: FileHandler); process(name: string, stream: Readable, info: FileInfo): import("./index").File | Promise; } \ No newline at end of file diff --git a/CallbackStorage.js b/CallbackStorage.js index 97bb327..2f869c8 100644 --- a/CallbackStorage.js +++ b/CallbackStorage.js @@ -1,12 +1,12 @@ "use strict"; class CallbackStorage { - #callback; + callback; constructor(callback) { - this.#callback = callback; + this.callback = callback; } process(name, stream, info) { - return this.#callback(name, stream, info); + return this.callback(name, stream, info); } } diff --git a/DiscStorage.d.ts b/DiscStorage.d.ts index 49c4a0f..90ad958 100644 --- a/DiscStorage.d.ts +++ b/DiscStorage.d.ts @@ -3,7 +3,7 @@ import { Readable } from "stream"; import { FileInfo } from "busboy"; export declare class DiscStorage implements StorageOption { - #target: TargetType; + private target: TargetType; constructor(target: TargetType); process(name: string, stream: Readable, info: FileInfo): Promise; } \ No newline at end of file diff --git a/DiscStorage.js b/DiscStorage.js index d42d60e..fd16237 100644 --- a/DiscStorage.js +++ b/DiscStorage.js @@ -7,12 +7,12 @@ const os = require("os"); const fs = require("fs"); class DiscStorage { - #target; + target; constructor(target) { - this.#target = target; + this.target = target; } process(name, stream, info) { - const target = this.#target; + const target = this.target; const file = new FileInternal(name, info); const saveLocation = typeof target === "function" ? target(file) : target; const filePath = path.join(saveLocation?.directory || os.tmpdir(), saveLocation?.fileName || file.originalName); diff --git a/FieldParserWithSchema.d.ts b/FieldParserWithSchema.d.ts index e7491a2..2fa4a0f 100644 --- a/FieldParserWithSchema.d.ts +++ b/FieldParserWithSchema.d.ts @@ -1,7 +1,7 @@ import { Dictionary, FieldParser } from "./index"; export declare class FieldParserWithSchema implements FieldParser { - #props: Dictionary; + private props: Dictionary; constructor(props: Dictionary); parseField(name: string, value: any): any; } \ No newline at end of file diff --git a/FieldParserWithSchema.js b/FieldParserWithSchema.js index c88aa42..0f0c587 100644 --- a/FieldParserWithSchema.js +++ b/FieldParserWithSchema.js @@ -1,12 +1,12 @@ "use strict"; class FieldParserWithSchema { - #props; + props; constructor(props) { - this.#props = props; + this.props = props; } parseField(name, value) { - if (this.#props[name]?.type !== "string") { + if (this.props[name]?.type !== "string") { try { return JSON.parse(value); } catch { diff --git a/package-lock.json b/package-lock.json index 72fa16a..f473ae5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "formzilla", - "version": "3.2.14", + "version": "3.2.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "formzilla", - "version": "3.2.14", + "version": "3.2.15", "license": "ISC", "dependencies": { "busboy": "^1.6.0", diff --git a/package.json b/package.json index 119b6d8..b2e998a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formzilla", - "version": "3.2.14", + "version": "3.2.15", "description": "Fastify plugin for parsing multipart/form data", "main": "index.js", "scripts": {