Skip to content

Commit e059a85

Browse files
committed
Fix formatting issues
1 parent 6522bfb commit e059a85

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"deno.enable": true
2+
"deno.enable": true,
3+
"deno.lint": true,
4+
"editor.formatOnSave": true,
5+
"editor.defaultFormatter": "denoland.vscode-deno"
36
}

packages/formdata/mod.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function isObject(input: unknown): input is { [key: string]: unknown } {
2020
* @returns {FormData} - A `FormData` instance with the serialized data.
2121
*/
2222
export function encode<T extends { [key: string]: unknown }>(
23-
data: T
23+
data: T,
2424
): FormData {
2525
if (!isObject(data)) {
2626
throw new Error("The provided data must be a plain object.");
@@ -116,7 +116,7 @@ export type DecodeArray = DecodeValue[];
116116
*/
117117
export function decode(
118118
formData: FormData,
119-
options: { emptyString?: "set null" | "set undefined" | "preserve" } = {}
119+
options: { emptyString?: "set null" | "set undefined" | "preserve" } = {},
120120
): DecodeObject {
121121
const { emptyString = "preserve" } = options; // Default behavior for empty strings.
122122
const result = Object.create(null) as DecodeObject; // Root object for decoding.
@@ -131,7 +131,7 @@ export function decode(
131131
function setValue(
132132
target: Record<string, unknown>,
133133
keys: readonly string[],
134-
value: FormDataEntryValue
134+
value: FormDataEntryValue,
135135
): void {
136136
const len = keys.length;
137137
let current = target; // Pointer to the current level in the nested object.

packages/schema/mod.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class SchemaError extends Error {
8080
* @returns A new schema instance.
8181
*/
8282
function createSchema<TOutput = unknown, TInput = unknown>(
83-
safeParse: (input: TInput) => Result<TOutput>
83+
safeParse: (input: TInput) => Result<TOutput>,
8484
): Schema<TOutput, TInput> {
8585
/**
8686
* Parses the input data and returns the validated output.
@@ -115,7 +115,7 @@ function createSchema<TOutput = unknown, TInput = unknown>(
115115
*/
116116
function prependKeyToIssues(
117117
key: PropertyKey,
118-
issues: readonly Issue[]
118+
issues: readonly Issue[],
119119
): Issue[] {
120120
return issues.map((issue) => ({
121121
...issue,
@@ -168,7 +168,7 @@ export function boolean(message = "Expected boolean"): Schema<boolean> {
168168
*/
169169
export function array<T extends Schema>(
170170
schema: T,
171-
message = "Expected array"
171+
message = "Expected array",
172172
): Schema<InferOutput<T>[]> {
173173
return createSchema<InferOutput<T>[]>((input) => {
174174
if (!Array.isArray(input)) return { issues: [{ message }] };
@@ -218,7 +218,7 @@ export interface ObjectSchema<TOutput extends RawShape, TInput = unknown>
218218
*/
219219
export function object<T extends RawShape>(
220220
shape: ObjectShape<T>,
221-
message = "Expected object"
221+
message = "Expected object",
222222
): ObjectSchema<T> {
223223
return {
224224
shape,
@@ -244,7 +244,7 @@ export function object<T extends RawShape>(
244244
* @returns A schema that validates inputs that can be `null`, `undefined`, or match the provided schema.
245245
*/
246246
export function maybe<T extends Schema>(
247-
schema: T
247+
schema: T,
248248
): Schema<InferOutput<T> | undefined> {
249249
return createSchema<InferOutput<T> | undefined>((value) => {
250250
if (null === value || undefined === value) return { value: undefined };
@@ -261,7 +261,7 @@ export function maybe<T extends Schema>(
261261
*/
262262
export function defaulted<T extends Schema>(
263263
schema: T,
264-
defaultValue: InferOutput<T>
264+
defaultValue: InferOutput<T>,
265265
): Schema<InferOutput<T>> {
266266
return createSchema<InferOutput<T>>((value) => {
267267
if (null === value || undefined === value) return { value: defaultValue };

0 commit comments

Comments
 (0)