From 8eb5a472f25483279b9fea92a8e42bc596e1bd6e Mon Sep 17 00:00:00 2001 From: Willem Veelenturf Date: Thu, 5 Nov 2020 07:59:39 +0100 Subject: [PATCH] Denoify and refactor tests --- .github/workflows/ci.yml | 22 + coverage.svg | 2 +- deno_lib/LICENSE | 21 + deno_lib/PseudoPromise.ts | 280 ++ deno_lib/README.md | 1800 ++++++++ deno_lib/ZodError.ts | 205 + deno_lib/__tests__/all-errors.test.ts | 25 + deno_lib/__tests__/anyunknown.test.ts | 30 + deno_lib/__tests__/array.test.ts | 62 + deno_lib/__tests__/async-parsing.test.ts | 440 ++ deno_lib/__tests__/async-refinements.test.ts | 44 + deno_lib/__tests__/base.test.ts | 18 + deno_lib/__tests__/codegen.test.ts | 9 + deno_lib/__tests__/complex.test.ts | 51 + deno_lib/__tests__/deepmasking.test.ts | 184 + deno_lib/__tests__/enum.test.ts | 21 + deno_lib/__tests__/error.test.ts | 189 + deno_lib/__tests__/function.test.ts | 140 + deno_lib/__tests__/instanceof.test.ts | 25 + deno_lib/__tests__/intersection.test.ts | 22 + deno_lib/__tests__/map.tests.ts | 64 + deno_lib/__tests__/masking.test.ts | 20 + deno_lib/__tests__/mocker.test.ts | 17 + deno_lib/__tests__/nativeEnum.test.ts | 86 + deno_lib/__tests__/number.test.ts | 24 + .../__tests__/object-augmentation.test.ts | 27 + deno_lib/__tests__/object.test.ts | 268 ++ deno_lib/__tests__/optional.test.ts | 53 + deno_lib/__tests__/parser.test.ts | 45 + deno_lib/__tests__/partials.test.ts | 74 + deno_lib/__tests__/pickomit.test.ts | 81 + deno_lib/__tests__/primitive.test.ts | 409 ++ deno_lib/__tests__/promise.test.ts | 80 + deno_lib/__tests__/pseudopromise.test.ts | 66 + deno_lib/__tests__/record.test.ts | 51 + deno_lib/__tests__/recursive.test.ts | 199 + deno_lib/__tests__/refine.test.ts | 89 + deno_lib/__tests__/safeparse.test.ts | 25 + deno_lib/__tests__/string.test.ts | 112 + deno_lib/__tests__/transformer.test.ts | 122 + deno_lib/__tests__/tuple.test.ts | 80 + deno_lib/__tests__/validations.test.ts | 137 + deno_lib/__tests__/void.test.ts | 14 + deno_lib/codegen.ts | 178 + deno_lib/crazySchema.ts | 56 + deno_lib/defaultErrorMap.ts | 117 + deno_lib/helpers/Mocker.ts | 51 + deno_lib/helpers/errorUtil.ts | 5 + deno_lib/helpers/maskUtil.ts | 72 + deno_lib/helpers/objectUtil.ts | 130 + deno_lib/helpers/partialUtil.ts | 36 + deno_lib/helpers/primitive.ts | 3 + deno_lib/helpers/util.ts | 60 + deno_lib/index.ts | 202 + deno_lib/isScalar.ts | 100 + deno_lib/mod.ts | 1 + deno_lib/parser.ts | 1207 +++++ deno_lib/playground.ts | 0 deno_lib/switcher.ts | 64 + deno_lib/types/any.ts | 20 + deno_lib/types/array.ts | 108 + deno_lib/types/base.ts | 364 ++ deno_lib/types/bigint.ts | 22 + deno_lib/types/boolean.ts | 21 + deno_lib/types/date.ts | 21 + deno_lib/types/enum.ts | 67 + deno_lib/types/function.ts | 90 + deno_lib/types/intersection.ts | 42 + deno_lib/types/lazy.ts | 35 + deno_lib/types/literal.ts | 27 + deno_lib/types/map.ts | 41 + deno_lib/types/nativeEnum.ts | 22 + deno_lib/types/never.ts | 15 + deno_lib/types/null.ts | 20 + deno_lib/types/nullable.ts | 39 + deno_lib/types/number.ts | 85 + deno_lib/types/object.ts | 406 ++ deno_lib/types/optional.ts | 36 + deno_lib/types/promise.ts | 34 + deno_lib/types/record.ts | 38 + deno_lib/types/string.ts | 95 + deno_lib/types/transformer.ts | 84 + deno_lib/types/tuple.ts | 84 + deno_lib/types/undefined.ts | 21 + deno_lib/types/union.ts | 44 + deno_lib/types/unknown.ts | 20 + deno_lib/types/void.ts | 20 + deno_scripts/UpdateTestImports.js | 22 + package.json | 10 +- src/PseudoPromise.ts | 2 +- src/__tests__/all-errors.test.ts | 2 +- src/__tests__/anyunknown.test.ts | 4 +- src/__tests__/deepmasking.test.ts | 6 +- src/__tests__/instanceof.test.ts | 18 +- src/__tests__/nativeEnum.test.ts | 5 +- src/__tests__/object.test.ts | 5 +- src/__tests__/optional.test.ts | 4 +- src/__tests__/primitive.test.ts | 7 +- src/__tests__/promise.test.ts | 9 +- src/__tests__/pseudopromise.test.ts | 25 +- src/__tests__/recursive.test.ts | 4 +- src/__tests__/refine.test.ts | 24 +- src/__tests__/transformer.test.ts | 2 - src/__tests__/validations.test.ts | 189 +- src/helpers/errorUtil.ts | 3 +- src/types/enum.ts | 12 +- src/types/nativeEnum.ts | 8 +- tsconfig.json | 3 + yarn-error.log | 4079 ----------------- yarn.lock | 222 +- 110 files changed, 10345 insertions(+), 4256 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 deno_lib/LICENSE create mode 100644 deno_lib/PseudoPromise.ts create mode 100644 deno_lib/README.md create mode 100644 deno_lib/ZodError.ts create mode 100644 deno_lib/__tests__/all-errors.test.ts create mode 100644 deno_lib/__tests__/anyunknown.test.ts create mode 100644 deno_lib/__tests__/array.test.ts create mode 100644 deno_lib/__tests__/async-parsing.test.ts create mode 100644 deno_lib/__tests__/async-refinements.test.ts create mode 100644 deno_lib/__tests__/base.test.ts create mode 100644 deno_lib/__tests__/codegen.test.ts create mode 100644 deno_lib/__tests__/complex.test.ts create mode 100644 deno_lib/__tests__/deepmasking.test.ts create mode 100644 deno_lib/__tests__/enum.test.ts create mode 100644 deno_lib/__tests__/error.test.ts create mode 100644 deno_lib/__tests__/function.test.ts create mode 100644 deno_lib/__tests__/instanceof.test.ts create mode 100644 deno_lib/__tests__/intersection.test.ts create mode 100644 deno_lib/__tests__/map.tests.ts create mode 100644 deno_lib/__tests__/masking.test.ts create mode 100644 deno_lib/__tests__/mocker.test.ts create mode 100644 deno_lib/__tests__/nativeEnum.test.ts create mode 100644 deno_lib/__tests__/number.test.ts create mode 100644 deno_lib/__tests__/object-augmentation.test.ts create mode 100644 deno_lib/__tests__/object.test.ts create mode 100644 deno_lib/__tests__/optional.test.ts create mode 100644 deno_lib/__tests__/parser.test.ts create mode 100644 deno_lib/__tests__/partials.test.ts create mode 100644 deno_lib/__tests__/pickomit.test.ts create mode 100644 deno_lib/__tests__/primitive.test.ts create mode 100644 deno_lib/__tests__/promise.test.ts create mode 100644 deno_lib/__tests__/pseudopromise.test.ts create mode 100644 deno_lib/__tests__/record.test.ts create mode 100644 deno_lib/__tests__/recursive.test.ts create mode 100644 deno_lib/__tests__/refine.test.ts create mode 100644 deno_lib/__tests__/safeparse.test.ts create mode 100644 deno_lib/__tests__/string.test.ts create mode 100644 deno_lib/__tests__/transformer.test.ts create mode 100644 deno_lib/__tests__/tuple.test.ts create mode 100644 deno_lib/__tests__/validations.test.ts create mode 100644 deno_lib/__tests__/void.test.ts create mode 100644 deno_lib/codegen.ts create mode 100644 deno_lib/crazySchema.ts create mode 100644 deno_lib/defaultErrorMap.ts create mode 100644 deno_lib/helpers/Mocker.ts create mode 100644 deno_lib/helpers/errorUtil.ts create mode 100644 deno_lib/helpers/maskUtil.ts create mode 100644 deno_lib/helpers/objectUtil.ts create mode 100644 deno_lib/helpers/partialUtil.ts create mode 100644 deno_lib/helpers/primitive.ts create mode 100644 deno_lib/helpers/util.ts create mode 100644 deno_lib/index.ts create mode 100644 deno_lib/isScalar.ts create mode 100644 deno_lib/mod.ts create mode 100644 deno_lib/parser.ts create mode 100644 deno_lib/playground.ts create mode 100644 deno_lib/switcher.ts create mode 100644 deno_lib/types/any.ts create mode 100644 deno_lib/types/array.ts create mode 100644 deno_lib/types/base.ts create mode 100644 deno_lib/types/bigint.ts create mode 100644 deno_lib/types/boolean.ts create mode 100644 deno_lib/types/date.ts create mode 100644 deno_lib/types/enum.ts create mode 100644 deno_lib/types/function.ts create mode 100644 deno_lib/types/intersection.ts create mode 100644 deno_lib/types/lazy.ts create mode 100644 deno_lib/types/literal.ts create mode 100644 deno_lib/types/map.ts create mode 100644 deno_lib/types/nativeEnum.ts create mode 100644 deno_lib/types/never.ts create mode 100644 deno_lib/types/null.ts create mode 100644 deno_lib/types/nullable.ts create mode 100644 deno_lib/types/number.ts create mode 100644 deno_lib/types/object.ts create mode 100644 deno_lib/types/optional.ts create mode 100644 deno_lib/types/promise.ts create mode 100644 deno_lib/types/record.ts create mode 100644 deno_lib/types/string.ts create mode 100644 deno_lib/types/transformer.ts create mode 100644 deno_lib/types/tuple.ts create mode 100644 deno_lib/types/undefined.ts create mode 100644 deno_lib/types/union.ts create mode 100644 deno_lib/types/unknown.ts create mode 100644 deno_lib/types/void.ts create mode 100644 deno_scripts/UpdateTestImports.js delete mode 100644 yarn-error.log diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..a305118c7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: test and build + +on: [push, pull_request] + +jobs: + build_test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - uses: denolib/setup-deno@v2 + with: + deno-version: v1.4.6 + - run: npm install + - run: npm install yarn -g + - run: npm build + - run: npm test + - run: npm run deno_build + - run: npm run deno_test \ No newline at end of file diff --git a/coverage.svg b/coverage.svg index 2bf2095f6..e98830612 100644 --- a/coverage.svg +++ b/coverage.svg @@ -1 +1 @@ -Coverage: 94.04%Coverage94.04% \ No newline at end of file +Coverage: 91.58%Coverage91.58% \ No newline at end of file diff --git a/deno_lib/LICENSE b/deno_lib/LICENSE new file mode 100644 index 000000000..2c93bb52b --- /dev/null +++ b/deno_lib/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Colin McDonnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deno_lib/PseudoPromise.ts b/deno_lib/PseudoPromise.ts new file mode 100644 index 000000000..d82d3c6b9 --- /dev/null +++ b/deno_lib/PseudoPromise.ts @@ -0,0 +1,280 @@ +import { INVALID } from './helpers/util.ts'; +import { ZodError } from './ZodError.ts'; +// import { INVALID } from './util/index.ts'; + +type Func = (arg: any, ctx: { async: boolean }) => any; +type FuncItem = { type: 'function'; function: Func }; +type Catcher = (error: Error, ctx: { async: boolean }) => any; +type CatcherItem = { type: 'catcher'; catcher: Catcher }; +type Items = (FuncItem | CatcherItem)[]; + +export class PseudoPromise { + readonly _return: ReturnType | undefined; + items: Items; + constructor(funcs: Items = []) { + this.items = funcs; + } + + static all = []>(pps: T) => { + return new PseudoPromise().all(pps); + }; + + all = []>( + pps: T, + ): PseudoPromise< + { + [k in keyof T]: T[k] extends PseudoPromise ? T[k]['_return'] : never; + } + > => { + return this.then((_arg, ctx) => { + // const results = pps.map(pp => pp.getValue()); + // const caughtPPs = pps.map((pp, index) => + // pp.catch(err => { + // if (err instanceof ZodError) zerr.addIssues(err.issues); + // }), + // ); + if (ctx.async) { + try { + return Promise.all(pps.map(pp => pp.getValueAsync())); + } catch (err) {} + // return Promise.all(pps.map(pp => pp.getValueAsync())); + } else { + try { + return pps.map(pp => pp.getValueSync()) as any; + } catch (err) {} + } + }); + }; + + // subpromise = >(subprom:T)=>{ + // return this.then((arg,ctx)=>{ + // const subval = subprom. + // }) + // } + + // static allAsync = (pps:all PseudoPromise[]) => { + // return PseudoPromise.resolve(Promise.all(pps.map(pp => pp.toPromise()))); + // }; + + static object = (pps: { [k: string]: PseudoPromise }) => { + return new PseudoPromise().then((_arg, ctx) => { + const value: any = {}; + // const items = Object.keys(pps).map(k => { + // const v = pps[k].getValue(); + // return [k, v] as [string, any]; + // }); + + // let isAsync = ctx.async; //items.some(item => item[1] instanceof Promise); + // Object.keys(pps).some( + // k => pps[k].getValue() instanceof Promise, + // ); + // + + const zerr = new ZodError([]); + if (ctx.async) { + const getAsyncObject = async () => { + // const promises = Object.keys(pps).map(async k => { + // const v = await pps[k].getValue(); + // return [k, v] as [string, any]; + // }); + // const items = await Promise.all(promises); + // const asyncValue: any = {}; + const items = await Promise.all( + Object.keys(pps).map(async k => { + try { + const v = await pps[k].getValueAsync(); + return [k, v] as [string, any]; + } catch (err) { + if (err instanceof ZodError) { + zerr.addIssues(err.issues); + return [k, INVALID] as [string, any]; + } + throw err; + } + }), + ); + + if (!zerr.isEmpty) throw zerr; + // // const resolvedItems = await Promise.all( + // // items.map(async item => [item[0], await item[1]]), + // // ); + + // const filtered: any = items.filter(entry => { + // return entry[1] instanceof ZodError; + // }); + + // if (filtered.length > 0) { + // const allIssues = filtered.reduce( + // (acc: any[], val: [string, ZodError]) => { + // const error = val[1]; + // return acc.concat(error.issues); + // }, + // [], + // ); + // const error = new ZodError(allIssues); + // // const base = filtered[0][1]; + // // base.issues = all_issues; + // throw error; + // } else { + for (const item of items) { + value[item[0]] = item[1]; + } + + return value; + // } + }; + return getAsyncObject(); + } else { + const items = Object.keys(pps).map(k => { + try { + const v = pps[k].getValueSync(); + return [k, v] as [string, any]; + } catch (err) { + if (err instanceof ZodError) { + zerr.addIssues(err.issues); + return [k, INVALID] as [string, any]; + } + throw err; + } + }); + // let syncValue: any = {}; + if (!zerr.isEmpty) throw zerr; + for (const item of items) { + value[item[0]] = item[1]; + } + return value; + } + }); + }; + + static resolve = (value: T): PseudoPromise => { + if (value instanceof PseudoPromise) { + throw new Error('Do not pass PseudoPromise into PseudoPromise.resolve'); + } + return new PseudoPromise().then(() => value) as any; + }; + + then = ( + func: (arg: ReturnType, ctx: { async: boolean }) => NewReturn, + ): PseudoPromise ? U : NewReturn> => { + return new PseudoPromise([ + ...this.items, + { type: 'function', function: func }, + ]); + }; + + catch = ( + catcher: (err: Error, ctx: { async: boolean }) => NewReturn, + ): PseudoPromise ? U : NewReturn> => { + return new PseudoPromise([...this.items, { type: 'catcher', catcher }]); + }; + + // getValue = ( + // allowPromises: boolean = false, + // ): ReturnType | Promise => { + // try { + // return this.getValueSync(allowPromises); + // } catch (err) { + // if (err.message === 'found_promise') { + // return this.getValueAsync(); + // } + // throw err; + // } + // }; + + getValueSync = (): ReturnType => { + // // if (this._cached.value) return this._cached.value; + let val: any = undefined; + + // for (const item of this.items) { + // if (item.type === 'function') { + // val = item.function(val, { async: false }); + // } + + // if (val instanceof Promise && allowPromises === false) { + // throw new Error('found_promise'); + // } + // } + for (let index = 0; index < this.items.length; index++) { + try { + const item = this.items[index]; + + if (item.type === 'function') { + val = item.function(val, { async: false }); + } + } catch (err) { + const catcherIndex = this.items.findIndex( + (x, i) => x.type === 'catcher' && i > index, + ); + + const catcherItem = this.items[catcherIndex]; + if (!catcherItem || catcherItem.type !== 'catcher') { + throw err; + } else { + val = catcherItem.catcher(err, { async: false }); + index = catcherIndex; + } + } + + // if (val instanceof PseudoPromise) { + // throw new Error('SYNC: DO NOT RETURN PSEUDOPROMISE FROM FUNCTIONS'); + // } + // if (val instanceof Promise) { + // throw new Error('SYNC: DO NOT RETURN PROMISE FROM FUNCTIONS'); + // } + + // while (!!val.then) { + // if (val instanceof PseudoPromise) { + // val = await val.toPromise(); + // } else { + // val = await val; + // } + // } + } + // this._cached.value = val; + return val; + }; + + getValueAsync = async (): Promise => { + // // if (this._cached.value) return this._cached.value; + let val: any = undefined; + + for (let index = 0; index < this.items.length; index++) { + const item = this.items[index]; + try { + if (item.type === 'function') { + val = await item.function(val, { async: true }); + } + } catch (err) { + const catcherIndex = this.items.findIndex( + (x, i) => x.type === 'catcher' && i > index, + ); + + const catcherItem = this.items[catcherIndex]; + + if (!catcherItem || catcherItem.type !== 'catcher') { + throw err; + } else { + index = catcherIndex; + val = await catcherItem.catcher(err, { async: true }); + } + } + + if (val instanceof PseudoPromise) { + throw new Error('ASYNC: DO NOT RETURN PSEUDOPROMISE FROM FUNCTIONS'); + } + if (val instanceof Promise) { + throw new Error('ASYNC: DO NOT RETURN PROMISE FROM FUNCTIONS'); + } + // while (!!val.then) { + // if (val instanceof PseudoPromise) { + // val = await val.toPromise(); + // } else { + // val = await val; + // } + // } + } + // this._cached.value = val; + return val; + }; +} diff --git a/deno_lib/README.md b/deno_lib/README.md new file mode 100644 index 000000000..84ecc33b6 --- /dev/null +++ b/deno_lib/README.md @@ -0,0 +1,1800 @@ +

+ +

Zod

+

+

+Created by Colin McDonnell +License +npm +stars +coverage + +

+

+if you're happy and you know it, star this repo ⭐ +

+ +
+ + + +### **Sept 17 — Zod 2 is now in beta!** + +You should be able to upgrade from v1 to v2 without any breaking changes to your code. Zod 2 is recommended for all new projects. + +``` +npm install zod@beta +yarn add zod@beta +``` + +Here are some of the new features. + +- Transformers! These let you provide default values, do casting/coercion, and a lot more. Read more here: [Transformers](#transformers) +- Asynchronous refinements and new `.parseAsync` and `.safeParseAsync` methods. Read more here: [Refinements](#refinements) +- Schema parsing now returns a deep clone of the data you pass in (instead of the _exact_ value you pass in) +- Object schemas now strip unknown keys by default. There are also new object methods: `.passthrough()`, `.strict()`, and `.catchall()`. Read more here: [Objects](#objects) + +In almost all cases, you'll be able to upgrade to Zod 2 without changing any code. Here are some of the (very minor) breaking changes: + +- Parsing now returns a _deep clone_ of the data you pass in. Previously it returned the exact same object you passed in. +- Relatedly, Zod _no longer_ supports cyclical _data_. Recursive schemas are still supported, but Zod can't properly parse nested objects that contain cycles. +- Object schemas now strip unknown keys by default, instead of throwing an error +- Optional and nullable schemas are now represented with the dedicated ZodOptional and ZodNullable classes, instead of using ZodUnion. + +--- + +Aug 30 — zod@1.11 was released with lots of cool features! + +- All schemas now have a `.safeParse` method. This lets you validate data in a more functional way, similar to `io-ts`: https://github.com/vriad/zod#safe-parse +- String schemas have a new `.regex` refinement method: https://github.com/vriad/zod#strings +- Object schemas now have two new methods: `.primitives()` and `.nonprimitives()`. These methods let you quickly pick or omit primitive fields from objects, useful for validating API inputs: https://github.com/vriad/zod#primitives-and-nonprimitives +- Zod now provides `z.nativeEnum()`, which lets you create z Zod schema from an existing TypeScript `enum`: https://github.com/vriad/zod#native-enums + + + +# What is Zod + +Zod is a TypeScript-first schema declaration and validation library. I'm using the term "schema" to broadly refer to any data type/structure, from a simple `string` to a complex nested object. + +Zod is designed to be as developer-friendly as possible. My goal is to eliminate duplicative type declarations wherever possible. With Zod, you declare a validator _once_ and Zod will automatically infer the static TypeScript type. It's easy to compose simpler types into complex data structures. + +Some other great aspects: + +- Zero dependencies +- Plain JavaScript: works in browsers and Node.js +- Tiny: 8kb minified + zipped +- Immutability: methods (i.e. `.optional()` return a new instance +- Concise, chainable interface +- Functional approach: [parse, don't validate](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/) +- Works with plain JavaScript too! You don't need to use TypeScript. + +# Sponsorship + +I work on Zod in my free time, so if you're making money from a product that is built with Zod, I'd massively appreciate sponsorship at any level. For solo devs, I recommend the [Chipotle Bowl tier](https://github.com/sponsors/vriad) or the [Cup of Coffee tier](https://github.com/sponsors/vriad). If you're making money from a product you built using Zod, consider the [Startup tier]([Cup of Coffee tier](https://github.com/sponsors/vriad)). You can learn more about the tiers at [github.com/sponsors/vriad](github.com/sponsors/vriad). + +### Sponsors + + + + + + +
+ + + +
+ Kevin Simper +
+ @kevinsimper +
+ + + +
+ Brandon Bayer +
+ @flybayer, + creator of Blitz.js +
+
+ +_To get your name + Twitter + website here, sponsor Zod at the [Freelancer](https://github.com/sponsors/vriad) or [Consultancy](https://github.com/sponsors/vriad) tier._ + +# Table of contents + +- [Installation](#installation) + +- [Primitives](#primitives) +- [Literals](#literals) +- [Parsing](#parsing) +- [Type inference](#type-inference) +- [Refinements](#refinements) +- [Strings](#strings) +- [Numbers](#numbers) +- [Objects](#objects) + - [.shape](#shape-property) + - [.merge](#merging) + - [.extend](#extending-objects) + - [.pick/.omit](#pick-and-omit) + - [.partial/.deepPartial](#partials) + - [.passthrough](#pass-through-unknown-keys) + - [.strict](#disallow-unknown-keys) + - [.primitives/.nonprimitives](#primitives-and-nonprimitives) +- [Records](#records) +- [Arrays](#arrays) + - [.nonempty](#non-empty-lists) +- [Unions](#unions) + - [.optional](#optional-types) + - [.nullable](#nullable-types) +- [Enums](#enums) +- [Intersections](#intersections) +- [Tuples](#tuples) +- [Recursive types](#recursive-types) + - [JSON type](#json-type) + - [Cyclical data](#cyclical-objects) +- [Promises](#promises) +- [Maps](#maps) +- [Instanceof](#instanceof) +- [Function schemas](#function-schemas) +- [Transformers](#transformers) +- [Errors](#errors) +- [Comparison](#comparison) + - [Joi](#joi) + - [Yup](#yup) + - [io-ts](#io-ts) + - [Runtypes](#runtypes) +- [Changelog](#changelog) + +# Installation + +To use the beta of Zod 2 (recommended for new projects). + +``` +yarn add zod@beta +npm install zod@beta +``` + +To install the most recent v1 version: + +```sh +yarn add zod +npm install zod +``` + +#### TypeScript requirements + +- Zod 2.x requires TypeScript 3.7+ +- Zod 1.x requires TypeScript 3.3+ + +> Support for TS 3.2 was dropped with the release of zod@1.10 on 19 July 2020 + +You must enable `strictNullChecks` or use `strict` mode which includes `strictNullChecks`. Otherwise Zod can't correctly infer the types of your schemas! + +```ts +// tsconfig.json +{ + // ... + "compilerOptions": { + // ... + "strictNullChecks": true + } +} +``` + +# Usage + +Zod is a validation library designed for optimal developer experience. It's a TypeScript-first schema declaration library with rigorous inferred types, incredible developer experience, and a few killer features missing from the existing libraries. + + + + + +- Zero dependencies (5kb compressed) +- Immutability; methods (i.e. `.optional()` return a new instance +- Concise, chainable interface +- Functional approach (["Parse, don't validate!"](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/)) + +## Primitives + +You can create a Zod schema for any TypeScript primitive. + +```ts +import * as z from 'zod'; + +// primitive values +z.string(); +z.number(); +z.bigint(); +z.boolean(); +z.date(); + +// empty types +z.undefined(); +z.null(); +z.void(); + +// catch-all types +z.any(); +z.unknown(); +``` + +## Literals + +```ts +const tuna = z.literal('tuna'); +const twelve = z.literal(12); +const tru = z.literal(true); +``` + +> Currently there is no support for Date or bigint literals in Zod. If you have a use case for this feature, please file an issue. + +## Validation + +### Parsing + +`.parse(data:unknown): T` + +Given any Zod schema, you can call its `.parse` method to check `data` is valid. If it is, a value is returned with full type information! Otherwise, an error is thrown. + +> IMPORTANT: In Zod 2 and Zod 1.11+, the value returned by `.parse` is a _deep clone_ of the variable you passed in. This was also the case in zod@1.4 and earlier. + + + +```ts +const stringSchema = z.string(); +stringSchema.parse('fish'); // => returns "fish" +stringSchema.parse(12); // throws Error('Non-string type: number'); +``` + +### Safe parse + +`.safeParse(data:unknown): { success: true; data: T; } | { success: false; error: ZodError; }` + +If you don't want Zod to throw when validation errors occur, you can use `.safeParse`. This method returns an object, even if validation errors occur: + +```ts +stringSchema.safeParse(12); +// => { success: false; error: ZodError } + +stringSchema.safeParse('billie'); +// => { success: true; data: 'billie' } +``` + +There is also an asynchronous version: + +```ts +await stringSchema.safeParseAsync('billie'); +``` + +> You must use .parseAsync() or .safeParseAsync() if your schema contains asynchronous refinements for transformers. + +The result is a _discriminated union_ so you can handle errors very conveniently: + +```ts +const result = stringSchema.safeParse('billie'); +if (!result.success) { + // handle error then return + return; +} + +// underneath the if statement, TypeScript knows +// that validation passed +console.log(result.data); +``` + +> Errors thrown from within refinement functions will _not_ be caught. + +### Type guards + +`.check(data:unknown)` + +You can also use a Zod schema as a type guard using the schema's `.check()` method, like so: + +```ts +const stringSchema = z.string(); +const blob: any = 'Albuquerque'; +if (stringSchema.check(blob)) { + // blob is now of type `string` + // within this if statement +} +``` + +You can use the same method to check for invalid data: + +```ts +const stringSchema = z.string(); + +const process = (blob: any) => { + if (!stringSchema.check(blob)) { + throw new Error('Not a string'); + } + + // blob is now of type `string` + // underneath the if statement +}; +``` + +### Refinements + +`.refine(validator: (data:T)=>any, params?: RefineParams)` + +Zod let you provide custom validation logic via _refinements_. + +Zod was designed to mirror TypeScript as closely as possible. But there are many so-called "refinement types" you may wish to check for that can't be represented in TypeScript's type system. For instance: checking that a number is an Int or that a string is a valid email address. + +For example, you can define a custom validation check on _any_ Zod schema with `.refine`: + +```ts +const myString = z.string().refine(val => val.length <= 255, { + message: "String can't be more than 255 characters", +}); +``` + +Refinements can also be async: + +```ts +const userId = z.string().refine(async id => { + // verify that ID exists in database + return true; +}); +``` + +> If you use async refinements, you must use the `.parseAsync` method to parse data! Otherwise Zod will throw an error. + +As you can see, `.refine` takes two arguments. + +1. The first is the validation function. This function takes one input (of type `T` — the inferred type of the schema) and returns `any`. Any truthy value will pass validation. (Prior to zod@1.6.2 the validation function had to return a boolean.) +2. The second argument accepts some options. You can use this to customize certain error-handling behavior: + + ```ts + type RefineParams = { + // override error message + message?: string; + + // appended to error path + path?: (string | number)[]; + + // params object you can use to customize message + // in error map + params?: object; + }; + ``` + +These options let you define powerful custom behavior. Zod is commonly used for form validation. If you want to verify that "password" and "confirm" match, you can do so like this: + +```ts +const passwordForm = z + .object({ + password: z.string(), + confirm: z.string(), + }) + .refine(data => data.password === data.confirm, { + message: "Passwords don't match", + path: ['confirm'], // path of error + }) + .parse({ password: 'asdf', confirm: 'qwer' }); +``` + +Because you provided a `path` parameter, the resulting error will be: + +```ts +ZodError { + issues: [{ + "code": "custom", + "path": [ "confirm" ], + "message": "Passwords don't match" + }] +} +``` + +Note that the `path` is set to `["confirm"]`, so you can easily display this error underneath the "Confirm password" textbox. + +Important note, the value passed to the `path` option is _concatenated_ to the actual error path. So if you took `passwordForm` from above and nested it inside another object, you would still get the error path you expect. + +```ts +const allForms = z.object({ passwordForm }).parse({ + passwordForm: { + password: 'asdf', + confirm: 'qwer', + }, +}); +``` + +would result in + +``` +ZodError { + issues: [{ + "code": "custom", + "path": [ "passwordForm", "confirm" ], + "message": "Passwords don't match" + }] +} +``` + +## Type inference + +You can extract the TypeScript type of any schema with `z.infer`. + +```ts +const A = z.string(); +type A = z.infer; // string + +const u: A = 12; // TypeError +const u: A = 'asdf'; // compiles +``` + +We'll include examples of inferred types throughout the rest of the documentation. + +## Strings + +There are a handful of string-specific validations. + +All of these validations allow you to _optionally_ specify a custom error message. + +```ts +z.string().min(5); +z.string().max(5); +z.string().length(5); +z.string().email(); +z.string().url(); +z.string().uuid(); +z.string().regex(regex); +z.string().nonempty(); +``` + +> Use the `.nonempty` method if you want the empty string (`""`) to be considered invalid. + +> Check out [validator.js](https://github.com/validatorjs/validator.js) for a bunch of other useful string validation functions. + +### Custom error messages + +Like `.refine`, The final (optional) argument is an object that lets you provide a custom error in the `message` field. + +```ts +z.string().min(5, { message: 'Must be 5 or more characters long' }); +z.string().max(5, { message: 'Must be 5 or fewer characters long' }); +z.string().length(5, { message: 'Must be exactly 5 characters long' }); +z.string().email({ message: 'Invalid email address.' }); +z.string().url({ message: 'Invalid url' }); +z.string().uuid({ message: 'Invalid UUID' }); +``` + +> To see the email and url regexes, check out [this file](https://github.com/vriad/zod/blob/master/src/types/string.ts). To use a more advanced method, use a custom refinement. + +## Numbers + +There are a handful of number-specific validations. + +```ts +z.number().min(5); +z.number().max(5); + +z.number().int(); // value must be an integer + +z.number().positive(); // > 0 +z.number().nonnegative(); // >= 0 +z.number().negative(); // < 0 +z.number().nonpositive(); // <= 0 +``` + +You can optionally pass in a params object as the second argument to provide a custom error message. + +```ts +z.number().max(5, { message: 'this👏is👏too👏big' }); +``` + +## Objects + +```ts +// all properties are required by default +const dogSchema = z.object({ + name: z.string(), + age: z.number(), +}); + +type Dog = z.infer; +/* +equivalent to: +type Dog = { + name: string; + age: number; +} +*/ + +const cujo = dogSchema.parse({ + name: 'Cujo', + age: 4, +}); // passes, returns Dog + +const fido: Dog = { + name: 'Fido', +}; // TypeError: missing required property `age` +``` + +#### `.shape` property + +Use `.shape` to access an object schema's property schemas. + +```ts +const Location = z.object({ + latitude: z.number(), + longitude: z.number(), +}); + +const Business = z.object({ + location: Location, +}); + +Business.shape.location; // => Location schema +``` + +#### Merging + +You can combine two object schemas with `.merge`, like so: + +```ts +const BaseTeacher = z.object({ subjects: z.array(z.string()) }); +const HasID = z.object({ id: z.string() }); + +const Teacher = BaseTeacher.merge(HasID); +type Teacher = z.infer; // => { subjects: string[], id: string } +``` + +You're able to fluently chain together many `.merge` calls as well: + +```ts +// chaining mixins +const Teacher = BaseTeacher.merge(HasId) + .merge(HasName) + .merge(HasAddress); +``` + + + +> IMPORTANT: the schema returned by `.merge` is the _intersection_ of the two schemas. The schema passed into `.merge` does not "overwrite" properties of the original schema. To demonstrate: + +```ts +const Obj1 = z.object({ field: z.string() }); +const Obj2 = z.object({ field: z.number() }); + +const Merged = Obj1.merge(Obj2); + +type Merged = z.infer; +// => { field: never } +// because no type can simultaneously be both a string and a number +``` + +To "overwrite" existing keys, use `.extend` (documented below). + +#### Extending objects + +You can add additional fields an object schema with the `.extend` method. + +> Before zod@1.8 this method was called `.augment`. The `augment` method is still available for backwards compatibility but it is deprecated and will be removed in a future release. + +```ts +const Animal = z + .object({ + species: z.string(), + }) + .extend({ + population: z.number(), + }); +``` + +> ⚠️ You can use `.extend` to overwrite fields! Be careful with this power! + +```ts +// overwrites `species` +const ModifiedAnimal = Animal.extend({ + species: z.array(z.string()), +}); + +// => { population: number, species: string[] } +``` + +#### Pick and omit + +Object masking is one of Zod's killer features. It lets you create slight variations of your object schemas easily and succinctly. Inspired by TypeScript's built-in `Pick` and `Omit` utility types, all Zod object schemas have `.pick` and `.omit` methods that return a "masked" version of the schema. + +```ts +const Recipe = z.object({ + id: z.string(), + name: z.string(), + ingredients: z.array(z.string()), +}); +``` + +To only keep certain keys, use `.pick`. + +```ts +const JustTheName = Recipe.pick({ name: true }); + +type JustTheName = z.infer; +// => { name: string } +``` + +To remove certain keys, use `.omit`. + +```ts +const NoIDRecipe = Recipe.omit({ id: true }); + +type NoIDRecipe = z.infer; +// => { name: string, ingredients: string[] } +``` + +This is useful for database logic, where endpoints often accept as input slightly modified versions of your database schemas. For instance, the input to a hypothetical `createRecipe` endpoint would accept the `NoIDRecipe` type, since the ID will be generated by your database automatically. + +> This is a vital feature for implementing typesafe backend logic, yet as far as I know, no other validation library (yup, Joi, io-ts, runtypes, class-validator, ow...) offers similar functionality as of this writing (April 2020). This is one of the must-have features that inspired the creation of Zod. + +#### Partials + +Inspired by the built-in TypeScript utility type [Partial](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialt), all Zod object schemas have a `.partial` method that makes all properties optional. + +Starting from this object: + +```ts +const user = z.object({ + username: z.string(), + location: z.object({ + latitude: z.number(), + longitude: z.number(), + }), +}); +/* + { username: string, location: { city: number, state: number } } +*/ +``` + +We can create a partial version: + +```ts +const partialUser = user.partial(); +/* +{ + username?: string | undefined, + location?: { + city: number; + state: number; + } | undefined +} +*/ + +// equivalent to: +const partialUser = z.object({ + username: user.shape.username.optional(), + location: user.shape.location.optional(), +}); +``` + +Or you can use `.deepPartial`: + +```ts +const deepPartialUser = user.deepPartial(); + +/* +{ + username?: string | undefined, + location?: { + latitude?: number | undefined; + longitude?: number | undefined; + } | undefined +} +*/ +``` + +> Important limitation: deep partials only work as expected in hierarchies of object schemas. It also can't be used on recursive schemas currently, since creating a recursive schema requires casting to the generic `ZodSchema` type (which doesn't include all the methods of the `ZodObject` class). Currently an improved version of Zod is under development that will have better support for recursive schemas. + +#### Unknown keys + +By default Zod object schema strip unknown keys from the output. + +> ⚠️ Before version 2, Zod did NOT allow unknown keys by default. + +Zod will return + +```ts +const person = z.object({ + name: z.string(), +}); + +person.parse({ + name: 'bob dylan', + extraKey: 61, +}); +// => { name: "bob dylan" } +``` + +#### Pass through unknown keys + +If you want to pass through unknown keys, use `.passthrough()`. + +> For backwards compatibility, you can also use `.nonstrict()` which behaves identically. + +```ts +const person = z + .object({ + name: z.string(), + }) + .passthrough(); + +person.parse({ + name: 'bob dylan', + extraKey: 61, +}); +// => { name: "bob dylan", extraKey: 61 } +``` + +#### Disallow unknown keys + +You can _disallow_ unknown keys with `.strict()`. If there are any unknown keys in the input, Zod will throw an error. + +```ts +const person = z + .object({ + name: z.string(), + }) + .strict(); + +person.parse({ + name: 'bob dylan', + extraKey: 61, +}); +// => throws ZodError +``` + +#### Primitives and nonprimitives + +Zod provides a convenience method for automatically picking all primitive or non-primitive fields from an object schema. + +```ts +const Post = z.object({ + title: z.string() +}); + +const User = z.object({ + id: z.number(), + name: z.string(), + posts: z.array(Post) +}); + +const UserFields = User.primitives(); +typeof UserFields = z.infer; +// => { id: number; name; string; } + +const UserRelations = User.nonprimitives(); +typeof UserFields = z.infer; +// => { posts: Post[] } +``` + +These schemas are considering "primitive": + +- string +- number +- boolean +- bigint +- date +- null/undefined +- enums +- any array of the above types +- any union of the above types + +#### Catchall + +You can add a `catchall` schema with `.catchall()`. All unknown keys will be validated against the catchall schema. + +```ts +const person = z + .object({ + name: z.string(), + }) + .catchall(z.number()); + +person.parse({ + name: 'bob dylan', + validExtraKey: 61, // works fine +}); +// => { name: "bob dylan" } +``` + +> Using `.catchall()` overrides `.passsthrough()`, `.strip()`, or `.strict()`. All keys are now considered "known". + +## Records + +Record schemas are used to validate types such as this: + +```ts +type NumberCache = { [k: string]: number }; +``` + +If you want to validate that all the _values_ of an object match some schema, without caring about the keys, you should use a Record. + + + + + + + + + + + +```ts +const User = z.object({ + name: z.string(), +}); + +const UserStore = z.record(User); + +type UserStore = z.infer; +// => { [k: string]: User } +``` + +This is particularly useful for storing or caching items by ID. + +```ts +const userStore: UserStore = {}; + +userStore['77d2586b-9e8e-4ecf-8b21-ea7e0530eadd'] = { + name: 'Carlotta', +}; // passes + +userStore['77d2586b-9e8e-4ecf-8b21-ea7e0530eadd'] = { + whatever: 'Ice cream sundae', +}; // TypeError +``` + +And of course you can call `.parse` just like any other Zod schema. + +```ts +UserStore.parse({ + user_1328741234: { name: 'James' }, +}); // => passes +``` + +#### A note on numerical keys + +You may have expected `z.record()` to accept two arguments, one for the keys and one for the values. After all, TypeScript's built-in Record type does: `Record`. Otherwise, how do you represent the TypeScript type `Record` in Zod? + +As it turns out, TypeScript's behavior surrounding `[k: number]` is a little unintuitive: + +```ts +const testMap: { [k: number]: string } = { + 1: 'one', +}; + +for (const key in testMap) { + console.log(`${key}: ${typeof key}`); +} +// prints: `1: string` +``` + +As you can see, JavaScript automatically casts all object keys to strings under the hood. + +Since Zod is trying to bridge the gap between static and runtime types, it doesn't make sense to provide a way of creating a record schema with numerical keys, since there's no such thing as a numerical key in runtime JavaScript. + +## Arrays + +There are two ways to define array schemas: + +#### `z.array(arg: ZodSchema)` + +First, you can create an array schema with the `z.array()` function; it accepts another ZodSchema, which defines the type of each array element. + +```ts +const stringArray = z.array(z.string()); +// inferred type: string[] +``` + +#### the `.array()` method + +Second, you can call the `.array()` method on **any** Zod schema: + +```ts +const stringArray = z.string().array(); +// inferred type: string[] +``` + +You have to be careful with the `.array()` method. It returns a new `ZodArray` instance. This means you need to be careful about the _order_ in which you call methods. These two schemas are very different: + +```ts +z.string() + .undefined() + .array(); // (string | undefined)[] +z.string() + .array() + .undefined(); // string[] | undefined +``` + + + +#### Non-empty lists + +```ts +const nonEmptyStrings = z + .string() + .array() + .nonempty(); +// [string, ...string[]] + +nonEmptyStrings.parse([]); // throws: "Array cannot be empty" +nonEmptyStrings.parse(['Ariana Grande']); // passes +``` + +#### Length validations + +```ts +// must contain 5 or more items +z.array(z.string()).min(5); + +// must contain 5 or fewer items +z.array(z.string()).max(5); + +// must contain exactly 5 items +z.array(z.string()).length(5); +``` + +## Unions + +Zod includes a built-in `z.union` method for composing "OR" types. + +```ts +const stringOrNumber = z.union([z.string(), z.number()]); + +stringOrNumber.parse('foo'); // passes +stringOrNumber.parse(14); // passes +``` + +Zod will test the input against each of the "options" in order and return the first value that validates successfully. + + + +## Optional types + + + +You can make any schema optional with `z.optional()`: + +```ts +const A = z.optional(z.string()); + +A.parse(undefined); // => passes, returns undefined +type A = z.infer; // string | undefined +``` + +You can also call the `.optional()` method on an existing schema: + +```ts +const B = z.boolean().optional(); + +const C = z.object({ + username: z.string().optional(), +}); +type C = z.infer; // { username?: string | undefined }; +``` + +## Nullable types + +Similarly, you can create nullable types like so: + +```ts +const D = z.nullable(z.string()); +D.parse('asdf'); // => "asdf" +D.parse(null); // => null +``` + +Or you can use the `.optional()` method on any existing schema: + +```ts +const E = z.string().nullable(); // equivalent to D +type E = z.infer; // string | null +``` + +You can create unions of any two or more schemas. + + + +## Enums + +There are two ways to define enums in Zod. + +### Zod enums + +An enum is just a union of string literals, so you _could_ define an enum like this: + +```ts +const FishEnum = z.union([ + z.literal('Salmon'), + z.literal('Tuna'), + z.literal('Trout'), +]); + +FishEnum.parse('Salmon'); // => "Salmon" +FishEnum.parse('Flounder'); // => throws +``` + +For convenience Zod provides a built-in `z.enum()` function. Here's is the equivalent code: + +```ts +const FishEnum = z.enum(['Salmon', 'Tuna', 'Trout']); + +type FishEnum = z.infer; +// 'Salmon' | 'Tuna' | 'Trout' +``` + +> Important! You need to pass the literal array _directly_ into z.enum(). Do not define it separately, than pass it in as a variable! This is required for proper type inference. + +**Autocompletion** + +To get autocompletion with a Zod enum, use the `.enum` property of your schema: + +```ts +FishEnum.enum.Salmon; // => autocompletes + +FishEnum.enum; +/* +=> { + Salmon: "Salmon", + Tuna: "Tuna", + Trout: "Trout", +} +*/ +``` + +You can also retrieve the list of options as a tuple with the `.options` property: + +```ts +FishEnum.options; // ["Salmon", "Tuna", "Trout"]); +``` + +### Native enums + +> ⚠️ `nativeEnum()` requires TypeScript 3.6 or higher! + +Zod enums are the recommended approach to defining and validating enums. But there may be scenarios where you need to validate against an enum from a third-party library, or perhaps you don't want to rewrite your existing enums. For this you can use `z.nativeEnum()`. + +**Numeric enums** + +```ts +enum Fruits { + Apple, + Banana, +} + +const FruitEnum = z.nativeEnum(Fruits); +type FruitEnum = z.infer; // Fruits + +FruitEnum.parse(Fruits.Apple); // passes +FruitEnum.parse(Fruits.Banana); // passes +FruitEnum.parse(0); // passes +FruitEnum.parse(1); // passes +FruitEnum.parse(3); // fails +``` + +**String enums** + +```ts +enum Fruits { + Apple = 'apple', + Banana = 'banana', + Cantaloupe, // you can mix numerical and string enums +} + +const FruitEnum = z.nativeEnum(Fruits); +type FruitEnum = z.infer; // Fruits + +FruitEnum.parse(Fruits.Apple); // passes +FruitEnum.parse(Fruits.Cantaloupe); // passes +FruitEnum.parse('apple'); // passes +FruitEnum.parse('banana'); // passes +FruitEnum.parse(0); // passes +FruitEnum.parse('Cantaloupe'); // fails +``` + +**Const enums** + +The `.nativeEnum()` function works for `as const` objects as well. ⚠️ `as const` required TypeScript 3.4+! + +```ts +const Fruits = { + Apple: 'apple', + Banana: 'banana', + Cantaloupe: 3, +} as const; + +const FruitEnum = z.nativeEnum(Fruits); +type FruitEnum = z.infer; // "apple" | "banana" | 3 + +FruitEnum.parse('apple'); // passes +FruitEnum.parse('banana'); // passes +FruitEnum.parse(3); // passes +FruitEnum.parse('Cantaloupe'); // fails +``` + +## Intersections + + + +Intersections are useful for creating "logical AND" types. + +```ts +const a = z.union([z.number(), z.string()]); +const b = z.union([z.number(), z.boolean()]); +const c = z.intersection(a, b); + +type c = z.infer; // => number + +const stringAndNumber = z.intersection(z.string(), z.number()); +type Never = z.infer; // => never +``` + + + + + +## Tuples + +These differ from arrays in that they have a fixed number of elements, and each element can have a different type. + +```ts +const athleteSchema = z.tuple([ + // takes an array of schemas + z.string(), // name + z.number(), // jersey number + z.object({ + pointsScored: z.number(), + }), // statistics +]); + +type Athlete = z.infer; +// type Athlete = [string, number, { pointsScored: number }] +``` + +## Recursive types + +You can define a recursive schema in Zod, but because of a limitation of TypeScript, their type can't be statically inferred. If you need a recursive Zod schema you'll need to define the type definition manually, and provide it to Zod as a "type hint". + +```ts +interface Category { + name: string; + subcategories: Category[]; +} + +const Category: z.ZodSchema = z.lazy(() => + z.object({ + name: z.string(), + subcategories: z.array(Category), + }), +); + +Category.parse({ + name: 'People', + subcategories: [ + { + name: 'Politicians', + subcategories: [{ name: 'Presidents', subcategories: [] }], + }, + ], +}); // passes +``` + +Unfortunately this code is a bit duplicative, since you're declaring the types twice: once in the interface and again in the Zod definition. + +If your schema has lots of primitive fields, there's a way of reducing the amount of duplication: + +```ts +// define all the non-recursive stuff here +const BaseCategory = z.object({ + name: z.string(), + tags: z.array(z.string()), + itemCount: z.number(), +}); + +// create an interface that extends the base schema +interface Category extends z.infer { + subcategories: Category[]; +} + +// merge the base schema with +// a new Zod schema containing relations +const Category: z.ZodSchema = BaseCategory.merge( + z.object({ + subcategories: z.lazy(() => z.array(Category)), + }), +); +``` + +#### JSON type + +If you want to validate any JSON value, you can use the snippet below. This requires TypeScript 3.7 or higher! + +```ts +type Literal = boolean | null | number | string; +type Json = Literal | { [key: string]: Json } | Json[]; +const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]); +const jsonSchema: z.ZodSchema = z.lazy(() => + z.union([literalSchema, z.array(jsonSchema), z.record(jsonSchema)]), +); + +jsonSchema.parse({ + // data +}); +``` + +Thanks to [ggoodman](https://github.com/ggoodman) for suggesting this. + +#### Cyclical objects + +As of Zod 2, Zod _no longer_ supports cyclical objects. If you absolutely need this feature you can still use Zod v1. + + + +## Promises + +```ts +const numberPromise = z.promise(z.number()); +``` + +"Parsing" works a little differently with promise schemas. Validation happens in two parts: + +1. Zod synchronously checks that the input is an instance of Promise (i.e. an object with `.then` and `.catch` methods.). +2. Zod _waits for the promise to resolve_ then validates the resolved value. + +```ts +numberPromise.parse('tuna'); +// ZodError: Non-Promise type: string + +numberPromise.parse(Promise.resolve('tuna')); +// => Promise + +const test = async () => { + await numberPromise.parse(Promise.resolve('tuna')); + // ZodError: Non-number type: string + + await numberPromise.parse(Promise.resolve(3.14)); + // => 3.14 +}; +``` + +#### Non-native promise implementations + +When "parsing" a promise, Zod checks that the passed value is an object with `.then` and `.catch` methods — that's it. So you should be able to pass non-native Promises (Bluebird, etc) into `z.promise(...).parse` with no trouble. One gotcha: the return type of the parse function will be a _native_ `Promise`, so if you have downstream logic that uses non-standard Promise methods, this won't work. + +## Maps + +```ts +const stringNumberMap = z.map(z.string(), z.number()); + +type StringNumberMap = z.infer; +// type StringNumber = Map +``` + +## Instanceof + +You can use `z.instanceof` to create a schema that checks if the input is an instance of a class. + +```ts +class Test { + name: string; +} + +const TestSchema = z.instanceof(Test); + +const blob: any = 'whatever'; +if (TestSchema.check(blob)) { + blob.name; // Test instance +} +``` + +## Function schemas + +Zod also lets you define "function schemas". This makes it easy to validate the inputs and outputs of a function without intermixing your validation code and "business logic". + +You can create a function schema with `z.function(args, returnType)`. + +```ts +const myFunction = z.function(); + +type myFunction = z.infer; +// => ()=>unknown +``` + +You can use the `.args` and `.returns` methods to refine your function schema: + +```ts +const myFunction = z + .function() + .args(z.string(), z.number()) // accepts an arbitrary number of arguments + .returns(z.boolean()); +type myFunction = z.infer; +// => (arg0: string, arg1: number)=>boolean +``` + + + +> You can use the special `z.void()` option if your function doesn't return anything. This will let Zod properly infer the type of void-returning functions. (Void-returning function can actually return either undefined or null.) + + + +Function schemas have an `.implement()` method which accepts a function and returns a new function. + +```ts +const trimmedLength = z + .function() + .args(z.string()) // accepts an arbitrary number of arguments + .returns(z.number()) + .implement(x => { + // TypeScript knows x is a string! + return x.trim().length; + }); + +trimmedLength('sandwich'); // => 8 +trimmedLength(' asdf '); // => 4 +``` + +`myValidatedFunction` now automatically validates both its inputs and return value against the schemas provided to `z.function`. If either is invalid, the function throws. This way you can confidently write application logic in a "validated function" without worrying about invalid inputs, scattering `schema.validate()` calls in your endpoint definitions,or writing duplicative types for your functions. + +Here's a more complex example showing how to write a typesafe API query endpoint: + +```ts +const FetcherEndpoint = z + .function(args, returnType) + .args(z.object({ id: z.string() })) + .returns( + z.promise( + z.object({ + id: string(), + name: string(), + }), + ), + ); + +const getUserByID = FetcherEndpoint.validate(args => { + args; // => { id: string } + + const user = await User.findByID(args.id); + + // TypeScript statically verifies that value returned by + // this function is of type Promise<{ id: string; name: string; }> + return 'salmon'; // TypeError + + return user; // compiles successfully +}); +``` + +> This is particularly useful for defining HTTP or RPC endpoints that accept complex payloads that require validation. Moreover, you can define your endpoints once with Zod and share the code with both your client and server code to achieve end-to-end type safety. + +```ts +// Express example +server.get(`/user/:id`, async (req, res) => { + const user = await getUserByID({ id: req.params.id }).catch(err => { + res.status(400).send(err.message); + }); + + res.status(200).send(user); +}); +``` + + + +## Transformers + +You can integrate custom data transformations into your schemas with transformers. Transformers are just another type of Zod schema. + +### z.transformer() + +```ts +const countLength = z.transformer( + z.string(), + z.number(), + myString => myString.length, +); + +countLength.parse('string'); // => 6 +``` + +This lets you perform coercion, similar to Yup. You still need to provide the coercion logic yourself. + +```ts +const coercedString = z.transformer(z.unknown(), z.string(), val => { + return `${val}`; +}); + +coercedString.parse(false); // => "false" +coercedString.parse(12); // => "12" +``` + +Transformations can also be async. + +```ts +const IdToUser = z.transformer( + z.string().uuid(), + UserSchema, + userId => async id => { + return await getUserById(id); + }, +); +``` + +> ⚠️ If your schema contains asynchronous transformers, you must use .parseAsync() or .safeParseAsync() to parse data. Otherwise Zod will throw an error. + +### .transform() + +For convenience, ALL Zod schemas (not just transformers) has a `.transform` method. The first argument lets you specify a "destination schema" which defines the type that the data should be transformed _into_. + +```ts +const lengthChecker = z.string().transform(z.boolean(), val => { + return val.length > 5; +}); + +lengthChecker.parse('asdf'); // => false; +lengthChecker.parse('qwerty'); // => true; +``` + +You can omit the first argument, in which case Zod assumes you aren't transforming the data type: + +```ts +z.string() + .transform(val => val.replace('pretty', 'extremely')) + .transform(val => val.toUpperCase()) + .transform(val => val.split(' ').join('👏')) + .parse('zod 2 is pretty cool'); + +// => "ZOD👏2👏IS👏EXTREMELY👏COOL" +``` + +### Default values + +Using transformers, Zod lets you supply default values for your schemas. + +```ts +const stringWithDefault = z.transformer( + z.string().optional(), + z.string(), + val => val || 'default value', +); +``` + +Equivalently you can express this using the built-in `.default()` method, available on all Zod schemas. The default value will be used if and only if the schema is `undefined`. + +```ts +z.string().default('default value'); +``` + +### Type inference for transformers + +There are special rules surrounding type inference for transformers. + +```ts +const stringToNumber = z.transformer( + z.string(), + z.number(), + myString => myString.length, +); + +// ⚠️ Important: z.infer gives the return type!! +type type = z.infer; // number + +// it is equivalent to z.output<> +type out = z.output; // number + +// you can use z.input<> to get the input type +type in = z.input; // string +``` + +## Errors + +There is a dedicated guide on Zod's error handling system here: [ERROR_HANDLING.md](https://github.com/vriad/zod/blob/master/ERROR_HANDLING.md) + +# Comparison + +There are a handful of other widely-used validation libraries, but all of them have certain design limitations that make for a non-ideal developer experience. + + + + + + + +#### Joi + +[https://github.com/hapijs/joi](https://github.com/hapijs/joi) + +Doesn't support static type inference 😕 + +#### Yup + +[https://github.com/jquense/yup](https://github.com/jquense/yup) + +Yup is a full-featured library that was implemented first in vanilla JS, with TypeScript typings added later. + +Differences + +- Supports for casting and transformation +- All object fields are optional by default +- Non-standard `.required()`¹ +- Missing object methods: (pick, omit, partial, deepPartial, merge, extend) +- Missing nonempty arrays with proper typing (`[T, ...T[]]`) +- Missing promise schemas +- Missing function schemas +- Missing union & intersection schemas + +¹ Yup has a strange interpretation of the word `required`. Instead of meaning "not undefined", Yup uses it to mean "not empty". So `yup.string().required()` will not accept an empty string, and `yup.array(yup.string()).required()` will not accept an empty array. For Zod arrays there is a dedicated `.nonempty()` method to indicate this, or you can implement it with a custom refinement. + +#### io-ts + +[https://github.com/gcanti/io-ts](https://github.com/gcanti/io-ts) + +io-ts is an excellent library by gcanti. The API of io-ts heavily inspired the design of Zod. + +In our experience, io-ts prioritizes functional programming purity over developer experience in many cases. This is a valid and admirable design goal, but it makes io-ts particularly hard to integrate into an existing codebase with a more procedural or object-oriented bias. For instance, consider how to define an object with optional properties in io-ts: + +```ts +import * as t from 'io-ts'; + +const A = t.type({ + foo: t.string, +}); + +const B = t.partial({ + bar: t.number, +}); + +const C = t.intersection([A, B]); + +type C = t.TypeOf; +// returns { foo: string; bar?: number | undefined } +``` + +You must define the required and optional props in separate object validators, pass the optionals through `t.partial` (which marks all properties as optional), then combine them with `t.intersection`. + +Consider the equivalent in Zod: + +```ts +const C = z.object({ + foo: z.string(), + bar: z.string().optional(), +}); + +type C = z.infer; +// returns { foo: string; bar?: number | undefined } +``` + +This more declarative API makes schema definitions vastly more concise. + +`io-ts` also requires the use of gcanti's functional programming library `fp-ts` to parse results and handle errors. This is another fantastic resource for developers looking to keep their codebase strictly functional. But depending on `fp-ts` necessarily comes with a lot of intellectual overhead; a developer has to be familiar with functional programming concepts and the `fp-ts` nomenclature to use the library. + +- Supports codecs with serialization & deserialization transforms +- Supports branded types +- Supports advanced functional programming, higher-kinded types, `fp-ts` compatibility +- Missing object methods: (pick, omit, partial, deepPartial, merge, extend) +- Missing nonempty arrays with proper typing (`[T, ...T[]]`) +- Missing lazy/recursive types +- Missing promise schemas +- Missing function schemas +- Missing union & intersection schemas +- Missing support for parsing cyclical data (maybe) +- Missing error customization + +#### Runtypes + +[https://github.com/pelotom/runtypes](https://github.com/pelotom/runtypes) + +Good type inference support, but limited options for object type masking (no `.pick`, `.omit`, `.extend`, etc.). No support for `Record`s (their `Record` is equivalent to Zod's `object`). They DO support branded and readonly types, which Zod does not. + +- Supports "pattern matching": computed properties that distribute over unions +- Supports readonly types +- Missing object methods: (pick, omit, partial, deepPartial, merge, extend) +- Missing nonempty arrays with proper typing (`[T, ...T[]]`) +- Missing lazy/recursive types +- Missing promise schemas +- Missing union & intersection schemas +- Missing error customization +- Missing record schemas (their "record" is equivalent to Zod "object") + +#### Ow + +[https://github.com/sindresorhus/ow](https://github.com/sindresorhus/ow) + +Ow is focused on function input validation. It's a library that makes it easy to express complicated assert statements, but it doesn't let you parse untyped data. They support a much wider variety of types; Zod has a nearly one-to-one mapping with TypeScript's type system, whereas ow lets you validate several highly-specific types out of the box (e.g. `int32Array`, see full list in their README). + +If you want to validate function inputs, use function schemas in Zod! It's a much simpler approach that lets you reuse a function type declaration without repeating yourself (namely, copy-pasting a bunch of ow assertions at the beginning of every function). Also Zod lets you validate your return types as well, so you can be sure there won't be any unexpected data passed downstream. + +# Changelog + +View the changelog at [CHANGELOG.md](https://github.com/vriad/zod/blob/master/CHANGELOG.md) diff --git a/deno_lib/ZodError.ts b/deno_lib/ZodError.ts new file mode 100644 index 000000000..63941e48c --- /dev/null +++ b/deno_lib/ZodError.ts @@ -0,0 +1,205 @@ +import { ZodParsedType } from './parser.ts'; +import { util } from './helpers/util.ts'; + +export const ZodIssueCode = util.arrayToEnum([ + 'invalid_type', + 'nonempty_array_is_empty', + 'custom', + 'invalid_union', + 'invalid_literal_value', + 'invalid_enum_value', + 'unrecognized_keys', + 'invalid_arguments', + 'invalid_return_type', + 'invalid_date', + 'invalid_string', + 'too_small', + 'too_big', + 'invalid_intersection_types', +]); + +export type ZodIssueCode = keyof typeof ZodIssueCode; + +export type ZodIssueBase = { + path: (string | number)[]; + // code: ZodIssueCode; + message?: string; +}; + +export interface ZodInvalidTypeIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_type; + expected: ZodParsedType; + received: ZodParsedType; +} + +export interface ZodNonEmptyArrayIsEmptyIssue extends ZodIssueBase { + code: typeof ZodIssueCode.nonempty_array_is_empty; +} + +export interface ZodUnrecognizedKeysIssue extends ZodIssueBase { + code: typeof ZodIssueCode.unrecognized_keys; + keys: string[]; +} + +export interface ZodInvalidUnionIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_union; + unionErrors: ZodError[]; +} + +export interface ZodInvalidLiteralValueIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_literal_value; + expected: string | number | boolean; +} + +export interface ZodInvalidEnumValueIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_enum_value; + options: (string | number)[]; +} + +export interface ZodInvalidArgumentsIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_arguments; + argumentsError: ZodError; +} + +export interface ZodInvalidReturnTypeIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_return_type; + returnTypeError: ZodError; +} + +export interface ZodInvalidDateIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_date; +} + +export type StringValidation = 'email' | 'url' | 'uuid' | 'regex'; + +export interface ZodInvalidStringIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_string; + validation: StringValidation; +} + +export interface ZodTooSmallIssue extends ZodIssueBase { + code: typeof ZodIssueCode.too_small; + minimum: number; + inclusive: boolean; + type: 'array' | 'string' | 'number'; +} + +export interface ZodTooBigIssue extends ZodIssueBase { + code: typeof ZodIssueCode.too_big; + maximum: number; + inclusive: boolean; + type: 'array' | 'string' | 'number'; +} + +export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_intersection_types; +} + +export interface ZodCustomIssue extends ZodIssueBase { + code: typeof ZodIssueCode.custom; + params?: { [k: string]: any }; +} + +export type ZodIssueOptionalMessage = + | ZodInvalidTypeIssue + | ZodNonEmptyArrayIsEmptyIssue + | ZodUnrecognizedKeysIssue + | ZodInvalidUnionIssue + | ZodInvalidLiteralValueIssue + | ZodInvalidEnumValueIssue + | ZodInvalidArgumentsIssue + | ZodInvalidReturnTypeIssue + | ZodInvalidDateIssue + | ZodInvalidStringIssue + | ZodTooSmallIssue + | ZodTooBigIssue + | ZodInvalidIntersectionTypesIssue + | ZodCustomIssue; + +export type ZodIssue = ZodIssueOptionalMessage & { message: string }; + +export const quotelessJson = (obj: any) => { + const json = JSON.stringify(obj, null, 2); // {"name":"John Smith"} + return json.replace(/"([^"]+)":/g, '$1:'); +}; + +export class ZodError extends Error { + issues: ZodIssue[] = []; + + get errors() { + return this.issues; + } + + constructor(issues: ZodIssue[]) { + super(); + // restore prototype chain + const actualProto = new.target.prototype; + Object.setPrototypeOf(this, actualProto); + this.issues = issues; + } + + static create = (issues: ZodIssue[]) => { + const error = new ZodError(issues); + return error; + }; + + get message() { + return JSON.stringify(this.issues, null, 2); + // const errorMessage: string[] = [ + // `${this.issues.length} validation issue(s)`, + // '', + // ]; + // for (const err of this.issues) { + // errorMessage.push( + // ` Issue #${this.issues.indexOf(err)}: ${err.code} at ${err.path.join( + // '.', + // )}`, + // ); + // errorMessage.push(` ` + err.message); + // errorMessage.push(''); + // } + // return errorMessage.join('\n'); + // return quotelessJson(this); + // .map(({ path, message }) => { + // return path.length ? `${path.join('./index')}: ${message}` : `${message}`; + // }) + // .join('\n'); + } + + get isEmpty(): boolean { + return this.issues.length === 0; + } + + addIssue = (sub: ZodIssue) => { + // console.log(`adding issue...`); + // console.log(JSON.stringify(sub, null, 2)); + this.issues = [...this.issues, sub]; + }; + + addIssues = (subs: ZodIssue[] = []) => { + // console.log(`adding issues...`); + // console.log(JSON.stringify(subs, null, 2)); + this.issues = [...this.issues, ...subs]; + }; + + flatten = (): { + formErrors: string[]; + fieldErrors: { [k: string]: string[] }; + } => { + const fieldErrors: any = {}; + const formErrors: string[] = []; + for (const sub of this.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(sub.message); + } else { + formErrors.push(sub.message); + } + } + return { formErrors, fieldErrors }; + }; + + get formErrors() { + return this.flatten(); + } +} diff --git a/deno_lib/__tests__/all-errors.test.ts b/deno_lib/__tests__/all-errors.test.ts new file mode 100644 index 000000000..303092b24 --- /dev/null +++ b/deno_lib/__tests__/all-errors.test.ts @@ -0,0 +1,25 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +test('all errors', () => { + const propertySchema = z.string(); + const schema = z.object({ + a: propertySchema, + b: propertySchema, + }); + + try { + schema.parse({ + a: null, + b: null, + }); + } catch (error) { + expect(error.flatten()).toEqual({ + formErrors: [], + fieldErrors: { + a: ['Expected string, received null'], + b: ['Expected string, received null'], + }, + }); + } +}); diff --git a/deno_lib/__tests__/anyunknown.test.ts b/deno_lib/__tests__/anyunknown.test.ts new file mode 100644 index 000000000..5c75594a7 --- /dev/null +++ b/deno_lib/__tests__/anyunknown.test.ts @@ -0,0 +1,30 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +test('check any inference', () => { + const t1 = z.any(); + t1.optional(); + t1.nullable(); + t1.toJSON(); + type t1 = z.infer; + const f1: util.AssertEqual = true; + expect(f1).toBeTruthy(); +}); + +test('check unknown inference', () => { + const t1 = z.unknown(); + t1.optional(); + t1.nullable(); + t1.toJSON(); + type t1 = z.infer; + const f1: util.AssertEqual = true; + expect(f1).toBeTruthy(); +}); + +test('check never inference', () => { + const t1 = z.never(); + expect(() => t1.parse(undefined)).toThrow(); + expect(() => t1.parse('asdf')).toThrow(); + expect(() => t1.parse(null)).toThrow(); +}); diff --git a/deno_lib/__tests__/array.test.ts b/deno_lib/__tests__/array.test.ts new file mode 100644 index 000000000..546d11881 --- /dev/null +++ b/deno_lib/__tests__/array.test.ts @@ -0,0 +1,62 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +const minTwo = z + .string() + .array() + .min(2); + +const maxTwo = z + .string() + .array() + .max(2); + +const justTwo = z + .string() + .array() + .length(2); + +const intNum = z + .string() + .array() + .nonempty(); + +const nonEmptyMax = z + .string() + .array() + .nonempty() + .max(2); + +test('passing validations', () => { + minTwo.parse(['a', 'a']); + minTwo.parse(['a', 'a', 'a']); + maxTwo.parse(['a', 'a']); + maxTwo.parse(['a']); + justTwo.parse(['a', 'a']); + intNum.parse(['a']); + nonEmptyMax.parse(['a']); +}); + +test('failing validations', () => { + expect(() => minTwo.parse(['a'])).toThrow(); + expect(() => maxTwo.parse(['a', 'a', 'a'])).toThrow(); + expect(() => justTwo.parse(['a'])).toThrow(); + expect(() => justTwo.parse(['a', 'a', 'a'])).toThrow(); + expect(() => intNum.parse([])).toThrow(); + expect(() => nonEmptyMax.parse([])).toThrow(); + expect(() => nonEmptyMax.parse(['a', 'a', 'a'])).toThrow(); +}); + +test('parse empty array in nonempty', () => { + expect(() => + z + .array(z.string()) + .nonempty() + .parse([] as any), + ).toThrow(); +}); + +test('get element', () => { + justTwo.element.parse('asdf'); + expect(() => justTwo.element.parse(12)).toThrow(); +}); diff --git a/deno_lib/__tests__/async-parsing.test.ts b/deno_lib/__tests__/async-parsing.test.ts new file mode 100644 index 000000000..7905fa5e9 --- /dev/null +++ b/deno_lib/__tests__/async-parsing.test.ts @@ -0,0 +1,440 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +const stringToNumber = z.transformer( + z.string(), + z.number(), + v => v.length + 10, +); + +/// string +const stringSchema = z.string(); +test('string async parse', async () => { + const goodData = 'XXX'; + const badData = 12; + + const goodResult = await stringSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await stringSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// number +const numberSchema = z.number(); +test('number async parse', async () => { + const goodData = 1234.2353; + const badData = '1234'; + + const goodResult = await numberSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await numberSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// bigInt +const bigIntSchema = z.bigint(); +test('bigInt async parse', async () => { + const goodData = BigInt(145); + const badData = 134; + + const goodResult = await bigIntSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await bigIntSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// boolean +const booleanSchema = z.boolean(); +test('boolean async parse', async () => { + const goodData = true; + const badData = 1; + + const goodResult = await booleanSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await booleanSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// date +const dateSchema = z.date(); +test('date async parse', async () => { + const goodData = new Date(); + const badData = new Date().toISOString(); + + const goodResult = await dateSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await dateSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// undefined +const undefinedSchema = z.undefined(); +test('undefined async parse', async () => { + const goodData = undefined; + const badData = 'XXX'; + + const goodResult = await undefinedSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(undefined); + + const badResult = await undefinedSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// null +const nullSchema = z.null(); +test('null async parse', async () => { + const goodData = null; + const badData = undefined; + + const goodResult = await nullSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await nullSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// any +const anySchema = z.any(); +test('any async parse', async () => { + const goodData = [{}]; + // const badData = 'XXX'; + + const goodResult = await anySchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + // const badResult = await anySchema.safeParseAsync(badData); + // expect(badResult.success).toBe(false); + // if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// unknown +const unknownSchema = z.unknown(); +test('unknown async parse', async () => { + const goodData = ['asdf', 124, () => {}]; + // const badData = 'XXX'; + + const goodResult = await unknownSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + // const badResult = await unknownSchema.safeParseAsync(badData); + // expect(badResult.success).toBe(false); + // if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// void +const voidSchema = z.void(); +test('void async parse', async () => { + const goodData = undefined; + const badData = 0; + + const goodResult = await voidSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await voidSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// array +const arraySchema = z.array(z.string()); +test('array async parse', async () => { + const goodData = ['XXX']; + const badData = 'XXX'; + + const goodResult = await arraySchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await arraySchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// object +const objectSchema = z.object({ string: z.string() }); +test('object async parse', async () => { + const goodData = { string: 'XXX' }; + const badData = { string: 12 }; + + const goodResult = await objectSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await objectSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// union +const unionSchema = z.union([z.string(), z.undefined()]); +test('union async parse', async () => { + const goodData = undefined; + const badData = null; + + const goodResult = await unionSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await unionSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// intersection +// const intersectionSchema = z.intersection(); +// test('intersection async parse', async () => { +// const goodData = 'XXX'; +// const badData = 'XXX'; + +// const goodResult = await intersectionSchema.safeParseAsync(goodData); +// expect(goodResult.success).toBe(true); +// if (goodResult.success) expect(goodResult.data).toEqual(goodData); + +// const badResult = await intersectionSchema.safeParseAsync(badData); +// expect(badResult.success).toBe(false); +// if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +// }); + +/// tuple +const tupleSchema = z.tuple([stringToNumber, z.object({})]); +test('tuple async parse', async () => { + const goodData = ['XXX', {}]; + const badData = [12, {}]; + + const goodResult = await tupleSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual([13, {}]); + + const badResult = await tupleSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// record +const recordSchema = z.record(z.object({})); +test('record async parse', async () => { + const goodData = { adsf: {}, asdf: {} }; + const badData = [{}]; + + const goodResult = await recordSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await recordSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// function +const functionSchema = z.function(); +test('function async parse', async () => { + const goodData = () => {}; + const badData = 'XXX'; + + const goodResult = await functionSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(typeof goodResult.data).toEqual('function'); + + const badResult = await functionSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// lazy +// const lazySchema = z.lazy(); +// test('lazy async parse', async () => { +// const goodData = 'XXX'; +// const badData = 'XXX'; + +// const goodResult = await lazySchema.safeParseAsync(goodData); +// expect(goodResult.success).toBe(true); +// if (goodResult.success) expect(goodResult.data).toEqual(goodData); + +// const badResult = await lazySchema.safeParseAsync(badData); +// expect(badResult.success).toBe(false); +// if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +// }); + +/// literal +const literalSchema = z.literal('asdf'); +test('literal async parse', async () => { + const goodData = 'asdf'; + const badData = 'asdff'; + + const goodResult = await literalSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await literalSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// enum +const enumSchema = z.enum(['fish', 'whale']); +test('enum async parse', async () => { + const goodData = 'whale'; + const badData = 'leopard'; + + const goodResult = await enumSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await enumSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// nativeEnum +enum nativeEnumTest { + asdf = 'qwer', +} +// @ts-ignore +const nativeEnumSchema = z.nativeEnum(nativeEnumTest); +test('nativeEnum async parse', async () => { + const goodData = nativeEnumTest.asdf; + const badData = 'asdf'; + + const goodResult = await nativeEnumSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(goodData); + + const badResult = await nativeEnumSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// promise +const promiseSchema = z.promise(z.number()); +test('promise async parse', async () => { + const goodData = Promise.resolve(123); + const badData = Promise.resolve('XXX'); + + const goodResult = await promiseSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual(123); + + const badResult = await promiseSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +/// transformer +const transformerSchema = z.transformer( + z.number(), + z.string(), + async val => `${Math.pow(val, 2)}`, +); +test('transformer async parse', async () => { + const goodData = 5; + const badData = '5'; + + const goodResult = await transformerSchema.safeParseAsync(goodData); + expect(goodResult.success).toBe(true); + if (goodResult.success) expect(goodResult.data).toEqual('25'); + + const badResult = await transformerSchema.safeParseAsync(badData); + expect(badResult.success).toBe(false); + if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError); +}); + +test('async validation non-empty strings', async () => { + const base = z.object({ + hello: z.string().refine(x => x && x.length > 0), + foo: z.string().refine(x => x && x.length > 0), + }); + + const testval = { hello: '', foo: '' }; + const result1 = base.safeParse(testval); + const result2 = base.safeParseAsync(testval); + + const r1 = result1; + return result2.then(r2 => { + if (r1.success === false && r2.success === false) + expect(r1.error.issues.length).toBe(r2.error.issues.length); // <--- r1 has length 2, r2 has length 1 + }); +}); + +test('async validation multiple errors 1', async () => { + const base = z.object({ + hello: z.string(), + foo: z.number(), + }); + + const testval = { hello: 3, foo: 'hello' }; + const result1 = base.safeParse(testval); + const result2 = base.safeParseAsync(testval); + + const r1 = result1; + return result2.then(r2 => { + if (r1.success === false && r2.success === false) + expect(r2.error.issues.length).toBe(r1.error.issues.length); + }); +}); + +test('async validation multiple errors 2', async () => { + const base = (is_async?: boolean) => + z.object({ + hello: z.string(), + foo: z.object({ + bar: z.number().refine(is_async ? async () => false : () => false), + }), + }); + + const testval = { hello: 3, foo: { bar: 4 } }; + const result1 = base().safeParse(testval); + const result2 = base(true).safeParseAsync(testval); + + const r1 = result1; + return result2.then(r2 => { + if (r1.success === false && r2.success === false) + expect(r2.error.issues.length).toBe(r1.error.issues.length); + }); +}); + +test('ensure early async failure prevents follow-up refinement checks', async () => { + let count = 0; + const base = z.object({ + hello: z.string(), + foo: z + .number() + .refine(async () => { + count++; + return false; + }) + .refine(async () => { + count++; + return true; + }), + }); + + const testval = { hello: 'bye', foo: 3 }; + const result = base.safeParseAsync(testval); + + return result.then(r => { + if (r.success === false) expect(r.error.issues.length).toBe(1); + expect(count).toBe(2); + }); +}); diff --git a/deno_lib/__tests__/async-refinements.test.ts b/deno_lib/__tests__/async-refinements.test.ts new file mode 100644 index 000000000..332d604fd --- /dev/null +++ b/deno_lib/__tests__/async-refinements.test.ts @@ -0,0 +1,44 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +test('parse async test', async () => { + const schema1 = z.string().refine(async _val => false); + expect(() => schema1.parse('asdf')).toThrow(); + + const schema2 = z.string().refine(_val => Promise.resolve(true)); + return await expect(() => schema2.parse('asdf')).toThrow(); +}); + +test('parseAsync async test', async () => { + const schema1 = z.string().refine(async _val => true); + await schema1.parseAsync('asdf'); + + const schema2 = z.string().refine(async _val => false); + return await expect(schema2.parseAsync('asdf')).rejects.toBeDefined(); + // expect(async () => await schema2.parseAsync('asdf')).toThrow(); +}); + +test('parseAsync async test', async () => { + // expect.assertions(2); + + const schema1 = z.string().refine(_val => Promise.resolve(true)); + const v1 = await schema1.parseAsync('asdf'); + expect(v1).toEqual('asdf'); + + const schema2 = z.string().refine(_val => Promise.resolve(false)); + await expect(schema2.parseAsync('asdf')).rejects.toBeDefined(); + + const schema3 = z.string().refine(_val => Promise.resolve(true)); + await expect(schema3.parseAsync('asdf')).resolves.toEqual('asdf'); + return await expect(schema3.parseAsync('qwer')).resolves.toEqual('qwer'); +}); + +test('parseAsync async with value', async () => { + const schema1 = z.string().refine(async val => { + return val.length > 5; + }); + expect(schema1.parseAsync('asdf')).rejects.toBeDefined(); + + const v = await schema1.parseAsync('asdf123'); + return await expect(v).toEqual('asdf123'); +}); diff --git a/deno_lib/__tests__/base.test.ts b/deno_lib/__tests__/base.test.ts new file mode 100644 index 000000000..07eae2826 --- /dev/null +++ b/deno_lib/__tests__/base.test.ts @@ -0,0 +1,18 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +test('type guard', () => { + const stringToNumber = z.string().transform(z.number(), arg => arg.length); + + const s1 = z.object({ + stringToNumber, + }); + type t1 = z.input; + + const data: any = 'asdf'; + if (s1.check(data)) { + const f1: util.AssertEqual = true; + f1; + } +}); diff --git a/deno_lib/__tests__/codegen.test.ts b/deno_lib/__tests__/codegen.test.ts new file mode 100644 index 000000000..9937598f0 --- /dev/null +++ b/deno_lib/__tests__/codegen.test.ts @@ -0,0 +1,9 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { crazySchema } from '../crazySchema.ts'; + +test('ZodCodeGenerator', () => { + const gen = new z.ZodCodeGenerator(); + gen.generate(crazySchema); + gen.dump(); +}); diff --git a/deno_lib/__tests__/complex.test.ts b/deno_lib/__tests__/complex.test.ts new file mode 100644 index 000000000..5911e9bec --- /dev/null +++ b/deno_lib/__tests__/complex.test.ts @@ -0,0 +1,51 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { crazySchema } from '../crazySchema.ts'; + +test('parse', () => { + const value = crazySchema.parse({ + tuple: ['asdf', 1234, true, null, undefined, '1234'], + merged: { k1: 'asdf', k2: 12 }, + union: ['asdf', 12, 'asdf', 12, 'asdf', 12], + array: [12, 15, 16], + sumTransformer: [12, 15, 16], + sumMinLength: [12, 15, 16, 98, 24, 63], + intersection: {}, + enum: 'one', + nonstrict: { points: 1234 }, + numProm: Promise.resolve(12), + lenfun: (x: string) => x.length, + }); + expect(typeof value.sumTransformer).toEqual('number'); +}); + +test('to JSON', () => { + crazySchema.toJSON(); +}); + +const stringSchema = z.string(); + +test('type guard', () => { + if (stringSchema.check('adsf' as any)) { + } +}); + +test('type guard fail', () => { + if (crazySchema.check('asdf' as any)) { + } +}); + +test('type guard (is)', () => { + if (stringSchema.is('asdf' as any)) { + } +}); + +test('type guard failure (is)', () => { + if (crazySchema.is('asdf' as any)) { + } +}); + +test('ZodCodeGenerator', () => { + const gen = new z.ZodCodeGenerator(); + gen.generate(crazySchema); +}); diff --git a/deno_lib/__tests__/deepmasking.test.ts b/deno_lib/__tests__/deepmasking.test.ts new file mode 100644 index 000000000..9c7aa00a4 --- /dev/null +++ b/deno_lib/__tests__/deepmasking.test.ts @@ -0,0 +1,184 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";// import * as z from '../index.ts'; + +test('dummy test deepmasking', () => { + expect(true).toBeTruthy(); +}); + +// const fish = z.object({ +// name: z.string(), +// props: z.object({ +// color: z.string(), +// numScales: z.number(), +// }), +// }); + +// const nonStrict = z +// .object({ +// name: z.string(), +// color: z.string(), +// }) +// .nonstrict(); + +// test('object pick type', () => { +// const modNonStrictFish = nonStrict.omit({ name: true }); +// modNonStrictFish.parse({ color: 'asdf' }); + +// const bad1 = () => fish.pick({ props: { unknown: true } } as any); +// const bad2 = () => fish.omit({ name: true, props: { unknown: true } } as any); + +// expect(bad1).toThrow(); +// expect(bad2).toThrow(); +// }); + +// test('f1', () => { +// const f1 = fish.pick(true); +// f1.parse({ name: 'a', props: { color: 'b', numScales: 3 } }); +// }); +// test('f2', () => { +// const f2 = fish.pick({ props: true }); +// f2.parse({ props: { color: 'asdf', numScales: 1 } }); +// const badcheck2 = () => f2.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); +// expect(badcheck2).toThrow(); +// }); +// test('f3', () => { +// const f3 = fish.pick({ props: { color: true } }); +// f3.parse({ props: { color: 'b' } }); +// const badcheck3 = () => f3.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); +// expect(badcheck3).toThrow(); +// }); +// test('f4', () => { +// const badcheck4 = () => fish.pick({ props: { color: true, unknown: true } }); +// expect(badcheck4).toThrow(); +// }); +// test('f6', () => { +// const f6 = fish.omit({ props: true }); +// const badcheck6 = () => f6.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); +// f6.parse({ name: 'adsf' }); +// expect(badcheck6).toThrow(); +// }); +// test('f7', () => { +// const f7 = fish.omit({ props: { color: true } }); +// f7.parse({ name: 'a', props: { numScales: 3 } }); +// const badcheck7 = () => f7.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); +// expect(badcheck7).toThrow(); +// }); +// test('f8', () => { +// const badcheck8 = () => fish.omit({ props: { color: true, unknown: true } }); +// expect(badcheck8).toThrow(); +// }); +// test('f9', () => { +// const f9 = nonStrict.pick(true); +// f9.parse({ name: 'a', color: 'asdf' }); +// }); +// test('f10', () => { +// const f10 = nonStrict.pick({ name: true }); +// f10.parse({ name: 'a' }); +// const val = f10.parse({ name: 'a', color: 'b' }); +// expect(val).toStrictEqual({ name: 'a' }); +// }); +// test('f12', () => { +// const badfcheck12 = () => nonStrict.omit({ color: true, asdf: true }); +// expect(badfcheck12).toThrow(); +// }); + +// test('array masking', () => { +// const fishArray = z.array(fish); +// const modFishArray = fishArray.pick({ +// name: true, +// props: { +// numScales: true, +// }, +// }); + +// modFishArray.parse([{ name: 'fish', props: { numScales: 12 } }]); +// const bad1 = () => modFishArray.parse([{ name: 'fish', props: { numScales: 12, color: 'asdf' } }] as any); +// expect(bad1).toThrow(); +// }); + +// test('array masking', () => { +// const fishArray = z.array(fish); +// const fail = () => +// fishArray.pick({ +// name: true, +// props: { +// whatever: true, +// }, +// } as any); +// expect(fail).toThrow(); +// }); + +// test('array masking', () => { +// const fishArray = z.array(fish); +// const fail = () => +// fishArray.omit({ +// whateve: true, +// } as any); +// expect(fail).toThrow(); +// }); + +// test('array masking', () => { +// const fishArray = z.array(fish); +// const modFishList = fishArray.omit({ +// name: true, +// props: { +// color: true, +// }, +// }); + +// modFishList.parse([{ props: { numScales: 12 } }]); +// const fail = () => modFishList.parse([{ name: 'hello', props: { numScales: 12 } }] as any); +// expect(fail).toThrow(); +// }); + +// test('primitive array masking', () => { +// const fishArray = z.array(z.number()); +// const fail = () => fishArray.pick({} as any); +// expect(fail).toThrow(); +// }); + +// test('other array masking', () => { +// const fishArray = z.array(z.array(z.number())); +// const fail = () => fishArray.pick({} as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #1', () => { +// const fail = () => fish.pick(1 as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #2', () => { +// const fail = () => fish.pick([] as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #3', () => { +// const fail = () => fish.pick(false as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #4', () => { +// const fail = () => fish.pick('asdf' as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #5', () => { +// const fail = () => fish.omit(1 as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #6', () => { +// const fail = () => fish.omit([] as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #7', () => { +// const fail = () => fish.omit(false as any); +// expect(fail).toThrow(); +// }); + +// test('invalid mask #8', () => { +// const fail = () => fish.omit('asdf' as any); +// expect(fail).toThrow(); +// }); diff --git a/deno_lib/__tests__/enum.test.ts b/deno_lib/__tests__/enum.test.ts new file mode 100644 index 000000000..28d04a870 --- /dev/null +++ b/deno_lib/__tests__/enum.test.ts @@ -0,0 +1,21 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +test('create enum', () => { + const MyEnum = z.enum(['Red', 'Green', 'Blue']); + expect(MyEnum.Values.Red).toEqual('Red'); + expect(MyEnum.Enum.Red).toEqual('Red'); + expect(MyEnum.enum.Red).toEqual('Red'); +}); + +test('infer enum', () => { + const MyEnum = z.enum(['Red', 'Green', 'Blue']); + type MyEnum = z.infer; + const t1: util.AssertEqual = true; + [t1]; +}); + +test('get options', () => { + expect(z.enum(['tuna', 'trout']).options).toEqual(['tuna', 'trout']); +}); diff --git a/deno_lib/__tests__/error.test.ts b/deno_lib/__tests__/error.test.ts new file mode 100644 index 000000000..dc7dc014a --- /dev/null +++ b/deno_lib/__tests__/error.test.ts @@ -0,0 +1,189 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { ZodError, ZodIssueCode } from '../ZodError.ts'; +import { ZodParsedType } from '../parser.ts'; + +test('error creation', () => { + const err1 = ZodError.create([]); + err1.addIssue({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ZodParsedType.string, + path: [], + message: '', + }); + err1.isEmpty; + + const err2 = ZodError.create(err1.issues); + const err3 = new ZodError([]); + err3.addIssues(err1.issues); + err3.addIssue(err1.issues[0]); + err1.message; + err2.message; + err3.message; +}); + +const errorMap: z.ZodErrorMap = (error, ctx) => { + if (error.code === ZodIssueCode.invalid_type) { + if (error.expected === 'string') { + return { message: 'bad type!' }; + } + } + if (error.code === ZodIssueCode.custom) { + return { message: `less-than-${(error.params || {}).minimum}` }; + } + return { message: ctx.defaultError }; +}; + +test('type error with custom error map', () => { + try { + z.string().parse('asdf', { errorMap }); + } catch (err) { + const zerr: z.ZodError = err; + + expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.invalid_type); + expect(zerr.issues[0].message).toEqual(`bad type!`); + } +}); + +test('refinement fail with params', () => { + try { + z.number() + .refine(val => val >= 3, { + params: { minimum: 3 }, + }) + .parse(2, { errorMap }); + } catch (err) { + const zerr: z.ZodError = err; + expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.custom); + expect(zerr.issues[0].message).toEqual(`less-than-3`); + } +}); + +test('custom error with custom errormap', () => { + try { + z.string() + .refine(val => val.length > 12, { + params: { minimum: 13 }, + message: 'override', + }) + .parse('asdf', { errorMap }); + } catch (err) { + const zerr: z.ZodError = err; + expect(zerr.issues[0].message).toEqual('override'); + } +}); + +test('default error message', () => { + try { + z.number() + .refine(x => x > 3) + .parse(2); + } catch (err) { + const zerr: z.ZodError = err; + expect(zerr.issues.length).toEqual(1); + expect(zerr.issues[0].message).toEqual('Invalid value.'); + } +}); + +test('override error in refine', () => { + try { + z.number() + .refine(x => x > 3, 'override') + .parse(2); + } catch (err) { + const zerr: z.ZodError = err; + expect(zerr.issues.length).toEqual(1); + expect(zerr.issues[0].message).toEqual('override'); + } +}); + +test('override error in refinement', () => { + try { + z.number() + .refine(x => x > 3, { + message: 'override', + }) + .parse(2); + } catch (err) { + const zerr: z.ZodError = err; + expect(zerr.issues.length).toEqual(1); + expect(zerr.issues[0].message).toEqual('override'); + } +}); + +test('array minimum', () => { + try { + z.array(z.string()) + .min(3, 'tooshort') + .parse(['asdf', 'qwer']); + } catch (err) { + const zerr: ZodError = err; + expect(zerr.issues[0].code).toEqual(ZodIssueCode.too_small); + expect(zerr.issues[0].message).toEqual('tooshort'); + } + try { + z.array(z.string()) + .min(3) + .parse(['asdf', 'qwer']); + } catch (err) { + const zerr: ZodError = err; + expect(zerr.issues[0].code).toEqual(ZodIssueCode.too_small); + expect(zerr.issues[0].message).toEqual(`Should have at least 3 items`); + } +}); + +// implement test for semi-smart union logic that checks for type error on either left or right +test('union smart errors', () => { + // expect.assertions(2); + + const p1 = z + .union([z.string(), z.number().refine(x => x > 0)]) + .safeParse(-3.2); + + if (p1.success === true) throw new Error(); + // console.log(JSON.stringify(p1.error, null, 2)); + expect(p1.success).toBe(false); + expect(p1.error.issues[0].code).toEqual(ZodIssueCode.custom); + + const p2 = z.union([z.string(), z.number()]).safeParse(false); + // .catch(err => expect(err.issues[0].code).toEqual(ZodIssueCode.invalid_union)); + if (p2.success === true) throw new Error(); + expect(p2.success).toBe(false); + expect(p2.error.issues[0].code).toEqual(ZodIssueCode.invalid_union); +}); + +test('custom path in custom error map', () => { + const schema = z.object({ + items: z.array(z.string()).refine(data => data.length > 3, { + path: ['items-too-few'], + }), + }); + + const errorMap: z.ZodErrorMap = error => { + expect(error.path.length).toBe(2); + return { message: 'doesnt matter' }; + }; + const result = schema.safeParse({ items: ['first'] }, { errorMap }); + expect(result.success).toEqual(false); + if (!result.success) { + expect(result.error.issues[0].path).toEqual(['items', 'items-too-few']); + } +}); + +test('error metadata from value', () => { + const dynamicRefine = z.string().refine( + val => val === val.toUpperCase(), + val => ({ params: { val } }), + ); + + const result = dynamicRefine.safeParse('asdf'); + expect(result.success).toEqual(false); + if (!result.success) { + const sub = result.error.issues[0]; + expect(result.error.issues[0].code).toEqual('custom'); + if (sub.code === 'custom') { + expect(sub.params!.val).toEqual('asdf'); + } + } +}); diff --git a/deno_lib/__tests__/function.test.ts b/deno_lib/__tests__/function.test.ts new file mode 100644 index 000000000..fce031a44 --- /dev/null +++ b/deno_lib/__tests__/function.test.ts @@ -0,0 +1,140 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +const args1 = z.tuple([z.string()]); +const returns1 = z.number(); +const func1 = z.function(args1, returns1); + +test('function parsing', () => { + const parsed = func1.parse((arg: any) => arg.length); + parsed('asdf'); +}); + +test('parsed function fail 1', () => { + const parsed = func1.parse((x: string) => x); + expect(() => parsed('asdf')).toThrow(); +}); + +test('parsed function fail 2', () => { + const parsed = func1.parse((x: string) => x); + expect(() => parsed(13 as any)).toThrow(); +}); + +test('function inference 1', () => { + type func1 = z.TypeOf; + const t1: util.AssertEqual number> = true; + [t1]; +}); + +test('args method', () => { + const t1 = z.function(); + type t1 = z.infer; + const f1: util.AssertEqual void> = true; + + const t2 = t1.args(z.string()); + type t2 = z.infer; + const f2: util.AssertEqual void> = true; + + const t3 = t2.returns(z.boolean()); + type t3 = z.infer; + const f3: util.AssertEqual boolean> = true; + + f1; + f2; + f3; +}); + +const args2 = z.tuple([ + z.object({ + f1: z.number(), + f2: z.string().nullable(), + f3: z.array(z.boolean().optional()).optional(), + }), +]); +const returns2 = z.union([z.string(), z.number()]); + +const func2 = z.function(args2, returns2); + +test('function inference 2', () => { + type func2 = z.TypeOf; + const t2: util.AssertEqual< + func2, + (arg: { + f1: number; + f2: string | null; + f3?: (boolean | undefined)[] | undefined; + }) => string | number + > = true; + [t2]; +}); + +test('valid function run', () => { + const validFunc2Instance = func2.validate(_x => { + return 'adf' as any; + }); + + const checker = () => { + validFunc2Instance({ + f1: 21, + f2: 'asdf', + f3: [true, false], + }); + }; + + checker(); +}); + +test('input validation error', () => { + const invalidFuncInstance = func2.validate(_x => { + return 'adf' as any; + }); + + const checker = () => { + invalidFuncInstance('Invalid_input' as any); + }; + + expect(checker).toThrow(); +}); + +test('output validation error', () => { + const invalidFuncInstance = func2.validate(_x => { + return ['this', 'is', 'not', 'valid', 'output'] as any; + }); + + const checker = () => { + invalidFuncInstance({ + f1: 21, + f2: 'asdf', + f3: [true, false], + }); + }; + + expect(checker).toThrow(); +}); + +test('special function error codes', () => { + const checker = z + .function(z.tuple([z.string()]), z.boolean()) + .implement(arg => { + return arg.length as any; + }); + try { + checker('12' as any); + } catch (err) { + const zerr: z.ZodError = err; + const first = zerr.issues[0]; + if (first.code !== z.ZodIssueCode.invalid_return_type) throw new Error(); + + expect(first.returnTypeError).toBeInstanceOf(z.ZodError); + } + + try { + checker(12 as any); + } catch (err) { + const zerr: z.ZodError = err; + const first = zerr.issues[0]; + if (first.code !== z.ZodIssueCode.invalid_arguments) throw new Error(); + expect(first.argumentsError).toBeInstanceOf(z.ZodError); + } +}); diff --git a/deno_lib/__tests__/instanceof.test.ts b/deno_lib/__tests__/instanceof.test.ts new file mode 100644 index 000000000..0920b5590 --- /dev/null +++ b/deno_lib/__tests__/instanceof.test.ts @@ -0,0 +1,25 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +test('instanceof', async () => { + class Test {} + class Subtest extends Test {} + + const TestSchema = z.instanceof(Test); + const SubtestSchema = z.instanceof(Subtest); + + TestSchema.parse(new Test()); + TestSchema.parse(new Subtest()); + SubtestSchema.parse(new Subtest()); + + await expect(() => SubtestSchema.parse(new Test())).toThrow( + /Input not instance of Subtest/, + ); + await expect(() => TestSchema.parse(12)).toThrow( + /Input not instance of Test/, + ); + + const f1: util.AssertEqual> = true; + expect(f1).toBeTruthy(); +}); diff --git a/deno_lib/__tests__/intersection.test.ts b/deno_lib/__tests__/intersection.test.ts new file mode 100644 index 000000000..dca0c3146 --- /dev/null +++ b/deno_lib/__tests__/intersection.test.ts @@ -0,0 +1,22 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +test('object intersection', () => { + const BaseTeacher = z.object({ + subjects: z.array(z.string()), + }); + const HasID = z.object({ id: z.string() }); + + const Teacher = z.intersection(BaseTeacher.passthrough(), HasID); // BaseTeacher.merge(HasID); + const data = { + subjects: ['math'], + id: 'asdfasdf', + }; + expect(Teacher.parse(data)).toEqual(data); + expect(() => Teacher.parse({ subject: data.subjects })).toThrow(); + expect(Teacher.parse({ ...data, extra: 12 })).toEqual({ ...data, extra: 12 }); + + expect(() => + z.intersection(BaseTeacher.strict(), HasID).parse({ ...data, extra: 12 }), + ).toThrow(); +}); diff --git a/deno_lib/__tests__/map.tests.ts b/deno_lib/__tests__/map.tests.ts new file mode 100644 index 000000000..856832833 --- /dev/null +++ b/deno_lib/__tests__/map.tests.ts @@ -0,0 +1,64 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; +import { ZodIssueCode } from '../index.ts'; + +const stringMap = z.map(z.string(), z.string()); +type stringMap = z.infer; + +test('type inference', () => { + const f1: util.AssertEqual> = true; + f1; +}); + +test('doesn’t throw when a valid value is given', () => { + const result = stringMap.safeParse( + new Map([ + ['first', 'foo'], + ['second', 'bar'], + ]), + ); + expect(result.success).toEqual(true); +}); + +test('throws when a Set is given', () => { + const result = stringMap.safeParse(new Set([])); + expect(result.success).toEqual(false); + if (result.success === false) { + expect(result.error.issues.length).toEqual(1); + expect(result.error.issues[0].code).toEqual(ZodIssueCode.invalid_type); + } +}); + +test('throws when the given map has invalid key and invalid value', () => { + const result = stringMap.safeParse(new Map([[42, Symbol()]])); + expect(result.success).toEqual(false); + if (result.success === false) { + expect(result.error.issues.length).toEqual(2); + expect(result.error.issues[0].code).toEqual(ZodIssueCode.invalid_type); + expect(result.error.issues[0].path).toEqual([0, 'key']); + expect(result.error.issues[1].code).toEqual(ZodIssueCode.invalid_type); + expect(result.error.issues[1].path).toEqual([0, 'value']); + } +}); + +test('throws when the given map has multiple invalid entries', () => { + // const result = stringMap.safeParse(new Map([[42, Symbol()]])); + + const result = stringMap.safeParse( + new Map([ + [1, 'foo'], + ['bar', 2], + ] as [any, any][]) as Map, + ); + + // const result = stringMap.safeParse(new Map([[42, Symbol()]])); + expect(result.success).toEqual(false); + if (result.success === false) { + expect(result.error.issues.length).toEqual(2); + expect(result.error.issues[0].code).toEqual(ZodIssueCode.invalid_type); + expect(result.error.issues[0].path).toEqual([0, 'key']); + expect(result.error.issues[1].code).toEqual(ZodIssueCode.invalid_type); + expect(result.error.issues[1].path).toEqual([1, 'value']); + } +}); diff --git a/deno_lib/__tests__/masking.test.ts b/deno_lib/__tests__/masking.test.ts new file mode 100644 index 000000000..7b113b554 --- /dev/null +++ b/deno_lib/__tests__/masking.test.ts @@ -0,0 +1,20 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +test('masking test', () => {}); + +test('require', () => { + const baseSchema = z.object({ + firstName: z.string(), + middleName: z.string().optional(), + lastName: z.union([z.undefined(), z.string()]), + otherName: z.union([z.string(), z.undefined(), z.string()]), + }); + baseSchema; + // const reqBase = baseSchema.require(); + // const ewr = reqBase.shape; + // expect(ewr.firstName).toBeInstanceOf(z.ZodString); + // expect(ewr.middleName).toBeInstanceOf(z.ZodString); + // expect(ewr.lastName).toBeInstanceOf(z.ZodString); + // expect(ewr.otherName).toBeInstanceOf(z.ZodUnion); +}); diff --git a/deno_lib/__tests__/mocker.test.ts b/deno_lib/__tests__/mocker.test.ts new file mode 100644 index 000000000..e4eb38e44 --- /dev/null +++ b/deno_lib/__tests__/mocker.test.ts @@ -0,0 +1,17 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import { Mocker } from '../helpers/Mocker.ts'; + +test('mocker', () => { + const mocker = new Mocker(); + mocker.string; + mocker.number; + mocker.boolean; + mocker.null; + mocker.undefined; + mocker.stringOptional; + mocker.stringNullable; + mocker.numberOptional; + mocker.numberNullable; + mocker.booleanOptional; + mocker.booleanNullable; +}); diff --git a/deno_lib/__tests__/nativeEnum.test.ts b/deno_lib/__tests__/nativeEnum.test.ts new file mode 100644 index 000000000..b24421bb0 --- /dev/null +++ b/deno_lib/__tests__/nativeEnum.test.ts @@ -0,0 +1,86 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +test('nativeEnum test with consts', () => { + const Fruits: { Apple: 'apple'; Banana: 'banana' } = { + Apple: 'apple', + Banana: 'banana', + }; + const fruitEnum = z.nativeEnum(Fruits); + type fruitEnum = z.infer; + fruitEnum.parse('apple'); + fruitEnum.parse('banana'); + fruitEnum.parse(Fruits.Apple); + fruitEnum.parse(Fruits.Banana); + const t1: util.AssertEqual = true; + [t1]; +}); + +test('nativeEnum test with real enum', () => { + enum Fruits { + Apple = 'apple', + Banana = 'banana', + } + // @ts-ignore + const fruitEnum = z.nativeEnum(Fruits); + type fruitEnum = z.infer; + fruitEnum.parse('apple'); + fruitEnum.parse('banana'); + fruitEnum.parse(Fruits.Apple); + fruitEnum.parse(Fruits.Banana); + const t1: util.AssertEqual = true; + [t1]; +}); + +test('nativeEnum test with const with numeric keys', () => { + const FruitValues = { + Apple: 10, + Banana: 20, + // @ts-ignore + } as const; + const fruitEnum = z.nativeEnum(FruitValues); + type fruitEnum = z.infer; + fruitEnum.parse(10); + fruitEnum.parse(20); + fruitEnum.parse(FruitValues.Apple); + fruitEnum.parse(FruitValues.Banana); + const t1: util.AssertEqual = true; + [t1]; +}); + +test('from enum', () => { + enum Fruits { + Cantaloupe, + Apple = 'apple', + Banana = 'banana', + } + + const FruitEnum = z.nativeEnum(Fruits as any); + type FruitEnum = z.infer; + FruitEnum.parse(Fruits.Cantaloupe); + FruitEnum.parse(Fruits.Apple); + FruitEnum.parse('apple'); + FruitEnum.parse(0); + expect(() => FruitEnum.parse(1)).toThrow(); + expect(() => FruitEnum.parse('Apple')).toThrow(); + expect(() => FruitEnum.parse('Cantaloupe')).toThrow(); +}); + +test('from const', () => { + const Greek = { + Alpha: 'a', + Beta: 'b', + Gamma: 3, + // @ts-ignore + } as const; + + const GreekEnum = z.nativeEnum(Greek); + type GreekEnum = z.infer; + GreekEnum.parse('a'); + GreekEnum.parse('b'); + GreekEnum.parse(3); + expect(() => GreekEnum.parse('v')).toThrow(); + expect(() => GreekEnum.parse('Alpha')).toThrow(); + expect(() => GreekEnum.parse(2)).toThrow(); +}); diff --git a/deno_lib/__tests__/number.test.ts b/deno_lib/__tests__/number.test.ts new file mode 100644 index 000000000..49871e733 --- /dev/null +++ b/deno_lib/__tests__/number.test.ts @@ -0,0 +1,24 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +const minFive = z.number().min(5, 'min5'); +const maxFive = z.number().max(5, 'max5'); +const intNum = z.number().int(); + +test('passing validations', () => { + minFive.parse(5); + minFive.parse(6); + maxFive.parse(5); + maxFive.parse(4); + intNum.parse(4); +}); + +test('failing validations', () => { + expect(() => minFive.parse(4)).toThrow(); + expect(() => maxFive.parse(6)).toThrow(); + expect(() => intNum.parse(3.14)).toThrow(); +}); + +test('parse NaN', () => { + expect(() => z.number().parse(NaN)).toThrow(); +}); diff --git a/deno_lib/__tests__/object-augmentation.test.ts b/deno_lib/__tests__/object-augmentation.test.ts new file mode 100644 index 000000000..42841b05b --- /dev/null +++ b/deno_lib/__tests__/object-augmentation.test.ts @@ -0,0 +1,27 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +test('object augmentation', () => { + const Animal = z + .object({ + species: z.string(), + }) + .augment({ + population: z.number(), + }); + // overwrites `species` + const ModifiedAnimal = Animal.augment({ + species: z.array(z.string()), + }); + ModifiedAnimal.parse({ + species: ['asd'], + population: 1324, + }); + + const bad = () => + ModifiedAnimal.parse({ + species: 'asdf', + population: 1324, + } as any); + expect(bad).toThrow(); +}); diff --git a/deno_lib/__tests__/object.test.ts b/deno_lib/__tests__/object.test.ts new file mode 100644 index 000000000..a936055d4 --- /dev/null +++ b/deno_lib/__tests__/object.test.ts @@ -0,0 +1,268 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +const Test = z.object({ + f1: z.number(), + f2: z.string().optional(), + f3: z.string().nullable(), + f4: z.array(z.object({ t: z.union([z.string(), z.boolean()]) })), +}); +type Test = z.infer; + +test('object type inference', () => { + type TestType = { + f1: number; + f2?: string | undefined; + f3: string | null; + f4: { t: string | boolean }[]; + }; + + const t1: util.AssertEqual, TestType> = true; + [t1]; +}); + +test('unknown throw', () => { + const asdf: unknown = 35; + expect(() => Test.parse(asdf)).toThrow(); +}); + +test('correct parsing', () => { + Test.parse({ + f1: 12, + f2: 'string', + f3: 'string', + f4: [ + { + t: 'string', + }, + ], + }); + + Test.parse({ + f1: 12, + f3: null, + f4: [ + { + t: false, + }, + ], + }); +}); + +test('incorrect #1', () => { + expect(() => Test.parse({} as any)).toThrow(); +}); + +test('inference', () => { + const t1 = z.object({ + name: z.string(), + obj: z.object({}), + arrayarray: z.array(z.array(z.string())), + }); + + const i1 = t1.primitives(); + type i1 = z.infer; + const f1: util.AssertEqual = true; + + const i2 = t1.nonprimitives(); + type i2 = z.infer; + const f2: util.AssertEqual = true; + + expect(f1).toBeTruthy(); + expect(f2).toBeTruthy(); + i1.parse({ name: 'name' }); + i2.parse({ obj: {}, arrayarray: [['asdf']] }); + expect(() => i1.parse({} as any)).toThrow(); +}); + +test('nonstrict by default', () => { + z.object({ points: z.number() }).parse({ + points: 2314, + unknown: 'asdf', + }); +}); + +const data = { + points: 2314, + unknown: 'asdf', +}; + +test('strip by default', () => { + const val = z.object({ points: z.number() }).parse(data); + expect(val).toEqual({ points: 2314 }); +}); + +test('unknownkeys override', () => { + const val = z + .object({ points: z.number() }) + .strict() + .passthrough() + .strip() + .nonstrict() + .parse(data); + + expect(val).toEqual(data); +}); + +test('passthrough unknown', () => { + const val = z + .object({ points: z.number() }) + .passthrough() + .parse(data); + + expect(val).toEqual(data); +}); + +test('strip unknown', () => { + const val = z + .object({ points: z.number() }) + .strip() + .parse(data); + + expect(val).toEqual({ points: 2314 }); +}); + +test('strict', () => { + const val = z + .object({ points: z.number() }) + .strict() + .safeParse(data); + + expect(val.success).toEqual(false); +}); + +test('primitives', () => { + const baseObj = z.object({ + stringPrimitive: z.string(), + stringArrayPrimitive: z.array(z.string()), + numberPrimitive: z.number(), + numberArrayPrimitive: z.array(z.number()), + booleanPrimitive: z.boolean(), + booleanArrayPrimitive: z.array(z.boolean()), + bigintPrimitive: z.bigint(), + bigintArrayPrimitive: z.array(z.bigint()), + undefinedPrimitive: z.undefined(), + nullPrimitive: z.null(), + primitiveUnion: z.union([z.string(), z.number()]), + primitiveIntersection: z.intersection(z.string(), z.string()), + lazyPrimitive: z.lazy(() => z.string()), + literalPrimitive: z.literal('sup'), + enumPrimitive: z.enum(['asdf', 'qwer']), + datePrimitive: z.date(), + primitiveTuple: z.tuple([z.string(), z.number()]), + + nonprimitiveUnion: z.union([z.string(), z.object({})]), + object: z.object({}), + objectArray: z.object({}).array(), + arrayarray: z.array(z.array(z.string())), + nonprimitiveTuple: z.tuple([z.string(), z.number().array()]), + }); + + expect(Object.keys(baseObj.primitives().shape)).toEqual([ + 'stringPrimitive', + 'stringArrayPrimitive', + 'numberPrimitive', + 'numberArrayPrimitive', + 'booleanPrimitive', + 'booleanArrayPrimitive', + 'bigintPrimitive', + 'bigintArrayPrimitive', + 'undefinedPrimitive', + 'nullPrimitive', + 'primitiveUnion', + 'primitiveIntersection', + 'lazyPrimitive', + 'literalPrimitive', + 'enumPrimitive', + 'datePrimitive', + 'primitiveTuple', + ]); + + expect(Object.keys(baseObj.nonprimitives().shape)).toEqual([ + 'nonprimitiveUnion', + 'object', + 'objectArray', + 'arrayarray', + 'nonprimitiveTuple', + ]); +}); + +test('catchall inference', () => { + const o1 = z + .object({ + first: z.string(), + }) + .catchall(z.number()); + + const d1 = o1.parse({ first: 'asdf', num: 1243 }); + const f1: util.AssertEqual = true; + const f2: util.AssertEqual = true; + f1; + f2; +}); + +test('catchall overrides strict', () => { + const o1 = z + .object({ first: z.string().optional() }) + .strict() + .catchall(z.number()); + + // should run fine + // setting a catchall overrides the unknownKeys behavior + o1.parse({ + asdf: 1234, + }); + + // should only run catchall validation + // against unknown keys + o1.parse({ + first: 'asdf', + asdf: 1234, + }); +}); + +test('catchall overrides strict', () => { + const o1 = z + .object({ + first: z.string(), + }) + .strict() + .catchall(z.number()); + + // should run fine + // setting a catchall overrides the unknownKeys behavior + o1.parse({ + first: 'asdf', + asdf: 1234, + }); +}); + +test('test that optional keys are unset', async () => { + const SNamedEntity = z.object({ + id: z.string(), + set: z.string().optional(), + unset: z.string().optional(), + }); + const result = await SNamedEntity.parse({ + id: 'asdf', + set: undefined, + }); + expect(Object.keys(result)).toEqual(['id', 'set']); +}); + +test('test catchall parsing', async () => { + const result = z + .object({ name: z.string() }) + .catchall(z.number()) + .parse({ name: 'Foo', validExtraKey: 61 }); + + expect(result).toEqual({ name: 'Foo', validExtraKey: 61 }); + + const result2 = z + .object({ name: z.string() }) + .catchall(z.number()) + .safeParse({ name: 'Foo', validExtraKey: 61, invalid: 'asdf' }); + + expect(result2.success).toEqual(false); +}); diff --git a/deno_lib/__tests__/optional.test.ts b/deno_lib/__tests__/optional.test.ts new file mode 100644 index 000000000..a75361171 --- /dev/null +++ b/deno_lib/__tests__/optional.test.ts @@ -0,0 +1,53 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +function checkErrors(a: z.ZodTypeAny, bad: any) { + let expected; + try { + a.parse(bad); + } catch (error) { + expected = error.formErrors; + } + try { + a.optional().parse(bad); + } catch (error) { + expect(error.formErrors).toEqual(expected); + } +} + +test('Should have error messages appropriate for the underlying type', () => { + checkErrors(z.string().min(2), 1); + z.string() + .min(2) + .optional() + .parse(undefined); + checkErrors(z.number().min(2), 1); + z.number() + .min(2) + .optional() + .parse(undefined); + checkErrors(z.boolean(), ''); + z.boolean() + .optional() + .parse(undefined); + checkErrors(z.undefined(), null); + z.undefined() + .optional() + .parse(undefined); + checkErrors(z.null(), {}); + z.null() + .optional() + .parse(undefined); + checkErrors(z.object({}), 1); + z.object({}) + .optional() + .parse(undefined); + checkErrors(z.tuple([]), 1); + z.tuple([]) + .optional() + .parse(undefined); + checkErrors(z.unknown(), 1); + z.unknown() + .optional() + .parse(undefined); +}); diff --git a/deno_lib/__tests__/parser.test.ts b/deno_lib/__tests__/parser.test.ts new file mode 100644 index 000000000..f86353934 --- /dev/null +++ b/deno_lib/__tests__/parser.test.ts @@ -0,0 +1,45 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +test('parse strict object with unknown keys', () => { + expect(() => + z + .object({ name: z.string() }) + .strict() + .parse({ name: 'bill', unknownKey: 12 } as any), + ).toThrow(); +}); + +test('parse nonstrict object with unknown keys', () => { + z.object({ name: z.string() }) + .nonstrict() + .parse({ name: 'bill', unknownKey: 12 }); +}); + +test('invalid left side of intersection', () => { + expect(() => + z.intersection(z.string(), z.number()).parse(12 as any), + ).toThrow(); +}); + +test('invalid right side of intersection', () => { + expect(() => + z.intersection(z.string(), z.number()).parse('12' as any), + ).toThrow(); +}); + +test('parsing non-array in tuple schema', () => { + expect(() => z.tuple([]).parse('12' as any)).toThrow(); +}); + +test('incorrect num elements in tuple', () => { + expect(() => z.tuple([]).parse(['asdf'] as any)).toThrow(); +}); + +test('invalid enum value', () => { + expect(() => z.enum(['Blue']).parse('Red' as any)).toThrow(); +}); + +test('parsing unknown', () => { + z.string().parse('Red' as unknown); +}); diff --git a/deno_lib/__tests__/partials.test.ts b/deno_lib/__tests__/partials.test.ts new file mode 100644 index 000000000..8f4a52990 --- /dev/null +++ b/deno_lib/__tests__/partials.test.ts @@ -0,0 +1,74 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +const nested = z.object({ + name: z.string(), + age: z.number(), + outer: z.object({ + inner: z.string(), + }), +}); + +test('shallow inference', () => { + const shallow = nested.partial(); + type shallow = z.infer; + type correct = { + name?: string | undefined; + age?: number | undefined; + outer?: { inner: string } | undefined; + }; + const t1: util.AssertEqual = true; + t1; +}); + +test('shallow partial parse', () => { + const shallow = nested.partial(); + shallow.parse({}); + shallow.parse({ + name: 'asdf', + age: 23143, + }); +}); + +test('deep partial inference', () => { + const deep = nested.deepPartial(); + type deep = z.infer; + type correct = { + name?: string | undefined; + age?: number | undefined; + outer?: { inner?: string | undefined } | undefined; + }; + + const t1: util.AssertEqual = true; + t1; +}); + +test('deep partial parse', () => { + const deep = nested.deepPartial(); + expect(deep.shape.name instanceof z.ZodOptional).toBe(true); + expect(deep.shape.outer instanceof z.ZodOptional).toBe(true); + expect(deep.shape.outer._def.innerType instanceof z.ZodObject).toBe(true); + expect( + deep.shape.outer._def.innerType.shape.inner instanceof z.ZodOptional, + ).toBe(true); + expect( + deep.shape.outer._def.innerType.shape.inner._def.innerType instanceof + z.ZodString, + ).toBe(true); +}); + +test('deep partial runtime tests', () => { + const deep = nested.deepPartial(); + deep.parse({}); + deep.parse({ + outer: {}, + }); + deep.parse({ + name: 'asdf', + age: 23143, + outer: { + inner: 'adsf', + }, + }); +}); diff --git a/deno_lib/__tests__/pickomit.test.ts b/deno_lib/__tests__/pickomit.test.ts new file mode 100644 index 000000000..887781fce --- /dev/null +++ b/deno_lib/__tests__/pickomit.test.ts @@ -0,0 +1,81 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +const fish = z.object({ + name: z.string(), + age: z.number(), + nested: z.object({}), +}); + +test('pick type inference', () => { + const nameonlyFish = fish.pick({ name: true }); + type nameonlyFish = z.infer; + const f1: util.AssertEqual = true; + f1; +}); + +test('pick parse - success', () => { + const nameonlyFish = fish.pick({ name: true }); + nameonlyFish.parse({ name: 'bob' }); +}); + +test('pick parse - fail', () => { + fish.pick({ name: true }).parse({ name: '12' } as any); + fish.pick({ name: true }).parse({ name: 'bob', age: 12 } as any); + fish.pick({ age: true }).parse({ age: 12 } as any); + + const nameonlyFish = fish.pick({ name: true }).strict(); + const bad1 = () => nameonlyFish.parse({ name: 12 } as any); + const bad2 = () => nameonlyFish.parse({ name: 'bob', age: 12 } as any); + const bad3 = () => nameonlyFish.parse({ age: 12 } as any); + + expect(bad1).toThrow(); + expect(bad2).toThrow(); + expect(bad3).toThrow(); +}); + +test('omit type inference', () => { + const nonameFish = fish.omit({ name: true }); + type nonameFish = z.infer; + const f1: util.AssertEqual = true; + f1; +}); + +test('omit parse - success', () => { + const nonameFish = fish.omit({ name: true }); + nonameFish.parse({ age: 12, nested: {} }); +}); + +test('omit parse - fail', () => { + const nonameFish = fish.omit({ name: true }); + const bad1 = () => nonameFish.parse({ name: 12 } as any); + const bad2 = () => nonameFish.parse({ age: 12 } as any); + const bad3 = () => nonameFish.parse({} as any); + + expect(bad1).toThrow(); + expect(bad2).toThrow(); + expect(bad3).toThrow(); +}); + +test('nonstrict inference', () => { + const laxfish = fish.nonstrict().pick({ name: true }); + type laxfish = z.infer; + const f1: util.AssertEqual< + laxfish, + { [k: string]: any; name: string } + > = true; + f1; +}); + +test('nonstrict parsing - pass', () => { + const laxfish = fish.nonstrict().pick({ name: true }); + laxfish.parse({ name: 'asdf', whatever: 'asdf' }); + laxfish.parse({ name: 'asdf', age: 12, nested: {} }); +}); + +test('nonstrict parsing - fail', () => { + const laxfish = fish.nonstrict().pick({ name: true }); + const bad = () => laxfish.parse({ whatever: 'asdf' } as any); + expect(bad).toThrow(); +}); diff --git a/deno_lib/__tests__/primitive.test.ts b/deno_lib/__tests__/primitive.test.ts new file mode 100644 index 000000000..fe3e844bf --- /dev/null +++ b/deno_lib/__tests__/primitive.test.ts @@ -0,0 +1,409 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { Mocker } from '../helpers/Mocker.ts'; + +const literalStringSchema = z.literal('asdf'); +const literalNumberSchema = z.literal(12); +const literalBooleanSchema = z.literal(true); +const stringSchema = z.string(); +const numberSchema = z.number(); +const bigintSchema = z.bigint(); +const booleanSchema = z.boolean(); +const dateSchema = z.date(); +const nullSchema = z.null(); +const undefinedSchema = z.undefined(); +const stringSchemaOptional = z.string().optional(); +const stringSchemaNullable = z.string().nullable(); +const numberSchemaOptional = z.number().optional(); +const numberSchemaNullable = z.number().nullable(); +const bigintSchemaOptional = z.bigint().optional(); +const bigintSchemaNullable = z.bigint().nullable(); +const booleanSchemaOptional = z.boolean().optional(); +const booleanSchemaNullable = z.boolean().nullable(); +const dateSchemaOptional = z.date().optional(); +const dateSchemaNullable = z.date().nullable(); + +const val = new Mocker(); + +test('literal string correct', () => { + expect(literalStringSchema.parse('asdf')).toBe('asdf'); +}); + +test('literal string incorrect', () => { + const f = () => literalStringSchema.parse('not_asdf'); + expect(f).toThrow(); +}); + +test('literal string number', () => { + const f = () => literalStringSchema.parse(123); + expect(f).toThrow(); +}); + +test('literal string boolean', () => { + const f = () => literalStringSchema.parse(true); + expect(f).toThrow(); +}); + +test('literal string boolean', () => { + const f = () => literalStringSchema.parse(true); + expect(f).toThrow(); +}); + +test('literal string object', () => { + const f = () => literalStringSchema.parse({}); + expect(f).toThrow(); +}); + +test('literal number correct', () => { + expect(literalNumberSchema.parse(12)).toBe(12); +}); + +test('literal number incorrect', () => { + const f = () => literalNumberSchema.parse(13); + expect(f).toThrow(); +}); + +test('literal number number', () => { + const f = () => literalNumberSchema.parse(val.string); + expect(f).toThrow(); +}); + +test('literal number boolean', () => { + const f = () => literalNumberSchema.parse(val.boolean); + expect(f).toThrow(); +}); + +test('literal number object', () => { + const f = () => literalStringSchema.parse({}); + expect(f).toThrow(); +}); + +test('literal boolean correct', () => { + expect(literalBooleanSchema.parse(true)).toBe(true); +}); + +test('literal boolean incorrect', () => { + const f = () => literalBooleanSchema.parse(false); + expect(f).toThrow(); +}); + +test('literal boolean number', () => { + const f = () => literalBooleanSchema.parse('asdf'); + expect(f).toThrow(); +}); + +test('literal boolean boolean', () => { + const f = () => literalBooleanSchema.parse(123); + expect(f).toThrow(); +}); + +test('literal boolean object', () => { + const f = () => literalBooleanSchema.parse({}); + expect(f).toThrow(); +}); + +test('parse stringSchema string', () => { + stringSchema.parse(val.string); +}); + +test('parse stringSchema number', () => { + const f = () => stringSchema.parse(val.number); + expect(f).toThrow(); +}); + +test('parse stringSchema boolean', () => { + const f = () => stringSchema.parse(val.boolean); + expect(f).toThrow(); +}); + +test('parse stringSchema undefined', () => { + const f = () => stringSchema.parse(val.undefined); + expect(f).toThrow(); +}); + +test('parse stringSchema null', () => { + const f = () => stringSchema.parse(val.null); + expect(f).toThrow(); +}); + +test('parse numberSchema string', () => { + const f = () => numberSchema.parse(val.string); + expect(f).toThrow(); +}); + +test('parse numberSchema number', () => { + numberSchema.parse(val.number); +}); + +test('parse numberSchema bigint', () => { + const f = () => numberSchema.parse(val.bigint); + expect(f).toThrow(); +}); + +test('parse numberSchema boolean', () => { + const f = () => numberSchema.parse(val.boolean); + expect(f).toThrow(); +}); + +test('parse numberSchema undefined', () => { + const f = () => numberSchema.parse(val.undefined); + expect(f).toThrow(); +}); + +test('parse numberSchema null', () => { + const f = () => numberSchema.parse(val.null); + expect(f).toThrow(); +}); + +test('parse bigintSchema string', () => { + const f = () => bigintSchema.parse(val.string); + expect(f).toThrow(); +}); + +test('parse bigintSchema number', () => { + const f = () => bigintSchema.parse(val.number); + expect(f).toThrow(); +}); + +test('parse bigintSchema bigint', () => { + bigintSchema.parse(val.bigint); +}); + +test('parse bigintSchema boolean', () => { + const f = () => bigintSchema.parse(val.boolean); + expect(f).toThrow(); +}); + +test('parse bigintSchema undefined', () => { + const f = () => bigintSchema.parse(val.undefined); + expect(f).toThrow(); +}); + +test('parse bigintSchema null', () => { + const f = () => bigintSchema.parse(val.null); + expect(f).toThrow(); +}); + +test('parse booleanSchema string', () => { + const f = () => booleanSchema.parse(val.string); + expect(f).toThrow(); +}); + +test('parse booleanSchema number', () => { + const f = () => booleanSchema.parse(val.number); + expect(f).toThrow(); +}); + +test('parse booleanSchema boolean', () => { + booleanSchema.parse(val.boolean); +}); + +test('parse booleanSchema undefined', () => { + const f = () => booleanSchema.parse(val.undefined); + expect(f).toThrow(); +}); + +test('parse booleanSchema null', () => { + const f = () => booleanSchema.parse(val.null); + expect(f).toThrow(); +}); + +// ============== + +test('parse dateSchema string', () => { + const f = () => dateSchema.parse(val.string); + expect(f).toThrow(); +}); + +test('parse dateSchema number', () => { + const f = () => dateSchema.parse(val.number); + expect(f).toThrow(); +}); + +test('parse dateSchema boolean', () => { + const f = () => dateSchema.parse(val.boolean); + expect(f).toThrow(); +}); + +test('parse dateSchema date', () => { + dateSchema.parse(val.date); +}); + +test('parse dateSchema undefined', () => { + const f = () => dateSchema.parse(val.undefined); + expect(f).toThrow(); +}); + +test('parse dateSchema null', () => { + const f = () => dateSchema.parse(val.null); + expect(f).toThrow(); +}); + +test('parse dateSchema invalid date', async () => { + try { + await dateSchema.parseAsync(new Date('invalid')); + } catch (err) { + expect(err.issues[0].code).toEqual(z.ZodIssueCode.invalid_date); + } +}); +// ============== + +test('parse undefinedSchema string', () => { + const f = () => undefinedSchema.parse(val.string); + expect(f).toThrow(); +}); + +test('parse undefinedSchema number', () => { + const f = () => undefinedSchema.parse(val.number); + expect(f).toThrow(); +}); + +test('parse undefinedSchema boolean', () => { + const f = () => undefinedSchema.parse(val.boolean); + expect(f).toThrow(); +}); + +test('parse undefinedSchema undefined', () => { + undefinedSchema.parse(val.undefined); +}); + +test('parse undefinedSchema null', () => { + const f = () => undefinedSchema.parse(val.null); + expect(f).toThrow(); +}); + +test('parse nullSchema string', () => { + const f = () => nullSchema.parse(val.string); + expect(f).toThrow(); +}); + +test('parse nullSchema number', () => { + const f = () => nullSchema.parse(val.number); + expect(f).toThrow(); +}); + +test('parse nullSchema boolean', () => { + const f = () => nullSchema.parse(val.boolean); + expect(f).toThrow(); +}); + +test('parse nullSchema undefined', () => { + const f = () => nullSchema.parse(val.undefined); + expect(f).toThrow(); +}); + +test('parse nullSchema null', () => { + nullSchema.parse(val.null); +}); + +export type AssertEqualTest = boolean | undefined extends true + ? true extends boolean | undefined + ? true + : never + : never; + +type AssertEqual = (() => T extends X ? 1 : 2) extends < + T +>() => T extends Y ? 1 : 2 + ? true + : never; + +test('primitive inference', () => { + const literalStringSchemaTest: AssertEqual< + z.TypeOf, + 'asdf' + > = true; + const literalNumberSchemaTest: AssertEqual< + z.TypeOf, + 12 + > = true; + const literalBooleanSchemaTest: AssertEqual< + z.TypeOf, + true + > = true; + const stringSchemaTest: AssertEqual< + z.TypeOf, + string + > = true; + const numberSchemaTest: AssertEqual< + z.TypeOf, + number + > = true; + const bigintSchemaTest: AssertEqual< + z.TypeOf, + bigint + > = true; + const booleanSchemaTest: AssertEqual< + z.TypeOf, + boolean + > = true; + const dateSchemaTest: AssertEqual, Date> = true; + const nullSchemaTest: AssertEqual, null> = true; + const undefinedSchemaTest: AssertEqual< + z.TypeOf, + undefined + > = true; + const stringSchemaOptionalTest: AssertEqual< + z.TypeOf, + string | undefined + > = true; + const stringSchemaNullableTest: AssertEqual< + z.TypeOf, + string | null + > = true; + const numberSchemaOptionalTest: AssertEqual< + z.TypeOf, + number | undefined + > = true; + const numberSchemaNullableTest: AssertEqual< + z.TypeOf, + number | null + > = true; + const bigintSchemaOptionalTest: AssertEqual< + z.TypeOf, + bigint | undefined + > = true; + const bigintSchemaNullableTest: AssertEqual< + z.TypeOf, + bigint | null + > = true; + const booleanSchemaOptionalTest: AssertEqual< + z.TypeOf, + boolean | undefined + > = true; + const booleanSchemaNullableTest: AssertEqual< + z.TypeOf, + boolean | null + > = true; + const dateSchemaOptionalTest: AssertEqual< + z.TypeOf, + Date | undefined + > = true; + const dateSchemaNullableTest: AssertEqual< + z.TypeOf, + Date | null + > = true; + + [ + literalStringSchemaTest, + literalNumberSchemaTest, + literalBooleanSchemaTest, + stringSchemaTest, + numberSchemaTest, + bigintSchemaTest, + booleanSchemaTest, + dateSchemaTest, + nullSchemaTest, + undefinedSchemaTest, + stringSchemaOptionalTest, + stringSchemaNullableTest, + numberSchemaOptionalTest, + numberSchemaNullableTest, + bigintSchemaOptionalTest, + bigintSchemaNullableTest, + booleanSchemaOptionalTest, + booleanSchemaNullableTest, + dateSchemaOptionalTest, + dateSchemaNullableTest, + ]; +}); diff --git a/deno_lib/__tests__/promise.test.ts b/deno_lib/__tests__/promise.test.ts new file mode 100644 index 000000000..14008e6d1 --- /dev/null +++ b/deno_lib/__tests__/promise.test.ts @@ -0,0 +1,80 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +const promSchema = z.promise( + z.object({ + name: z.string(), + age: z.number(), + }), +); + +test('promise inference', () => { + type promSchemaType = z.infer; + const t1: util.AssertEqual< + promSchemaType, + Promise<{ name: string; age: number }> + > = true; + expect(t1).toBeTruthy(); +}); + +test('promise parsing success', async () => { + const pr = promSchema.parse(Promise.resolve({ name: 'Bobby', age: 10 })); + expect(pr).toBeInstanceOf(Promise); + const result = await pr; + expect(typeof result).toBe('object'); + expect(typeof result.age).toBe('number'); + expect(typeof result.name).toBe('string'); +}); + +test('promise parsing success 2', () => { + promSchema.parse({ then: () => {}, catch: () => {} }); +}); + +test('promise parsing fail', async () => { + const bad = promSchema.parse(Promise.resolve({ name: 'Bobby', age: '10' })); + // return await expect(bad).resolves.toBe({ name: 'Bobby', age: '10' }); + return await expect(bad).rejects.toBeInstanceOf(Error); + // done(); +}); + +test('promise parsing fail 2', async () => { + const failPromise = promSchema.parse( + Promise.resolve({ name: 'Bobby', age: '10' }), + ); + await expect(failPromise).rejects.toBeInstanceOf(Error); + // done();/z +}); + +test('promise parsing fail', () => { + const bad = () => promSchema.parse({ then: () => {}, catch: {} }); + expect(bad).toThrow(); +}); + +// test('sync promise parsing', () => { +// expect(() => z.promise(z.string()).parse(Promise.resolve('asfd'))).toThrow(); +// }); + +const asyncFunction = z.function(z.tuple([]), promSchema); + +test('async function pass', async () => { + const validatedFunction = asyncFunction.implement(async () => { + return { name: 'jimmy', age: 14 }; + }); + await expect(validatedFunction()).resolves.toEqual({ + name: 'jimmy', + age: 14, + }); +}); + +test('async function fail', async () => { + const validatedFunction = asyncFunction.implement(() => { + return Promise.resolve('asdf' as any); + }); + await expect(validatedFunction()).rejects.toBeInstanceOf(Error); +}); + +test('async promise parsing', () => { + const res = z.promise(z.number()).parseAsync(Promise.resolve(12)); + expect(res).toBeInstanceOf(Promise); +}); diff --git a/deno_lib/__tests__/pseudopromise.test.ts b/deno_lib/__tests__/pseudopromise.test.ts new file mode 100644 index 000000000..f1f707068 --- /dev/null +++ b/deno_lib/__tests__/pseudopromise.test.ts @@ -0,0 +1,66 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";// import * as z from './index.ts'; +import { PseudoPromise } from '../PseudoPromise.ts'; + +test('sync pass', () => { + const myProm = new PseudoPromise() + .then(() => 15) + .then(arg => arg.toString()) + .then(arg => arg.length); + expect(myProm.getValueSync()).toEqual(2); +}); + +test('sync fail', async () => { + const myProm = new PseudoPromise() + .then(async () => 15) + .then(arg => arg.toString()) + .then(arg => { + return arg.length; + }); + + expect(myProm.getValueSync()).toEqual(16); + myProm.getValueSync(); + // expect(myProm.getValue()).resolves.toEqual(2); + const val = await myProm.getValueAsync(); + expect(val).toEqual(2); + // (myProm.getValue() as Promise).then(val => expect(val).toEqual(2)); +}); + +test('pseudopromise all', async () => { + const myProm = PseudoPromise.all([ + new PseudoPromise().then(() => 'asdf'), + PseudoPromise.resolve(12), + ]).getValueAsync(); + await expect(await myProm).toEqual(['asdf', 12]); +}); + +test('.resolve sync ', () => { + expect(PseudoPromise.resolve(12).getValueSync()).toEqual(12); +}); + +test('.resolve async', async () => { + expect( + await PseudoPromise.resolve(Promise.resolve(12)).getValueAsync(), + ).toEqual(12); +}); + +test('sync and async', async () => { + expect(PseudoPromise.resolve(15).getValueSync()).toEqual(15); + expect(await PseudoPromise.resolve(15).getValueAsync()).toEqual(15); +}); + +test('object', async () => { + const prom = PseudoPromise.object({ + asdf: PseudoPromise.resolve(15), + qwer: new PseudoPromise().then(async () => 'asdfadsf'), + }); + + expect(await prom.getValueAsync()).toEqual({ asdf: 15, qwer: 'asdfadsf' }); +}); + +test('all', async () => { + const asdf = new PseudoPromise().then(async () => 'asdf'); + await PseudoPromise.all([asdf]) + .getValueAsync() + .then(val => expect(val).toEqual(['asdf'])); +}); diff --git a/deno_lib/__tests__/record.test.ts b/deno_lib/__tests__/record.test.ts new file mode 100644 index 000000000..346b29943 --- /dev/null +++ b/deno_lib/__tests__/record.test.ts @@ -0,0 +1,51 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +const booleanRecord = z.record(z.boolean()); +type booleanRecord = z.infer; + +test('type inference', () => { + const f1: util.AssertEqual> = true; + f1; +}); + +test('methods', () => { + booleanRecord.toJSON(); + booleanRecord.optional(); + booleanRecord.nullable(); +}); + +test('string record parse - pass', () => { + booleanRecord.parse({ + k1: true, + k2: false, + 1234: false, + }); +}); + +test('string record parse - fail', () => { + const badCheck = () => + booleanRecord.parse({ + asdf: 1234, + } as any); + expect(badCheck).toThrow(); + + expect(() => booleanRecord.parse('asdf')).toThrow(); +}); + +test('string record parse - fail', () => { + const badCheck = () => + booleanRecord.parse({ + asdf: {}, + } as any); + expect(badCheck).toThrow(); +}); + +test('string record parse - fail', () => { + const badCheck = () => + booleanRecord.parse({ + asdf: [], + } as any); + expect(badCheck).toThrow(); +}); diff --git a/deno_lib/__tests__/recursive.test.ts b/deno_lib/__tests__/recursive.test.ts new file mode 100644 index 000000000..f528cff61 --- /dev/null +++ b/deno_lib/__tests__/recursive.test.ts @@ -0,0 +1,199 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";test('dummy test recursive', () => { + expect(true).toBeTruthy(); +}); +// import * as z from '../index.ts'; + +// interface A { +// val: number; +// b: B; +// } + +// interface B { +// val: number; +// a: A; +// } + +// const A: z.ZodType = z.late.object(() => ({ +// val: z.number(), +// b: B, +// })); + +// const B: z.ZodType = z.late.object(() => ({ +// val: z.number(), +// a: A, +// })); + +// const a: any = { val: 1 }; +// const b: any = { val: 2 }; +// a.b = b; +// b.a = a; + +// test('valid check', () => { +// A.parse(a); +// B.parse(b); +// }); + +// test('masking check', () => { +// const FragmentOnA = z +// .object({ +// val: z.number(), +// b: z +// .object({ +// val: z.number(), +// a: z +// .object({ +// val: z.number(), +// }) +// .nonstrict(), +// }) +// .nonstrict(), +// }) +// .nonstrict(); + +// const fragment = FragmentOnA.parse(a); +// fragment; +// }); + +// test('invalid check', () => { +// expect(() => A.parse({} as any)).toThrow(); +// }); + +// test('toJSON throws', () => { +// const checker = () => A.toJSON(); +// expect(checker).toThrow(); +// }); + +// test('schema getter', () => { +// (A as z.ZodLazy).schema; +// }); + +// test('self recursion', () => { +// interface Category { +// name: string; +// subcategories: Category[]; +// } + +// const Category: z.Schema = z.late.object(() => ({ +// name: z.string(), +// subcategories: z.array(Category), +// })); + +// const untypedCategory: any = { +// name: 'Category A', +// }; +// // creating a cycle +// untypedCategory.subcategories = [untypedCategory]; +// Category.parse(untypedCategory); +// }); + +// test('self recursion with base type', () => { +// const BaseCategory = z.object({ +// name: z.string(), +// }); +// type BaseCategory = z.infer; + +// type Category = BaseCategory & { subcategories: Category[] }; + +// const Category: z.Schema = z.late +// .object(() => ({ +// subcategories: z.array(Category), +// })) +// .extend({ +// name: z.string(), +// }); + +// const untypedCategory: any = { +// name: 'Category A', +// }; +// // creating a cycle +// untypedCategory.subcategories = [untypedCategory]; +// Category.parse(untypedCategory); // parses successfully +// }); + +// test('repeated parsing', () => { +// const extensions = z.object({ +// name: z.string(), +// }); + +// const dog = z.object({ +// extensions, +// }); + +// const cat = z.object({ +// extensions, +// }); + +// const animal = z.union([dog, cat]); + +// // it should output type error because name is ought to be type of string +// expect(() => animal.parse({ extensions: { name: 123 } })).toThrow; +// }); + +// test('repeated errors', () => { +// const Shape = z.array( +// z.object({ +// name: z.string().nonempty(), +// value: z.string().nonempty(), +// }), +// ); + +// const data = [ +// { +// name: 'Name 1', +// value: 'Value', +// }, +// { +// name: '', +// value: 'Value', +// }, +// { +// name: '', +// value: '', +// }, +// ]; + +// try { +// Shape.parse(data); +// } catch (e) { +// if (e instanceof z.ZodError) { +// expect(e.issues.length).toEqual(3); +// } +// } +// }); + +// test('unions of object', () => { +// const base = z.object({ +// id: z.string(), +// }); + +// const type1 = base.merge( +// z.object({ +// type: z.literal('type1'), +// }), +// ); + +// const type2 = base.merge( +// z.object({ +// type: z.literal('type2'), +// }), +// ); + +// const union1 = z.union([type1, type2]); +// const union2 = z.union([type2, type1]); + +// const value1 = { +// type: 'type1', +// }; + +// const value2 = { +// type: 'type2', +// }; + +// expect(type1.check(value1)).toEqual(false); +// expect(union1.check(value1)).toEqual(false); +// expect(union2.check(value1)).toEqual(false); +// expect(type2.check(value2)).toEqual(false); +// expect(union1.check(value2)).toEqual(false); +// expect(union2.check(value2)).toEqual(false); +// }); diff --git a/deno_lib/__tests__/refine.test.ts b/deno_lib/__tests__/refine.test.ts new file mode 100644 index 000000000..efae9a27b --- /dev/null +++ b/deno_lib/__tests__/refine.test.ts @@ -0,0 +1,89 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { ZodIssueCode } from '../ZodError.ts'; + +test('refinement', () => { + const obj1 = z.object({ + first: z.string(), + second: z.string(), + }); + const obj2 = obj1.partial().strict(); + + const obj3 = obj2.refine( + data => data.first || data.second, + 'Either first or second should be filled in.', + ); + + expect(obj1 === (obj2 as any)).toEqual(false); + expect(obj2 === obj3).toEqual(false); + + expect(() => obj1.parse({})).toThrow(); + expect(() => obj2.parse({ third: 'adsf' })).toThrow(); + expect(() => obj3.parse({})).toThrow(); + obj3.parse({ first: 'a' }); + obj3.parse({ second: 'a' }); + obj3.parse({ first: 'a', second: 'a' }); +}); + +test('refinement 2', () => { + const validationSchema = z + .object({ + email: z.string().email(), + password: z.string(), + confirmPassword: z.string(), + }) + .refine( + data => data.password === data.confirmPassword, + 'Both password and confirmation must match', + ); + + expect(() => + validationSchema.parse({ + email: 'aaaa@gmail.com', + password: 'aaaaaaaa', + confirmPassword: 'bbbbbbbb', + }), + ).toThrow(); +}); + +test('custom path', async () => { + try { + await z + .object({ + password: z.string(), + confirm: z.string(), + }) + .refine(data => data.confirm === data.password, { path: ['confirm'] }) + .parseAsync({ password: 'asdf', confirm: 'qewr' }); + } catch (err) { + expect(err.issues[0].path).toEqual(['confirm']); + } +}); + +test('use path in refinement context', async () => { + const noNested = z.string()._refinement((_val, ctx) => { + if (ctx.path.length > 0) { + ctx.addIssue({ + code: ZodIssueCode.custom, + message: `schema cannot be nested. path: ${ctx.path.join('.')}`, + }); + } + }); + + const data = z.object({ + foo: noNested, + }); + + const t1 = await noNested.spa('asdf'); + const t2 = await data.spa({ foo: 'asdf' }); + // console.log(t1); + // console.log(t2); + + expect(t1.success).toBe(true); + expect(t2.success).toBe(false); + if (t2.success === false) { + expect(t2.error.issues[0].message).toEqual( + 'schema cannot be nested. path: foo', + ); + } +}); diff --git a/deno_lib/__tests__/safeparse.test.ts b/deno_lib/__tests__/safeparse.test.ts new file mode 100644 index 000000000..ff0f11c4d --- /dev/null +++ b/deno_lib/__tests__/safeparse.test.ts @@ -0,0 +1,25 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +const stringSchema = z.string(); + +test('safeparse fail', () => { + const safe = stringSchema.safeParse(12); + expect(safe.success).toEqual(false); + expect((safe as any).error).toBeInstanceOf(z.ZodError); +}); + +test('safeparse pass', () => { + const safe = stringSchema.safeParse('12'); + expect(safe.success).toEqual(true); + expect((safe as any).data).toEqual('12'); +}); + +test('safeparse unexpected error', () => { + expect(() => + stringSchema + .refine(data => { + throw new Error(data); + }) + .safeParse('12'), + ).toThrow(); +}); diff --git a/deno_lib/__tests__/string.test.ts b/deno_lib/__tests__/string.test.ts new file mode 100644 index 000000000..c1424b9cf --- /dev/null +++ b/deno_lib/__tests__/string.test.ts @@ -0,0 +1,112 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +const minFive = z.string().min(5, 'min5'); +const maxFive = z.string().max(5, 'max5'); +const justFive = z.string().length(5); +const nonempty = z.string().nonempty('nonempty'); + +test('passing validations', () => { + minFive.parse('12345'); + minFive.parse('123456'); + maxFive.parse('12345'); + maxFive.parse('1234'); + nonempty.parse('1'); + justFive.parse('12345'); +}); + +test('failing validations', () => { + expect(() => minFive.parse('1234')).toThrow(); + expect(() => maxFive.parse('123456')).toThrow(); + expect(() => nonempty.parse('')).toThrow(); + expect(() => justFive.parse('1234')).toThrow(); + expect(() => justFive.parse('123456')).toThrow(); +}); + +test('email validations', () => { + const email = z.string().email(); + email.parse('mojojojo@example.com'); + expect(() => email.parse('asdf')).toThrow(); + expect(() => email.parse('@lkjasdf.com')).toThrow(); + expect(() => email.parse('asdf@sdf.')).toThrow(); +}); + +test('url validations', () => { + const url = z.string().url(); + try { + url.parse('http://google.com'); + url.parse('https://google.com/asdf?asdf=ljk3lk4&asdf=234#asdf'); + expect(() => url.parse('asdf')).toThrow(); + expect(() => url.parse('https:/')).toThrow(); + expect(() => url.parse('asdfj@lkjsdf.com')).toThrow(); + } catch (err) { + console.log(JSON.stringify(err, null, 2)); + } +}); + +test('url error overrides', () => { + try { + z.string() + .url() + .parse('https'); + } catch (err) { + expect(err.issues[0].message).toEqual('Invalid url'); + } + try { + z.string() + .url('badurl') + .parse('https'); + } catch (err) { + expect(err.issues[0].message).toEqual('badurl'); + } + try { + z.string() + .url({ message: 'badurl' }) + .parse('https'); + } catch (err) { + expect(err.issues[0].message).toEqual('badurl'); + } +}); + +test('uuid', () => { + z.string() + .uuid() + .parse('9491d710-3185-4e06-bea0-6a2f275345e0'); + expect(() => + z + .string() + .uuid() + .parse('9491d710-3185-4e06-bea0-6a2f275345e'), + ).toThrow(); +}); + +test('regex', () => { + z.string() + .regex(/^moo+$/) + .parse('mooooo'); + expect(() => + z + .string() + .uuid() + .parse('purr'), + ).toThrow(); +}); + +test('regexp error message', () => { + const result = z + .string() + .regex(/^moo+$/) + .safeParse('boooo'); + if (!result.success) { + expect(result.error.issues[0].message).toEqual('Invalid'); + } else { + throw new Error('validation should have failed'); + } + + expect(() => + z + .string() + .uuid() + .parse('purr'), + ).toThrow(); +}); diff --git a/deno_lib/__tests__/transformer.test.ts b/deno_lib/__tests__/transformer.test.ts new file mode 100644 index 000000000..d2316726e --- /dev/null +++ b/deno_lib/__tests__/transformer.test.ts @@ -0,0 +1,122 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; + +const stringToNumber = z.string().transform(z.number(), arg => parseFloat(arg)); +const numberToString = z.transformer(z.number(), z.string(), n => String(n)); +const asyncNumberToString = z.transformer(z.number(), z.string(), async n => + String(n), +); + +test('basic transformations', () => { + const r1 = z + .transformer(z.string(), z.number(), data => data.length) + .parse('asdf'); + expect(r1).toEqual(4); +}); + +test('coercion', () => { + const numToString = z.transformer(z.number(), z.string(), n => String(n)); + const data = z + .object({ + id: numToString, + }) + .parse({ id: 5 }); + + expect(data).toEqual({ id: '5' }); +}); + +test('async coercion', async () => { + const numToString = z.transformer(z.number(), z.string(), async n => + String(n), + ); + const data = await z + .object({ + id: numToString, + }) + .parseAsync({ id: 5 }); + + expect(data).toEqual({ id: '5' }); +}); + +test('sync coercion async error', async () => { + expect(() => + z + .object({ + id: asyncNumberToString, + }) + .parse({ id: 5 }), + ).toThrow(); + // expect(data).toEqual({ id: '5' }); +}); + +test('default', () => { + const data = z + .string() + .default('asdf') + .parse(undefined); // => "asdf" + expect(data).toEqual('asdf'); +}); + +test('dynamic default', () => { + const data = z + .string() + .default(s => s._def.t) + .parse(undefined); // => "asdf" + expect(data).toEqual('string'); +}); + +test('default when property is null or undefined', () => { + const data = z + .object({ + foo: z + .boolean() + .nullable() + .default(true), + bar: z.boolean().default(true), + }) + .parse({ foo: null }); + + expect(data).toEqual({ foo: null, bar: true }); +}); + +test('default with falsy values', () => { + const schema = z.object({ + emptyStr: z.string().default('def'), + zero: z.number().default(5), + falseBoolean: z.boolean().default(true), + }); + const input = { emptyStr: '', zero: 0, falseBoolean: true }; + const output = schema.parse(input); + // defaults are not supposed to be used + expect(output).toEqual(input); +}); + +test('object typing', () => { + const t1 = z.object({ + stringToNumber, + }); + + type t1 = z.input; + type t2 = z.output; + + const f1: util.AssertEqual = true; + const f2: util.AssertEqual = true; + f1; + f2; +}); + +test('transform method overloads', () => { + const t1 = z.string().transform(val => val.toUpperCase()); + expect(t1.parse('asdf')).toEqual('ASDF'); + + const t2 = z.string().transform(z.number(), val => val.length); + expect(t2.parse('asdf')).toEqual(4); +}); + +test('multiple transformers', () => { + const doubler = z.transformer(stringToNumber, numberToString, val => { + return val * 2; + }); + expect(doubler.parse('5')).toEqual('10'); +}); diff --git a/deno_lib/__tests__/tuple.test.ts b/deno_lib/__tests__/tuple.test.ts new file mode 100644 index 000000000..d9d498ca4 --- /dev/null +++ b/deno_lib/__tests__/tuple.test.ts @@ -0,0 +1,80 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { ZodError } from '../ZodError.ts'; +import { util } from '../helpers/util.ts'; + +const testTuple = z.tuple([ + z.string(), + z.object({ name: z.literal('Rudy') }), + z.array(z.literal('blue')), +]); +const testData = ['asdf', { name: 'Rudy' }, ['blue']]; +const badData = [123, { name: 'Rudy2' }, ['blue', 'red']]; + +test('tuple inference', () => { + const args1 = z.tuple([z.string()]); + const returns1 = z.number(); + const func1 = z.function(args1, returns1); + type func1 = z.TypeOf; + const t1: util.AssertEqual number> = true; + [t1]; +}); + +test('successful validation', () => { + const val = testTuple.parse(testData); + expect(val).toEqual(['asdf', { name: 'Rudy' }, ['blue']]); +}); + +test('successful async validation', async () => { + const val = await testTuple.parseAsync(testData); + return expect(val).toEqual(testData); +}); + +test('failed validation', () => { + const checker = () => { + testTuple.parse([123, { name: 'Rudy2' }, ['blue', 'red']] as any); + }; + try { + checker(); + } catch (err) { + if (err instanceof ZodError) { + expect(err.issues.length).toEqual(3); + } + } +}); + +test('failed async validation', async () => { + const res = await testTuple.safeParse(badData); + expect(res.success).toEqual(false); + if (!res.success) { + expect(res.error.issues.length).toEqual(3); + } + // try { + // checker(); + // } catch (err) { + // if (err instanceof ZodError) { + // expect(err.issues.length).toEqual(3); + // } + // } +}); + +test('tuple with transformers', () => { + const stringToNumber = z.string().transform(z.number(), val => val.length); + const val = z.tuple([stringToNumber]); + + type t1 = z.input; + const f1: util.AssertEqual = true; + // const f1: util.AssertEqual = + type t2 = z.output; + const f2: util.AssertEqual = true; + + f1; + f2; +}); + +// test('tuple with optional elements', () => { +// const result = z +// .tuple([z.string(), z.number().optional()]) +// .safeParse(['asdf']); +// expect(result).toEqual(['asdf']); +// }); diff --git a/deno_lib/__tests__/validations.test.ts b/deno_lib/__tests__/validations.test.ts new file mode 100644 index 000000000..ed3852cf2 --- /dev/null +++ b/deno_lib/__tests__/validations.test.ts @@ -0,0 +1,137 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; + +test('array min', async () => { + try { + await z + .array(z.string()) + .min(4) + .parseAsync([]); + } catch (err) { + expect(err.issues[0].message).toEqual('Should have at least 4 items'); + } +}); + +test('array max', async () => { + try { + await z + .array(z.string()) + .max(2) + .parseAsync(['asdf', 'asdf', 'asdf']); + } catch (err) { + expect(err.issues[0].message).toEqual('Should have at most 2 items'); + } +}); + +test('string min', async () => { + try { + await z + .string() + .min(4) + .parseAsync('asd'); + } catch (err) { + expect(err.issues[0].message).toEqual('Should be at least 4 characters'); + } +}); + +test('string max', async () => { + try { + await z + .string() + .max(4) + .parseAsync('aasdfsdfsd'); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Should be at most 4 characters long', + ); + } +}); + +test('number min', async () => { + try { + await z + .number() + .min(3) + .parseAsync(2); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be greater than or equal to 3', + ); + } +}); + +test('number max', async () => { + try { + await z + .number() + .max(3) + .parseAsync(4); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be less than or equal to 3', + ); + } +}); + +test('number nonnegative', async () => { + try { + await z + .number() + .nonnegative() + .parseAsync(-1); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be greater than or equal to 0', + ); + } +}); + +test('number nonpositive', async () => { + try { + await z + .number() + .nonpositive() + .parseAsync(1); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be less than or equal to 0', + ); + } +}); + +test('number negative', async () => { + try { + await z + .number() + .negative() + .parseAsync(1); + } catch (err) { + expect(err.issues[0].message).toEqual('Value should be less than 0'); + } +}); + +test('number positive', async () => { + try { + await z + .number() + .positive() + .parseAsync(-1); + } catch (err) { + expect(err.issues[0].message).toEqual('Value should be greater than 0'); + } +}); + +test('instantiation', () => { + z.string().min(5); + z.string().max(5); + z.string().length(5); + z.string().email(); + z.string().url(); + z.string().uuid(); + z.string().min(5, { message: 'Must be 5 or more characters long' }); + z.string().max(5, { message: 'Must be 5 or fewer characters long' }); + z.string().length(5, { message: 'Must be exactly 5 characters long' }); + z.string().email({ message: 'Invalid email address.' }); + z.string().url({ message: 'Invalid url' }); + z.string().uuid({ message: 'Invalid UUID' }); +}); diff --git a/deno_lib/__tests__/void.test.ts b/deno_lib/__tests__/void.test.ts new file mode 100644 index 000000000..3cb9444a8 --- /dev/null +++ b/deno_lib/__tests__/void.test.ts @@ -0,0 +1,14 @@ +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts";import * as z from '../index.ts'; +import { util } from '../helpers/util.ts'; +test('void', () => { + const v = z.void(); + v.parse(null); + v.parse(undefined); + + expect(() => v.parse('')).toThrow(); + + type v = z.infer; + const t1: util.AssertEqual = true; + t1; +}); diff --git a/deno_lib/codegen.ts b/deno_lib/codegen.ts new file mode 100644 index 000000000..4895b2f40 --- /dev/null +++ b/deno_lib/codegen.ts @@ -0,0 +1,178 @@ +import * as z from './index.ts'; +import { util } from './helpers/util.ts'; + +type TypeResult = { schema: any; id: string; type: string }; + +const isOptional = (schema: z.ZodType): boolean => { + // const def: z.ZodDef = schema._def; + // if (def.t === z.ZodTypes.undefined) return true; + // else if (def.t === z.ZodTypes.intersection) { + // return isOptional(def.right) && isOptional(def.left); + // } else if (def.t === z.ZodTypes.union) { + // return def.options.map(isOptional).some(x => x === true); + // } + // return false; + + return schema.isOptional(); +}; + +export class ZodCodeGenerator { + seen: TypeResult[] = []; + serial: number = 0; + + randomId = () => { + return `IZod${this.serial++}`; + }; + + findBySchema = (schema: z.ZodType) => { + return this.seen.find(s => s.schema === schema); + }; + + findById = (id: string) => { + const found = this.seen.find(s => s.id === id); + if (!found) throw new Error(`Unfound ID: ${id}`); + return found; + }; + + dump = () => { + return ` +type Identity = T; + +${this.seen + .map(item => `type ${item.id} = Identity<${item.type}>;`) + .join('\n\n')} +`; + }; + + setType = (id: string, type: string) => { + const found = this.findById(id); + found.type = type; + return found; + }; + + generate = (schema: z.ZodType): TypeResult => { + const found = this.findBySchema(schema); + if (found) return found; + + const def: z.ZodDef = schema._def; + + const id = this.randomId(); + + const ty = { + schema, + id, + type: `__INCOMPLETE__`, + }; + + this.seen.push(ty); + + switch (def.t) { + case z.ZodTypes.string: + return this.setType(id, `string`); + case z.ZodTypes.number: + return this.setType(id, `number`); + case z.ZodTypes.bigint: + return this.setType(id, `bigint`); + case z.ZodTypes.boolean: + return this.setType(id, `boolean`); + case z.ZodTypes.date: + return this.setType(id, `Date`); + case z.ZodTypes.undefined: + return this.setType(id, `undefined`); + case z.ZodTypes.null: + return this.setType(id, `null`); + case z.ZodTypes.any: + return this.setType(id, `any`); + case z.ZodTypes.unknown: + return this.setType(id, `unknown`); + case z.ZodTypes.never: + return this.setType(id, `never`); + case z.ZodTypes.void: + return this.setType(id, `void`); + case z.ZodTypes.literal: + const val = def.value; + const literalType = typeof val === 'string' ? `"${val}"` : `${val}`; + return this.setType(id, literalType); + case z.ZodTypes.enum: + return this.setType(id, def.values.map(v => `"${v}"`).join(' | ')); + case z.ZodTypes.object: + const objectLines: string[] = []; + const shape = def.shape(); + + for (const key in shape) { + const childSchema = shape[key]; + const childType = this.generate(childSchema); + const OPTKEY = isOptional(childSchema) ? '?' : ''; + objectLines.push(`${key}${OPTKEY}: ${childType.id}`); + } + const baseStruct = `{\n${objectLines + .map(line => ` ${line};`) + .join('\n')}\n}`; + this.setType(id, `${baseStruct}`); + break; + case z.ZodTypes.tuple: + const tupleLines: string[] = []; + for (const elSchema of def.items) { + const elType = this.generate(elSchema); + tupleLines.push(elType.id); + } + const baseTuple = `[\n${tupleLines + .map(line => ` ${line},`) + .join('\n')}\n]`; + return this.setType(id, `${baseTuple}`); + case z.ZodTypes.array: + return this.setType(id, `${this.generate(def.type).id}[]`); + case z.ZodTypes.function: + const args = this.generate(def.args); + const returns = this.generate(def.returns); + return this.setType(id, `(...args: ${args.id})=>${returns.id}`); + case z.ZodTypes.promise: + const promValue = this.generate(def.type); + return this.setType(id, `Promise<${promValue.id}>`); + case z.ZodTypes.union: + const unionLines: string[] = []; + for (const elSchema of def.options) { + const elType = this.generate(elSchema); + unionLines.push(elType.id); + } + return this.setType(id, unionLines.join(` | `)); + case z.ZodTypes.intersection: + return this.setType( + id, + `${this.generate(def.left).id} & ${this.generate(def.right).id}`, + ); + case z.ZodTypes.record: + return this.setType( + id, + `{[k:string]: ${this.generate(def.valueType).id}}`, + ); + case z.ZodTypes.transformer: + return this.setType(id, this.generate(def.output).id); + case z.ZodTypes.map: + return this.setType( + id, + `Map<${this.generate(def.keyType).id}, ${ + this.generate(def.valueType).id + }>`, + ); + case z.ZodTypes.lazy: + const lazyType = def.getter(); + return this.setType(id, this.generate(lazyType).id); + case z.ZodTypes.nativeEnum: + // const lazyType = def.getter(); + return this.setType(id, 'asdf'); + case z.ZodTypes.optional: + return this.setType( + id, + `${this.generate(def.innerType).id} | undefined`, + ); + case z.ZodTypes.nullable: + return this.setType(id, `${this.generate(def.innerType).id} | null`); + default: + util.assertNever(def); + } + return this.findById(id); + }; + + static create = () => new ZodCodeGenerator(); +} diff --git a/deno_lib/crazySchema.ts b/deno_lib/crazySchema.ts new file mode 100644 index 000000000..3d29d9671 --- /dev/null +++ b/deno_lib/crazySchema.ts @@ -0,0 +1,56 @@ +import * as z from './index.ts'; + +export const crazySchema = z.object({ + tuple: z.tuple([ + z + .string() + .nullable() + .optional(), + z + .number() + .nullable() + .optional(), + z + .boolean() + .nullable() + .optional(), + z + .null() + .nullable() + .optional(), + z + .undefined() + .nullable() + .optional(), + z + .literal('1234') + .nullable() + .optional(), + ]), + merged: z + .object({ + k1: z.string().optional(), + }) + .merge(z.object({ k1: z.string().nullable(), k2: z.number() })), + union: z.array(z.union([z.literal('asdf'), z.literal(12)])).nonempty(), + array: z.array(z.number()), + sumTransformer: z.transformer(z.array(z.number()), z.number(), arg => { + return arg.reduce((a, b) => a + b, 0); + }), + sumMinLength: z.array(z.number()).refine(arg => arg.length > 5), + intersection: z.intersection( + z.object({ p1: z.string().optional() }), + z.object({ p1: z.number().optional() }), + ), + enum: z.intersection(z.enum(['zero', 'one']), z.enum(['one', 'two'])), + nonstrict: z.object({ points: z.number() }).nonstrict(), + numProm: z.promise(z.number()), + lenfun: z.function(z.tuple([z.string()]), z.boolean()), +}); + +export const asyncCrazySchema = crazySchema.extend({ + async_transform: z.transformer(z.array(z.number()), z.number(), async arg => { + return arg.reduce((a, b) => a + b, 0); + }), + async_refine: z.array(z.number()).refine(async arg => arg.length > 5), +}); diff --git a/deno_lib/defaultErrorMap.ts b/deno_lib/defaultErrorMap.ts new file mode 100644 index 000000000..7578dcfdd --- /dev/null +++ b/deno_lib/defaultErrorMap.ts @@ -0,0 +1,117 @@ +import { ZodIssueCode, ZodIssueOptionalMessage } from './ZodError.ts'; +import { util } from './helpers/util.ts'; + +type ErrorMapCtx = { + // path: (string | number)[]; + // details: any; + defaultError: string; + data: any; + // metadata: object; +}; + +export type ZodErrorMap = typeof defaultErrorMap; +export const defaultErrorMap = ( + error: ZodIssueOptionalMessage, + _ctx: ErrorMapCtx, +): { message: string } => { + let message: string; + switch (error.code) { + case ZodIssueCode.invalid_type: + if (error.received === 'undefined') { + message = 'Required'; + } else { + message = `Expected ${error.expected}, received ${error.received}`; + } + break; + case ZodIssueCode.nonempty_array_is_empty: + message = `List must contain at least one item`; + break; + case ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${error.keys + .map(k => `'${k}'`) + .join(', ')}`; + break; + case ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + // case ZodIssueCode.invalid_tuple_length: + // message = `Expected list of ${error.expected} items, received ${error.received} items`; + // break; + case ZodIssueCode.invalid_literal_value: + message = `Input must be "${error.expected}"`; + break; + case ZodIssueCode.invalid_enum_value: + message = `Input must be one of these values: ${error.options.join( + ', ', + )}`; + break; + case ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + // case ZodIssueCode.too_small: + // const tooShortNoun = _ctx.data === 'string' ? 'characters' : 'items'; + // message = `Too short, should be at least ${error.minimum} ${tooShortNoun}`; + // break; + // case ZodIssueCode.too_big: + // const tooLongNoun = _ctx.data === 'string' ? 'characters' : 'items'; + // message = `Too short, should be at most ${error.maximum} ${tooLongNoun}`; + // break; + case ZodIssueCode.invalid_string: + if (error.validation !== 'regex') message = `Invalid ${error.validation}`; + else message = 'Invalid'; + break; + // case ZodIssueCode.invalid_url: + // message = 'Invalid URL.'; + // break; + // case ZodIssueCode.invalid_uuid: + // message = 'Invalid UUID.'; + // break; + case ZodIssueCode.too_small: + if (error.type === 'array') + message = `Should have ${error.inclusive ? `at least` : `more than`} ${ + error.minimum + } items`; + else if (error.type === 'string') + message = `Should be ${error.inclusive ? `at least` : `over`} ${ + error.minimum + } characters`; + else if (error.type === 'number') + message = `Value should be greater than ${ + error.inclusive ? `or equal to ` : `` + }${error.minimum}`; + else message = 'Invalid input'; + break; + case ZodIssueCode.too_big: + if (error.type === 'array') + message = `Should have ${error.inclusive ? `at most` : `less than`} ${ + error.maximum + } items`; + else if (error.type === 'string') + message = `Should be ${error.inclusive ? `at most` : `under`} ${ + error.maximum + } characters long`; + else if (error.type === 'number') + message = `Value should be less than ${ + error.inclusive ? `or equal to ` : `` + }${error.maximum}`; + else message = 'Invalid input'; + break; + case ZodIssueCode.custom: + message = `Invalid input.`; + break; + case ZodIssueCode.invalid_intersection_types: + message = `Intersections only support objects`; + break; + default: + message = `Invalid input.`; + util.assertNever(error); + } + return { message }; + // return `Invalid input.`; +}; diff --git a/deno_lib/helpers/Mocker.ts b/deno_lib/helpers/Mocker.ts new file mode 100644 index 000000000..1d8faa8ee --- /dev/null +++ b/deno_lib/helpers/Mocker.ts @@ -0,0 +1,51 @@ +function getRandomInt(max: number) { + return Math.floor(Math.random() * Math.floor(max)); +} + +export class Mocker { + pick = (...args: any[]) => { + return args[getRandomInt(args.length)]; + }; + + get string() { + return Math.random() + .toString(36) + .substring(7); + } + get number() { + return Math.random() * 100; + } + get bigint() { + return BigInt(Math.floor(Math.random() * 10000)); + } + get boolean() { + return Math.random() < 0.5; + } + get date() { + return new Date(Math.floor(Date.now() * Math.random())); + } + get null(): null { + return null; + } + get undefined(): undefined { + return undefined; + } + get stringOptional() { + return this.pick(this.string, this.undefined); + } + get stringNullable() { + return this.pick(this.string, this.null); + } + get numberOptional() { + return this.pick(this.number, this.undefined); + } + get numberNullable() { + return this.pick(this.number, this.null); + } + get booleanOptional() { + return this.pick(this.boolean, this.undefined); + } + get booleanNullable() { + return this.pick(this.boolean, this.null); + } +} diff --git a/deno_lib/helpers/errorUtil.ts b/deno_lib/helpers/errorUtil.ts new file mode 100644 index 000000000..2165ca1e6 --- /dev/null +++ b/deno_lib/helpers/errorUtil.ts @@ -0,0 +1,5 @@ +export namespace errorUtil { + export type ErrMessage = string | { message?: string }; + export const errToObj = (message?: ErrMessage) => + typeof message === 'string' ? { message } : message || {}; +} diff --git a/deno_lib/helpers/maskUtil.ts b/deno_lib/helpers/maskUtil.ts new file mode 100644 index 000000000..5b6039b65 --- /dev/null +++ b/deno_lib/helpers/maskUtil.ts @@ -0,0 +1,72 @@ +import { Primitive } from './primitive.ts'; + +type AnyObject = { [k: string]: any }; +type IsAny = any extends T ? (T extends any ? true : false) : false; +type IsNever = never extends T ? (T extends never ? true : false) : false; +type IsTrue = true extends T ? (T extends true ? true : false) : false; +type IsObject = T extends { [k: string]: any } + ? T extends Array + ? false + : true + : false; +type IsObjectArray = T extends Array<{ [k: string]: any }> ? true : false; +// type IsObject = T extends { [k: string]: any } ? (T extends Array ? never : true) : never; + +export namespace maskUtil { + export type Params = { + array: T extends Array + ? true | { [k in keyof U]?: true | Params } + : never; + object: T extends AnyObject + ? { [k in keyof T]?: true | Params } + : never; + rest: never; + never: never; + }[T extends null | undefined | Primitive | Array + ? 'never' + : any extends T + ? 'never' + : T extends Array + ? 'array' + : IsObject extends true + ? 'object' + : 'rest']; + + export type PickTest = P extends true + ? 'true' + : true extends IsObject + ? 'object' + : true extends IsObjectArray + ? 'array' + : 'rest'; + + export type Pick = null extends T + ? undefined extends T + ? BasePick, P> | null | undefined + : BasePick, P> | null + : undefined extends T + ? BasePick, P> | undefined + : BasePick, P>; + + export type BasePick = { + primitive: T; + primitivearray: T; + true: T; + object: { [k in keyof P]: k extends keyof T ? Pick : never }; + array: T extends (infer U)[] ? Pick[] : never; + never: never; + any: any; + }[IsAny extends true + ? 'any' + : IsNever extends true + ? 'never' + : IsNever

extends true + ? 'true' + : IsTrue

extends true + ? 'true' + : true extends IsObject + ? 'object' + : true extends IsObjectArray + ? 'array' + : 'any']; +} diff --git a/deno_lib/helpers/objectUtil.ts b/deno_lib/helpers/objectUtil.ts new file mode 100644 index 000000000..c4252a70a --- /dev/null +++ b/deno_lib/helpers/objectUtil.ts @@ -0,0 +1,130 @@ +import { ZodRawShape, ZodTypes } from '../types/base.ts'; +import { ZodIntersection } from '../types/intersection.ts'; +import { ZodObject, AnyZodObject } from '../types/object.ts'; + +export namespace objectUtil { + // export interface ZodObjectParams { + // strict: boolean; + // } + + // export type MergeObjectParams< + // First extends ZodObjectParams, + // Second extends ZodObjectParams + // > = { + // strict: First['strict'] extends false + // ? false + // : Second['strict'] extends false + // ? false + // : true; + // }; + + export type MergeShapes = { + [k in Exclude]: U[k]; + } & + V; + + type optionalKeys = { + [k in keyof T]: undefined extends T[k] ? k : never; + }[keyof T]; + + type requiredKeys = Exclude>; + + export type addQuestionMarks = { + [k in optionalKeys]?: T[k]; + } & + { [k in requiredKeys]: T[k] }; + + // type ObjectIntersection = addQuestionMarks< + // { + // [k in keyof T]: T[k]['_type']; + // } + // >; + + export type identity = T; + export type flatten = identity<{ [k in keyof T]: T[k] }>; + + export type NoNeverKeys = { + [k in keyof T]: [T[k]] extends [never] ? never : k; + }[keyof T]; + + export type NoNever = identity< + { + [k in NoNeverKeys]: k extends keyof T ? T[k] : never; + } + >; + + // export type ObjectType = flatten< + // ObjectIntersection + // >; + // type ObjectIntersectionInput = addQuestionMarks< + // { + // [k in keyof T]: T[k]['_input']; + // } + // >; + // type ObjectIntersectionOutput = addQuestionMarks< + // { + // [k in keyof T]: T[k]['_output']; + // } + // >; + + // export type objectInputType> = flatten< + // addQuestionMarks< + // { + // [k in keyof T['_shape']]: T['_shape'][k]['_input']; + // } + // > + // >; + + // export type objectOutputType> = flatten< + // addQuestionMarks< + // { + // [k in keyof T['_shape']]: T['_shape'][k]['_output']; + // } + // > + // >; + + export const mergeShapes = ( + first: U, + second: T, + ): T & U => { + const firstKeys = Object.keys(first); + const secondKeys = Object.keys(second); + const sharedKeys = firstKeys.filter(k => secondKeys.indexOf(k) !== -1); + + const sharedShape: any = {}; + for (const k of sharedKeys) { + sharedShape[k] = ZodIntersection.create(first[k], second[k]); + } + return { + ...(first as object), + ...(second as object), + ...sharedShape, + }; + }; + + export const mergeObjects = (first: First) => < + Second extends AnyZodObject + >( + second: Second, + ): ZodObject< + First['_shape'] & Second['_shape'], + First['_unknownKeys'], + First['_catchall'] + // MergeObjectParams, + // First['_input'] & Second['_input'], + // First['_output'] & Second['_output'] + > => { + const mergedShape = mergeShapes(first._def.shape(), second._def.shape()); + const merged: any = new ZodObject({ + t: ZodTypes.object, + checks: [...(first._def.checks || []), ...(second._def.checks || [])], + unknownKeys: first._def.unknownKeys, + catchall: first._def.catchall, + // params: { + // strict: first.params.strict && second.params.strict, + // }, + shape: () => mergedShape, + }) as any; + return merged; + }; +} diff --git a/deno_lib/helpers/partialUtil.ts b/deno_lib/helpers/partialUtil.ts new file mode 100644 index 000000000..a0c1d5c02 --- /dev/null +++ b/deno_lib/helpers/partialUtil.ts @@ -0,0 +1,36 @@ +import * as z from '../index.ts'; +import { AnyZodObject } from '../types/object.ts'; + +export namespace partialUtil { + export type RootDeepPartial = { + // optional: T extends z.ZodOptional ? T : z.ZodOptional; + // array: T extends z.ZodArray ? z.ZodArray> : never; + object: T extends AnyZodObject + ? z.ZodObject< + { [k in keyof T['_shape']]: DeepPartial }, + T['_unknownKeys'], + T['_catchall'] + > + : never; + rest: ReturnType; // z.ZodOptional; + }[T extends AnyZodObject + ? 'object' // T extends z.ZodOptional // ? 'optional' // : + : 'rest']; + + export type DeepPartial = { + // optional: T extends z.ZodOptional ? T : z.ZodOptional; + // array: T extends z.ZodArray ? z.ZodArray> : never; + object: T extends z.ZodObject + ? z.ZodOptional< + z.ZodObject< + { [k in keyof Shape]: DeepPartial }, + Params, + Catchall + > + > + : never; + rest: ReturnType; + }[T extends z.ZodObject + ? 'object' // T extends z.ZodOptional // ? 'optional' // : + : 'rest']; +} diff --git a/deno_lib/helpers/primitive.ts b/deno_lib/helpers/primitive.ts new file mode 100644 index 000000000..3a0252f9a --- /dev/null +++ b/deno_lib/helpers/primitive.ts @@ -0,0 +1,3 @@ +export type Primitive = string | number | bigint | boolean | null | undefined; + +export type Scalars = Primitive | Primitive[]; diff --git a/deno_lib/helpers/util.ts b/deno_lib/helpers/util.ts new file mode 100644 index 000000000..f3e3af4ac --- /dev/null +++ b/deno_lib/helpers/util.ts @@ -0,0 +1,60 @@ +export const INVALID = Symbol('invalid_data'); +export namespace util { + export type AssertEqual = T extends Expected + ? Expected extends T + ? true + : false + : false; + + export function assertNever(_x: never): never { + throw new Error(); + } + + export type Omit = Pick>; + export type OmitKeys = Pick>; + export type MakePartial = Omit & + Partial>; + + export const arrayToEnum = ( + items: U, + ): { [k in U[number]]: k } => { + const obj: any = {}; + for (const item of items) { + obj[item] = item; + } + return obj as any; + }; + + export const getValidEnumValues = (obj: any) => { + const validKeys = Object.keys(obj).filter( + (k: any) => typeof obj[obj[k]] !== 'number', + ); + const filtered: any = {}; + for (const k of validKeys) { + filtered[k] = obj[k]; + } + return getValues(filtered); + }; + + export const getValues = (obj: any) => { + return Object.keys(obj).map(function(e) { + return obj[e]; + }); + }; + + export const objectValues = (obj: any) => { + return Object.keys(obj).map(function(e) { + return obj[e]; + }); + }; + + export const find = ( + arr: T[], + checker: (arg: T) => any, + ): T | undefined => { + for (const item of arr) { + if (checker(item)) return item; + } + return undefined; + }; +} diff --git a/deno_lib/index.ts b/deno_lib/index.ts new file mode 100644 index 000000000..4a2fb38b8 --- /dev/null +++ b/deno_lib/index.ts @@ -0,0 +1,202 @@ +/* ZOD */ + +import { ZodString, ZodStringDef } from './types/string.ts'; +import { ZodNumber, ZodNumberDef } from './types/number.ts'; +import { ZodBigInt, ZodBigIntDef } from './types/bigint.ts'; +import { ZodBoolean, ZodBooleanDef } from './types/boolean.ts'; +import { ZodDate, ZodDateDef } from './types/date.ts'; +import { ZodUndefined, ZodUndefinedDef } from './types/undefined.ts'; +import { ZodNull, ZodNullDef } from './types/null.ts'; +import { ZodAny, ZodAnyDef } from './types/any.ts'; +import { ZodUnknown, ZodUnknownDef } from './types/unknown.ts'; +import { ZodNever, ZodNeverDef } from './types/never.ts'; +import { ZodVoid, ZodVoidDef } from './types/void.ts'; +import { ZodArray, ZodArrayDef } from './types/array.ts'; +import { ZodObject, ZodObjectDef } from './types/object.ts'; +import { ZodUnion, ZodUnionDef } from './types/union.ts'; +import { ZodIntersection, ZodIntersectionDef } from './types/intersection.ts'; +import { ZodTuple, ZodTupleDef } from './types/tuple.ts'; +import { ZodRecord, ZodRecordDef } from './types/record.ts'; +import { ZodMap, ZodMapDef } from './types/map.ts'; +import { ZodFunction, ZodFunctionDef } from './types/function.ts'; +import { ZodLazy, ZodLazyDef } from './types/lazy.ts'; +import { ZodLiteral, ZodLiteralDef } from './types/literal.ts'; +import { ZodEnum, ZodEnumDef } from './types/enum.ts'; +import { ZodNativeEnum, ZodNativeEnumDef } from './types/nativeEnum.ts'; +import { ZodPromise, ZodPromiseDef } from './types/promise.ts'; +import { ZodTransformer, ZodTransformerDef } from './types/transformer.ts'; +import { ZodOptional, ZodOptionalDef } from './types/optional.ts'; +import { ZodNullable, ZodNullableDef } from './types/nullable.ts'; +import { + TypeOf, + input, + output, + ZodType, + ZodTypeAny, + ZodTypeDef, + ZodTypes, +} from './types/base.ts'; + +// export { ZodIssueCode } from './ZodError.ts'; + +import { ZodParsedType } from './parser.ts'; +import { ZodErrorMap } from './defaultErrorMap.ts'; +import { ZodCodeGenerator } from './codegen.ts'; + +export { ZodTypeDef, ZodTypes }; +type ZodDef = + | ZodStringDef + | ZodNumberDef + | ZodBigIntDef + | ZodBooleanDef + | ZodDateDef + | ZodUndefinedDef + | ZodNullDef + | ZodAnyDef + | ZodUnknownDef + | ZodNeverDef + | ZodVoidDef + | ZodArrayDef + | ZodObjectDef + | ZodUnionDef + | ZodIntersectionDef + | ZodTupleDef + | ZodRecordDef + | ZodMapDef + | ZodFunctionDef + | ZodLazyDef + | ZodLiteralDef + | ZodEnumDef + | ZodTransformerDef + | ZodNativeEnumDef + | ZodOptionalDef + | ZodNullableDef + | ZodPromiseDef; + +const stringType = ZodString.create; +const numberType = ZodNumber.create; +const bigIntType = ZodBigInt.create; +const booleanType = ZodBoolean.create; +const dateType = ZodDate.create; +const undefinedType = ZodUndefined.create; +const nullType = ZodNull.create; +const anyType = ZodAny.create; +const unknownType = ZodUnknown.create; +const neverType = ZodNever.create; +const voidType = ZodVoid.create; +const arrayType = ZodArray.create; +const objectType = ZodObject.create; +const unionType = ZodUnion.create; +const intersectionType = ZodIntersection.create; +const tupleType = ZodTuple.create; +const recordType = ZodRecord.create; +const mapType = ZodMap.create; +const functionType = ZodFunction.create; +const lazyType = ZodLazy.create; +const literalType = ZodLiteral.create; +const enumType = ZodEnum.create; +const nativeEnumType = ZodNativeEnum.create; +const promiseType = ZodPromise.create; +const transformerType = ZodTransformer.create; +const optionalType = ZodOptional.create; +const nullableType = ZodNullable.create; +const ostring = () => stringType().optional(); +const onumber = () => numberType().optional(); +const oboolean = () => booleanType().optional(); + +const codegen = ZodCodeGenerator.create; + +export const custom = ( + check?: (data: unknown) => any, + params?: Parameters[1], +): ZodType => { + if (check) return anyType().refine(check, params); + return anyType(); +}; + +const instanceOfType = any>( + cls: T, + params: Parameters[1] = { + message: `Input not instance of ${cls.name}`, + }, +) => custom>(data => data instanceof cls, params); + +export { + stringType as string, + numberType as number, + bigIntType as bigint, + booleanType as boolean, + dateType as date, + undefinedType as undefined, + nullType as null, + anyType as any, + unknownType as unknown, + neverType as never, + voidType as void, + arrayType as array, + objectType as object, + unionType as union, + intersectionType as intersection, + tupleType as tuple, + recordType as record, + mapType as map, + functionType as function, + lazyType as lazy, + literalType as literal, + enumType as enum, + nativeEnumType as nativeEnum, + promiseType as promise, + instanceOfType as instanceof, + transformerType as transformer, + optionalType as optional, + nullableType as nullable, + ostring, + onumber, + oboolean, + codegen, +}; + +export const late = { + object: ZodObject.lazycreate, +}; + +export { + ZodString, + ZodNumber, + ZodBigInt, + ZodBoolean, + ZodDate, + ZodUndefined, + ZodNull, + ZodAny, + ZodUnknown, + ZodNever, + ZodVoid, + ZodArray, + ZodObject, + ZodUnion, + ZodIntersection, + ZodTuple, + ZodRecord, + ZodFunction, + ZodLazy, + ZodLiteral, + ZodEnum, + ZodNativeEnum, + ZodPromise, + ZodTransformer, + ZodOptional, + ZodNullable, + ZodType, + ZodType as Schema, + ZodType as ZodSchema, + ZodTypeAny, + ZodDef, + ZodErrorMap, + ZodParsedType, + ZodCodeGenerator, +}; + +export { TypeOf, TypeOf as infer, input, output }; + +export * from './ZodError.ts'; diff --git a/deno_lib/isScalar.ts b/deno_lib/isScalar.ts new file mode 100644 index 000000000..d545de29f --- /dev/null +++ b/deno_lib/isScalar.ts @@ -0,0 +1,100 @@ +import * as z from './index.ts'; +import { util } from './helpers/util.ts'; + +export const isScalar = ( + schema: z.ZodType, + params: { root: boolean } = { root: true }, +): boolean => { + const def = schema._def as z.ZodDef; + + let returnValue = false; + switch (def.t) { + case z.ZodTypes.string: + returnValue = true; + break; + case z.ZodTypes.number: + returnValue = true; + break; + case z.ZodTypes.bigint: + returnValue = true; + break; + case z.ZodTypes.boolean: + returnValue = true; + break; + case z.ZodTypes.undefined: + returnValue = true; + break; + case z.ZodTypes.null: + returnValue = true; + break; + case z.ZodTypes.any: + returnValue = false; + break; + case z.ZodTypes.unknown: + returnValue = false; + break; + case z.ZodTypes.never: + returnValue = false; + break; + case z.ZodTypes.void: + returnValue = false; + break; + case z.ZodTypes.array: + if (params.root === false) return false; + returnValue = isScalar(def.type, { root: false }); + break; + case z.ZodTypes.object: + returnValue = false; + break; + case z.ZodTypes.union: + returnValue = def.options.every(x => isScalar(x)); + break; + case z.ZodTypes.intersection: + returnValue = isScalar(def.left) && isScalar(def.right); + break; + case z.ZodTypes.tuple: + returnValue = def.items.every(x => isScalar(x, { root: false })); + break; + case z.ZodTypes.lazy: + returnValue = isScalar(def.getter()); + break; + case z.ZodTypes.literal: + returnValue = true; + break; + case z.ZodTypes.enum: + returnValue = true; + break; + case z.ZodTypes.nativeEnum: + returnValue = true; + break; + case z.ZodTypes.function: + returnValue = false; + break; + case z.ZodTypes.record: + returnValue = false; + break; + case z.ZodTypes.map: + returnValue = false; + break; + case z.ZodTypes.date: + returnValue = true; + break; + case z.ZodTypes.promise: + returnValue = false; + break; + case z.ZodTypes.transformer: + returnValue = isScalar(def.output); + break; + + case z.ZodTypes.optional: + returnValue = isScalar(def.innerType); + break; + case z.ZodTypes.nullable: + returnValue = isScalar(def.innerType); + break; + default: + util.assertNever(def); + // returnValue = false; break; + } + return returnValue; +}; diff --git a/deno_lib/mod.ts b/deno_lib/mod.ts new file mode 100644 index 000000000..a6d139036 --- /dev/null +++ b/deno_lib/mod.ts @@ -0,0 +1 @@ +export * from "./cjs/index.ts"; \ No newline at end of file diff --git a/deno_lib/parser.ts b/deno_lib/parser.ts new file mode 100644 index 000000000..7d3cfa020 --- /dev/null +++ b/deno_lib/parser.ts @@ -0,0 +1,1207 @@ +import * as z from './types/base.ts'; +import { ZodDef, ZodNever } from './index.ts'; +import { + ZodError, + ZodIssueCode, + ZodIssue, + ZodIssueOptionalMessage, +} from './ZodError.ts'; +import { INVALID, util } from './helpers/util.ts'; +import { ZodErrorMap, defaultErrorMap } from './defaultErrorMap.ts'; +import { PseudoPromise } from './PseudoPromise.ts'; + +export const getParsedType = (data: any): ZodParsedType => { + if (typeof data === 'string') return 'string'; + if (typeof data === 'number') { + if (Number.isNaN(data)) return 'nan'; + return 'number'; + } + if (typeof data === 'boolean') return 'boolean'; + if (typeof data === 'bigint') return 'bigint'; + if (typeof data === 'symbol') return 'symbol'; + if (data instanceof Date) return 'date'; + if (typeof data === 'function') return 'function'; + if (data === undefined) return 'undefined'; + if (typeof data === 'undefined') return 'undefined'; + if (typeof data === 'object') { + if (Array.isArray(data)) return 'array'; + if (data === null) return 'null'; + if ( + data.then && + typeof data.then === 'function' && + data.catch && + typeof data.catch === 'function' + ) { + return 'promise'; + } + if (data instanceof Map) { + return 'map'; + } + return 'object'; + } + return 'unknown'; +}; + +export const ZodParsedType = util.arrayToEnum([ + 'string', + 'nan', + 'number', + 'integer', + 'boolean', + 'date', + 'bigint', + 'symbol', + 'function', + 'undefined', + 'null', + 'array', + 'object', + 'unknown', + 'promise', + 'void', + 'never', + 'map', +]); + +export type ZodParsedType = keyof typeof ZodParsedType; + +// conditional required to distribute union +type stripPath = T extends any + ? util.OmitKeys + : never; +export type MakeErrorData = stripPath & { + path?: (string | number)[]; +}; + +// export const INVALID = Symbol('invalid_data'); + +// const NODATA = Symbol('no_data'); + +export type ParseParams = { + seen?: { + schema: z.ZodType; + objects: { input: any; error?: ZodError; output: any }[]; + }[]; + path?: (string | number)[]; + errorMap?: ZodErrorMap; + async?: boolean; + runAsyncValidationsInSeries?: boolean; +}; + +export const ZodParser = (schema: z.ZodType) => ( + data: any, + baseParams: ParseParams = { seen: [], errorMap: defaultErrorMap, path: [] }, +) => { + const params: Required = { + seen: baseParams.seen || [], + path: baseParams.path || [], + errorMap: baseParams.errorMap || defaultErrorMap, + async: baseParams.async ?? false, + runAsyncValidationsInSeries: + baseParams.runAsyncValidationsInSeries ?? false, + }; + + const makeError = (errorData: MakeErrorData): ZodIssue => { + const errorArg = { + ...errorData, + path: [...params.path, ...(errorData.path || [])], + }; + const ctxArg = { data }; + + const defaultError = + defaultErrorMap === params.errorMap + ? { message: `Invalid value.` } + : defaultErrorMap(errorArg, { + ...ctxArg, + defaultError: `Invalid value.`, + }); + return { + ...errorData, + path: [...params.path, ...(errorData.path || [])], + message: + errorData.message || + params.errorMap(errorArg, { + ...ctxArg, + defaultError: defaultError.message, + }).message, + }; + }; + + const def: ZodDef = schema._def as any; + + let PROMISE: PseudoPromise = new PseudoPromise(); + (PROMISE as any)._default = true; + + const RESULT: { input: any; output: any; error?: ZodError } = { + input: data, + output: INVALID, + }; + + params.seen = params.seen || []; + + // partially working cycle detection system + + // params.seen.push({ schema, objects: [] }); + // const schemaSeen = util.find(params.seen, x => x.schema === schema)!; // params.seen.find(x => x.schema === schemaDef)!; + // const objectSeen = util.find(schemaSeen.objects, arg => arg.input === data); //.find(x => x.data === data); + // if (objectSeen) { + + // if (objectSeen.error) { + // don't throw previous error + // the path with be wrong for arrays + // let the validation re-run and generate a new error + // } else if (objectSeen.output !== NODATA) { + // return the previous value + // return objectSeen.output; + // } + // } else { + // schemaSeen.objects.push(RESULT); + // } + + // else { + // params.seen.push({ schema: schemaDef, objects: [{ data, promise: PROM }] }); + // } + // } + + const ERROR = new ZodError([]); + const THROW = () => { + RESULT.error = ERROR; + throw ERROR; + }; + const HANDLE = (err: Error) => { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + } + throw err; + }; + // const defaultPROMISE = Symbol('return_value'); + // let returnValue: PseudoPromise; // = defaultReturnValue; + const parsedType = getParsedType(data); + + // console.log( + // `\n============\nPARSING ${def.t.toUpperCase()} at ${params.path.join( + // '.', + // )}`, + // ); + // console.log(JSON.stringify(data, null, 2)); + switch (def.t) { + case z.ZodTypes.string: + if (parsedType !== ZodParsedType.string) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.string, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + + break; + case z.ZodTypes.number: + if (parsedType !== ZodParsedType.number) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.number, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + if (Number.isNaN(data)) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.number, + received: ZodParsedType.nan, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.bigint: + if (parsedType !== ZodParsedType.bigint) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.number, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.boolean: + if (parsedType !== ZodParsedType.boolean) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.boolean, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.undefined: + if (parsedType !== ZodParsedType.undefined) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.undefined, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.null: + if (parsedType !== ZodParsedType.null) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.null, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.any: + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.unknown: + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.never: + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.never, + received: parsedType, + }), + ); + PROMISE = PseudoPromise.resolve(INVALID); + break; + case z.ZodTypes.void: + if ( + parsedType !== ZodParsedType.undefined && + parsedType !== ZodParsedType.null + ) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.void, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.array: + RESULT.output = []; + if (parsedType !== ZodParsedType.array) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + // const data: any[] = data; + if (def.nonempty === true && data.length === 0) { + ERROR.addIssue( + makeError({ code: ZodIssueCode.nonempty_array_is_empty }), + ); + THROW(); + } + // PROMISE = (data as any[]).map((item, i) => { + // try { + // return def.type.parse(item, { ...params, path: [...params.path, i] }); + // } catch (err) { + // const zerr: ZodError = err; + // ERROR.addIssues(zerr.issues); + // } + // }); + PROMISE = PseudoPromise.all( + (data as any[]).map((item, i) => { + try { + return PseudoPromise.resolve( + def.type.parse(item, { + ...params, + path: [...params.path, i], + }), + ); + } catch (err) { + if (!(err instanceof ZodError)) { + throw err; + } + ERROR.addIssues(err.issues); + return PseudoPromise.resolve(INVALID); + } + }), + ); + // if (!ERROR.isEmpty) { + // THROW(); + // } + break; + case z.ZodTypes.map: + if (parsedType !== ZodParsedType.map) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.map, + received: parsedType, + }), + ); + THROW(); + } + + const dataMap: Map = data; + const returnedMap = new Map(); + + PROMISE = PseudoPromise.all( + [...dataMap.entries()].map(([key, value], index) => { + return PseudoPromise.all([ + new PseudoPromise() + .then(() => { + return def.keyType.parse(key, { + ...params, + path: [...params.path, index, 'key'], + }); + }) + .catch(err => { + if (!(err instanceof ZodError)) { + throw err; + } + + ERROR.addIssues(err.issues); + return INVALID; + }), + new PseudoPromise() + .then(() => { + const mapValue = def.valueType.parse(value, { + ...params, + path: [...params.path, index, 'value'], + }); + return [key, mapValue]; + }) + .catch(err => { + if (!(err instanceof ZodError)) { + throw err; + } + + ERROR.addIssues(err.issues); + return INVALID; + }), + ]) + .then((item: any) => { + try { + if (item[0] !== INVALID && item[1] !== INVALID) { + returnedMap.set(item[0], item[1]); + } else { + } + } catch (err) {} + }) + .catch(err => { + if (!(err instanceof ZodError)) { + throw err; + } + + ERROR.addIssues(err.issues); + return INVALID; + }); + // const promises = [ + // PseudoPromise.resolve( + // def.keyType.parse(key, { + // ...params, + // path: [...params.path, index, 'key'], + // }), + // ).catch(err => { + // if (!(err instanceof ZodError)) { + // throw err; + // } + + // ERROR.addIssues(err.issues); + // return INVALID; + // }), + // PseudoPromise.resolve( + // def.valueType.parse(value, { + // ...params, + // path: [...params.path, index, 'value'], + // }), + // ).catch(err => { + // if (!(err instanceof ZodError)) { + // throw err; + // } + + // ERROR.addIssues(err.issues); + // return INVALID; + // }), + // ]; + + // try { + // promises.push( + // PseudoPromise.resolve( + // def.keyType.parse(key, { + // ...params, + // path: [...params.path, index, 'key'], + // }), + // ), + // ); + // } catch (err) { + // if (!(err instanceof ZodError)) { + // throw err; + // } + + // ERROR.addIssues(err.issues); + // promises.push(PseudoPromise.resolve(INVALID)); + // } + + // try { + // promises.push( + // PseudoPromise.resolve( + // def.valueType.parse(value, { + // ...params, + // path: [...params.path, index, 'value'], + // }), + // ), + // ); + // } catch (err) { + // if (err instanceof ZodError) { + // const zerr: ZodError = err; + // ERROR.addIssues(zerr.issues); + // promises.push(PseudoPromise.resolve(INVALID)); + // } else { + // throw err; + // } + // } + + // return PseudoPromise.all(promises).then(pairs =>{ + // for(const [key,value] of pairs){} + // }); + }), + ) + .then(() => { + if (!ERROR.isEmpty) { + throw ERROR; + } + }) + .then(() => { + return returnedMap; + }) + .then(() => { + return returnedMap; + }); + break; + case z.ZodTypes.object: + RESULT.output = {}; + if (parsedType !== ZodParsedType.object) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: parsedType, + }), + ); + THROW(); + } + + const objectPromises: { [k: string]: PseudoPromise } = {}; + + const shape = def.shape(); + const shapeKeys = Object.keys(shape); + const dataKeys = Object.keys(data); + const extraKeys = dataKeys.filter(k => shapeKeys.indexOf(k) === -1); + + for (const key of shapeKeys) { + const keyValidator = shapeKeys.includes(key) + ? shape[key] + : !(def.catchall instanceof ZodNever) + ? def.catchall + : undefined; + + if (!keyValidator) continue; + + // check if schema and value are both optional + + // const keyDataType = getParsedType(data[key]); + if (!Object.keys(data).includes(key)) { + try { + const output = keyValidator.parse(undefined, { + ...params, + path: [...params.path, key], + }); + if (output === undefined) { + // schema is optional + // data is undefined + // don't explicity add undefined to outut + continue; + } + } catch (err) {} + } + + objectPromises[key] = new PseudoPromise().then(() => { + try { + const parsedValue = keyValidator.parse(data[key], { + ...params, + path: [...params.path, key], + }); + return parsedValue; + } catch (err) { + if (err instanceof ZodError) { + const zerr: ZodError = err; + ERROR.addIssues(zerr.issues); + return INVALID; + } else { + throw err; + } + } + }); + } + + if (def.catchall instanceof ZodNever) { + if (def.unknownKeys === 'passthrough') { + for (const key of extraKeys) { + objectPromises[key] = PseudoPromise.resolve(data[key]); + } + } else if (def.unknownKeys === 'strict') { + if (extraKeys.length > 0) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.unrecognized_keys, + keys: extraKeys, + }), + ); + } + } else if (def.unknownKeys === 'strip') { + // do nothing + } else { + util.assertNever(def.unknownKeys); + } + } else { + // run cathcall validation + for (const key of extraKeys) { + objectPromises[key] = new PseudoPromise().then(() => { + try { + const parsedValue = def.catchall.parse(data[key], { + ...params, + path: [...params.path, key], + }); + return parsedValue; + } catch (err) { + if (err instanceof ZodError) { + const zerr: ZodError = err; + ERROR.addIssues(zerr.issues); + return INVALID; + } else { + throw err; + } + } + }); + } + } + + PROMISE = PseudoPromise.object(objectPromises) + .then(resolvedObject => { + Object.assign(RESULT.output, resolvedObject); + return RESULT.output; + }) + .catch(err => { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + return INVALID; + } + throw err; + }); + + break; + case z.ZodTypes.union: + // let parsedUnion: any; + let isValid = false; + const unionErrors: ZodError[] = []; + // const INVALID = Symbol('invalid_data'); + PROMISE = PseudoPromise.all( + def.options.map(opt => { + try { + const unionValueProm = PseudoPromise.resolve( + opt.parse(data, params), + ); + isValid = true; + return unionValueProm; + // return parsed; + } catch (err) { + if (err instanceof ZodError) { + unionErrors.push(err); + return PseudoPromise.resolve(INVALID); + } + throw err; + } + // } + }), + ) + .then((unionResults: any[]) => { + return util.find(unionResults, (val: any) => val !== INVALID); + }) + .then((unionResult: any) => { + // const unionResults: any[] = _unionResults; + if (!isValid) { + const nonTypeErrors = unionErrors.filter(err => { + return err.issues[0].code !== 'invalid_type'; + }); + if (nonTypeErrors.length === 1) { + ERROR.addIssues(nonTypeErrors[0].issues); + } else { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_union, + unionErrors, + }), + ); + } + return INVALID; + } + + return unionResult; + }); + // .then(unionResults => (unionResults as any).find((res: any) => res !== INVALID)); + // for (const option of def.options) { + // try { + // parsedUnion = option.parse(data, params); + // isValid = true; + // break; + // } catch (err) { + // unionErrors.push(err); + // } + // } + + // if (!isValid) { + // const filteredErrors = unionErrors.filter(err => { + // return err.issues[0].code !== 'invalid_type'; + // }); + // if (filteredErrors.length === 1) { + // ERROR.addIssues(filteredErrors[0].issues); + // } else { + // ERROR.addIssue( + // makeError({ + // code: ZodIssueCode.invalid_union, + // unionErrors: unionErrors, + // }), + // ); + // } + // } + // PROMISE = parsedUnion; + break; + case z.ZodTypes.intersection: + // let parsedIntersection:any; + // let parsedLeft: any; + // let parsedRight: any; + // PROMISE = PseudoPromise.resolve(data); + PROMISE = PseudoPromise.all([ + new PseudoPromise().then(() => { + try { + return def.left.parse(data, params); + } catch (err) { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + return INVALID; + } + throw err; + } + }), + new PseudoPromise().then(() => { + try { + return def.right.parse(data, params); + } catch (err) { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + return INVALID; + } + throw err; + } + }), + ]).then(([parsedLeft, parsedRight]: any) => { + if (parsedLeft === INVALID || parsedRight === INVALID) return INVALID; + + const parsedLeftType = getParsedType(parsedLeft); + const parsedRightType = getParsedType(parsedRight); + + if (parsedLeft === parsedRight) { + return parsedLeft; + } else if ( + parsedLeftType === ZodParsedType.object && + parsedRightType === ZodParsedType.object + ) { + return { ...parsedLeft, ...parsedRight }; + } else { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_intersection_types, + }), + ); + } + }); + + break; + + case z.ZodTypes.optional: + if (parsedType === ZodParsedType.undefined) { + PROMISE = PseudoPromise.resolve(undefined); + break; + } + + PROMISE = new PseudoPromise().then(() => { + try { + return def.innerType.parse(data, params); + } catch (err) { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + return INVALID; + } + throw err; + } + }); + break; + case z.ZodTypes.nullable: + if (parsedType === ZodParsedType.null) { + PROMISE = PseudoPromise.resolve(null); + break; + } + + PROMISE = new PseudoPromise().then(() => { + try { + return def.innerType.parse(data, params); + } catch (err) { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + return INVALID; + } + throw err; + } + }); + break; + case z.ZodTypes.tuple: + if (parsedType !== ZodParsedType.array) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + if (data.length > def.items.length) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.too_big, + maximum: def.items.length, + inclusive: true, + type: 'array', + }), + ); + } else if (data.length < def.items.length) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.too_small, + minimum: def.items.length, + inclusive: true, + type: 'array', + }), + ); + } + + // const parsedTuple: any[] = []; + const tupleData: any[] = data; + // const parsedTuple: any = []; + // const tuplePromises: PseudoPromise[] = []; + + PROMISE = PseudoPromise.all( + tupleData.map((item, index) => { + const itemParser = def.items[index]; + return new PseudoPromise().then(() => { + try { + return itemParser.parse(item, { + ...params, + path: [...params.path, index], + }); + } catch (err) { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + return INVALID; + } + throw err; + } + }); + }), + ); + // for (const index in tupleData) { + // const item = tupleData[index]; + // const itemParser = def.items[index]; + // tuplePromises.push( + // new PseudoPromise().then(() => { + // try { + // return itemParser.parse(item, { ...params, path: [...params.path, index] }); + // } catch (err) { + // ERROR.addIssues(err.issues); + // } + // }), + // ); + // // parsedTuple.push(itemParser.parse(item, { ...params, path: [...params.path, index] })); + // } + // PROMISE = parsedTuple; + break; + case z.ZodTypes.lazy: + const lazySchema = def.getter(); + PROMISE = PseudoPromise.resolve(lazySchema.parse(data, params)); + break; + case z.ZodTypes.literal: + if (data !== def.value) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_literal_value, + expected: def.value, + }), + ); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.enum: + if (def.values.indexOf(data) === -1) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_enum_value, + options: def.values, + }), + ); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.nativeEnum: + if (util.getValidEnumValues(def.values).indexOf(data) === -1) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_enum_value, + options: util.objectValues(def.values), + }), + ); + } + PROMISE = PseudoPromise.resolve(data); + break; + case z.ZodTypes.function: + if (parsedType !== ZodParsedType.function) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.function, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + const validatedFunc = (...args: any[]) => { + try { + def.args.parse(args as any, params); + } catch (err) { + if (err instanceof ZodError) { + const argsError = new ZodError([]); + argsError.addIssue( + makeError({ + code: ZodIssueCode.invalid_arguments, + argumentsError: err, + }), + ); + throw argsError; + } + throw err; + } + + const result = data(...(args as any)); + + try { + return def.returns.parse(result, params); + } catch (err) { + if (err instanceof ZodError) { + const returnsError = new ZodError([]); + returnsError.addIssue( + makeError({ + code: ZodIssueCode.invalid_return_type, + returnTypeError: err, + }), + ); + throw returnsError; + } + throw err; + } + }; + PROMISE = PseudoPromise.resolve(validatedFunc); + // return validatedFunc; + break; + case z.ZodTypes.record: + if (parsedType !== ZodParsedType.object) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + + const parsedRecordPromises: { [k: string]: PseudoPromise } = {}; + for (const key in data) { + parsedRecordPromises[key] = new PseudoPromise().then(() => { + try { + return def.valueType.parse(data[key], { + ...params, + path: [...params.path, key], + }); + } catch (err) { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + return INVALID; + } + throw err; + } + }); + } + PROMISE = PseudoPromise.object(parsedRecordPromises); + // PROMISE = parsedRecord; + break; + case z.ZodTypes.date: + if (!(data instanceof Date)) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.date, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + if (isNaN(data.getTime())) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_date, + }), + ); + // setError(error); + THROW(); + } + PROMISE = PseudoPromise.resolve(data); + break; + + case z.ZodTypes.promise: + if (parsedType !== ZodParsedType.promise && params.async !== true) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.promise, + received: parsedType, + }), + ); + // setError(error); + THROW(); + } + + const promisified = + parsedType === ZodParsedType.promise ? data : Promise.resolve(data); + + PROMISE = PseudoPromise.resolve( + promisified.then((resolvedData: any) => { + try { + const parsed = def.type.parse(resolvedData, params); + return parsed; + } catch (err) { + if (err instanceof ZodError) { + ERROR.addIssues(err.issues); + } + throw err; + } + }), + ); + + // new Promise(async (res, rej) => { + // const dataValue = await data; + // try { + // const parsed = def.type.parse(dataValue, params); + // res(parsed); + // } catch (err) { + // rej(err); + // } + // }), + // ); + break; + case z.ZodTypes.transformer: + PROMISE = new PseudoPromise() + .then(() => { + return def.input.parse(data, params); + }) + .catch(HANDLE) + .then(inputParseResult => { + // try { + // console.log(`TRANSFORMING`); + // console.log(JSON.stringify(inputParseResult, null, 2)); + const transformed = def.transformer(inputParseResult); + if (transformed instanceof Promise && params.async === false) { + if (z.inputSchema(def.output)._def.t !== z.ZodTypes.promise) { + throw new Error( + "You can't call .parse on a schema containing async transformations.", + ); + } + } + + // console.log(`RESULT`); + // console.log(JSON.stringify(transformed, null, 2)); + return transformed; + // } catch (err) { + // if (err instanceof ZodError) { + // ERROR.addIssues(err.issues); + // return INVALID; + // } + // throw err; + // } + }) + .then(transformedResult => { + // try { + return def.output.parse(transformedResult, params); + // } catch (err) { + // if (err instanceof ZodError) { + // ERROR.addIssues(err.issues); + // return INVALID; + // } + // throw err; + // } + }) + .catch(HANDLE); + break; + default: + PROMISE = PseudoPromise.resolve('adsf' as never); + util.assertNever(def); + } + + if ((PROMISE as any)._default === true) { + throw new Error('Result is not materialized.'); + } + + if (!ERROR.isEmpty) { + THROW(); + } + + const customChecks = def.checks || []; + + const checkCtx: z.RefinementCtx = { + addIssue: (arg: MakeErrorData) => { + ERROR.addIssue(makeError(arg)); + }, + path: params.path, + }; + if (params.async === false) { + const resolvedValue = PROMISE.getValueSync(); + + // const SYNC_ERROR = + // "You can't use .parse on a schema containing async refinements or transformations. Use .parseAsync instead."; + // if (resolvedValue instanceof Promise) { + + // if (def.t !== z.ZodTypes.promise) { + // throw new Error(SYNC_ERROR); + // } + // } + + for (const check of customChecks) { + const checkResult = check.check(resolvedValue, checkCtx); + if (checkResult instanceof Promise) + throw new Error( + "You can't use .parse on a schema containing async refinements. Use .parseAsync instead.", + ); + + // if (!checkResult) { + // const { check: checkMethod, ...noMethodCheck } = check; + // ERROR.addIssue(makeError(noMethodCheck)); + // } + } + if (!ERROR.isEmpty) { + THROW(); + } + // if (resolvedValue === INVALID) { + // throw new ZodError([]).addIssue( + // makeError({ + // code: ZodIssueCode.custom, + // message: 'Invalid', + // }), + // ); + // } + return resolvedValue as any; + } else { + // if (params.async == true) { + const checker = async () => { + let resolvedValue = await PROMISE.getValueAsync(); + + // if (resolvedValue !== INVALID) { + // // let someError: boolean = false; + + // } + if (resolvedValue !== INVALID) { + if (params.runAsyncValidationsInSeries) { + let someError = false; + await customChecks.reduce((previousPromise, check) => { + return previousPromise.then(async () => { + if (!someError) { + const len = ERROR.issues.length; + await check.check(resolvedValue, checkCtx); + if (len < ERROR.issues.length) someError = true; + } + }); + }, Promise.resolve()); + } else { + await Promise.all( + customChecks.map(async check => { + await check.check(resolvedValue, checkCtx); + }), + ); + } + } else { + if (ERROR.isEmpty) { + ERROR.addIssue( + makeError({ + code: ZodIssueCode.custom, + message: 'Invalid', + }), + ); + } + } + + if (!ERROR.isEmpty) { + THROW(); + } + + return resolvedValue; + }; + + return checker(); + } +}; diff --git a/deno_lib/playground.ts b/deno_lib/playground.ts new file mode 100644 index 000000000..e69de29bb diff --git a/deno_lib/switcher.ts b/deno_lib/switcher.ts new file mode 100644 index 000000000..1b5c62b88 --- /dev/null +++ b/deno_lib/switcher.ts @@ -0,0 +1,64 @@ +import * as z from './index.ts'; +import { util } from './helpers/util.ts'; + +export const visitor = (schema: z.ZodType) => { + const def = schema._def as z.ZodDef; + switch (def.t) { + case z.ZodTypes.string: + break; + case z.ZodTypes.number: + break; + case z.ZodTypes.bigint: + break; + case z.ZodTypes.boolean: + break; + case z.ZodTypes.undefined: + break; + case z.ZodTypes.null: + break; + case z.ZodTypes.any: + break; + case z.ZodTypes.unknown: + break; + case z.ZodTypes.never: + break; + case z.ZodTypes.void: + break; + case z.ZodTypes.array: + break; + case z.ZodTypes.object: + break; + case z.ZodTypes.union: + break; + case z.ZodTypes.intersection: + break; + case z.ZodTypes.tuple: + break; + case z.ZodTypes.lazy: + break; + case z.ZodTypes.literal: + break; + case z.ZodTypes.enum: + break; + case z.ZodTypes.nativeEnum: + break; + case z.ZodTypes.function: + break; + case z.ZodTypes.record: + break; + case z.ZodTypes.date: + break; + case z.ZodTypes.promise: + break; + case z.ZodTypes.transformer: + break; + case z.ZodTypes.optional: + break; + case z.ZodTypes.nullable: + break; + case z.ZodTypes.map: + break; + default: + util.assertNever(def); + } +}; diff --git a/deno_lib/types/any.ts b/deno_lib/types/any.ts new file mode 100644 index 000000000..d35835588 --- /dev/null +++ b/deno_lib/types/any.ts @@ -0,0 +1,20 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodAnyDef extends z.ZodTypeDef { + t: z.ZodTypes.any; +} + +export class ZodAny extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + toJSON = () => this._def; + + static create = (): ZodAny => { + return new ZodAny({ + t: z.ZodTypes.any, + }); + }; +} diff --git a/deno_lib/types/array.ts b/deno_lib/types/array.ts new file mode 100644 index 000000000..0534218e4 --- /dev/null +++ b/deno_lib/types/array.ts @@ -0,0 +1,108 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; +import { ZodIssueCode } from '../ZodError.ts'; + +export interface ZodArrayDef + extends z.ZodTypeDef { + t: z.ZodTypes.array; + type: T; + nonempty: boolean; +} + +export class ZodArray extends z.ZodType< + T['_output'][], + ZodArrayDef, + T['_input'][] +> { + toJSON = () => { + return { + t: this._def.t, + nonempty: this._def.nonempty, + type: this._def.type.toJSON(), + }; + }; + + get element() { + return this._def.type; + } + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + min = (minLength: number, message?: string | { message?: string }) => + this.refinement(data => data.length >= minLength, { + code: ZodIssueCode.too_small, + type: 'array', + inclusive: true, + minimum: minLength, + ...(typeof message === 'string' ? { message } : message), + }); + + max = (maxLength: number, message?: string | { message?: string }) => + this.refinement(data => data.length <= maxLength, { + // check: data => data.length <= maxLength, + code: ZodIssueCode.too_big, + type: 'array', + inclusive: true, + maximum: maxLength, + ...(typeof message === 'string' ? { message } : message), + }); + + length = (len: number, message?: string) => + this.min(len, { message }).max(len, { message }); + + nonempty: () => ZodNonEmptyArray = () => { + return new ZodNonEmptyArray({ ...this._def, nonempty: true }); + }; + + static create = (schema: T): ZodArray => { + return new ZodArray({ + t: z.ZodTypes.array, + type: schema, + nonempty: false, + }); + }; +} + +export class ZodNonEmptyArray extends z.ZodType< + [T['_output'], ...T['_output'][]], + ZodArrayDef, + [T['_input'], ...T['_input'][]] +> { + toJSON = () => { + return { + t: this._def.t, + type: this._def.type.toJSON(), + }; + }; + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + min = (minLength: number, message?: string | { message?: string }) => + this.refinement(data => data.length >= minLength, { + // check: data => data.length >= minLength, + code: ZodIssueCode.too_small, + minimum: minLength, + type: 'array', + inclusive: true, + ...(typeof message === 'string' ? { message } : message), + }); + + max = (maxLength: number, message?: string | { message?: string }) => + this.refinement(data => data.length <= maxLength, { + // check: + code: ZodIssueCode.too_big, + maximum: maxLength, + type: 'array', + inclusive: true, + ...(typeof message === 'string' ? { message } : message), + }); + + length = (len: number, message?: string) => + this.min(len, { message }).max(len, { message }); +} diff --git a/deno_lib/types/base.ts b/deno_lib/types/base.ts new file mode 100644 index 000000000..a5645986d --- /dev/null +++ b/deno_lib/types/base.ts @@ -0,0 +1,364 @@ +import { + ZodIssueCode, + ZodArray, + ZodTransformer, + ZodError, + ZodOptional, + ZodNullable, +} from '../index.ts'; +import { ZodParser, ParseParams, MakeErrorData } from '../parser.ts'; +import { ZodOptionalType } from './optional.ts'; +import { ZodNullableType } from './nullable.ts'; +import { ZodCustomIssue } from '../ZodError.ts'; +import { util } from '../helpers/util.ts'; + +export enum ZodTypes { + string = 'string', + number = 'number', + bigint = 'bigint', + boolean = 'boolean', + date = 'date', + undefined = 'undefined', + null = 'null', + array = 'array', + object = 'object', + union = 'union', + intersection = 'intersection', + tuple = 'tuple', + record = 'record', + map = 'map', + function = 'function', + lazy = 'lazy', + literal = 'literal', + enum = 'enum', + nativeEnum = 'nativeEnum', + promise = 'promise', + any = 'any', + unknown = 'unknown', + never = 'never', + void = 'void', + transformer = 'transformer', + optional = 'optional', + nullable = 'nullable', +} + +export type ZodTypeAny = ZodType; +export type ZodRawShape = { [k: string]: ZodTypeAny }; + +export const inputSchema = (schema: ZodType): ZodType => { + if (schema instanceof ZodTransformer) { + return inputSchema(schema._def.input); + } else { + return schema; + } +}; + +export const outputSchema = (schema: ZodType): ZodType => { + if (schema instanceof ZodTransformer) { + return inputSchema(schema._def.output); + } else { + return schema; + } +}; + +export type RefinementCtx = { + addIssue: (arg: MakeErrorData) => void; + path: (string | number)[]; +}; +type InternalCheck = { + check: (arg: T, ctx: RefinementCtx) => any; + // refinementError: (arg: T) => MakeErrorData; +}; + +// type Check = { +// check: (arg: T) => any; +// path?: (string | number)[]; +// // message?: string; +// // params?: {[k:string]:any} +// } & util.Omit; + +type CustomErrorParams = Partial>; +// type Check = { +// check: (arg: T) => any; +// refinementError: (arg: T) => CustomErrorParams; +// }; + +export interface ZodTypeDef { + t: ZodTypes; + checks?: InternalCheck[]; + accepts?: ZodType; +} + +export type TypeOf> = T['_output']; +export type input> = T['_input']; +export type output> = T['_output']; +export type infer> = T['_output']; + +export abstract class ZodType< + Output, + Def extends ZodTypeDef = ZodTypeDef, + Input = Output +> { + readonly _type!: Output; + readonly _output!: Output; + readonly _def!: Def; + readonly _input!: Input; + + // get inputSchema(): ZodTypeAny = this; + // outputSchema: ZodTypeAny = this; + // = ()=>{ + // return this; + // } + // outputSchema = () => { + // return this; + // }; + + parse: (x: unknown, params?: ParseParams) => Output; + + safeParse: ( + x: unknown, + params?: ParseParams, + ) => { success: true; data: Output } | { success: false; error: ZodError } = ( + data, + params, + ) => { + try { + const parsed = this.parse(data, params); + return { success: true, data: parsed }; + } catch (err) { + if (err instanceof ZodError) { + return { success: false, error: err }; + } + throw err; + } + }; + + parseAsync: (x: unknown, params?: ParseParams) => Promise = async ( + value, + params, + ) => { + return await this.parse(value, { ...params, async: true }); + }; + + safeParseAsync: ( + x: unknown, + params?: ParseParams, + ) => Promise< + { success: true; data: Output } | { success: false; error: ZodError } + > = async (data, params) => { + try { + const parsed = await this.parseAsync(data, params); + return { success: true, data: parsed }; + } catch (err) { + if (err instanceof ZodError) { + return { success: false, error: err }; + } + throw err; + } + }; + + spa = this.safeParseAsync; + + is(u: Input): u is Input { + try { + this.parse(u as any); + return true; + } catch (err) { + return false; + } + } + + check(u: unknown): u is Input { + try { + this.parse(u as any); + return true; + } catch (err) { + return false; + } + } + + refine = any>( + check: Func, + message: + | string + | CustomErrorParams + | ((arg: Output) => CustomErrorParams) = 'Invalid value.', + ) => { + if (typeof message === 'string') { + return this._refinement((val, ctx) => { + const result = check(val); + const setError = () => + ctx.addIssue({ + code: ZodIssueCode.custom, + message, + }); + if (result instanceof Promise) { + return result.then(data => { + if (!data) setError(); + }); + } + if (!result) { + setError(); + return result; + } + }); + } + if (typeof message === 'function') { + return this._refinement((val, ctx) => { + const result = check(val); + const setError = () => + ctx.addIssue({ + code: ZodIssueCode.custom, + ...message(val), + }); + if (result instanceof Promise) { + return result.then(data => { + if (!data) setError(); + }); + } + if (!result) { + setError(); + return result; + } + }); + } + return this._refinement((val, ctx) => { + const result = check(val); + const setError = () => + ctx.addIssue({ + code: ZodIssueCode.custom, + ...message, + }); + if (result instanceof Promise) { + return result.then(data => { + if (!data) setError(); + }); + } + + if (!result) { + setError(); + return result; + } + }); + }; + + refinement = ( + check: (arg: Output) => any, + refinementData: + | MakeErrorData + | ((arg: Output, ctx: RefinementCtx) => MakeErrorData), + ) => { + return this._refinement((val, ctx) => { + if (!check(val)) { + ctx.addIssue( + typeof refinementData === 'function' + ? refinementData(val, ctx) + : refinementData, + ); + } + }); + }; + + _refinement: ( + refinement: InternalCheck['check'], + ) => this = refinement => { + return new (this as any).constructor({ + ...this._def, + checks: [...(this._def.checks || []), { check: refinement }], + }) as this; + }; + + constructor(def: Def) { + this._def = def; + this.parse = ZodParser(this); + } + + abstract toJSON: () => object; + // abstract // opt optional: () => any; + optional: () => ZodOptionalType = () => ZodOptional.create(this); + or = this.optional; + + nullable: () => ZodNullableType = () => { + return ZodNullable.create(this) as any; + }; + // nullable: () => ZodUnion<[this, ZodNull]> = () => + // ZodUnion.create([this, ZodNull.create()]); + array: () => ZodArray = () => ZodArray.create(this); + // pre: ( + // input: T, + // transformer: (arg: T) => Type, + // ) => any = (input, transformer) => 'adsf'; + + // transformFrom: , Tx extends (arg: U['_type']) => this['_type']>( + // x: U, + // transformer: Tx, + // ) => ZodTransformer = (input, transformer) => { + // return ZodTransformer.create(input, this, transformer); + // }; + + // transformFrom: , Tx extends (arg: U['_type']) => this['_type']>( + // x: U, + // transformer: Tx, + // ) => ZodTransformer = (input, transformer) => { + // return ZodTransformer.create(this as any, input, transformer) as any; + // }; + + // push(...items: T[]): number; + // push(this: BetterArrayClass, value: T): this; + + transform< + This extends this, + U extends ZodType, + Tx extends (arg: This['_output']) => U['_input'] | Promise + >(input: U, transformer: Tx): ZodTransformer; + transform< + This extends this, + Tx extends ( + arg: This['_output'], + ) => This['_output'] | Promise + >(transformer: Tx): ZodTransformer; + transform(input: any, transformer?: any) { + if (transformer) { + return ZodTransformer.create(this as any, input, transformer) as any; + } + return ZodTransformer.create(this as any, outputSchema(this), input) as any; + } + + default< + T extends Output = Output, + Opt extends ReturnType = ReturnType + >(def: T): ZodTransformer; + default< + T extends (arg: this) => Output, + Opt extends ReturnType = ReturnType + >(def: T): ZodTransformer; + default(def: any) { + return ZodTransformer.create(this.optional(), this, (x: any) => { + return x === undefined + ? typeof def === 'function' + ? def(this) + : def + : x; + }) as any; + } + + // default: (val: Type) => ZodTransformer, this> = val => { + // return ZodTransformer.create(this.optional(), this, x => { + // return (x || val) as any; + // }) as any; + // }; + + // codec = (): ZodCodec => { + // return ZodCodec.create(this, this, x => x); + // }; + + // transform: , Tx extends (arg: Type) => U['_type']>( + // x: U,s + // transformer: Tx, + // ) => ZodCodec = (input, transformer) => { + // return ZodCodec.create(input, this, transformer); + // }; + + isOptional: () => boolean = () => this.safeParse(undefined).success; + isNullable: () => boolean = () => this.safeParse(null).success; +} diff --git a/deno_lib/types/bigint.ts b/deno_lib/types/bigint.ts new file mode 100644 index 000000000..270ae2af1 --- /dev/null +++ b/deno_lib/types/bigint.ts @@ -0,0 +1,22 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodBigIntDef extends z.ZodTypeDef { + t: z.ZodTypes.bigint; +} + +export class ZodBigInt extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => this._def; + + static create = (): ZodBigInt => { + return new ZodBigInt({ + t: z.ZodTypes.bigint, + }); + }; +} diff --git a/deno_lib/types/boolean.ts b/deno_lib/types/boolean.ts new file mode 100644 index 000000000..d44353eb4 --- /dev/null +++ b/deno_lib/types/boolean.ts @@ -0,0 +1,21 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodBooleanDef extends z.ZodTypeDef { + t: z.ZodTypes.boolean; +} + +export class ZodBoolean extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => this._def; + static create = (): ZodBoolean => { + return new ZodBoolean({ + t: z.ZodTypes.boolean, + }); + }; +} diff --git a/deno_lib/types/date.ts b/deno_lib/types/date.ts new file mode 100644 index 000000000..5ee90e348 --- /dev/null +++ b/deno_lib/types/date.ts @@ -0,0 +1,21 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodDateDef extends z.ZodTypeDef { + t: z.ZodTypes.date; +} + +export class ZodDate extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => this._def; + static create = (): ZodDate => { + return new ZodDate({ + t: z.ZodTypes.date, + }); + }; +} diff --git a/deno_lib/types/enum.ts b/deno_lib/types/enum.ts new file mode 100644 index 000000000..2c53954e1 --- /dev/null +++ b/deno_lib/types/enum.ts @@ -0,0 +1,67 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export type ArrayKeys = keyof any[]; +export type Indices = Exclude; + +type EnumValues = [string, ...string[]]; + +type Values = { + [k in T[number]]: k; +}; + +export interface ZodEnumDef + extends z.ZodTypeDef { + t: z.ZodTypes.enum; + values: T; +} + +export class ZodEnum extends z.ZodType< + T[number], + ZodEnumDef +> { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => this._def; + + get options() { + return this._def.values; + } + + get enum(): Values { + const enumValues: any = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues as any; + } + + get Values(): Values { + const enumValues: any = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues as any; + } + + get Enum(): Values { + const enumValues: any = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues as any; + } + + static create = ( + values: T, + ): ZodEnum => { + return new ZodEnum({ + t: z.ZodTypes.enum, + values: values, + }) as any; + }; +} diff --git a/deno_lib/types/function.ts b/deno_lib/types/function.ts new file mode 100644 index 000000000..ba79afc6f --- /dev/null +++ b/deno_lib/types/function.ts @@ -0,0 +1,90 @@ +import * as z from './base.ts'; +import { ZodTuple } from './tuple.ts'; +import { ZodUnknown } from './unknown.ts'; + +export interface ZodFunctionDef< + Args extends ZodTuple = ZodTuple, + Returns extends z.ZodTypeAny = z.ZodTypeAny +> extends z.ZodTypeDef { + t: z.ZodTypes.function; + args: Args; + returns: Returns; +} + +export type OuterTypeOfFunction< + Args extends ZodTuple, + Returns extends z.ZodTypeAny +> = Args['_input'] extends Array + ? (...args: Args['_input']) => Returns['_output'] + : never; + +export type InnerTypeOfFunction< + Args extends ZodTuple, + Returns extends z.ZodTypeAny +> = Args['_output'] extends Array + ? (...args: Args['_output']) => Returns['_input'] + : never; + +// type as df = string extends unknown ? true : false +export class ZodFunction< + Args extends ZodTuple, + Returns extends z.ZodTypeAny +> extends z.ZodType< + OuterTypeOfFunction, + ZodFunctionDef, + InnerTypeOfFunction +> { + readonly _def!: ZodFunctionDef; + // readonly _type!: TypeOfFunction; + + args = [0]>( + ...items: Items + ): ZodFunction, Returns> => { + return new ZodFunction({ + ...this._def, + args: ZodTuple.create(items), + }); + }; + + returns = >( + returnType: NewReturnType, + ): ZodFunction => { + return new ZodFunction({ + ...this._def, + returns: returnType, + }); + }; + + implement = >(func: F): F => { + const validatedFunc = this.parse(func); + return validatedFunc as any; + }; + + validate = this.implement; + + static create = < + T extends ZodTuple = ZodTuple<[]>, + U extends z.ZodTypeAny = ZodUnknown + >( + args?: T, + returns?: U, + ): ZodFunction => { + return new ZodFunction({ + t: z.ZodTypes.function, + args: args || ZodTuple.create([]), + returns: returns || ZodUnknown.create(), + }); + }; + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => { + return { + t: this._def.t, + args: this._def.args.toJSON(), + returns: this._def.returns.toJSON(), + }; + }; +} diff --git a/deno_lib/types/intersection.ts b/deno_lib/types/intersection.ts new file mode 100644 index 000000000..2b05ba5f2 --- /dev/null +++ b/deno_lib/types/intersection.ts @@ -0,0 +1,42 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodIntersectionDef< + T extends z.ZodTypeAny = z.ZodTypeAny, + U extends z.ZodTypeAny = z.ZodTypeAny +> extends z.ZodTypeDef { + t: z.ZodTypes.intersection; + left: T; + right: U; +} + +export class ZodIntersection< + T extends z.ZodTypeAny, + U extends z.ZodTypeAny +> extends z.ZodType< + T['_output'] & U['_output'], + ZodIntersectionDef, + T['_input'] & U['_input'] +> { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => ({ + t: this._def.t, + left: this._def.left.toJSON(), + right: this._def.right.toJSON(), + }); + + static create = ( + left: T, + right: U, + ): ZodIntersection => { + return new ZodIntersection({ + t: z.ZodTypes.intersection, + left: left, + right: right, + }); + }; +} diff --git a/deno_lib/types/lazy.ts b/deno_lib/types/lazy.ts new file mode 100644 index 000000000..d0621ad70 --- /dev/null +++ b/deno_lib/types/lazy.ts @@ -0,0 +1,35 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodLazyDef + extends z.ZodTypeDef { + t: z.ZodTypes.lazy; + getter: () => T; +} + +export class ZodLazy extends z.ZodType< + z.output, + ZodLazyDef, + z.input +> { + get schema(): T { + return this._def.getter(); + } + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => { + throw new Error("Can't JSONify recursive structure"); + }; + + static create = (getter: () => T): ZodLazy => { + return new ZodLazy({ + t: z.ZodTypes.lazy, + getter: getter, + }); + }; +} diff --git a/deno_lib/types/literal.ts b/deno_lib/types/literal.ts new file mode 100644 index 000000000..5a315a065 --- /dev/null +++ b/deno_lib/types/literal.ts @@ -0,0 +1,27 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; +import { Primitive } from '../helpers/primitive.ts'; + +type LiteralValue = Primitive; + +export interface ZodLiteralDef extends z.ZodTypeDef { + t: z.ZodTypes.literal; + value: T; +} + +export class ZodLiteral extends z.ZodType> { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => this._def; + + static create = (value: T): ZodLiteral => { + return new ZodLiteral({ + t: z.ZodTypes.literal, + value: value, + }); + }; +} diff --git a/deno_lib/types/map.ts b/deno_lib/types/map.ts new file mode 100644 index 000000000..0213de4c6 --- /dev/null +++ b/deno_lib/types/map.ts @@ -0,0 +1,41 @@ +import * as z from './base.ts'; + +export interface ZodMapDef< + Key extends z.ZodTypeAny = z.ZodTypeAny, + Value extends z.ZodTypeAny = z.ZodTypeAny +> extends z.ZodTypeDef { + t: z.ZodTypes.map; + valueType: Value; + keyType: Key; +} + +export class ZodMap< + Key extends z.ZodTypeAny = z.ZodTypeAny, + Value extends z.ZodTypeAny = z.ZodTypeAny +> extends z.ZodType< + Map, + ZodMapDef, + Map +> { + readonly _value!: Value; + + toJSON = () => ({ + t: this._def.t, + valueType: this._def.valueType.toJSON(), + keyType: this._def.keyType.toJSON(), + }); + + static create = < + Key extends z.ZodTypeAny = z.ZodTypeAny, + Value extends z.ZodTypeAny = z.ZodTypeAny + >( + keyType: Key, + valueType: Value, + ): ZodMap => { + return new ZodMap({ + t: z.ZodTypes.map, + valueType, + keyType, + }); + }; +} diff --git a/deno_lib/types/nativeEnum.ts b/deno_lib/types/nativeEnum.ts new file mode 100644 index 000000000..93e92c940 --- /dev/null +++ b/deno_lib/types/nativeEnum.ts @@ -0,0 +1,22 @@ +import * as z from './base.ts'; + +export interface ZodNativeEnumDef + extends z.ZodTypeDef { + t: z.ZodTypes.nativeEnum; + values: T; +} + +type EnumLike = { [k: string]: string | number; [nu: number]: string }; + +export class ZodNativeEnum extends z.ZodType< + T[keyof T], + ZodNativeEnumDef +> { + toJSON = () => this._def; + static create = (values: T): ZodNativeEnum => { + return new ZodNativeEnum({ + t: z.ZodTypes.nativeEnum, + values: values, + }); + }; +} diff --git a/deno_lib/types/never.ts b/deno_lib/types/never.ts new file mode 100644 index 000000000..d0ca9d302 --- /dev/null +++ b/deno_lib/types/never.ts @@ -0,0 +1,15 @@ +import * as z from './base.ts'; + +export interface ZodNeverDef extends z.ZodTypeDef { + t: z.ZodTypes.never; +} + +export class ZodNever extends z.ZodType { + toJSON = () => this._def; + + static create = (): ZodNever => { + return new ZodNever({ + t: z.ZodTypes.never, + }); + }; +} diff --git a/deno_lib/types/null.ts b/deno_lib/types/null.ts new file mode 100644 index 000000000..3ebf2cc20 --- /dev/null +++ b/deno_lib/types/null.ts @@ -0,0 +1,20 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodNullDef extends z.ZodTypeDef { + t: z.ZodTypes.null; +} + +export class ZodNull extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => this._def; + static create = (): ZodNull => { + return new ZodNull({ + t: z.ZodTypes.null, + }); + }; +} diff --git a/deno_lib/types/nullable.ts b/deno_lib/types/nullable.ts new file mode 100644 index 000000000..4578ea339 --- /dev/null +++ b/deno_lib/types/nullable.ts @@ -0,0 +1,39 @@ +import * as z from './base.ts'; + +export interface ZodNullableDef + extends z.ZodTypeDef { + t: z.ZodTypes.nullable; + innerType: T; +} + +// This type allows for nullable flattening +export type ZodNullableType = T extends ZodNullable< + z.ZodTypeAny +> + ? T + : ZodNullable; + +export class ZodNullable< + T extends z.ZodTypeAny + // Output extends T['_output'] | null = T['_output'] | null, + // Input extends T['_input'] | null = T['_input'] | null +> extends z.ZodType< + T['_output'] | null, + ZodNullableDef, + T['_input'] | null +> { + // An nullable nullable is the original nullable + // nullable: () => ZodNullableType = () => this as ZodNullableType; + toJSON = () => ({ + t: this._def.t, + innerType: this._def.innerType.toJSON(), + }); + + static create = (type: T): ZodNullableType => { + if (type instanceof ZodNullable) return type as ZodNullableType; + return new ZodNullable({ + t: z.ZodTypes.nullable, + innerType: type, + }) as ZodNullableType; + }; +} diff --git a/deno_lib/types/number.ts b/deno_lib/types/number.ts new file mode 100644 index 000000000..312e4def2 --- /dev/null +++ b/deno_lib/types/number.ts @@ -0,0 +1,85 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; +import { ZodIssueCode } from '../ZodError.ts'; +import { errorUtil } from '../helpers/errorUtil.ts'; + +export interface ZodNumberDef extends z.ZodTypeDef { + t: z.ZodTypes.number; +} + +export class ZodNumber extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = () => this._def; + static create = (): ZodNumber => { + return new ZodNumber({ + t: z.ZodTypes.number, + }); + }; + + min = (minimum: number, message?: errorUtil.ErrMessage) => + this.refinement(data => data >= minimum, { + code: ZodIssueCode.too_small, + minimum, + type: 'number', + inclusive: true, + ...errorUtil.errToObj(message), + }); + + max = (maximum: number, message?: errorUtil.ErrMessage) => + this.refinement(data => data <= maximum, { + code: ZodIssueCode.too_big, + maximum, + type: 'number', + inclusive: true, + ...errorUtil.errToObj(message), + }); + + int = (message?: errorUtil.ErrMessage) => + this.refinement(data => Number.isInteger(data), { + code: ZodIssueCode.invalid_type, + expected: 'integer', + received: 'number', + ...errorUtil.errToObj(message), + }); + + positive = (message?: errorUtil.ErrMessage) => + this.refinement(data => data > 0, { + code: ZodIssueCode.too_small, + minimum: 0, + type: 'number', + inclusive: false, + ...errorUtil.errToObj(message), + }); + + negative = (message?: errorUtil.ErrMessage) => + this.refinement(data => data < 0, { + code: ZodIssueCode.too_big, + maximum: 0, + type: 'number', + inclusive: false, + ...errorUtil.errToObj(message), + }); + + nonpositive = (message?: errorUtil.ErrMessage) => + this.refinement(data => data <= 0, { + code: ZodIssueCode.too_big, + maximum: 0, + type: 'number', + inclusive: true, + ...errorUtil.errToObj(message), + }); + + nonnegative = (message?: errorUtil.ErrMessage) => + this.refinement(data => data >= 0, { + code: ZodIssueCode.too_small, + minimum: 0, + type: 'number', + inclusive: true, + ...errorUtil.errToObj(message), + }); +} diff --git a/deno_lib/types/object.ts b/deno_lib/types/object.ts new file mode 100644 index 000000000..9e19d3b2b --- /dev/null +++ b/deno_lib/types/object.ts @@ -0,0 +1,406 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; +import { objectUtil } from '../helpers/objectUtil.ts'; +import { partialUtil } from '../helpers/partialUtil.ts'; +import { isScalar } from '../isScalar.ts'; +import { ZodNever } from '../index.ts'; +import { Scalars } from '../helpers/primitive.ts'; + +const AugmentFactory = (def: Def) => < + Augmentation extends z.ZodRawShape +>( + augmentation: Augmentation, +): ZodObject< + { + [k in Exclude< + keyof ReturnType, + keyof Augmentation + >]: ReturnType[k]; + } & + { [k in keyof Augmentation]: Augmentation[k] }, + Def['unknownKeys'], + Def['catchall'] +> => { + return new ZodObject({ + ...def, + shape: () => ({ + ...def.shape(), + ...augmentation, + }), + }) as any; +}; + +type UnknownKeysParam = 'passthrough' | 'strict' | 'strip'; + +export interface ZodObjectDef< + T extends z.ZodRawShape = z.ZodRawShape, + UnknownKeys extends UnknownKeysParam = UnknownKeysParam, + Catchall extends z.ZodTypeAny = z.ZodTypeAny + // Params extends ZodObjectParams = ZodObjectParams +> extends z.ZodTypeDef { + t: z.ZodTypes.object; + shape: () => T; + catchall: Catchall; + unknownKeys: UnknownKeys; + // params: Params; +} + +export type baseObjectOutputType< + Shape extends z.ZodRawShape + // Catchall extends z.ZodTypeAny +> = objectUtil.flatten< + objectUtil.addQuestionMarks< + { + [k in keyof Shape]: Shape[k]['_output']; + } + > //{ [k: string]: Catchall['_output'] } +>; + +export type objectOutputType< + Shape extends z.ZodRawShape, + Catchall extends z.ZodTypeAny +> = z.ZodTypeAny extends Catchall + ? baseObjectOutputType + : objectUtil.flatten< + baseObjectOutputType & { [k: string]: Catchall['_output'] } + >; + +export type baseObjectInputType< + Shape extends z.ZodRawShape +> = objectUtil.flatten< + objectUtil.addQuestionMarks< + { + [k in keyof Shape]: Shape[k]['_input']; + } + > +>; + +export type objectInputType< + Shape extends z.ZodRawShape, + Catchall extends z.ZodTypeAny +> = z.ZodTypeAny extends Catchall + ? baseObjectInputType + : objectUtil.flatten< + baseObjectInputType & { [k: string]: Catchall['_input'] } + >; + +const objectDefToJson = (def: ZodObjectDef) => ({ + t: def.t, + shape: Object.assign( + {}, + ...Object.keys(def.shape()).map(k => ({ + [k]: def.shape()[k].toJSON(), + })), + ), +}); + +// interface ZodObjectParams { +// strict: boolean; +// } + +// type SetKey< +// Target extends object, +// Key extends string, +// Value extends any +// > = objectUtil.Flatten< +// { [k in Exclude]: Target[k] } & { [k in Key]: Value } +// >; + +// type makeKeysRequired> = T extends ZodObject< +// infer U, +// infer P, +// infer C +// > +// ? ZodObject }>, P, C> +// : never; + +// type makeRequired> = T extends ZodUnion +// ? U extends [infer Y, ZodUndefined] +// ? Y +// : U extends [ZodUndefined, infer Z] +// ? Z +// : T +// : T; + +// type ZodObjectType< +// T extends z.ZodRawShape, +// Params extends ZodObjectParams +// > = Params['strict'] extends true +// ? objectUtil.ObjectType +// : objectUtil.Flatten & { [k: string]: any }>; + +export type AnyZodObject = ZodObject; +// export type AnyZodObject = ZodObject< +// z.ZodRawShape, +// UnknownKeysParam, +// z.ZodTypeAny +// >; +export class ZodObject< + T extends z.ZodRawShape, + UnknownKeys extends UnknownKeysParam = 'passthrough', + Catchall extends z.ZodTypeAny = z.ZodTypeAny, + // Params extends ZodObjectParams = { strict: true }, + // Type extends ZodObjectType = ZodObjectType + Output = objectOutputType, + Input = objectInputType +> extends z.ZodType< + // objectUtil.objectOutputType, + Output, + ZodObjectDef, + Input +> { + readonly _shape!: T; + readonly _unknownKeys!: UnknownKeys; + readonly _catchall!: Catchall; + + get shape() { + return this._def.shape(); + } + + // get params() { + // return this._def.params; + // } + + // get t() { + // return this; + // } + + toJSON = () => objectDefToJson(this._def); + + strict = (): ZodObject => + new ZodObject({ + ...this._def, + unknownKeys: 'strict', + }); + + strip = (): ZodObject => + new ZodObject({ + ...this._def, + unknownKeys: 'strip', + }); + + passthrough = (): ZodObject => + new ZodObject({ + ...this._def, + unknownKeys: 'passthrough', + }); + + nonstrict = this.passthrough; + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + augment = AugmentFactory>(this._def); + extend = AugmentFactory>(this._def); + + setKey = ( + key: Key, + schema: Schema, + ): ZodObject => { + return this.augment({ [key]: schema }) as any; + }; + + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge: ( + other: Incoming, + ) => ZodObject< + T & Incoming['_shape'], + UnknownKeys, + Catchall + // objectUtil.MergeObjectParams + > = objectUtil.mergeObjects(this as any) as any; + + catchall = ( + index: Index, + ): ZodObject< + T, + UnknownKeys, + Index + // objectUtil.MergeObjectParams + > => { + return new ZodObject({ + ...this._def, + // unknownKeys: 'passthrough', + catchall: index, + }); + }; + + pick = ( + mask: Mask, + ): ZodObject< + objectUtil.NoNever<{ [k in keyof Mask]: k extends keyof T ? T[k] : never }>, + UnknownKeys, + Catchall + > => { + const shape: any = {}; + Object.keys(mask).map(key => { + shape[key] = this.shape[key]; + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + }; + + omit = ( + mask: Mask, + ): ZodObject< + objectUtil.NoNever<{ [k in keyof T]: k extends keyof Mask ? never : T[k] }>, + UnknownKeys, + Catchall + > => { + const shape: any = {}; + Object.keys(this.shape).map(key => { + if (Object.keys(mask).indexOf(key) === -1) { + shape[key] = this.shape[key]; + } + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + }; + + partial = (): ZodObject< + { [k in keyof T]: ReturnType }, + UnknownKeys, + Catchall + > => { + const newShape: any = {}; + for (const key in this.shape) { + const fieldSchema = this.shape[key]; + newShape[key] = fieldSchema.isOptional() + ? fieldSchema + : fieldSchema.optional(); + } + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + }; + + // require: () => makeKeysRequired = () => { + // const newShape: any = {}; + // for (const key in this.shape) { + // const val = this.shape[key]; + // console.log(`key ${key}:`); + // console.log(val); + // if (val instanceof ZodUnion) { + // console.log(`${key} is union!`); + // const options = (val as ZodUnion)._def.options; + // if (options.length === 2) { + // console.log(`found ${options.length} options`); + // // .length === 2; + // if (options[0] instanceof ZodUndefined) { + // newShape[key] = options[1]; + // } else if (options[1] instanceof ZodUndefined) { + // newShape[key] = options[0]; + // } + // } else { + // newShape[key] = val; + // } + // } else { + // newShape[key] = val; + // } + // } + // return new ZodObject({ + // ...this._def, + // shape: () => newShape, + // }) as any; + // }; + + primitives = (): ZodObject< + objectUtil.NoNever< + { + [k in keyof T]: [T[k]['_output']] extends [Scalars] ? T[k] : never; + } + >, + UnknownKeys, + Catchall + > => { + const newShape: any = {}; + for (const key in this.shape) { + if (isScalar(this.shape[key])) { + newShape[key] = this.shape[key]; + } + } + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + }; + + nonprimitives = (): ZodObject< + objectUtil.NoNever< + { + [k in keyof T]: [T[k]['_output']] extends [Scalars] ? never : T[k]; + } + >, + UnknownKeys, + Catchall + > => { + const newShape: any = {}; + for (const key in this.shape) { + if (!isScalar(this.shape[key])) { + newShape[key] = this.shape[key]; + } + } + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + }; + + deepPartial: () => partialUtil.RootDeepPartial = () => { + const newShape: any = {}; + + for (const key in this.shape) { + const fieldSchema = this.shape[key]; + if (fieldSchema instanceof ZodObject) { + newShape[key] = fieldSchema.isOptional() + ? fieldSchema + : (fieldSchema.deepPartial() as any).optional(); + } else { + newShape[key] = fieldSchema.isOptional() + ? fieldSchema + : fieldSchema.optional(); + } + } + return new ZodObject({ + ...this._def, + shape: () => newShape, + }) as any; + }; + + // keyof: ()=>ZodEnum<{[k in T]: k}> + + static create = (shape: T): ZodObject => { + return new ZodObject({ + t: z.ZodTypes.object, + shape: () => shape, + unknownKeys: 'strip', + catchall: ZodNever.create(), + // params: { + // strict: true, + // }, + }) as any; + }; + + static lazycreate = ( + shape: () => T, + ): ZodObject => { + return new ZodObject({ + t: z.ZodTypes.object, + shape, + unknownKeys: 'strip', + catchall: ZodNever.create(), + }) as any; + }; +} diff --git a/deno_lib/types/optional.ts b/deno_lib/types/optional.ts new file mode 100644 index 000000000..bcd668bbd --- /dev/null +++ b/deno_lib/types/optional.ts @@ -0,0 +1,36 @@ +import * as z from './base.ts'; + +export interface ZodOptionalDef + extends z.ZodTypeDef { + t: z.ZodTypes.optional; + innerType: T; +} + +// This type allows for optional flattening +export type ZodOptionalType = T extends ZodOptional< + z.ZodTypeAny +> + ? T + : ZodOptional; + +export class ZodOptional extends z.ZodType< + T['_output'] | undefined, + ZodOptionalDef, + T['_input'] | undefined +> { + // An optional optional is the original optional + // optional: () => ZodOptionalType = () => this as ZodOptionalType; + toJSON = () => ({ + t: this._def.t, + innerType: this._def.innerType.toJSON(), + }); + + static create = (type: T): ZodOptionalType => { + if (type instanceof ZodOptional) return type as ZodOptionalType; + + return new ZodOptional({ + t: z.ZodTypes.optional, + innerType: type, + }) as ZodOptionalType; + }; +} diff --git a/deno_lib/types/promise.ts b/deno_lib/types/promise.ts new file mode 100644 index 000000000..e0213c99a --- /dev/null +++ b/deno_lib/types/promise.ts @@ -0,0 +1,34 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodPromiseDef + extends z.ZodTypeDef { + t: z.ZodTypes.promise; + type: T; +} + +export class ZodPromise extends z.ZodType< + Promise, + ZodPromiseDef, + Promise +> { + toJSON = () => { + return { + t: this._def.t, + type: this._def.type.toJSON(), + }; + }; + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + static create = (schema: T): ZodPromise => { + return new ZodPromise({ + t: z.ZodTypes.promise, + type: schema, + }); + }; +} diff --git a/deno_lib/types/record.ts b/deno_lib/types/record.ts new file mode 100644 index 000000000..e94c1d88e --- /dev/null +++ b/deno_lib/types/record.ts @@ -0,0 +1,38 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodRecordDef + extends z.ZodTypeDef { + t: z.ZodTypes.record; + valueType: Value; +} + +export class ZodRecord< + Value extends z.ZodTypeAny = z.ZodTypeAny +> extends z.ZodType< + Record, // { [k in keyof T]: T[k]['_type'] }, + ZodRecordDef, + Record +> { + readonly _value!: Value; + + toJSON = () => ({ + t: this._def.t, + valueType: this._def.valueType.toJSON(), + }); + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + static create = ( + valueType: Value, + ): ZodRecord => { + return new ZodRecord({ + t: z.ZodTypes.record, + valueType, + }); + }; +} diff --git a/deno_lib/types/string.ts b/deno_lib/types/string.ts new file mode 100644 index 000000000..48cedda7a --- /dev/null +++ b/deno_lib/types/string.ts @@ -0,0 +1,95 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; +import { StringValidation, ZodIssueCode } from '../ZodError.ts'; +import { errorUtil } from '../helpers/errorUtil.ts'; + +export interface ZodStringDef extends z.ZodTypeDef { + t: z.ZodTypes.string; + validation: { + uuid?: true; + custom?: ((val: any) => boolean)[]; + }; +} + +const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; +const uuidRegex = /([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}/i; + +export class ZodString extends z.ZodType { + inputSchema = this; + outputSchema = this; + + toJSON = () => this._def; + min = (minLength: number, message?: errorUtil.ErrMessage) => + this.refinement(data => data.length >= minLength, { + code: ZodIssueCode.too_small, + minimum: minLength, + type: 'string', + inclusive: true, + ...errorUtil.errToObj(message), + }); + + max = (maxLength: number, message?: errorUtil.ErrMessage) => + this.refinement(data => data.length <= maxLength, { + code: ZodIssueCode.too_big, + maximum: maxLength, + type: 'string', + inclusive: true, + ...errorUtil.errToObj(message), + }); + + length(len: number, message?: errorUtil.ErrMessage) { + return this.min(len, message).max(len, message); + } + + protected _regex = ( + regex: RegExp, + validation: StringValidation, + message?: errorUtil.ErrMessage, + ) => + this.refinement(data => regex.test(data), { + validation, + code: ZodIssueCode.invalid_string, + + ...errorUtil.errToObj(message), + }); + + email = (message?: errorUtil.ErrMessage) => + this._regex(emailRegex, 'email', message); + + url = (message?: errorUtil.ErrMessage) => + this.refinement( + data => { + try { + new URL(data); + return true; + } catch { + return false; + } + }, + { + code: ZodIssueCode.invalid_string, + validation: 'url', + ...errorUtil.errToObj(message), + }, + ); + + // url = (message?: errorUtil.ErrMessage) => this._regex(urlRegex, 'url', message); + + uuid = (message?: errorUtil.ErrMessage) => + this._regex(uuidRegex, 'uuid', message); + + regex = (regexp: RegExp, message?: errorUtil.ErrMessage) => + this._regex(regexp, 'regex', message); + + nonempty = (message?: errorUtil.ErrMessage) => + this.min(1, errorUtil.errToObj(message)); + + static create = (): ZodString => { + return new ZodString({ + t: z.ZodTypes.string, + validation: {}, + }); + }; +} diff --git a/deno_lib/types/transformer.ts b/deno_lib/types/transformer.ts new file mode 100644 index 000000000..794d77d1e --- /dev/null +++ b/deno_lib/types/transformer.ts @@ -0,0 +1,84 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodTransformerDef< + T extends z.ZodTypeAny = z.ZodTypeAny, + U extends z.ZodTypeAny = z.ZodTypeAny +> extends z.ZodTypeDef { + t: z.ZodTypes.transformer; + input: T; + output: U; + transformer: (arg: T['_output']) => U['_input']; +} + +export class ZodTransformer< + T extends z.ZodTypeAny, + U extends z.ZodTypeAny +> extends z.ZodType, T['_input']> { + // readonly _input!: T['_input']; + // readonly _output!: U['_output']; + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + // inputSchema():T{ + // return this._def.input; + // } + + // get output() { + // return this._def.output; + // } + // set inputSchema(val) { + // val; + // } + // get inputSchema() { + // return this._def.output; + // } + // set outputSchema(val) { + // val; + // } + // get outputSchema() { + // return this._def.output; + // } + + toJSON = () => ({ + t: this._def.t, + left: this._def.input.toJSON(), + right: this._def.output.toJSON(), + }); + + // transformTo: ( + // output: Out, + // transformer: (arg: U['_type']) => Out['_type'], + // ) => ZodTransformer = (output, transformer) => { + // return ZodTransformer.create(this as any, output, transformer) as any; + // }; + + get output() { + return this._def.output; + } + + static create = ( + input: I, + output: O, + transformer: (arg: I['_output']) => O['_input'] | Promise, + ): ZodTransformer => { + return new ZodTransformer({ + t: z.ZodTypes.transformer, + input, + output, + transformer, + }); + }; + + static fromSchema = ( + input: I, + ): ZodTransformer => { + return new ZodTransformer({ + t: z.ZodTypes.transformer, + input, + output: input, + transformer: x => x, + }); + }; +} diff --git a/deno_lib/types/tuple.ts b/deno_lib/types/tuple.ts new file mode 100644 index 000000000..744c5fb2e --- /dev/null +++ b/deno_lib/types/tuple.ts @@ -0,0 +1,84 @@ +import * as z from './base.ts'; +// import { objectUtil } from '../helpers/objectUtil.ts'; +// import { ZodUnion } from './union.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; + +// export type identity = T; +// export type flatten = identity< +// { [k in keyof T]: T[k] } +// >; +// type tupleOptionalKeys = { +// [k in keyof T]?: undefined extends T[k] ? T[k] : unknown; +// }; //[keyof T]; + +// type tupleRequiredKeys = { +// [k in keyof T]: undefined extends T[k] ? unknown : T[k]; +// }; + +// export type addTupleQuestionMarks = flatten< +// tupleOptionalKeys & tupleRequiredKeys +// >; + +// export type addTupleQuestionMarks = { +// [k in tupleOptionalKeys]?: T[k]; +// } & +// { [k in tupleRequiredKeys]: T[k] }; + +// type test = [string, number | undefined] +// type t2 = tupleOptionalKeys; +// type t3 = tupleRequiredKeys; +// type t4 = addTupleQuestionMarks; +// const x:t4 = ['asdf']; +// type t5 = string & unknown; + +export type OutputTypeOfTuple< + T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] +> = { + [k in keyof T]: T[k] extends z.ZodType ? T[k]['_output'] : never; +}; + +export type InputTypeOfTuple< + T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] +> = { + [k in keyof T]: T[k] extends z.ZodType ? T[k]['_input'] : never; +}; + +export interface ZodTupleDef< + T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] = [ + z.ZodTypeAny, + ...z.ZodTypeAny[], + ] +> extends z.ZodTypeDef { + t: z.ZodTypes.tuple; + items: T; +} + +export class ZodTuple< + T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] = [ + z.ZodTypeAny, + ...z.ZodTypeAny[], + ] +> extends z.ZodType, ZodTupleDef, InputTypeOfTuple> { + toJSON = () => ({ + t: this._def.t, + items: (this._def.items as any[]).map(item => item.toJSON()), + }); + + get items() { + return this._def.items; + } + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + static create = ( + schemas: T, + ): ZodTuple => { + return new ZodTuple({ + t: z.ZodTypes.tuple, + items: schemas, + }); + }; +} diff --git a/deno_lib/types/undefined.ts b/deno_lib/types/undefined.ts new file mode 100644 index 000000000..c87abcf1a --- /dev/null +++ b/deno_lib/types/undefined.ts @@ -0,0 +1,21 @@ +import * as z from './base.ts'; +// import { ZodUnion } from './union.ts'; +// import { ZodNull } from './null.ts'; + +export interface ZodUndefinedDef extends z.ZodTypeDef { + t: z.ZodTypes.undefined; +} + +export class ZodUndefined extends z.ZodType { + toJSON = () => this._def; + + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + static create = (): ZodUndefined => { + return new ZodUndefined({ + t: z.ZodTypes.undefined, + }); + }; +} diff --git a/deno_lib/types/union.ts b/deno_lib/types/union.ts new file mode 100644 index 000000000..aeeeaa6b9 --- /dev/null +++ b/deno_lib/types/union.ts @@ -0,0 +1,44 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; + +export interface ZodUnionDef< + T extends [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]] = [ + z.ZodTypeAny, + z.ZodTypeAny, + ...z.ZodTypeAny[], + ] +> extends z.ZodTypeDef { + t: z.ZodTypes.union; + options: T; +} + +export class ZodUnion< + T extends [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]] +> extends z.ZodType, T[number]['_input']> { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + + toJSON = (): object => ({ + t: this._def.t, + options: this._def.options.map(x => x.toJSON()), + }); + + get options() { + return this._def.options; + } + + // distribute = z.ZodTypeAny>(f: F): ZodUnion<{ [k in keyof T]: ReturnType }> => { + // return ZodUnion.create(this._def.options.map(f) as any); + // }; + + static create = ( + types: T, + ): ZodUnion => { + return new ZodUnion({ + t: z.ZodTypes.union, + options: types, + }); + }; +} diff --git a/deno_lib/types/unknown.ts b/deno_lib/types/unknown.ts new file mode 100644 index 000000000..dfc1a0e58 --- /dev/null +++ b/deno_lib/types/unknown.ts @@ -0,0 +1,20 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodUnknownDef extends z.ZodTypeDef { + t: z.ZodTypes.unknown; +} + +export class ZodUnknown extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + toJSON = () => this._def; + + static create = (): ZodUnknown => { + return new ZodUnknown({ + t: z.ZodTypes.unknown, + }); + }; +} diff --git a/deno_lib/types/void.ts b/deno_lib/types/void.ts new file mode 100644 index 000000000..e598810ef --- /dev/null +++ b/deno_lib/types/void.ts @@ -0,0 +1,20 @@ +import * as z from './base.ts'; +// import { ZodUndefined } from './undefined.ts'; +// import { ZodNull } from './null.ts'; +// import { ZodUnion } from './union.ts'; + +export interface ZodVoidDef extends z.ZodTypeDef { + t: z.ZodTypes.void; +} + +export class ZodVoid extends z.ZodType { + // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); + // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); + toJSON = () => this._def; + + static create = (): ZodVoid => { + return new ZodVoid({ + t: z.ZodTypes.void, + }); + }; +} diff --git a/deno_scripts/UpdateTestImports.js b/deno_scripts/UpdateTestImports.js new file mode 100644 index 000000000..34fde3a6d --- /dev/null +++ b/deno_scripts/UpdateTestImports.js @@ -0,0 +1,22 @@ +const path = require("path") +const fs = require("fs") + +const imp = ` +const test = Deno.test; +import { expect } from "https://deno.land/x/expect/mod.ts"; +`.trim() + +const dir = path.join(__dirname, `/../deno_lib/__tests__`) +console.log(dir) +fs.readdir(dir, (err, files) => { + files.map(file => { + fs.readFile(path.join(dir, file), 'utf8', function (err,data) { + if (err) { return console.log(err) } + fs.writeFile(path.join(dir, file), imp + data, (err) => { + if (err) { return console.log(err) } + }) + }); + }) + + +}) \ No newline at end of file diff --git a/package.json b/package.json index f63a66020..9385a08a6 100644 --- a/package.json +++ b/package.json @@ -28,19 +28,23 @@ ], "scripts": { "clean": "rm -rf lib/*", - "build": "yarn run clean && tsc --p tsconfig.json", + "build": "yarn run clean && tsc --p tsconfig.cjs.json && tsc --p tsconfig.esm.json", "buildall": "yarn add typescript@3.4 && yarn build && yarn add typescript@3.5 && yarn build && yarn add typescript@3.6 && yarn build && yarn add typescript@3.7 && yarn build && yarn add typescript@3.8 && yarn build && yarn add typescript@3.9 && yarn build && yarn add typescript@4 && yarn build && yarn add typescript@3.4", "buildallv2": "yarn add typescript@3.7 && yarn build && yarn add typescript@3.8 && yarn build && yarn add typescript@3.9 && yarn build && yarn add typescript@4.0 && yarn build && yarn add typescript@4.1 && yarn build && yarn add typescript@3.7", "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", "lint": "tslint -p tsconfig.json", "test": "jest --coverage && yarn run badge", "testone": "jest", - "badge": "make-coverage-badge --output-path ./coverage.svg", + "badge": "make-coverage-badge --report-path ./src/coverage/coverage-summary.json --output-path ./coverage.svg", "prepublishOnly": "npm run build", - "play": "nodemon -e ts -w . -x ts-node src/playground.ts --project tsconfig.json" + "play": "nodemon -e ts -w . -x ts-node src/playground.ts --project tsconfig.json", + "deno_clean": "rm -rf deno_lib", + "deno_build": "yarn run deno_clean && denoify && node deno_scripts/UpdateTestImports.js", + "deno_test": "deno test deno_lib/__tests__" }, "devDependencies": { "@types/jest": "^25.1.4", + "denoify": "^0.5.12", "jest": "^25.1.0", "make-coverage-badge": "^1.2.0", "nodemon": "^2.0.2", diff --git a/src/PseudoPromise.ts b/src/PseudoPromise.ts index 1c3df6667..801827379 100644 --- a/src/PseudoPromise.ts +++ b/src/PseudoPromise.ts @@ -9,7 +9,7 @@ type CatcherItem = { type: 'catcher'; catcher: Catcher }; type Items = (FuncItem | CatcherItem)[]; export class PseudoPromise { - readonly _return: ReturnType; + readonly _return: ReturnType | undefined; items: Items; constructor(funcs: Items = []) { this.items = funcs; diff --git a/src/__tests__/all-errors.test.ts b/src/__tests__/all-errors.test.ts index bb1e7bc22..42f2572fd 100644 --- a/src/__tests__/all-errors.test.ts +++ b/src/__tests__/all-errors.test.ts @@ -13,7 +13,7 @@ test('all errors', () => { b: null, }); } catch (error) { - expect(error.flatten()).toStrictEqual({ + expect(error.flatten()).toEqual({ formErrors: [], fieldErrors: { a: ['Expected string, received null'], diff --git a/src/__tests__/anyunknown.test.ts b/src/__tests__/anyunknown.test.ts index 010c24507..5460d1a9f 100644 --- a/src/__tests__/anyunknown.test.ts +++ b/src/__tests__/anyunknown.test.ts @@ -8,7 +8,7 @@ test('check any inference', () => { t1.toJSON(); type t1 = z.infer; const f1: util.AssertEqual = true; - f1; + expect(f1).toBeTruthy(); }); test('check unknown inference', () => { @@ -18,7 +18,7 @@ test('check unknown inference', () => { t1.toJSON(); type t1 = z.infer; const f1: util.AssertEqual = true; - f1; + expect(f1).toBeTruthy(); }); test('check never inference', () => { diff --git a/src/__tests__/deepmasking.test.ts b/src/__tests__/deepmasking.test.ts index 79aa6cfbb..841be351c 100644 --- a/src/__tests__/deepmasking.test.ts +++ b/src/__tests__/deepmasking.test.ts @@ -1,7 +1,7 @@ -import * as z from '../index'; +// import * as z from '../index'; -test('', () => { - z; +test('dummy test deepmasking', () => { + expect(true).toBeTruthy(); }); // const fish = z.object({ diff --git a/src/__tests__/instanceof.test.ts b/src/__tests__/instanceof.test.ts index fd0145926..e2041d21e 100644 --- a/src/__tests__/instanceof.test.ts +++ b/src/__tests__/instanceof.test.ts @@ -12,17 +12,13 @@ test('instanceof', async () => { TestSchema.parse(new Subtest()); SubtestSchema.parse(new Subtest()); - expect.assertions(4); - expect(() => SubtestSchema.parse(new Test())).toThrow(); - expect(() => TestSchema.parse(12)).toThrow(); - - await TestSchema.parseAsync(12).catch(err => { - expect(err.issues[0].message).toEqual('Input not instance of Test'); - }); - await SubtestSchema.parseAsync(12).catch(err => { - expect(err.issues[0].message).toEqual('Input not instance of Subtest'); - }); + await expect(() => SubtestSchema.parse(new Test())).toThrow( + /Input not instance of Subtest/, + ); + await expect(() => TestSchema.parse(12)).toThrow( + /Input not instance of Test/, + ); const f1: util.AssertEqual> = true; - return f1; + expect(f1).toBeTruthy(); }); diff --git a/src/__tests__/nativeEnum.test.ts b/src/__tests__/nativeEnum.test.ts index 837ec1c96..c1340c34c 100644 --- a/src/__tests__/nativeEnum.test.ts +++ b/src/__tests__/nativeEnum.test.ts @@ -2,7 +2,10 @@ import * as z from '../index'; import { util } from '../helpers/util'; test('nativeEnum test with consts', () => { - const Fruits: { Apple: 'apple'; Banana: 'banana' } = { Apple: 'apple', Banana: 'banana' }; + const Fruits: { Apple: 'apple'; Banana: 'banana' } = { + Apple: 'apple', + Banana: 'banana', + }; const fruitEnum = z.nativeEnum(Fruits); type fruitEnum = z.infer; fruitEnum.parse('apple'); diff --git a/src/__tests__/object.test.ts b/src/__tests__/object.test.ts index e9d97da60..0e6d1f4fe 100644 --- a/src/__tests__/object.test.ts +++ b/src/__tests__/object.test.ts @@ -68,8 +68,8 @@ test('inference', () => { type i2 = z.infer; const f2: util.AssertEqual = true; - f1; - f2; + expect(f1).toBeTruthy(); + expect(f2).toBeTruthy(); i1.parse({ name: 'name' }); i2.parse({ obj: {}, arrayarray: [['asdf']] }); expect(() => i1.parse({} as any)).toThrow(); @@ -264,5 +264,4 @@ test('test catchall parsing', async () => { .safeParse({ name: 'Foo', validExtraKey: 61, invalid: 'asdf' }); expect(result2.success).toEqual(false); - return result2; }); diff --git a/src/__tests__/optional.test.ts b/src/__tests__/optional.test.ts index 2447c04a3..f05902949 100644 --- a/src/__tests__/optional.test.ts +++ b/src/__tests__/optional.test.ts @@ -10,11 +10,11 @@ function checkErrors(a: z.ZodTypeAny, bad: any) { try { a.optional().parse(bad); } catch (error) { - expect(error.formErrors).toStrictEqual(expected); + expect(error.formErrors).toEqual(expected); } } -it('Should have error messages appropriate for the underlying type', () => { +test('Should have error messages appropriate for the underlying type', () => { checkErrors(z.string().min(2), 1); z.string() .min(2) diff --git a/src/__tests__/primitive.test.ts b/src/__tests__/primitive.test.ts index 56a1cc7ed..db2971e89 100644 --- a/src/__tests__/primitive.test.ts +++ b/src/__tests__/primitive.test.ts @@ -239,10 +239,11 @@ test('parse dateSchema null', () => { }); test('parse dateSchema invalid date', async () => { - expect.assertions(1); - return await dateSchema.parseAsync(new Date('invalid')).catch(err => { + try { + await dateSchema.parseAsync(new Date('invalid')); + } catch (err) { expect(err.issues[0].code).toEqual(z.ZodIssueCode.invalid_date); - }); + } }); // ============== diff --git a/src/__tests__/promise.test.ts b/src/__tests__/promise.test.ts index 94bd241d3..9d5a2441e 100644 --- a/src/__tests__/promise.test.ts +++ b/src/__tests__/promise.test.ts @@ -14,7 +14,7 @@ test('promise inference', () => { promSchemaType, Promise<{ name: string; age: number }> > = true; - t1; + expect(t1).toBeTruthy(); }); test('promise parsing success', async () => { @@ -24,7 +24,6 @@ test('promise parsing success', async () => { expect(typeof result).toBe('object'); expect(typeof result.age).toBe('number'); expect(typeof result.name).toBe('string'); - return result; }); test('promise parsing success 2', () => { @@ -42,7 +41,7 @@ test('promise parsing fail 2', async () => { const failPromise = promSchema.parse( Promise.resolve({ name: 'Bobby', age: '10' }), ); - return await expect(failPromise).rejects.toBeInstanceOf(Error); + await expect(failPromise).rejects.toBeInstanceOf(Error); // done();/z }); @@ -61,7 +60,7 @@ test('async function pass', async () => { const validatedFunction = asyncFunction.implement(async () => { return { name: 'jimmy', age: 14 }; }); - return await expect(validatedFunction()).resolves.toEqual({ + await expect(validatedFunction()).resolves.toEqual({ name: 'jimmy', age: 14, }); @@ -71,7 +70,7 @@ test('async function fail', async () => { const validatedFunction = asyncFunction.implement(() => { return Promise.resolve('asdf' as any); }); - return await expect(validatedFunction()).rejects.toBeInstanceOf(Error); + await expect(validatedFunction()).rejects.toBeInstanceOf(Error); }); test('async promise parsing', () => { diff --git a/src/__tests__/pseudopromise.test.ts b/src/__tests__/pseudopromise.test.ts index 841c366d5..0f7298e99 100644 --- a/src/__tests__/pseudopromise.test.ts +++ b/src/__tests__/pseudopromise.test.ts @@ -22,7 +22,6 @@ test('sync fail', async () => { // expect(myProm.getValue()).resolves.toEqual(2); const val = await myProm.getValueAsync(); expect(val).toEqual(2); - return val; // (myProm.getValue() as Promise).then(val => expect(val).toEqual(2)); }); @@ -31,30 +30,22 @@ test('pseudopromise all', async () => { new PseudoPromise().then(() => 'asdf'), PseudoPromise.resolve(12), ]).getValueAsync(); - expect.assertions(1); - const val = await myProm; - expect(val).toEqual(['asdf', 12]); - return val; + await expect(await myProm).toEqual(['asdf', 12]); }); test('.resolve sync ', () => { expect(PseudoPromise.resolve(12).getValueSync()).toEqual(12); }); -test('.resolve async', () => { - expect.assertions(1); - - return PseudoPromise.resolve(Promise.resolve(12)) - .getValueAsync() - .then(val => expect(val).toEqual(12)); +test('.resolve async', async () => { + expect( + await PseudoPromise.resolve(Promise.resolve(12)).getValueAsync(), + ).toEqual(12); }); -test('sync and async', () => { - expect.assertions(2); +test('sync and async', async () => { expect(PseudoPromise.resolve(15).getValueSync()).toEqual(15); - return PseudoPromise.resolve(15) - .getValueAsync() - .then(val => expect(val).toEqual(15)); + expect(await PseudoPromise.resolve(15).getValueAsync()).toEqual(15); }); test('object', async () => { @@ -64,7 +55,6 @@ test('object', async () => { }); expect(await prom.getValueAsync()).toEqual({ asdf: 15, qwer: 'asdfadsf' }); - return 'asdf'; }); test('all', async () => { @@ -72,5 +62,4 @@ test('all', async () => { await PseudoPromise.all([asdf]) .getValueAsync() .then(val => expect(val).toEqual(['asdf'])); - return 'asdf'; }); diff --git a/src/__tests__/recursive.test.ts b/src/__tests__/recursive.test.ts index bc8647939..e70731cdd 100644 --- a/src/__tests__/recursive.test.ts +++ b/src/__tests__/recursive.test.ts @@ -1,4 +1,6 @@ -test('', () => {}); +test('dummy test recursive', () => { + expect(true).toBeTruthy(); +}); // import * as z from '../index'; // interface A { diff --git a/src/__tests__/refine.test.ts b/src/__tests__/refine.test.ts index dc149e8ed..d78404a6c 100644 --- a/src/__tests__/refine.test.ts +++ b/src/__tests__/refine.test.ts @@ -46,18 +46,17 @@ test('refinement 2', () => { }); test('custom path', async () => { - expect.assertions(1); - await z - .object({ - password: z.string(), - confirm: z.string(), - }) - .refine(data => data.confirm === data.password, { path: ['confirm'] }) - .parseAsync({ password: 'asdf', confirm: 'qewr' }) - .catch(err => { - expect(err.issues[0].path).toEqual(['confirm']); - }); - return 'asdf'; + try { + await z + .object({ + password: z.string(), + confirm: z.string(), + }) + .refine(data => data.confirm === data.password, { path: ['confirm'] }) + .parseAsync({ password: 'asdf', confirm: 'qewr' }); + } catch (err) { + expect(err.issues[0].path).toEqual(['confirm']); + } }); test('use path in refinement context', async () => { @@ -86,5 +85,4 @@ test('use path in refinement context', async () => { 'schema cannot be nested. path: foo', ); } - return t2; }); diff --git a/src/__tests__/transformer.test.ts b/src/__tests__/transformer.test.ts index 9b58279c4..839db4e4d 100644 --- a/src/__tests__/transformer.test.ts +++ b/src/__tests__/transformer.test.ts @@ -36,7 +36,6 @@ test('async coercion', async () => { .parseAsync({ id: 5 }); expect(data).toEqual({ id: '5' }); - return 'asdf'; }); test('sync coercion async error', async () => { @@ -47,7 +46,6 @@ test('sync coercion async error', async () => { }) .parse({ id: 5 }), ).toThrow(); - return 'asdf'; // expect(data).toEqual({ id: '5' }); }); diff --git a/src/__tests__/validations.test.ts b/src/__tests__/validations.test.ts index c1b815709..f469dc83b 100644 --- a/src/__tests__/validations.test.ts +++ b/src/__tests__/validations.test.ts @@ -1,132 +1,123 @@ import * as z from '../index'; test('array min', async () => { - expect.assertions(1); - await z - .array(z.string()) - .min(4) - .parseAsync([]) - .catch(err => { - expect(err.issues[0].message).toEqual('Should have at least 4 items'); - }); + try { + await z + .array(z.string()) + .min(4) + .parseAsync([]); + } catch (err) { + expect(err.issues[0].message).toEqual('Should have at least 4 items'); + } }); test('array max', async () => { - expect.assertions(1); - const result = await z - .array(z.string()) - .max(2) - .parseAsync(['asdf', 'asdf', 'asdf']) - .catch(err => { - expect(err.issues[0].message).toEqual('Should have at most 2 items'); - }); - return result; + try { + await z + .array(z.string()) + .max(2) + .parseAsync(['asdf', 'asdf', 'asdf']); + } catch (err) { + expect(err.issues[0].message).toEqual('Should have at most 2 items'); + } }); test('string min', async () => { - expect.assertions(1); - const result = await z - .string() - .min(4) - .parseAsync('asd') - .catch(err => { - expect(err.issues[0].message).toEqual('Should be at least 4 characters'); - }); - return result; + try { + await z + .string() + .min(4) + .parseAsync('asd'); + } catch (err) { + expect(err.issues[0].message).toEqual('Should be at least 4 characters'); + } }); test('string max', async () => { - expect.assertions(1); - await z - .string() - .max(4) - .parseAsync('aasdfsdfsd') - .catch(err => { - expect(err.issues[0].message).toEqual( - 'Should be at most 4 characters long', - ); - }); - return 'asdf'; + try { + await z + .string() + .max(4) + .parseAsync('aasdfsdfsd'); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Should be at most 4 characters long', + ); + } }); test('number min', async () => { - expect.assertions(1); - await z - .number() - .min(3) - .parseAsync(2) - .catch(err => { - expect(err.issues[0].message).toEqual( - 'Value should be greater than or equal to 3', - ); - }); - return 'asdf'; + try { + await z + .number() + .min(3) + .parseAsync(2); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be greater than or equal to 3', + ); + } }); test('number max', async () => { - expect.assertions(1); - await z - .number() - .max(3) - .parseAsync(4) - .catch(err => { - expect(err.issues[0].message).toEqual( - 'Value should be less than or equal to 3', - ); - }); - return 'asdf'; + try { + await z + .number() + .max(3) + .parseAsync(4); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be less than or equal to 3', + ); + } }); test('number nonnegative', async () => { - expect.assertions(1); - await z - .number() - .nonnegative() - .parseAsync(-1) - .catch(err => { - expect(err.issues[0].message).toEqual( - 'Value should be greater than or equal to 0', - ); - }); - return 'asdf'; + try { + await z + .number() + .nonnegative() + .parseAsync(-1); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be greater than or equal to 0', + ); + } }); test('number nonpositive', async () => { - expect.assertions(1); - await z - .number() - .nonpositive() - .parseAsync(1) - .catch(err => { - expect(err.issues[0].message).toEqual( - 'Value should be less than or equal to 0', - ); - }); - return 'asdf'; + try { + await z + .number() + .nonpositive() + .parseAsync(1); + } catch (err) { + expect(err.issues[0].message).toEqual( + 'Value should be less than or equal to 0', + ); + } }); test('number negative', async () => { - expect.assertions(1); - await z - .number() - .negative() - .parseAsync(1) - .catch(err => { - expect(err.issues[0].message).toEqual('Value should be less than 0'); - }); - return 'asdf'; + try { + await z + .number() + .negative() + .parseAsync(1); + } catch (err) { + expect(err.issues[0].message).toEqual('Value should be less than 0'); + } }); test('number positive', async () => { - expect.assertions(1); - await z - .number() - .positive() - .parseAsync(-1) - .catch(err => { - expect(err.issues[0].message).toEqual('Value should be greater than 0'); - }); - return 'asdf'; + try { + await z + .number() + .positive() + .parseAsync(-1); + } catch (err) { + expect(err.issues[0].message).toEqual('Value should be greater than 0'); + } }); test('instantiation', () => { diff --git a/src/helpers/errorUtil.ts b/src/helpers/errorUtil.ts index 528e3d27d..2165ca1e6 100644 --- a/src/helpers/errorUtil.ts +++ b/src/helpers/errorUtil.ts @@ -1,4 +1,5 @@ export namespace errorUtil { export type ErrMessage = string | { message?: string }; - export const errToObj = (message?: ErrMessage) => (typeof message === 'string' ? { message } : message || {}); + export const errToObj = (message?: ErrMessage) => + typeof message === 'string' ? { message } : message || {}; } diff --git a/src/types/enum.ts b/src/types/enum.ts index be0840cd5..061ad595f 100644 --- a/src/types/enum.ts +++ b/src/types/enum.ts @@ -12,12 +12,16 @@ type Values = { [k in T[number]]: k; }; -export interface ZodEnumDef extends z.ZodTypeDef { +export interface ZodEnumDef + extends z.ZodTypeDef { t: z.ZodTypes.enum; values: T; } -export class ZodEnum extends z.ZodType> { +export class ZodEnum extends z.ZodType< + T[number], + ZodEnumDef +> { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -52,7 +56,9 @@ export class ZodEnum extends z.ZodType(values: T): ZodEnum => { + static create = ( + values: T, + ): ZodEnum => { return new ZodEnum({ t: z.ZodTypes.enum, values: values, diff --git a/src/types/nativeEnum.ts b/src/types/nativeEnum.ts index 60f17cdb3..2dd1814e7 100644 --- a/src/types/nativeEnum.ts +++ b/src/types/nativeEnum.ts @@ -1,13 +1,17 @@ import * as z from './base'; -export interface ZodNativeEnumDef extends z.ZodTypeDef { +export interface ZodNativeEnumDef + extends z.ZodTypeDef { t: z.ZodTypes.nativeEnum; values: T; } type EnumLike = { [k: string]: string | number; [nu: number]: string }; -export class ZodNativeEnum extends z.ZodType> { +export class ZodNativeEnum extends z.ZodType< + T[keyof T], + ZodNativeEnumDef +> { toJSON = () => this._def; static create = (values: T): ZodNativeEnum => { return new ZodNativeEnum({ diff --git a/tsconfig.json b/tsconfig.json index d76376f7d..2dae5a3d9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,6 @@ { "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "./lib" + } } \ No newline at end of file diff --git a/yarn-error.log b/yarn-error.log deleted file mode 100644 index 42ac59809..000000000 --- a/yarn-error.log +++ /dev/null @@ -1,4079 +0,0 @@ -Arguments: - /Users/colinmcd94/.nvm/versions/node/v10.15.3/bin/node /Users/colinmcd94/.nvm/versions/node/v10.15.3/bin/yarn add typescript @3.5 - -PATH: - /Users/colinmcd94/google-cloud-sdk/bin:/Users/colinmcd94/mongodb/bin:/Users/colinmcd94/.config/yarn/global/node_modules/.bin:/usr/local/Cellar/node/8.1.0_1/bin:/opt/local/bin:/opt/local/sbin:/Users/colinmcd94/.nvm/versions/node/v10.15.3/bin:/Users/colinmcd94/.yarn/bin:/Users/colinmcd94/.config/yarn/global/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/usr/local/bin:/Users/colinmcd94/Documents/Projects/flutter/bin:/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home:/Library/gurobi651/mac64/bin/:/Applications/Julia-0.4.5.app/Contents/Resources/julia/bin/julia:/Users/colinmcd94/Library/Android/sdk/tools:/Users/colinmcd94/Library/Android/sdk/platform-tools - -Yarn version: - 1.22.4 - -Node version: - 10.15.3 - -Platform: - darwin x64 - -Trace: - Error: https://registry.yarnpkg.com/@3.5: Request "https://registry.yarnpkg.com/@3.5" returned a 405 - at Request.params.callback [as _callback] (/Users/colinmcd94/.nvm/versions/node/v10.15.3/lib/node_modules/yarn/lib/cli.js:66996:18) - at Request.self.callback (/Users/colinmcd94/.nvm/versions/node/v10.15.3/lib/node_modules/yarn/lib/cli.js:140748:22) - at Request.emit (events.js:189:13) - at Request. (/Users/colinmcd94/.nvm/versions/node/v10.15.3/lib/node_modules/yarn/lib/cli.js:141720:10) - at Request.emit (events.js:189:13) - at IncomingMessage. (/Users/colinmcd94/.nvm/versions/node/v10.15.3/lib/node_modules/yarn/lib/cli.js:141642:12) - at Object.onceWrapper (events.js:277:13) - at IncomingMessage.emit (events.js:194:15) - at endReadableNT (_stream_readable.js:1125:12) - at process._tickCallback (internal/process/next_tick.js:63:19) - -npm manifest: - { - "name": "zod", - "version": "1.7.1", - "description": "TypeScript-first schema declaration and validation library with static type inference", - "main": "./lib/src/index.js", - "types": "./lib/src/index.d.ts", - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "https://github.com/colinhacks/zod" - }, - "author": "Colin McDonnell ", - "license": "MIT", - "sideEffects": false, - "bugs": { - "url": "https://github.com/colinhacks/zod/issues" - }, - "homepage": "https://github.com/colinhacks/zod", - "dependencies": {}, - "tags": [ - "typescript", - "schema", - "validation", - "type", - "inference" - ], - "keywords": [ - "typescript", - "schema", - "validation", - "type", - "inference" - ], - "scripts": { - "clean": "rm -rf lib/*", - "build": "yarn run clean && tsc --p tsconfig.package.json", - "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", - "lint": "tslint -p tsconfig.json", - "test": "jest --config jestconfig.json --coverage && yarn run badge", - "testone": "jest --config jestconfig.json ", - "badge": "make-coverage-badge --output-path ./coverage.svg", - "prepublishOnly": "npm run build", - "play": "nodemon -e ts -w . -x ts-node src/playground.ts" - }, - "devDependencies": { - "@types/jest": "^25.1.4", - "jest": "^25.1.0", - "make-coverage-badge": "^1.2.0", - "nodemon": "^2.0.2", - "prettier": "^1.19.1", - "ts-jest": "^25.2.1", - "tslint": "^6.1.0", - "tslint-config-prettier": "^1.18.0", - "typescript": "3.2" - } - } - -yarn manifest: - No manifest - -Lockfile: - # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - # yarn lockfile v1 - - - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" - integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== - dependencies: - "@babel/highlight" "^7.8.3" - - "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.7.tgz#b69017d221ccdeb203145ae9da269d72cf102f3b" - integrity sha512-rBlqF3Yko9cynC5CCFy6+K/w2N+Sq/ff2BPy+Krp7rHlABIr5epbA7OxVeKoMHB39LZOp1UY5SuLjy6uWi35yA== - dependencies: - "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.7" - "@babel/helpers" "^7.8.4" - "@babel/parser" "^7.8.7" - "@babel/template" "^7.8.6" - "@babel/traverse" "^7.8.6" - "@babel/types" "^7.8.7" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.1" - json5 "^2.1.0" - lodash "^4.17.13" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - - "@babel/generator@^7.8.6", "@babel/generator@^7.8.7": - version "7.8.8" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.8.tgz#cdcd58caab730834cee9eeadb729e833b625da3e" - integrity sha512-HKyUVu69cZoclptr8t8U5b6sx6zoWjh8jiUhnuj3MpZuKT2dJ8zPTuiy31luq32swhI0SpwItCIlU8XW7BZeJg== - dependencies: - "@babel/types" "^7.8.7" - jsesc "^2.5.1" - lodash "^4.17.13" - source-map "^0.5.0" - - "@babel/helper-function-name@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz#eeeb665a01b1f11068e9fb86ad56a1cb1a824cca" - integrity sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA== - dependencies: - "@babel/helper-get-function-arity" "^7.8.3" - "@babel/template" "^7.8.3" - "@babel/types" "^7.8.3" - - "@babel/helper-get-function-arity@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" - integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== - dependencies: - "@babel/types" "^7.8.3" - - "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.8.0": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" - integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ== - - "@babel/helper-split-export-declaration@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" - integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== - dependencies: - "@babel/types" "^7.8.3" - - "@babel/helpers@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" - integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== - dependencies: - "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.4" - "@babel/types" "^7.8.3" - - "@babel/highlight@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" - integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - - "@babel/parser@^7.1.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.8.7": - version "7.8.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4" - integrity sha512-mO5GWzBPsPf6865iIbzNE0AvkKF3NE+2S3eRUpE+FE07BOAkXh6G+GW/Pj01hhXjve1WScbaIO4UlY1JKeqCcA== - - "@babel/plugin-syntax-bigint@^7.0.0": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - - "@babel/plugin-syntax-object-rest-spread@^7.0.0": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - - "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": - version "7.8.6" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" - integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== - dependencies: - "@babel/code-frame" "^7.8.3" - "@babel/parser" "^7.8.6" - "@babel/types" "^7.8.6" - - "@babel/traverse@^7.1.0", "@babel/traverse@^7.7.4", "@babel/traverse@^7.8.4", "@babel/traverse@^7.8.6": - version "7.8.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff" - integrity sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A== - dependencies: - "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.6" - "@babel/helper-function-name" "^7.8.3" - "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.8.6" - "@babel/types" "^7.8.6" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.13" - - "@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.8.7": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d" - integrity sha512-k2TreEHxFA4CjGkL+GYjRyx35W0Mr7DP5+9q6WMkyKXB+904bYmG40syjMFV0oLlhhFCwWl0vA0DyzTDkwAiJw== - dependencies: - esutils "^2.0.2" - lodash "^4.17.13" - to-fast-properties "^2.0.0" - - "@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - - "@cnakazawa/watch@^1.0.3": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" - integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== - dependencies: - exec-sh "^0.3.2" - minimist "^1.2.0" - - "@istanbuljs/load-nyc-config@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b" - integrity sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - - "@istanbuljs/schema@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" - integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== - - "@jest/console@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.1.0.tgz#1fc765d44a1e11aec5029c08e798246bd37075ab" - integrity sha512-3P1DpqAMK/L07ag/Y9/Jup5iDEG9P4pRAuZiMQnU0JB3UOvCyYCjCoxr7sIA80SeyUCUKrr24fKAxVpmBgQonA== - dependencies: - "@jest/source-map" "^25.1.0" - chalk "^3.0.0" - jest-util "^25.1.0" - slash "^3.0.0" - - "@jest/core@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.1.0.tgz#3d4634fc3348bb2d7532915d67781cdac0869e47" - integrity sha512-iz05+NmwCmZRzMXvMo6KFipW7nzhbpEawrKrkkdJzgytavPse0biEnCNr2wRlyCsp3SmKaEY+SGv7YWYQnIdig== - dependencies: - "@jest/console" "^25.1.0" - "@jest/reporters" "^25.1.0" - "@jest/test-result" "^25.1.0" - "@jest/transform" "^25.1.0" - "@jest/types" "^25.1.0" - ansi-escapes "^4.2.1" - chalk "^3.0.0" - exit "^0.1.2" - graceful-fs "^4.2.3" - jest-changed-files "^25.1.0" - jest-config "^25.1.0" - jest-haste-map "^25.1.0" - jest-message-util "^25.1.0" - jest-regex-util "^25.1.0" - jest-resolve "^25.1.0" - jest-resolve-dependencies "^25.1.0" - jest-runner "^25.1.0" - jest-runtime "^25.1.0" - jest-snapshot "^25.1.0" - jest-util "^25.1.0" - jest-validate "^25.1.0" - jest-watcher "^25.1.0" - micromatch "^4.0.2" - p-each-series "^2.1.0" - realpath-native "^1.1.0" - rimraf "^3.0.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - - "@jest/environment@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.1.0.tgz#4a97f64770c9d075f5d2b662b5169207f0a3f787" - integrity sha512-cTpUtsjU4cum53VqBDlcW0E4KbQF03Cn0jckGPW/5rrE9tb+porD3+hhLtHAwhthsqfyF+bizyodTlsRA++sHg== - dependencies: - "@jest/fake-timers" "^25.1.0" - "@jest/types" "^25.1.0" - jest-mock "^25.1.0" - - "@jest/fake-timers@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.1.0.tgz#a1e0eff51ffdbb13ee81f35b52e0c1c11a350ce8" - integrity sha512-Eu3dysBzSAO1lD7cylZd/CVKdZZ1/43SF35iYBNV1Lvvn2Undp3Grwsv8PrzvbLhqwRzDd4zxrY4gsiHc+wygQ== - dependencies: - "@jest/types" "^25.1.0" - jest-message-util "^25.1.0" - jest-mock "^25.1.0" - jest-util "^25.1.0" - lolex "^5.0.0" - - "@jest/reporters@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.1.0.tgz#9178ecf136c48f125674ac328f82ddea46e482b0" - integrity sha512-ORLT7hq2acJQa8N+NKfs68ZtHFnJPxsGqmofxW7v7urVhzJvpKZG9M7FAcgh9Ee1ZbCteMrirHA3m5JfBtAaDg== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^25.1.0" - "@jest/environment" "^25.1.0" - "@jest/test-result" "^25.1.0" - "@jest/transform" "^25.1.0" - "@jest/types" "^25.1.0" - chalk "^3.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.2" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.0" - jest-haste-map "^25.1.0" - jest-resolve "^25.1.0" - jest-runtime "^25.1.0" - jest-util "^25.1.0" - jest-worker "^25.1.0" - slash "^3.0.0" - source-map "^0.6.0" - string-length "^3.1.0" - terminal-link "^2.0.0" - v8-to-istanbul "^4.0.1" - optionalDependencies: - node-notifier "^6.0.0" - - "@jest/source-map@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-25.1.0.tgz#b012e6c469ccdbc379413f5c1b1ffb7ba7034fb0" - integrity sha512-ohf2iKT0xnLWcIUhL6U6QN+CwFWf9XnrM2a6ybL9NXxJjgYijjLSitkYHIdzkd8wFliH73qj/+epIpTiWjRtAA== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.2.3" - source-map "^0.6.0" - - "@jest/test-result@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.1.0.tgz#847af2972c1df9822a8200457e64be4ff62821f7" - integrity sha512-FZzSo36h++U93vNWZ0KgvlNuZ9pnDnztvaM7P/UcTx87aPDotG18bXifkf1Ji44B7k/eIatmMzkBapnAzjkJkg== - dependencies: - "@jest/console" "^25.1.0" - "@jest/transform" "^25.1.0" - "@jest/types" "^25.1.0" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - - "@jest/test-sequencer@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.1.0.tgz#4df47208542f0065f356fcdb80026e3c042851ab" - integrity sha512-WgZLRgVr2b4l/7ED1J1RJQBOharxS11EFhmwDqknpknE0Pm87HLZVS2Asuuw+HQdfQvm2aXL2FvvBLxOD1D0iw== - dependencies: - "@jest/test-result" "^25.1.0" - jest-haste-map "^25.1.0" - jest-runner "^25.1.0" - jest-runtime "^25.1.0" - - "@jest/transform@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.1.0.tgz#221f354f512b4628d88ce776d5b9e601028ea9da" - integrity sha512-4ktrQ2TPREVeM+KxB4zskAT84SnmG1vaz4S+51aTefyqn3zocZUnliLLm5Fsl85I3p/kFPN4CRp1RElIfXGegQ== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^25.1.0" - babel-plugin-istanbul "^6.0.0" - chalk "^3.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.3" - jest-haste-map "^25.1.0" - jest-regex-util "^25.1.0" - jest-util "^25.1.0" - micromatch "^4.0.2" - pirates "^4.0.1" - realpath-native "^1.1.0" - slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" - - "@jest/types@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.1.0.tgz#b26831916f0d7c381e11dbb5e103a72aed1b4395" - integrity sha512-VpOtt7tCrgvamWZh1reVsGADujKigBUFTi19mlRjqEGsE8qH4r3s+skY33dNdXOwyZIvuftZ5tqdF1IgsMejMA== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^15.0.0" - chalk "^3.0.0" - - "@sinonjs/commons@^1.7.0": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.7.1.tgz#da5fd19a5f71177a53778073978873964f49acf1" - integrity sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ== - dependencies: - type-detect "4.0.8" - - "@types/babel__core@^7.1.0": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.6.tgz#16ff42a5ae203c9af1c6e190ed1f30f83207b610" - integrity sha512-tTnhWszAqvXnhW7m5jQU9PomXSiKXk2sFxpahXvI20SZKu9ylPi8WtIxueZ6ehDWikPT0jeFujMj3X4ZHuf3Tg== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - - "@types/babel__generator@*": - version "7.6.1" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.1.tgz#4901767b397e8711aeb99df8d396d7ba7b7f0e04" - integrity sha512-bBKm+2VPJcMRVwNhxKu8W+5/zT7pwNEqeokFOmbvVSqGzFneNxYcEBro9Ac7/N9tlsaPYnZLK8J1LWKkMsLAew== - dependencies: - "@babel/types" "^7.0.0" - - "@types/babel__template@*": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" - integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - - "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.9.tgz#be82fab304b141c3eee81a4ce3b034d0eba1590a" - integrity sha512-jEFQ8L1tuvPjOI8lnpaf73oCJe+aoxL6ygqSy6c8LcW98zaC+4mzWuQIRCEvKeCOu+lbqdXcg4Uqmm1S8AP1tw== - dependencies: - "@babel/types" "^7.3.0" - - "@types/color-name@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== - - "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" - integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== - - "@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== - dependencies: - "@types/istanbul-lib-coverage" "*" - - "@types/istanbul-reports@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" - integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== - dependencies: - "@types/istanbul-lib-coverage" "*" - "@types/istanbul-lib-report" "*" - - "@types/jest@^25.1.4": - version "25.1.4" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.1.4.tgz#9e9f1e59dda86d3fd56afce71d1ea1b331f6f760" - integrity sha512-QDDY2uNAhCV7TMCITrxz+MRk1EizcsevzfeS6LykIlq2V1E5oO4wXG8V2ZEd9w7Snxeeagk46YbMgZ8ESHx3sw== - dependencies: - jest-diff "^25.1.0" - pretty-format "^25.1.0" - - "@types/stack-utils@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" - integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== - - "@types/yargs-parser@*": - version "15.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" - integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== - - "@types/yargs@^15.0.0": - version "15.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.4.tgz#7e5d0f8ca25e9d5849f2ea443cf7c402decd8299" - integrity sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg== - dependencies: - "@types/yargs-parser" "*" - - abab@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" - integrity sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg== - - abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - - acorn-globals@^4.3.2: - version "4.3.4" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" - integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== - dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" - - acorn-walk@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" - integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== - - acorn@^6.0.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" - integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== - - acorn@^7.1.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" - integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== - - ajv@^6.5.5: - version "6.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" - integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - - ansi-align@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" - integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= - dependencies: - string-width "^2.0.0" - - ansi-escapes@^4.2.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" - integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== - dependencies: - type-fest "^0.11.0" - - ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - - ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - - ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - - ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - - ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" - integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== - dependencies: - "@types/color-name" "^1.1.1" - color-convert "^2.0.1" - - anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - - anymatch@^3.0.3, anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - - argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - - arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - - arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - - arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - - array-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" - integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= - - array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - - asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - - assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - - assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - - astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - - asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - - atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - - aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - - aws4@^1.8.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" - integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== - - babel-jest@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.1.0.tgz#206093ac380a4b78c4404a05b3277391278f80fb" - integrity sha512-tz0VxUhhOE2y+g8R2oFrO/2VtVjA1lkJeavlhExuRBg3LdNJY9gwQ+Vcvqt9+cqy71MCTJhewvTB7Qtnnr9SWg== - dependencies: - "@jest/transform" "^25.1.0" - "@jest/types" "^25.1.0" - "@types/babel__core" "^7.1.0" - babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^25.1.0" - chalk "^3.0.0" - slash "^3.0.0" - - babel-plugin-istanbul@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" - integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^4.0.0" - test-exclude "^6.0.0" - - babel-plugin-jest-hoist@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.1.0.tgz#fb62d7b3b53eb36c97d1bc7fec2072f9bd115981" - integrity sha512-oIsopO41vW4YFZ9yNYoLQATnnN46lp+MZ6H4VvPKFkcc2/fkl3CfE/NZZSmnEIEsJRmJAgkVEK0R7Zbl50CpTw== - dependencies: - "@types/babel__traverse" "^7.0.6" - - babel-preset-jest@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.1.0.tgz#d0aebfebb2177a21cde710996fce8486d34f1d33" - integrity sha512-eCGn64olaqwUMaugXsTtGAM2I0QTahjEtnRu0ql8Ie+gDWAc1N6wqN0k2NilnyTunM69Pad7gJY7LOtwLimoFQ== - dependencies: - "@babel/plugin-syntax-bigint" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^25.1.0" - - balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - - base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - - bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - - binary-extensions@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" - integrity sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow== - - boxen@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" - integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== - dependencies: - ansi-align "^2.0.0" - camelcase "^4.0.0" - chalk "^2.0.1" - cli-boxes "^1.0.0" - string-width "^2.0.0" - term-size "^1.2.0" - widest-line "^2.0.0" - - brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - - braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - - braces@^3.0.1, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - - browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - - browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" - - bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - - bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - - buffer-from@1.x, buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - - builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= - - cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - - callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - - camelcase@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - - camelcase@^5.0.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - - capture-exit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" - integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== - dependencies: - rsvp "^4.8.4" - - capture-stack-trace@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" - integrity sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw== - - caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - - chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - - chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - - chokidar@^3.2.2: - version "3.3.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.1.tgz#c84e5b3d18d9a4d77558fef466b1bf16bbeb3450" - integrity sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.3.0" - optionalDependencies: - fsevents "~2.1.2" - - ci-info@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" - integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== - - ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - - class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - - cli-boxes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" - integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= - - cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - - co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - - collect-v8-coverage@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.0.tgz#150ee634ac3650b71d9c985eb7f608942334feb1" - integrity sha512-VKIhJgvk8E1W28m5avZ2Gv2Ruv5YiF56ug2oclvaG9md69BuZImMG2sk9g7QNKLUbtYAKQjXjYxbYZVUlMMKmQ== - - collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - - color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - - color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - - color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - - color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - - combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - - commander@^2.12.1: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - - component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - - concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - - configstore@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" - integrity sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw== - dependencies: - dot-prop "^4.1.0" - graceful-fs "^4.1.2" - make-dir "^1.0.0" - unique-string "^1.0.0" - write-file-atomic "^2.0.0" - xdg-basedir "^3.0.0" - - convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== - dependencies: - safe-buffer "~5.1.1" - - copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - - core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - - create-error-class@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" - integrity sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= - dependencies: - capture-stack-trace "^1.0.0" - - cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - - cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - - cross-spawn@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14" - integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - - crypto-random-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" - integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= - - cssom@^0.4.1: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== - - cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - - cssstyle@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.2.0.tgz#e4c44debccd6b7911ed617a4395e5754bba59992" - integrity sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA== - dependencies: - cssom "~0.3.6" - - dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - - data-urls@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== - dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" - - debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - - debug@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - - debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - - decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - - decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - - deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - - deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - - define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - - define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - - define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - - define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - - delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - - detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - - diff-sequences@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.1.0.tgz#fd29a46f1c913fd66c22645dc75bffbe43051f32" - integrity sha512-nFIfVk5B/NStCsJ+zaPO4vYuLjlzQ6uFvPxzYyHlejNZ/UGa7G/n7peOXVrVNvRuyfstt+mZQYGpjxg9Z6N8Kw== - - diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - - domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== - dependencies: - webidl-conversions "^4.0.2" - - dot-prop@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" - integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== - dependencies: - is-obj "^1.0.0" - - duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - - ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - - emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - - end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - - es-abstract@^1.17.0-next.1, es-abstract@^1.17.2: - version "1.17.4" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" - integrity sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.5" - is-regex "^1.0.5" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.1" - string.prototype.trimright "^2.1.1" - - es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - - escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - - escodegen@^1.11.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.1.tgz#ba01d0c8278b5e95a9a45350142026659027a457" - integrity sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - - esprima@^4.0.0, esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - - estraverse@^4.2.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - - esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - - exec-sh@^0.3.2: - version "0.3.4" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" - integrity sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A== - - execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - - execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - - execa@^3.2.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" - integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - p-finally "^2.0.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - - exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - - expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - - expect@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-25.1.0.tgz#7e8d7b06a53f7d66ec927278db3304254ee683ee" - integrity sha512-wqHzuoapQkhc3OKPlrpetsfueuEiMf3iWh0R8+duCu9PIjXoP7HgD5aeypwTnXUAjC8aMsiVDaWwlbJ1RlQ38g== - dependencies: - "@jest/types" "^25.1.0" - ansi-styles "^4.0.0" - jest-get-type "^25.1.0" - jest-matcher-utils "^25.1.0" - jest-message-util "^25.1.0" - jest-regex-util "^25.1.0" - - extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - - extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - - extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - - extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - - extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - - extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - - fast-deep-equal@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" - integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== - - fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - - fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - - fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== - dependencies: - bser "2.1.1" - - fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - - fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - - find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - - for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - - forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - - form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - - fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - - fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - - fsevents@^2.1.2, fsevents@~2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805" - integrity sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA== - - function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - - gensync@^1.0.0-beta.1: - version "1.0.0-beta.1" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" - integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== - - get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - - get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - - get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - - get-stream@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" - integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== - dependencies: - pump "^3.0.0" - - get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - - getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - - glob-parent@~5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" - integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== - dependencies: - is-glob "^4.0.1" - - glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - - global-dirs@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" - integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= - dependencies: - ini "^1.3.4" - - globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - - got@^6.7.1: - version "6.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" - integrity sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA= - dependencies: - create-error-class "^3.0.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-redirect "^1.0.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - unzip-response "^2.0.1" - url-parse-lax "^1.0.0" - - graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" - integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== - - growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= - - har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - - har-validator@~5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== - dependencies: - ajv "^6.5.5" - har-schema "^2.0.0" - - has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - - has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - - has-symbols@^1.0.0, has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - - has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - - has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - - has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - - has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - - has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - - html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== - dependencies: - whatwg-encoding "^1.0.1" - - html-escaper@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.0.tgz#71e87f931de3fe09e56661ab9a29aadec707b491" - integrity sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig== - - http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - - human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - - iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - - ignore-by-default@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" - integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= - - import-lazy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" - integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= - - import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - - imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - - inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - - inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - - ini@^1.3.4, ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - - ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= - - is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - - is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - - is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - - is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - - is-callable@^1.1.4, is-callable@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - - is-ci@^1.0.10: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" - integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== - dependencies: - ci-info "^1.5.0" - - is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - - is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - - is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - - is-date-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" - integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== - - is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - - is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - - is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - - is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - - is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - - is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - - is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - - is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - - is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - - is-installed-globally@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" - integrity sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA= - dependencies: - global-dirs "^0.1.0" - is-path-inside "^1.0.0" - - is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= - - is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - - is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - - is-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= - - is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= - dependencies: - path-is-inside "^1.0.1" - - is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - - is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= - - is-regex@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - - is-retry-allowed@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" - integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== - - is-stream@^1.0.0, is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - - is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== - - is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== - dependencies: - has-symbols "^1.0.1" - - is-typedarray@^1.0.0, is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - - is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - - is-wsl@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d" - integrity sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog== - - isarray@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - - isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - - isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - - isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - - isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - - istanbul-lib-coverage@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" - integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== - - istanbul-lib-instrument@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz#61f13ac2c96cfefb076fe7131156cc05907874e6" - integrity sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg== - dependencies: - "@babel/core" "^7.7.5" - "@babel/parser" "^7.7.5" - "@babel/template" "^7.7.4" - "@babel/traverse" "^7.7.4" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - - istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - - istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - - istanbul-reports@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.0.tgz#d4d16d035db99581b6194e119bbf36c963c5eb70" - integrity sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - - jest-changed-files@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.1.0.tgz#73dae9a7d9949fdfa5c278438ce8f2ff3ec78131" - integrity sha512-bdL1aHjIVy3HaBO3eEQeemGttsq1BDlHgWcOjEOIAcga7OOEGWHD2WSu8HhL7I1F0mFFyci8VKU4tRNk+qtwDA== - dependencies: - "@jest/types" "^25.1.0" - execa "^3.2.0" - throat "^5.0.0" - - jest-cli@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.1.0.tgz#75f0b09cf6c4f39360906bf78d580be1048e4372" - integrity sha512-p+aOfczzzKdo3AsLJlhs8J5EW6ffVidfSZZxXedJ0mHPBOln1DccqFmGCoO8JWd4xRycfmwy1eoQkMsF8oekPg== - dependencies: - "@jest/core" "^25.1.0" - "@jest/test-result" "^25.1.0" - "@jest/types" "^25.1.0" - chalk "^3.0.0" - exit "^0.1.2" - import-local "^3.0.2" - is-ci "^2.0.0" - jest-config "^25.1.0" - jest-util "^25.1.0" - jest-validate "^25.1.0" - prompts "^2.0.1" - realpath-native "^1.1.0" - yargs "^15.0.0" - - jest-config@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.1.0.tgz#d114e4778c045d3ef239452213b7ad3ec1cbea90" - integrity sha512-tLmsg4SZ5H7tuhBC5bOja0HEblM0coS3Wy5LTCb2C8ZV6eWLewHyK+3qSq9Bi29zmWQ7ojdCd3pxpx4l4d2uGw== - dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^25.1.0" - "@jest/types" "^25.1.0" - babel-jest "^25.1.0" - chalk "^3.0.0" - glob "^7.1.1" - jest-environment-jsdom "^25.1.0" - jest-environment-node "^25.1.0" - jest-get-type "^25.1.0" - jest-jasmine2 "^25.1.0" - jest-regex-util "^25.1.0" - jest-resolve "^25.1.0" - jest-util "^25.1.0" - jest-validate "^25.1.0" - micromatch "^4.0.2" - pretty-format "^25.1.0" - realpath-native "^1.1.0" - - jest-diff@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.1.0.tgz#58b827e63edea1bc80c1de952b80cec9ac50e1ad" - integrity sha512-nepXgajT+h017APJTreSieh4zCqnSHEJ1iT8HDlewu630lSJ4Kjjr9KNzm+kzGwwcpsDE6Snx1GJGzzsefaEHw== - dependencies: - chalk "^3.0.0" - diff-sequences "^25.1.0" - jest-get-type "^25.1.0" - pretty-format "^25.1.0" - - jest-docblock@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-25.1.0.tgz#0f44bea3d6ca6dfc38373d465b347c8818eccb64" - integrity sha512-370P/mh1wzoef6hUKiaMcsPtIapY25suP6JqM70V9RJvdKLrV4GaGbfUseUVk4FZJw4oTZ1qSCJNdrClKt5JQA== - dependencies: - detect-newline "^3.0.0" - - jest-each@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.1.0.tgz#a6b260992bdf451c2d64a0ccbb3ac25e9b44c26a" - integrity sha512-R9EL8xWzoPySJ5wa0DXFTj7NrzKpRD40Jy+zQDp3Qr/2QmevJgkN9GqioCGtAJ2bW9P/MQRznQHQQhoeAyra7A== - dependencies: - "@jest/types" "^25.1.0" - chalk "^3.0.0" - jest-get-type "^25.1.0" - jest-util "^25.1.0" - pretty-format "^25.1.0" - - jest-environment-jsdom@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.1.0.tgz#6777ab8b3e90fd076801efd3bff8e98694ab43c3" - integrity sha512-ILb4wdrwPAOHX6W82GGDUiaXSSOE274ciuov0lztOIymTChKFtC02ddyicRRCdZlB5YSrv3vzr1Z5xjpEe1OHQ== - dependencies: - "@jest/environment" "^25.1.0" - "@jest/fake-timers" "^25.1.0" - "@jest/types" "^25.1.0" - jest-mock "^25.1.0" - jest-util "^25.1.0" - jsdom "^15.1.1" - - jest-environment-node@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.1.0.tgz#797bd89b378cf0bd794dc8e3dca6ef21126776db" - integrity sha512-U9kFWTtAPvhgYY5upnH9rq8qZkj6mYLup5l1caAjjx9uNnkLHN2xgZy5mo4SyLdmrh/EtB9UPpKFShvfQHD0Iw== - dependencies: - "@jest/environment" "^25.1.0" - "@jest/fake-timers" "^25.1.0" - "@jest/types" "^25.1.0" - jest-mock "^25.1.0" - jest-util "^25.1.0" - - jest-get-type@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.1.0.tgz#1cfe5fc34f148dc3a8a3b7275f6b9ce9e2e8a876" - integrity sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw== - - jest-haste-map@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.1.0.tgz#ae12163d284f19906260aa51fd405b5b2e5a4ad3" - integrity sha512-/2oYINIdnQZAqyWSn1GTku571aAfs8NxzSErGek65Iu5o8JYb+113bZysRMcC/pjE5v9w0Yz+ldbj9NxrFyPyw== - dependencies: - "@jest/types" "^25.1.0" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.3" - jest-serializer "^25.1.0" - jest-util "^25.1.0" - jest-worker "^25.1.0" - micromatch "^4.0.2" - sane "^4.0.3" - walker "^1.0.7" - optionalDependencies: - fsevents "^2.1.2" - - jest-jasmine2@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.1.0.tgz#681b59158a430f08d5d0c1cce4f01353e4b48137" - integrity sha512-GdncRq7jJ7sNIQ+dnXvpKO2MyP6j3naNK41DTTjEAhLEdpImaDA9zSAZwDhijjSF/D7cf4O5fdyUApGBZleaEg== - dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^25.1.0" - "@jest/source-map" "^25.1.0" - "@jest/test-result" "^25.1.0" - "@jest/types" "^25.1.0" - chalk "^3.0.0" - co "^4.6.0" - expect "^25.1.0" - is-generator-fn "^2.0.0" - jest-each "^25.1.0" - jest-matcher-utils "^25.1.0" - jest-message-util "^25.1.0" - jest-runtime "^25.1.0" - jest-snapshot "^25.1.0" - jest-util "^25.1.0" - pretty-format "^25.1.0" - throat "^5.0.0" - - jest-leak-detector@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.1.0.tgz#ed6872d15aa1c72c0732d01bd073dacc7c38b5c6" - integrity sha512-3xRI264dnhGaMHRvkFyEKpDeaRzcEBhyNrOG5oT8xPxOyUAblIAQnpiR3QXu4wDor47MDTiHbiFcbypdLcLW5w== - dependencies: - jest-get-type "^25.1.0" - pretty-format "^25.1.0" - - jest-matcher-utils@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.1.0.tgz#fa5996c45c7193a3c24e73066fc14acdee020220" - integrity sha512-KGOAFcSFbclXIFE7bS4C53iYobKI20ZWleAdAFun4W1Wz1Kkej8Ng6RRbhL8leaEvIOjGXhGf/a1JjO8bkxIWQ== - dependencies: - chalk "^3.0.0" - jest-diff "^25.1.0" - jest-get-type "^25.1.0" - pretty-format "^25.1.0" - - jest-message-util@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.1.0.tgz#702a9a5cb05c144b9aa73f06e17faa219389845e" - integrity sha512-Nr/Iwar2COfN22aCqX0kCVbXgn8IBm9nWf4xwGr5Olv/KZh0CZ32RKgZWMVDXGdOahicM10/fgjdimGNX/ttCQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^25.1.0" - "@jest/types" "^25.1.0" - "@types/stack-utils" "^1.0.1" - chalk "^3.0.0" - micromatch "^4.0.2" - slash "^3.0.0" - stack-utils "^1.0.1" - - jest-mock@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.1.0.tgz#411d549e1b326b7350b2e97303a64715c28615fd" - integrity sha512-28/u0sqS+42vIfcd1mlcg4ZVDmSUYuNvImP4X2lX5hRMLW+CN0BeiKVD4p+ujKKbSPKd3rg/zuhCF+QBLJ4vag== - dependencies: - "@jest/types" "^25.1.0" - - jest-pnp-resolver@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" - integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== - - jest-regex-util@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.1.0.tgz#efaf75914267741838e01de24da07b2192d16d87" - integrity sha512-9lShaDmDpqwg+xAd73zHydKrBbbrIi08Kk9YryBEBybQFg/lBWR/2BDjjiSE7KIppM9C5+c03XiDaZ+m4Pgs1w== - - jest-resolve-dependencies@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.1.0.tgz#8a1789ec64eb6aaa77fd579a1066a783437e70d2" - integrity sha512-Cu/Je38GSsccNy4I2vL12ZnBlD170x2Oh1devzuM9TLH5rrnLW1x51lN8kpZLYTvzx9j+77Y5pqBaTqfdzVzrw== - dependencies: - "@jest/types" "^25.1.0" - jest-regex-util "^25.1.0" - jest-snapshot "^25.1.0" - - jest-resolve@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.1.0.tgz#23d8b6a4892362baf2662877c66aa241fa2eaea3" - integrity sha512-XkBQaU1SRCHj2Evz2Lu4Czs+uIgJXWypfO57L7JYccmAXv4slXA6hzNblmcRmf7P3cQ1mE7fL3ABV6jAwk4foQ== - dependencies: - "@jest/types" "^25.1.0" - browser-resolve "^1.11.3" - chalk "^3.0.0" - jest-pnp-resolver "^1.2.1" - realpath-native "^1.1.0" - - jest-runner@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.1.0.tgz#fef433a4d42c89ab0a6b6b268e4a4fbe6b26e812" - integrity sha512-su3O5fy0ehwgt+e8Wy7A8CaxxAOCMzL4gUBftSs0Ip32S0epxyZPDov9Znvkl1nhVOJNf4UwAsnqfc3plfQH9w== - dependencies: - "@jest/console" "^25.1.0" - "@jest/environment" "^25.1.0" - "@jest/test-result" "^25.1.0" - "@jest/types" "^25.1.0" - chalk "^3.0.0" - exit "^0.1.2" - graceful-fs "^4.2.3" - jest-config "^25.1.0" - jest-docblock "^25.1.0" - jest-haste-map "^25.1.0" - jest-jasmine2 "^25.1.0" - jest-leak-detector "^25.1.0" - jest-message-util "^25.1.0" - jest-resolve "^25.1.0" - jest-runtime "^25.1.0" - jest-util "^25.1.0" - jest-worker "^25.1.0" - source-map-support "^0.5.6" - throat "^5.0.0" - - jest-runtime@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.1.0.tgz#02683218f2f95aad0f2ec1c9cdb28c1dc0ec0314" - integrity sha512-mpPYYEdbExKBIBB16ryF6FLZTc1Rbk9Nx0ryIpIMiDDkOeGa0jQOKVI/QeGvVGlunKKm62ywcioeFVzIbK03bA== - dependencies: - "@jest/console" "^25.1.0" - "@jest/environment" "^25.1.0" - "@jest/source-map" "^25.1.0" - "@jest/test-result" "^25.1.0" - "@jest/transform" "^25.1.0" - "@jest/types" "^25.1.0" - "@types/yargs" "^15.0.0" - chalk "^3.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.3" - jest-config "^25.1.0" - jest-haste-map "^25.1.0" - jest-message-util "^25.1.0" - jest-mock "^25.1.0" - jest-regex-util "^25.1.0" - jest-resolve "^25.1.0" - jest-snapshot "^25.1.0" - jest-util "^25.1.0" - jest-validate "^25.1.0" - realpath-native "^1.1.0" - slash "^3.0.0" - strip-bom "^4.0.0" - yargs "^15.0.0" - - jest-serializer@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.1.0.tgz#73096ba90e07d19dec4a0c1dd89c355e2f129e5d" - integrity sha512-20Wkq5j7o84kssBwvyuJ7Xhn7hdPeTXndnwIblKDR2/sy1SUm6rWWiG9kSCgJPIfkDScJCIsTtOKdlzfIHOfKA== - - jest-snapshot@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.1.0.tgz#d5880bd4b31faea100454608e15f8d77b9d221d9" - integrity sha512-xZ73dFYN8b/+X2hKLXz4VpBZGIAn7muD/DAg+pXtDzDGw3iIV10jM7WiHqhCcpDZfGiKEj7/2HXAEPtHTj0P2A== - dependencies: - "@babel/types" "^7.0.0" - "@jest/types" "^25.1.0" - chalk "^3.0.0" - expect "^25.1.0" - jest-diff "^25.1.0" - jest-get-type "^25.1.0" - jest-matcher-utils "^25.1.0" - jest-message-util "^25.1.0" - jest-resolve "^25.1.0" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - pretty-format "^25.1.0" - semver "^7.1.1" - - jest-util@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.1.0.tgz#7bc56f7b2abd534910e9fa252692f50624c897d9" - integrity sha512-7did6pLQ++87Qsj26Fs/TIwZMUFBXQ+4XXSodRNy3luch2DnRXsSnmpVtxxQ0Yd6WTipGpbhh2IFP1mq6/fQGw== - dependencies: - "@jest/types" "^25.1.0" - chalk "^3.0.0" - is-ci "^2.0.0" - mkdirp "^0.5.1" - - jest-validate@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.1.0.tgz#1469fa19f627bb0a9a98e289f3e9ab6a668c732a" - integrity sha512-kGbZq1f02/zVO2+t1KQGSVoCTERc5XeObLwITqC6BTRH3Adv7NZdYqCpKIZLUgpLXf2yISzQ465qOZpul8abXA== - dependencies: - "@jest/types" "^25.1.0" - camelcase "^5.3.1" - chalk "^3.0.0" - jest-get-type "^25.1.0" - leven "^3.1.0" - pretty-format "^25.1.0" - - jest-watcher@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.1.0.tgz#97cb4a937f676f64c9fad2d07b824c56808e9806" - integrity sha512-Q9eZ7pyaIr6xfU24OeTg4z1fUqBF/4MP6J801lyQfg7CsnZ/TCzAPvCfckKdL5dlBBEKBeHV0AdyjFZ5eWj4ig== - dependencies: - "@jest/test-result" "^25.1.0" - "@jest/types" "^25.1.0" - ansi-escapes "^4.2.1" - chalk "^3.0.0" - jest-util "^25.1.0" - string-length "^3.1.0" - - jest-worker@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.1.0.tgz#75d038bad6fdf58eba0d2ec1835856c497e3907a" - integrity sha512-ZHhHtlxOWSxCoNOKHGbiLzXnl42ga9CxDr27H36Qn+15pQZd3R/F24jrmjDelw9j/iHUIWMWs08/u2QN50HHOg== - dependencies: - merge-stream "^2.0.0" - supports-color "^7.0.0" - - jest@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-25.1.0.tgz#b85ef1ddba2fdb00d295deebbd13567106d35be9" - integrity sha512-FV6jEruneBhokkt9MQk0WUFoNTwnF76CLXtwNMfsc0um0TlB/LG2yxUd0KqaFjEJ9laQmVWQWS0sG/t2GsuI0w== - dependencies: - "@jest/core" "^25.1.0" - import-local "^3.0.2" - jest-cli "^25.1.0" - - js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - - js-yaml@^3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - - jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - - jsdom@^15.1.1: - version "15.2.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5" - integrity sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g== - dependencies: - abab "^2.0.0" - acorn "^7.1.0" - acorn-globals "^4.3.2" - array-equal "^1.0.0" - cssom "^0.4.1" - cssstyle "^2.0.0" - data-urls "^1.1.0" - domexception "^1.0.1" - escodegen "^1.11.1" - html-encoding-sniffer "^1.0.2" - nwsapi "^2.2.0" - parse5 "5.1.0" - pn "^1.1.0" - request "^2.88.0" - request-promise-native "^1.0.7" - saxes "^3.1.9" - symbol-tree "^3.2.2" - tough-cookie "^3.0.1" - w3c-hr-time "^1.0.1" - w3c-xmlserializer "^1.1.2" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^7.0.0" - ws "^7.0.0" - xml-name-validator "^3.0.0" - - jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - - json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - - json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - - json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - - json5@2.x, json5@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" - integrity sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== - dependencies: - minimist "^1.2.0" - - jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - - kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - - kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - - kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - - kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - - kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - - latest-version@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" - integrity sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU= - dependencies: - package-json "^4.0.0" - - leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - - levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - - locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - - lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - - lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= - - lodash@^4.17.13, lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - - lolex@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" - integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== - dependencies: - "@sinonjs/commons" "^1.7.0" - - lowercase-keys@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - - lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - - make-coverage-badge@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/make-coverage-badge/-/make-coverage-badge-1.2.0.tgz#125c337531ce7e036c64fa96a8b42ce60e33b437" - integrity sha512-nA1eQZJ9vcY2UoQLVIdzqyRoNtAZHWlXJfrHkaMB/pQgTYBPmbImkykfxWeAtUQuLJXzb6eAhbR7nEgrt+S7FA== - dependencies: - mri "1.1.4" - - make-dir@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" - integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== - dependencies: - pify "^3.0.0" - - make-dir@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392" - integrity sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w== - dependencies: - semver "^6.0.0" - - make-error@1.x: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - - makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= - dependencies: - tmpl "1.0.x" - - map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - - map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - - merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - - micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - - micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== - dependencies: - braces "^3.0.1" - picomatch "^2.0.5" - - mime-db@1.43.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" - integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== - - mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.26" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" - integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== - dependencies: - mime-db "1.43.0" - - mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - - minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - - minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - - minimist@^1.1.1, minimist@^1.2.0: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - - mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - - mkdirp@0.x, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - - mri@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.4.tgz#7cb1dd1b9b40905f1fac053abe25b6720f44744a" - integrity sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w== - - ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - - ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - - nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - - natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - - nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - - node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - - node-modules-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= - - node-notifier@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12" - integrity sha512-SVfQ/wMw+DesunOm5cKqr6yDcvUTDl/yc97ybGHMrteNEY6oekXpNpS3lZwgLlwz0FLgHoiW28ZpmBHUDg37cw== - dependencies: - growly "^1.3.0" - is-wsl "^2.1.1" - semver "^6.3.0" - shellwords "^0.1.1" - which "^1.3.1" - - nodemon@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.2.tgz#9c7efeaaf9b8259295a97e5d4585ba8f0cbe50b0" - integrity sha512-GWhYPMfde2+M0FsHnggIHXTqPDHXia32HRhh6H0d75Mt9FKUoCBvumNHr7LdrpPBTKxsWmIEOjoN+P4IU6Hcaw== - dependencies: - chokidar "^3.2.2" - debug "^3.2.6" - ignore-by-default "^1.0.1" - minimatch "^3.0.4" - pstree.remy "^1.1.7" - semver "^5.7.1" - supports-color "^5.5.0" - touch "^3.1.0" - undefsafe "^2.0.2" - update-notifier "^2.5.0" - - nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= - dependencies: - abbrev "1" - - normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - - normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - - npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - - npm-run-path@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - - nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== - - oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - - object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - - object-inspect@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - - object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - - object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - - object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - - object.getownpropertydescriptors@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" - integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - - object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - - once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - - onetime@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" - integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== - dependencies: - mimic-fn "^2.1.0" - - optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - - p-each-series@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.1.0.tgz#961c8dd3f195ea96c747e636b262b800a6b1af48" - integrity sha512-ZuRs1miPT4HrjFa+9fRfOFXxGJfORgelKV9f9nNOWw2gl6gVsRaVDOQP0+MI0G0wGKns1Yacsu0GjOFbTK0JFQ== - - p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - - p-finally@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" - integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== - - p-limit@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.2.tgz#61279b67721f5287aa1c13a9a7fbbc48c9291b1e" - integrity sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ== - dependencies: - p-try "^2.0.0" - - p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - - p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - - package-json@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" - integrity sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0= - dependencies: - got "^6.7.1" - registry-auth-token "^3.0.1" - registry-url "^3.0.3" - semver "^5.1.0" - - parse5@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" - integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== - - pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - - path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - - path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - - path-is-inside@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - - path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - - path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - - path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - - performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - - picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.0.7: - version "2.2.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.1.tgz#21bac888b6ed8601f831ce7816e335bc779f0a4a" - integrity sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA== - - pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - - pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== - dependencies: - node-modules-regexp "^1.0.0" - - pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - - pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== - - posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - - prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - - prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - - prettier@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - - pretty-format@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.1.0.tgz#ed869bdaec1356fc5ae45de045e2c8ec7b07b0c8" - integrity sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ== - dependencies: - "@jest/types" "^25.1.0" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^16.12.0" - - prompts@^2.0.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.3.1.tgz#b63a9ce2809f106fa9ae1277c275b167af46ea05" - integrity sha512-qIP2lQyCwYbdzcqHIUi2HAxiWixhoM9OdLCWf8txXsapC/X9YdsCoeyRIXE/GP+Q0J37Q7+XN/MFqbUa7IzXNA== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.4" - - pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - - psl@^1.1.28: - version "1.7.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.7.0.tgz#f1c4c47a8ef97167dea5d6bbf4816d736e884a3c" - integrity sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ== - - pstree.remy@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.7.tgz#c76963a28047ed61542dc361aa26ee55a7fa15f3" - integrity sha512-xsMgrUwRpuGskEzBFkH8NmTimbZ5PcPup0LA8JJkHIm2IMUbQcpo3yeLNWVrufEYjh8YwtSVh0xz6UeWc5Oh5A== - - pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - - punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - - qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - - rc@^1.0.1, rc@^1.1.6: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - - react-is@^16.12.0: - version "16.13.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.0.tgz#0f37c3613c34fe6b37cd7f763a0d6293ab15c527" - integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA== - - readdirp@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.3.0.tgz#984458d13a1e42e2e9f5841b129e162f369aff17" - integrity sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ== - dependencies: - picomatch "^2.0.7" - - realpath-native@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" - integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== - dependencies: - util.promisify "^1.0.0" - - regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - - registry-auth-token@^3.0.1: - version "3.4.0" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e" - integrity sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A== - dependencies: - rc "^1.1.6" - safe-buffer "^5.0.1" - - registry-url@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= - dependencies: - rc "^1.0.1" - - remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - - repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - - repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - - request-promise-core@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9" - integrity sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ== - dependencies: - lodash "^4.17.15" - - request-promise-native@^1.0.7: - version "1.0.8" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.8.tgz#a455b960b826e44e2bf8999af64dff2bfe58cb36" - integrity sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ== - dependencies: - request-promise-core "1.1.3" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - - request@^2.88.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - - require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - - require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - - resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - - resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - - resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - - resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - - resolve@1.x, resolve@^1.3.2: - version "1.15.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" - integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== - dependencies: - path-parse "^1.0.6" - - ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - - rimraf@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - - rsvp@^4.8.4: - version "4.8.5" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" - integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== - - safe-buffer@^5.0.1, safe-buffer@^5.1.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - - safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - - safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - - "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - - sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - - saxes@^3.1.9: - version "3.1.11" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" - integrity sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g== - dependencies: - xmlchars "^2.1.1" - - semver-diff@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" - integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= - dependencies: - semver "^5.0.3" - - semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - - semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - - semver@^7.1.1: - version "7.1.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.3.tgz#e4345ce73071c53f336445cfc19efb1c311df2a6" - integrity sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA== - - set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - - set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - - shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - - shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - - shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - - shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - - shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - - signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - - sisteransi@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.4.tgz#386713f1ef688c7c0304dc4c0632898941cad2e3" - integrity sha512-/ekMoM4NJ59ivGSfKapeG+FWtrmWvA1p6FBZwXrqojw90vJu8lBmrTxCMuBCydKtkaUe2zt4PlxeTKpjwMbyig== - - slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - - snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - - snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - - snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - - source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - - source-map-support@^0.5.6: - version "0.5.16" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" - integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - - source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - - source-map@^0.5.0, source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - - source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - - source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - - split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - - sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - - sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - - stack-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" - integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== - - static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - - stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - - string-length@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837" - integrity sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA== - dependencies: - astral-regex "^1.0.0" - strip-ansi "^5.2.0" - - string-width@^2.0.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - - string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - - string.prototype.trimleft@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" - integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - - string.prototype.trimright@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" - integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - - strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - - strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - - strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - - strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - - strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - - strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - - strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - - supports-color@^5.3.0, supports-color@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - - supports-color@^7.0.0, supports-color@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" - integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== - dependencies: - has-flag "^4.0.0" - - supports-hyperlinks@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz#f663df252af5f37c5d49bbd7eeefa9e0b9e59e47" - integrity sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA== - dependencies: - has-flag "^4.0.0" - supports-color "^7.0.0" - - symbol-tree@^3.2.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - - term-size@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" - integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= - dependencies: - execa "^0.7.0" - - terminal-link@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" - integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== - dependencies: - ansi-escapes "^4.2.1" - supports-hyperlinks "^2.0.0" - - test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - - throat@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" - integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== - - timed-out@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= - - tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= - - to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - - to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - - to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - - to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - - to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - - touch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" - integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== - dependencies: - nopt "~1.0.10" - - tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - - tough-cookie@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" - integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== - dependencies: - ip-regex "^2.1.0" - psl "^1.1.28" - punycode "^2.1.1" - - tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= - dependencies: - punycode "^2.1.0" - - ts-jest@^25.2.1: - version "25.2.1" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.2.1.tgz#49bf05da26a8b7fbfbc36b4ae2fcdc2fef35c85d" - integrity sha512-TnntkEEjuXq/Gxpw7xToarmHbAafgCaAzOpnajnFC6jI7oo1trMzAHA04eWpc3MhV6+yvhE8uUBAmN+teRJh0A== - dependencies: - bs-logger "0.x" - buffer-from "1.x" - fast-json-stable-stringify "2.x" - json5 "2.x" - lodash.memoize "4.x" - make-error "1.x" - mkdirp "0.x" - resolve "1.x" - semver "^5.5" - yargs-parser "^16.1.0" - - tslib@^1.10.0, tslib@^1.8.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" - integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== - - tslint-config-prettier@^1.18.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz#75f140bde947d35d8f0d238e0ebf809d64592c37" - integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg== - - tslint@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-6.1.0.tgz#c6c611b8ba0eed1549bf5a59ba05a7732133d851" - integrity sha512-fXjYd/61vU6da04E505OZQGb2VCN2Mq3doeWcOIryuG+eqdmFUXTYVwdhnbEu2k46LNLgUYt9bI5icQze/j0bQ== - dependencies: - "@babel/code-frame" "^7.0.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^4.0.1" - glob "^7.1.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - mkdirp "^0.5.1" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.10.0" - tsutils "^2.29.0" - - tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - - tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - - tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - - type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - - type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - - type-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== - - typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - - typescript@3.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" - integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== - - undefsafe@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae" - integrity sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A== - dependencies: - debug "^2.2.0" - - union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - - unique-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" - integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= - dependencies: - crypto-random-string "^1.0.0" - - unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - - unzip-response@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" - integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= - - update-notifier@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" - integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== - dependencies: - boxen "^1.2.1" - chalk "^2.0.1" - configstore "^3.0.0" - import-lazy "^2.1.0" - is-ci "^1.0.10" - is-installed-globally "^0.1.0" - is-npm "^1.0.0" - latest-version "^3.0.0" - semver-diff "^2.0.0" - xdg-basedir "^3.0.0" - - uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - - urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - - url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= - dependencies: - prepend-http "^1.0.1" - - use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - - util.promisify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" - integrity sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.2" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.0" - - uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - - v8-to-istanbul@^4.0.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.2.tgz#387d173be5383dbec209d21af033dcb892e3ac82" - integrity sha512-G9R+Hpw0ITAmPSr47lSlc5A1uekSYzXxTMlFxso2xoffwo4jQnzbv1p9yXIinO8UMZKfAFewaCHwWvnH4Jb4Ug== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - source-map "^0.7.3" - - verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - - w3c-hr-time@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - - w3c-xmlserializer@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" - integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== - dependencies: - domexception "^1.0.1" - webidl-conversions "^4.0.2" - xml-name-validator "^3.0.0" - - walker@^1.0.7, walker@~1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= - dependencies: - makeerror "1.0.x" - - webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - - whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - - whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - - whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - - which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - - which@^1.2.9, which@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - - which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - - widest-line@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" - integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== - dependencies: - string-width "^2.1.1" - - word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - - wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - - wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - - write-file-atomic@^2.0.0: - version "2.4.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" - integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - - write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - - ws@^7.0.0: - version "7.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" - integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== - - xdg-basedir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" - integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= - - xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - - xmlchars@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== - - y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== - - yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - - yargs-parser@^16.1.0: - version "16.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1" - integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - - yargs-parser@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.0.tgz#1b0ab1118ebd41f68bb30e729f4c83df36ae84c3" - integrity sha512-o/Jr6JBOv6Yx3pL+5naWSoIA2jJ+ZkMYQG/ie9qFbukBe4uzmBatlXFOiu/tNKRWEtyf+n5w7jc/O16ufqOTdQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - - yargs@^15.0.0: - version "15.3.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.0.tgz#403af6edc75b3ae04bf66c94202228ba119f0976" - integrity sha512-g/QCnmjgOl1YJjGsnUg2SatC7NUYEiLXJqxNOQU9qSpjzGtGXda9b+OKccr1kLTy8BN9yqEyqfq5lxlwdc13TA== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.0" diff --git a/yarn.lock b/yarn.lock index 76e2e0c8a..48131e7df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -325,6 +325,103 @@ "@types/yargs" "^15.0.0" chalk "^3.0.0" +"@octokit/auth-token@^2.4.0": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.3.tgz#b868b5f2366533a7e62933eaa1181a8924228cc4" + integrity sha512-fdGoOQ3kQJh+hrilc0Plg50xSfaCKOeYN9t6dpJKXN9BxhhfquL0OzoQXg3spLYymL5rm29uPeI3KEXRaZQ9zg== + dependencies: + "@octokit/types" "^5.0.0" + +"@octokit/core@^3.0.0": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.2.1.tgz#9e04df3f4e7f825ac0559327490ce34299140af5" + integrity sha512-XfFSDDwv6tclUenS0EmB6iA7u+4aOHBT1Lz4PtQNQQg3hBbNaR/+Uv5URU+egeIuuGAiMRiDyY92G4GBOWOqDA== + dependencies: + "@octokit/auth-token" "^2.4.0" + "@octokit/graphql" "^4.3.1" + "@octokit/request" "^5.4.0" + "@octokit/types" "^5.0.0" + before-after-hook "^2.1.0" + universal-user-agent "^6.0.0" + +"@octokit/endpoint@^6.0.1": + version "6.0.9" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.9.tgz#c6a772e024202b1bd19ab69f90e0536a2598b13e" + integrity sha512-3VPLbcCuqji4IFTclNUtGdp9v7g+nspWdiCUbK3+iPMjJCZ6LEhn1ts626bWLOn0GiDb6j+uqGvPpqLnY7pBgw== + dependencies: + "@octokit/types" "^5.0.0" + is-plain-object "^5.0.0" + universal-user-agent "^6.0.0" + +"@octokit/graphql@^4.3.1": + version "4.5.7" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.5.7.tgz#f4562dcd9e80ea94602068e85aefac19a88f8578" + integrity sha512-Gk0AR+DcwIK/lK/GX+OQ99UqtenQhcbrhHHfOYlrCQe17ADnX3EKAOKRsAZ9qZvpi5MuwWm/Nm+9aO2kTDSdyA== + dependencies: + "@octokit/request" "^5.3.0" + "@octokit/types" "^5.0.0" + universal-user-agent "^6.0.0" + +"@octokit/plugin-paginate-rest@^2.2.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.0.tgz#03416396e7a227b268c5b827365238f620a9c5c1" + integrity sha512-o+O8c1PqsC5++BHXfMZabRRsBIVb34tXPWyQLyp2IXq5MmkxdipS7TXM4Y9ldL1PzY9CTrCsn/lzFFJGM3oRRA== + dependencies: + "@octokit/types" "^5.5.0" + +"@octokit/plugin-request-log@^1.0.0": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz#394d59ec734cd2f122431fbaf05099861ece3c44" + integrity sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg== + +"@octokit/plugin-rest-endpoint-methods@4.2.1": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.1.tgz#8224833a45c3394836dc6e86f1e6c49269a2c350" + integrity sha512-QyFr4Bv807Pt1DXZOC5a7L5aFdrwz71UHTYoHVajYV5hsqffWm8FUl9+O7nxRu5PDMtB/IKrhFqTmdBTK5cx+A== + dependencies: + "@octokit/types" "^5.5.0" + deprecation "^2.3.1" + +"@octokit/request-error@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.0.3.tgz#b51b200052bf483f6fa56c9e7e3aa51ead36ecd8" + integrity sha512-GgD5z8Btm301i2zfvJLk/mkhvGCdjQ7wT8xF9ov5noQY8WbKZDH9cOBqXzoeKd1mLr1xH2FwbtGso135zGBgTA== + dependencies: + "@octokit/types" "^5.0.1" + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^5.3.0", "@octokit/request@^5.4.0": + version "5.4.10" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.10.tgz#402d2c53768bde12b99348329ba4129746aebb9c" + integrity sha512-egA49HkqEORVGDZGav1mh+VD+7uLgOxtn5oODj6guJk0HCy+YBSYapFkSLFgeYj3Fr18ZULKGURkjyhkAChylw== + dependencies: + "@octokit/endpoint" "^6.0.1" + "@octokit/request-error" "^2.0.0" + "@octokit/types" "^5.0.0" + deprecation "^2.0.0" + is-plain-object "^5.0.0" + node-fetch "^2.6.1" + once "^1.4.0" + universal-user-agent "^6.0.0" + +"@octokit/rest@^18.0.0": + version "18.0.9" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.0.9.tgz#964d707d914eb34b1787895fdcacff96de47844d" + integrity sha512-CC5+cIx974Ygx9lQNfUn7/oXDQ9kqGiKUC6j1A9bAVZZ7aoTF8K6yxu0pQhQrLBwSl92J6Z3iVDhGhGFgISCZg== + dependencies: + "@octokit/core" "^3.0.0" + "@octokit/plugin-paginate-rest" "^2.2.0" + "@octokit/plugin-request-log" "^1.0.0" + "@octokit/plugin-rest-endpoint-methods" "4.2.1" + +"@octokit/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b" + integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ== + dependencies: + "@types/node" ">= 8" + "@sinonjs/commons@^1.7.0": version "1.7.1" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.7.1.tgz#da5fd19a5f71177a53778073978873964f49acf1" @@ -370,6 +467,11 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/comment-json@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/comment-json/-/comment-json-1.1.1.tgz#b4ae889912a93e64619f97989aecaff8ce889dca" + integrity sha512-U70oEqvnkeSSp8BIJwJclERtT13rd9ejK7XkIzMCQQePZe3VW1b7iQggXyW4ZvfGtGeXD0pZw24q5iWNe++HqQ== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -398,6 +500,11 @@ jest-diff "^25.1.0" pretty-format "^25.1.0" +"@types/node@>= 8": + version "14.14.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.6.tgz#146d3da57b3c636cc0d1769396ce1cfa8991147f" + integrity sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw== + "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" @@ -657,6 +764,11 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +before-after-hook@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" + integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== + binary-extensions@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" @@ -909,6 +1021,21 @@ commander@^2.12.1: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + +comment-json@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/comment-json/-/comment-json-3.0.3.tgz#0cadacd6278602b57b8c51b1814dc5d311d228c4" + integrity sha512-P7XwYkC3qjIK45EAa9c5Y3lR7SMXhJqwFdWg3niAIAcbk3zlpKDdajV8Hyz/Y3sGNn3l+YNMl8A2N/OubSArHg== + dependencies: + core-util-is "^1.0.2" + esprima "^4.0.1" + has-own-prop "^2.0.0" + repeat-string "^1.6.1" + component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -943,7 +1070,7 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-util-is@1.0.2: +core-util-is@1.0.2, core-util-is@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= @@ -1097,6 +1224,29 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= +denoify@^0.5.12: + version "0.5.12" + resolved "https://registry.yarnpkg.com/denoify/-/denoify-0.5.12.tgz#a5575abd32e693f1abb6ae45522536e442320054" + integrity sha512-JUpYtwp3QUhgNbF+187Zjoqv+1nSNfvVL29RJr4QHPbSwm8KJCs5KjZWPegxcGZ+0BOPU66nQNDT9bFrjCqVEA== + dependencies: + "@octokit/rest" "^18.0.0" + "@types/comment-json" "^1.1.1" + commander "^4.1.1" + comment-json "^3.0.2" + evt "^1.7.13" + get-github-default-branch-name "^0.0.4" + gitignore-parser "0.0.2" + glob "^7.1.6" + node-fetch "^2.6.0" + path-depth "^1.0.0" + scripting-tools "^0.19.13" + url-join "^4.0.1" + +deprecation@^2.0.0, deprecation@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" @@ -1209,6 +1359,14 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +evt@^1.7.13: + version "1.9.2" + resolved "https://registry.yarnpkg.com/evt/-/evt-1.9.2.tgz#c68946f16474564482bce07b8859a3ac4700682f" + integrity sha512-eqdkqaF00OfATCkkg1R1m3ZVQpsY0AbZVe3RZ4T7Na1x88f9lesj/Vp3a1XWqXUIiXMxmFUcs/m0N08emij9Mg== + dependencies: + minimal-polyfills "^2.1.5" + run-exclusive "^2.2.14" + exec-sh@^0.3.2: version "0.3.4" resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" @@ -1428,6 +1586,14 @@ get-caller-file@^2.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-github-default-branch-name@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/get-github-default-branch-name/-/get-github-default-branch-name-0.0.4.tgz#9c0c6606ba606edb136d2fd26e4d515b69f2de90" + integrity sha512-ltOGC9Jk0k8boe48Gk7SkJErwxt7MhwXtbNrBUyNCZcwcXSmGRdkKb2u0YO250PGvPsUtdqRjg7lVuIk1VtpCg== + dependencies: + "@octokit/rest" "^18.0.0" + scripting-tools "^0.19.12" + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -1459,6 +1625,11 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +gitignore-parser@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/gitignore-parser/-/gitignore-parser-0.0.2.tgz#f61259b985dd91414b9a7168faef9171c2eec5df" + integrity sha1-9hJZuYXdkUFLmnFo+u+RccLuxd8= + glob-parent@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" @@ -1466,7 +1637,7 @@ glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1540,6 +1711,11 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-own-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-own-prop/-/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af" + integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== + has-symbols@^1.0.0, has-symbols@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" @@ -1827,6 +2003,11 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + is-redirect@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" @@ -2567,6 +2748,11 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +minimal-polyfills@^2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/minimal-polyfills/-/minimal-polyfills-2.1.5.tgz#19c91384dc56f94fe5f094eceac708eb6380fe0a" + integrity sha512-VUpTs1DaSA/M90eZ2yhl9WBSsaY0RG5V+Qo+NDd/Z6c0p4JzfHg4Vh5U+9U/8iuGt7S/9m2+LMLBaiaFg5QM5w== + minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -2641,6 +2827,11 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== +node-fetch@^2.6.0, node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -2852,6 +3043,11 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= +path-depth@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-depth/-/path-depth-1.0.0.tgz#88cf881097e171b8b54d450d2167ea76063d3086" + integrity sha512-dEiwdXAQyLvOi6ktLqhFhjVelJiVsdp2xBX3BaUtYCCkMRZTwUiq7cha+A0myvAVXRHbXfjhfTf4mNoAWzm2iA== + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -3152,6 +3348,13 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== +run-exclusive@^2.2.14: + version "2.2.14" + resolved "https://registry.yarnpkg.com/run-exclusive/-/run-exclusive-2.2.14.tgz#4f41dc7843e091f10991f8708fce87b09022a0ce" + integrity sha512-NHaQfB3zPJFx7p4M06AcmoK8xz/h8YDMCdy3jxfyoC9VqIbl1U+DiVjUuAYZBRMwvj5qkQnOUGfsmyUC4k46dg== + dependencies: + minimal-polyfills "^2.1.5" + safe-buffer@^5.0.1, safe-buffer@^5.1.2: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" @@ -3196,6 +3399,11 @@ saxes@^3.1.9: dependencies: xmlchars "^2.1.1" +scripting-tools@^0.19.12, scripting-tools@^0.19.13: + version "0.19.13" + resolved "https://registry.yarnpkg.com/scripting-tools/-/scripting-tools-0.19.13.tgz#836df7d9c2ec99aea91984d1d5b2bd110670afec" + integrity sha512-d09H8vzSVa8p4XUTJqHZDbjKDyl5TG3SyPfNPUUkfyOwjwykStmfK8AXyWq7VRWjcgzTpkTiJ9uMk1NytMQY7w== + semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" @@ -3724,6 +3932,11 @@ unique-string@^1.0.0: dependencies: crypto-random-string "^1.0.0" +universal-user-agent@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" + integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -3765,6 +3978,11 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= +url-join@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" + integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== + url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73"