ajv-validator / ajv-validator/ajv

Using Ajv2019 and format does not seem to work with deno

Offen
#2,231 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
compatibility
Vorherrschende Sprache
TypeScript
Sterne
14.8k
Forks
1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**The version of Ajv you are using**

Latest available on npm (8.12.0)

**The environment you have the problem with**

Deno 1.31.1 (latest as of today)

**Your code (please make it as small as possible to reproduce the issue)**
I use the 'standard' idiom to for Ajv2019 and various formats with node+Typescript:

```
import Ajv2019, { ErrorObject} from 'ajv/dist/2019';
import addFormats from 'ajv-formats';
...
const ajv = new Ajv2019({allErrors: true, verbose: true});
addFormats(ajv);
```

and that works well. One would expect that with the latest version of deno (which can use npm directly), one could
simply say

```
import Ajv2019, { ErrorObject} from 'npm:ajv/dist/2019';
import addFormats from 'npm:ajv-formats';
```

but deno complains on not finding `dist/2019` and that `addFormat` cannot be used as function. I have tried other CDNs, but did not work. Note that the "default" Ajv access seems to work.

Is there any way to access Ajv2019?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.