# @types/json-schema-compare

> TypeScript definitions for json-schema-compare

Latest version **0.2.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/json-schema-compare
pnpm add @types/json-schema-compare
yarn add @types/json-schema-compare
bun add @types/json-schema-compare
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2023-11-07 |
| First published | 2019-11-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/json-schema-compare
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema-compare
- npm.io page: https://npm.io/package/@types/json-schema-compare

## Dependencies (1)

- [@types/json-schema](https://npm.io/package/@types/json-schema.md) *

## Recent versions

- 0.2.4 (latest) — 2023-11-07
- 0.2.1 (ts3.6) — 2021-07-08
- 0.2.0 (ts2.8) — 2019-11-05
- 0.2.3 — 2023-10-18
- 0.2.2 — 2023-09-15

## README

# Installation
> `npm install --save @types/json-schema-compare`

# Summary
This package contains type definitions for json-schema-compare (https://github.com/mokkabonna/json-schema-compare#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema-compare.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema-compare/index.d.ts)
````ts
import { JSONSchema4, JSONSchema6, JSONSchema6Definition, JSONSchema7, JSONSchema7Definition } from "json-schema";

export = compare;

type JSONSchemaComparee = JSONSchema4 | JSONSchema6Definition | JSONSchema7Definition | undefined;
type KnownKeys<T> = {
    [K in keyof T]: string extends K ? never : K;
} extends { [_ in keyof T]: infer U } ? U : never;
/**
 * The `string & {''?: never}` is a workaround for
 * [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729).
 * It will be removed as soon as it's not needed anymore.
 */
type JSONSchemaKeys =
    | KnownKeys<JSONSchema4>
    | keyof JSONSchema6
    | keyof JSONSchema7
    | string & { ""?: never | undefined };
interface Options {
    /**
     * Ignores certain keywords, useful to exclude meta keywords like title,
     * description etc or custom keywords. If all you want to know if they are
     * the same in terms of validation keywords.
     *
     * @default []
     */
    ignore?: JSONSchemaKeys[] | undefined;
}

/**
 * Compare json schemas correctly.
 *
 * - Ignores sort for arrays where sort does not matter, like required, enum, type, anyOf, oneOf, anyOf, dependencies (if array)
 * - Compares correctly type when array or string
 * - Ignores duplicate values before comparing
 * - For schemas and sub schemas `undefined`, `true` and `{}` are equal
 * - For minLength, minItems and minProperties `undefined` and `0` are equal
 * - For uniqueItems, `undefined` and `false` are equal
 */
declare function compare(a: JSONSchemaComparee, b: JSONSchemaComparee, options?: Options): boolean;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: [@types/json-schema](https://npmjs.com/package/@types/json-schema)

# Credits
These definitions were written by [Emily Marigold Klassen](https://github.com/forivall).

---
_Source: https://npm.io/package/@types/json-schema-compare · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
