diff --git a/endpoints/Endpoint.ts b/endpoints/Endpoint.ts index 874842d..9e82d93 100644 --- a/endpoints/Endpoint.ts +++ b/endpoints/Endpoint.ts @@ -2,7 +2,7 @@ import { HttpMethod, HttpHeader, HttpStatusCode, HttpClient } from "../http"; import { Serializer } from "../serializers"; import { ErrorHandler, NotFoundError } from "../errors"; import { LinkExtractor, Link } from "../links"; -import template from 'url-template'; +import uriTemplates from 'uri-templates'; export class Endpoint { /** @@ -200,8 +200,8 @@ export class Endpoint { * @throws {@link errors!NotFoundError}: No link template with the specified `rel` could be found. */ linkTemplate(rel: string, variables: { [key: string]: any; }): URL { - const tmpl = template.parse(this.getLinkTemplate(rel)) - return new URL(this.join(tmpl.expand(variables))) + const tmpl = uriTemplates(this.getLinkTemplate(rel)) + return new URL(this.join(tmpl.fill(variables))) } /** diff --git a/package-lock.json b/package-lock.json index 7d89757..63f520f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,12 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "url-template": "^2.0.8" + "uri-templates": "^0.2.0" }, "devDependencies": { "@types/jest": "30.0.0", "@types/node": "26.2.0", - "@types/url-template": "2.0.31", + "@types/uri-templates": "0.1.34", "jest": "30.4.2", "jest-environment-jsdom": "30.4.1", "jest-fetch-mock": "4.2.0", @@ -1445,10 +1445,10 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/url-template": { - "version": "2.0.31", - "resolved": "https://registry.npmjs.org/@types/url-template/-/url-template-2.0.31.tgz", - "integrity": "sha512-mXzP2L5FkK9b+MYqlKYSJG/1RTMFWZT1oBuQ6KPzSY3m1hwKks7PrHg+Yd3QkoedBUJO749JXvK3FgCgGGIx6Q==", + "node_modules/@types/uri-templates": { + "version": "0.1.34", + "resolved": "https://registry.npmjs.org/@types/uri-templates/-/uri-templates-0.1.34.tgz", + "integrity": "sha512-13v4r/Op3iEO1y6FvEHQjrUNnrNyO67SigdFC9n80sVfsrM2AWJRNYbE1pBs4/p87I7z1J979JGeLAo3rM1L/Q==", "dev": true, "license": "MIT" }, @@ -5071,10 +5071,11 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==" + "node_modules/uri-templates": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/uri-templates/-/uri-templates-0.2.0.tgz", + "integrity": "sha512-EWkjYEN0L6KOfEoOH6Wj4ghQqU7eBZMJqRHQnxQAq+dSEzRPClkWjf8557HkWQXF6BrAUoLSAyy9i3RVTliaNg==", + "license": "http://geraintluff.github.io/tv4/LICENSE.txt" }, "node_modules/v8-to-istanbul": { "version": "9.3.0", diff --git a/package.json b/package.json index 106bc2e..1da4a4a 100644 --- a/package.json +++ b/package.json @@ -30,15 +30,15 @@ "devDependencies": { "@types/node": "26.2.0", "@types/jest": "30.0.0", - "@types/url-template": "2.0.31", + "@types/uri-templates": "0.1.34", "jest": "30.4.2", "jest-environment-jsdom": "30.4.1", "jest-fetch-mock": "4.2.0", "ts-jest": "29.4.12", "typedoc": "0.28.20", - "typescript": "6.0.3" + "typescript": "7.0.2" }, "dependencies": { - "url-template": "^2.0.8" + "uri-templates": "^0.2.0" } } diff --git a/renovate.json b/renovate.json index dc52b81..eb7f92c 100644 --- a/renovate.json +++ b/renovate.json @@ -10,10 +10,6 @@ "matchPackagePatterns": ["^gittools"], "allowedVersions": "<4" }, - { - "matchPackagePatterns": ["url-template$"], - "allowedVersions": "<3" - }, { "groupName": "Dev dependencies", "matchDepTypes": ["devDependencies"],