Skip to content

Commit

Permalink
feat: swap uri-js for fork toad-uri-js
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoniangreen committed Jun 3, 2024
1 parent ee11011 commit b8425d6
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ Include human-readable messages in errors. `true` by default. `false` can be pas

### uriResolver

By default `uriResolver` is undefined and relies on the embedded uriResolver [uri-js](https://github.com/garycourt/uri-js). Pass an object that satisfies the interface [UriResolver](https://github.com/ajv-validator/ajv/blob/master/lib/types/index.ts) to be used in replacement. One alternative is [fast-uri](https://github.com/fastify/fast-uri).
By default `uriResolver` is undefined and relies on the embedded uriResolver [toad-uri-js](https://github.com/kibertoad/toad-uri-js). Pass an object that satisfies the interface [UriResolver](https://github.com/ajv-validator/ajv/blob/master/lib/types/index.ts) to be used in replacement. One alternative is [fast-uri](https://github.com/fastify/fast-uri).

### code <Badge text="v7" />

Expand Down
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
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.3",
"json-schema-traverse": "^1.0.0",
"require-from-string": "^2.0.2",
"uri-js": "^4.4.1"
"toad-uri-js": "^5.0.1"
},
"devDependencies": {
"@ajv-validator/config": "^0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion spec/resolve.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ uriResolvers.forEach((resolver) => {
if (resolver !== undefined) {
describeTitle = "fast-uri resolver"
} else {
describeTitle = "uri-js resolver"
describeTitle = "toad-uri-js resolver"
}
describe(describeTitle, () => {
describe("resolve", () => {
Expand Down

0 comments on commit b8425d6

Please sign in to comment.