diff --git a/coverage.svg b/coverage.svg index 62a1c3a916..a36ff4964c 100644 --- a/coverage.svg +++ b/coverage.svg @@ -1 +1 @@ -Coverage: 96.17%Coverage96.17% \ No newline at end of file +Coverage: 96.27%Coverage96.27% \ No newline at end of file diff --git a/deno/lib/ZodError.ts b/deno/lib/ZodError.ts index 213695a0e1..4589ad81d3 100644 --- a/deno/lib/ZodError.ts +++ b/deno/lib/ZodError.ts @@ -17,6 +17,7 @@ export const ZodIssueCode = util.arrayToEnum([ "too_big", "invalid_intersection_types", "not_multiple_of", + "invalid_file_type", ]); export type ZodIssueCode = keyof typeof ZodIssueCode; @@ -78,14 +79,14 @@ export interface ZodTooSmallIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_small; minimum: number; inclusive: boolean; - type: "array" | "string" | "number" | "set"; + type: "array" | "string" | "number" | "set" | "file"; } export interface ZodTooBigIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_big; maximum: number; inclusive: boolean; - type: "array" | "string" | "number" | "set"; + type: "array" | "string" | "number" | "set" | "file"; } export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { @@ -97,6 +98,12 @@ export interface ZodNotMultipleOfIssue extends ZodIssueBase { multipleOf: number; } +export interface ZodInvalidFileType extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_file_type; + expected: string[]; + received: string; +} + export interface ZodCustomIssue extends ZodIssueBase { code: typeof ZodIssueCode.custom; params?: { [k: string]: any }; @@ -118,6 +125,7 @@ export type ZodIssueOptionalMessage = | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue + | ZodInvalidFileType | ZodCustomIssue; export type ZodIssue = ZodIssueOptionalMessage & { message: string }; @@ -356,6 +364,11 @@ export const defaultErrorMap = ( case ZodIssueCode.not_multiple_of: message = `Number must be a multiple of ${issue.multipleOf}`; break; + case ZodIssueCode.invalid_file_type: + message = `The file type should be ${issue.expected.join( + ", " + )}. Received: ${issue.received}`; + break; default: message = _ctx.defaultError; util.assertNever(issue); diff --git a/deno/lib/__tests__/file.test.ts b/deno/lib/__tests__/file.test.ts new file mode 100644 index 0000000000..3e8fcc657a --- /dev/null +++ b/deno/lib/__tests__/file.test.ts @@ -0,0 +1,84 @@ +import { expect } from "https://deno.land/x/expect@v0.2.6/mod.ts"; +const test = Deno.test; + +import * as z from "../index.ts"; + +const file = z.file(); +const max = z.file().max(4); +const min = z.file().min(2); +const type = z.file().type("image/png"); +const multipleTypes = z.file().type(["image/png", "image/jpeg"]); + +test("passing validations", () => { + file.parse( + new File([], "file.png", { + type: "image/png", + }) + ); + max.parse( + new File([], "file.png", { + type: "image/png", + }) + ); + min.parse( + new File(["d", "b", "e", "z"], "file.png", { + type: "image/png", + }) + ); + type.parse( + new File(["m", "i"], "file.png", { + type: "image/png", + }) + ); + multipleTypes.parse( + new File([], "file.png", { + type: "image/png", + }) + ); +}); + +test("failing validations", () => { + expect(() => file.parse(null)).toThrow(); + expect(() => + max.parse( + new File(["z", "o", "d", "l", "i", "b"], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + max.parse( + new File(["z", "o", "d", "l", "i"], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + min.parse( + new File(["s"], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + min.parse( + new File([], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + type.parse( + new File([], "file.gif", { + type: "image/jpg", + }) + ) + ).toThrow(); + expect(() => + multipleTypes.parse( + new File([], "file.gif", { + type: "image/jpg", + }) + ) + ).toThrow(); +}); diff --git a/deno/lib/__tests__/firstparty.test.ts b/deno/lib/__tests__/firstparty.test.ts index 20302bb208..9a7b241db1 100644 --- a/deno/lib/__tests__/firstparty.test.ts +++ b/deno/lib/__tests__/firstparty.test.ts @@ -69,6 +69,8 @@ test("first party switch", () => { break; case z.ZodFirstPartyTypeKind.ZodPromise: break; + case z.ZodFirstPartyTypeKind.ZodFile: + break; default: util.assertNever(def); } diff --git a/deno/lib/helpers/parseUtil.ts b/deno/lib/helpers/parseUtil.ts index f4d2d02e5a..5b46a96538 100644 --- a/deno/lib/helpers/parseUtil.ts +++ b/deno/lib/helpers/parseUtil.ts @@ -28,6 +28,7 @@ export const ZodParsedType = util.arrayToEnum([ "never", "map", "set", + "file", ]); export type ZodParsedType = keyof typeof ZodParsedType; diff --git a/deno/lib/types.ts b/deno/lib/types.ts index 39759a8dd6..396e9d8a56 100644 --- a/deno/lib/types.ts +++ b/deno/lib/types.ts @@ -3488,6 +3488,141 @@ export class ZodNaN extends ZodType { }; } +///////////////////////////////////////// +///////////////////////////////////////// +////////// ////////// +////////// ZodFile ////////// +////////// ////////// +///////////////////////////////////////// +///////////////////////////////////////// + +// const FileConstructor = typeof File === "undefined" ? WebStdFile : File; + +type ZodFileCheck = + | { kind: "max"; value: number; message?: string } + | { kind: "min"; value: number; message?: string } + | { kind: "type"; value: string | string[]; message?: string }; + +export interface ZodFileDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodFile; + checks: ZodFileCheck[]; +} + +export class ZodFile extends ZodType< + FileConstructor, + ZodFileDef +> { + constructor(def: ZodFileDef, private readonly fileConstructor: Function) { + super(def); + } + + _parse(input: ParseInput): ParseReturnType { + const { status, ctx } = this._processInputParams(input); + + if (!(input.data instanceof this.fileConstructor)) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.file, + received: ctx.parsedType, + }); + + return INVALID; + } + + for (const check of this._def.checks) { + if (check.kind === "max") { + if (ctx.data.size > check.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "file", + inclusive: true, + message: check.message, + }); + status.dirty(); + } + } else if (check.kind === "min") { + if (ctx.data.size < check.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "file", + inclusive: true, + message: check.message, + }); + status.dirty(); + } + } else if (check.kind === "type") { + const types = Array.isArray(check.value) ? check.value : [check.value]; + + if (!types.includes(ctx.data.type)) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_file_type, + expected: types, + received: ctx.data.type, + message: check.message, + }); + status.dirty(); + } + } + } + + return { status: status.value, value: ctx.data }; + } + + _addCheck(check: ZodFileCheck) { + return new ZodFile( + { + ...this._def, + checks: [...this._def.checks, check], + }, + this.fileConstructor + ); + } + + max(maxSize: number, message?: errorUtil.ErrMessage) { + return this._addCheck({ + kind: "max", + value: maxSize, + ...errorUtil.errToObj(message), + }); + } + + min(minSize: number, message?: errorUtil.ErrMessage) { + return this._addCheck({ + kind: "min", + value: minSize, + ...errorUtil.errToObj(message), + }); + } + + type(accept: string | string[], message?: errorUtil.ErrMessage) { + return this._addCheck({ + kind: "type", + value: accept, + ...errorUtil.errToObj(message), + }); + } + + static create = ( + fileConstructor?: T + ): ZodFile => { + if (typeof File === "undefined" && !fileConstructor) { + throw new Error( + '"File not supported in current environment, you need to pass constructor to create()' + ); + } + + return new ZodFile( + { + typeName: ZodFirstPartyTypeKind.ZodFile, + checks: [], + }, + fileConstructor || File + ); + }; +} + export const custom = ( check?: (data: unknown) => any, params?: Parameters[1] @@ -3534,6 +3669,7 @@ export enum ZodFirstPartyTypeKind { ZodNullable = "ZodNullable", ZodDefault = "ZodDefault", ZodPromise = "ZodPromise", + ZodFile = "ZodFile", } export type ZodFirstPartySchemaTypes = | ZodString @@ -3565,7 +3701,8 @@ export type ZodFirstPartySchemaTypes = | ZodOptional | ZodNullable | ZodDefault - | ZodPromise; + | ZodPromise + | ZodFile; const instanceOfType = any>( cls: T, @@ -3605,6 +3742,7 @@ const promiseType = ZodPromise.create; const effectsType = ZodEffects.create; const optionalType = ZodOptional.create; const nullableType = ZodNullable.create; +const fileType = ZodFile.create; const preprocessType = ZodEffects.createWithPreprocess; const ostring = () => stringType().optional(); const onumber = () => numberType().optional(); @@ -3619,6 +3757,7 @@ export { discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, + fileType as file, functionType as function, instanceOfType as instanceof, intersectionType as intersection, diff --git a/package.json b/package.json index 51dff86eaa..39922de533 100644 --- a/package.json +++ b/package.json @@ -101,5 +101,8 @@ "yarn fix:lint", "yarn fix:format" ] + }, + "dependencies": { + "@web-std/file": "^3.0.2" } } diff --git a/src/ZodError.ts b/src/ZodError.ts index 97580e8a94..a2c0e2dc53 100644 --- a/src/ZodError.ts +++ b/src/ZodError.ts @@ -17,6 +17,7 @@ export const ZodIssueCode = util.arrayToEnum([ "too_big", "invalid_intersection_types", "not_multiple_of", + "invalid_file_type", ]); export type ZodIssueCode = keyof typeof ZodIssueCode; @@ -78,14 +79,14 @@ export interface ZodTooSmallIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_small; minimum: number; inclusive: boolean; - type: "array" | "string" | "number" | "set"; + type: "array" | "string" | "number" | "set" | "file"; } export interface ZodTooBigIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_big; maximum: number; inclusive: boolean; - type: "array" | "string" | "number" | "set"; + type: "array" | "string" | "number" | "set" | "file"; } export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { @@ -97,6 +98,12 @@ export interface ZodNotMultipleOfIssue extends ZodIssueBase { multipleOf: number; } +export interface ZodInvalidFileType extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_file_type; + expected: string[]; + received: string; +} + export interface ZodCustomIssue extends ZodIssueBase { code: typeof ZodIssueCode.custom; params?: { [k: string]: any }; @@ -118,6 +125,7 @@ export type ZodIssueOptionalMessage = | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue + | ZodInvalidFileType | ZodCustomIssue; export type ZodIssue = ZodIssueOptionalMessage & { message: string }; @@ -356,6 +364,11 @@ export const defaultErrorMap = ( case ZodIssueCode.not_multiple_of: message = `Number must be a multiple of ${issue.multipleOf}`; break; + case ZodIssueCode.invalid_file_type: + message = `The file type should be ${issue.expected.join( + ", " + )}. Received: ${issue.received}`; + break; default: message = _ctx.defaultError; util.assertNever(issue); diff --git a/src/__tests__/file.test.ts b/src/__tests__/file.test.ts new file mode 100644 index 0000000000..704ddb0386 --- /dev/null +++ b/src/__tests__/file.test.ts @@ -0,0 +1,83 @@ +import { test } from "@jest/globals"; + +import * as z from "../index"; + +const file = z.file(); +const max = z.file().max(4); +const min = z.file().min(2); +const type = z.file().type("image/png"); +const multipleTypes = z.file().type(["image/png", "image/jpeg"]); + +test("passing validations", () => { + file.parse( + new File([], "file.png", { + type: "image/png", + }) + ); + max.parse( + new File([], "file.png", { + type: "image/png", + }) + ); + min.parse( + new File(["d", "b", "e", "z"], "file.png", { + type: "image/png", + }) + ); + type.parse( + new File(["m", "i"], "file.png", { + type: "image/png", + }) + ); + multipleTypes.parse( + new File([], "file.png", { + type: "image/png", + }) + ); +}); + +test("failing validations", () => { + expect(() => file.parse(null)).toThrow(); + expect(() => + max.parse( + new File(["z", "o", "d", "l", "i", "b"], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + max.parse( + new File(["z", "o", "d", "l", "i"], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + min.parse( + new File(["s"], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + min.parse( + new File([], "file.png", { + type: "image/png", + }) + ) + ).toThrow(); + expect(() => + type.parse( + new File([], "file.gif", { + type: "image/jpg", + }) + ) + ).toThrow(); + expect(() => + multipleTypes.parse( + new File([], "file.gif", { + type: "image/jpg", + }) + ) + ).toThrow(); +}); diff --git a/src/__tests__/firstparty.test.ts b/src/__tests__/firstparty.test.ts index 40984f8762..a81cf82a2c 100644 --- a/src/__tests__/firstparty.test.ts +++ b/src/__tests__/firstparty.test.ts @@ -68,6 +68,8 @@ test("first party switch", () => { break; case z.ZodFirstPartyTypeKind.ZodPromise: break; + case z.ZodFirstPartyTypeKind.ZodFile: + break; default: util.assertNever(def); } diff --git a/src/helpers/parseUtil.ts b/src/helpers/parseUtil.ts index c8bc7428a1..f3b2e10a77 100644 --- a/src/helpers/parseUtil.ts +++ b/src/helpers/parseUtil.ts @@ -28,6 +28,7 @@ export const ZodParsedType = util.arrayToEnum([ "never", "map", "set", + "file", ]); export type ZodParsedType = keyof typeof ZodParsedType; diff --git a/src/types.ts b/src/types.ts index 4f3e211650..39ad08f858 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3488,6 +3488,141 @@ export class ZodNaN extends ZodType { }; } +///////////////////////////////////////// +///////////////////////////////////////// +////////// ////////// +////////// ZodFile ////////// +////////// ////////// +///////////////////////////////////////// +///////////////////////////////////////// + +// const FileConstructor = typeof File === "undefined" ? WebStdFile : File; + +type ZodFileCheck = + | { kind: "max"; value: number; message?: string } + | { kind: "min"; value: number; message?: string } + | { kind: "type"; value: string | string[]; message?: string }; + +export interface ZodFileDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodFile; + checks: ZodFileCheck[]; +} + +export class ZodFile extends ZodType< + FileConstructor, + ZodFileDef +> { + constructor(def: ZodFileDef, private readonly fileConstructor: Function) { + super(def); + } + + _parse(input: ParseInput): ParseReturnType { + const { status, ctx } = this._processInputParams(input); + + if (!(input.data instanceof this.fileConstructor)) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.file, + received: ctx.parsedType, + }); + + return INVALID; + } + + for (const check of this._def.checks) { + if (check.kind === "max") { + if (ctx.data.size > check.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "file", + inclusive: true, + message: check.message, + }); + status.dirty(); + } + } else if (check.kind === "min") { + if (ctx.data.size < check.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "file", + inclusive: true, + message: check.message, + }); + status.dirty(); + } + } else if (check.kind === "type") { + const types = Array.isArray(check.value) ? check.value : [check.value]; + + if (!types.includes(ctx.data.type)) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_file_type, + expected: types, + received: ctx.data.type, + message: check.message, + }); + status.dirty(); + } + } + } + + return { status: status.value, value: ctx.data }; + } + + _addCheck(check: ZodFileCheck) { + return new ZodFile( + { + ...this._def, + checks: [...this._def.checks, check], + }, + this.fileConstructor + ); + } + + max(maxSize: number, message?: errorUtil.ErrMessage) { + return this._addCheck({ + kind: "max", + value: maxSize, + ...errorUtil.errToObj(message), + }); + } + + min(minSize: number, message?: errorUtil.ErrMessage) { + return this._addCheck({ + kind: "min", + value: minSize, + ...errorUtil.errToObj(message), + }); + } + + type(accept: string | string[], message?: errorUtil.ErrMessage) { + return this._addCheck({ + kind: "type", + value: accept, + ...errorUtil.errToObj(message), + }); + } + + static create = ( + fileConstructor?: T + ): ZodFile => { + if (typeof File === "undefined" && !fileConstructor) { + throw new Error( + '"File not supported in current environment, you need to pass constructor to create()' + ); + } + + return new ZodFile( + { + typeName: ZodFirstPartyTypeKind.ZodFile, + checks: [], + }, + fileConstructor || File + ); + }; +} + export const custom = ( check?: (data: unknown) => any, params?: Parameters[1] @@ -3534,6 +3669,7 @@ export enum ZodFirstPartyTypeKind { ZodNullable = "ZodNullable", ZodDefault = "ZodDefault", ZodPromise = "ZodPromise", + ZodFile = "ZodFile", } export type ZodFirstPartySchemaTypes = | ZodString @@ -3565,7 +3701,8 @@ export type ZodFirstPartySchemaTypes = | ZodOptional | ZodNullable | ZodDefault - | ZodPromise; + | ZodPromise + | ZodFile; const instanceOfType = any>( cls: T, @@ -3605,6 +3742,7 @@ const promiseType = ZodPromise.create; const effectsType = ZodEffects.create; const optionalType = ZodOptional.create; const nullableType = ZodNullable.create; +const fileType = ZodFile.create; const preprocessType = ZodEffects.createWithPreprocess; const ostring = () => stringType().optional(); const onumber = () => numberType().optional(); @@ -3619,6 +3757,7 @@ export { discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, + fileType as file, functionType as function, instanceOfType as instanceof, intersectionType as intersection, diff --git a/yarn.lock b/yarn.lock index ff59735882..5049f97bb2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -789,6 +789,33 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" +"@web-std/blob@^3.0.3": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@web-std/blob/-/blob-3.0.4.tgz#dd67a685547331915428d69e723c7da2015c3fc5" + integrity sha512-+dibyiw+uHYK4dX5cJ7HA+gtDAaUUe6JsOryp2ZpAC7h4ICsh49E34JwHoEKPlPvP0llCrNzz45vvD+xX5QDBg== + dependencies: + "@web-std/stream" "1.0.0" + web-encoding "1.1.5" + +"@web-std/file@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@web-std/file/-/file-3.0.2.tgz#b84cc9ed754608b18dcf78ac62c40dbcc6a94692" + integrity sha512-pIH0uuZsmY8YFvSHP1NsBIiMT/1ce0suPrX74fEeO3Wbr1+rW0fUGEe4d0R99iLwXtyCwyserqCFI4BJkJlkRA== + dependencies: + "@web-std/blob" "^3.0.3" + +"@web-std/stream@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@web-std/stream/-/stream-1.0.0.tgz#01066f40f536e4329d9b696dc29872f3a14b93c1" + integrity sha512-jyIbdVl+0ZJyKGTV0Ohb9E6UnxP+t7ZzX4Do3AHjZKxUXKMs9EmqnBDQgHF7bEw0EzbQygOjtt/7gvtmi//iCQ== + dependencies: + web-streams-polyfill "^3.1.1" + +"@zxing/text-encoding@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz#fb50ffabc6c7c66a0c96b4c03e3d9be74864b70b" + integrity sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA== + abab@^2.0.3, abab@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz" @@ -1015,6 +1042,11 @@ atob@^2.1.2: resolved "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + babel-jest@^26.6.3: version "26.6.3" resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz" @@ -1779,7 +1811,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.19.0, es-abstract@^1.19.1: +es-abstract@^1.18.5, es-abstract@^1.19.0, es-abstract@^1.19.1: version "1.19.1" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz" integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== @@ -2262,6 +2294,11 @@ for-in@^1.0.2: resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= + form-data@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" @@ -2639,7 +2676,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2: +inherits@2, inherits@^2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2696,6 +2733,14 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-arguments@^1.0.4: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" @@ -2818,6 +2863,13 @@ is-generator-fn@^2.0.0: resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== +is-generator-function@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + dependencies: + has-tostringtag "^1.0.0" + is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" @@ -2931,6 +2983,17 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" +is-typed-array@^1.1.3, is-typed-array@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.8.tgz#cbaa6585dc7db43318bc5b89523ea384a6f65e79" + integrity sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-abstract "^1.18.5" + foreach "^2.0.5" + has-tostringtag "^1.0.0" + is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" @@ -4553,6 +4616,11 @@ rxjs@^7.4.0: dependencies: tslib "~2.1.0" +safe-buffer@^5.1.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" @@ -5322,6 +5390,18 @@ use@^3.1.0: resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== +util@^0.12.3: + version "0.12.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" + integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== + dependencies: + inherits "^2.0.3" + is-arguments "^1.0.4" + is-generator-function "^1.0.7" + is-typed-array "^1.1.3" + safe-buffer "^5.1.2" + which-typed-array "^1.1.2" + uuid@^8.3.0: version "8.3.2" resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" @@ -5370,6 +5450,20 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.12" +web-encoding@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/web-encoding/-/web-encoding-1.1.5.tgz#fc810cf7667364a6335c939913f5051d3e0c4864" + integrity sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA== + dependencies: + util "^0.12.3" + optionalDependencies: + "@zxing/text-encoding" "0.9.0" + +web-streams-polyfill@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965" + integrity sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA== + webidl-conversions@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz" @@ -5422,6 +5516,18 @@ which-pm-runs@^1.0.0: resolved "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz" integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= +which-typed-array@^1.1.2: + version "1.1.7" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.7.tgz#2761799b9a22d4b8660b3c1b40abaa7739691793" + integrity sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-abstract "^1.18.5" + foreach "^2.0.5" + has-tostringtag "^1.0.0" + is-typed-array "^1.1.7" + which@^1.2.9: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz"