Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix punycode deprecation warning #2377

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/compile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import N from "./names"
import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve"
import {schemaHasRulesButRef, unescapeFragment} from "./util"
import {validateFunctionCode} from "./validate"
import * as URI from "uri-js"
import * as URI from "toad-uri-js"
import {JSONType} from "./rules"

export type SchemaRefs = {
Expand Down
2 changes: 1 addition & 1 deletion lib/compile/resolve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {AnySchema, AnySchemaObject, UriResolver} from "../types"
import type Ajv from "../ajv"
import type {URIComponents} from "uri-js"
import type {URIComponents} from "toad-uri-js"
import {eachItem} from "./util"
import * as equal from "fast-deep-equal"
import * as traverse from "json-schema-traverse"
Expand Down Expand Up @@ -102,7 +102,7 @@
traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => {
if (parentJsonPtr === undefined) return
const fullPath = pathPrefix + jsonPtr
let baseId = baseIds[parentJsonPtr]

Check warning on line 105 in lib/compile/resolve.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

'baseId' is already declared in the upper scope on line 93 column 61

Check warning on line 105 in lib/compile/resolve.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

'baseId' is already declared in the upper scope on line 93 column 61

Check warning on line 105 in lib/compile/resolve.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

'baseId' is already declared in the upper scope on line 93 column 61
if (typeof sch[schemaId] == "string") baseId = addRef.call(this, sch[schemaId])
addAnchor.call(this, sch.$anchor)
addAnchor.call(this, sch.$dynamicAnchor)
Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/uri.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as uri from "uri-js"
import * as uri from "toad-uri-js"

type URI = typeof uri & {code: string}
;(uri as URI).code = 'require("ajv/dist/runtime/uri").default'
Expand Down
2 changes: 1 addition & 1 deletion lib/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as URI from "uri-js"
import * as URI from "toad-uri-js"
import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen"
import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile"
import type {JSONType} from "../compile/rules"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"fast-deep-equal": "^3.1.1",
"json-schema-traverse": "^1.0.0",
"require-from-string": "^2.0.2",
"uri-js": "^4.2.2"
"toad-uri-js": "^5.0.0"
},
"devDependencies": {
"@ajv-validator/config": "^0.3.0",
Expand Down