From 36b8d07a1695e46ab4b7c717087512e43ced67db Mon Sep 17 00:00:00 2001 From: raphi Date: Sat, 24 Oct 2026 14:46:03 +0200 Subject: [PATCH] fix: allow patch.create origin after opts in type declarations The second overload declared a required `origin` after an optional `opts`, a TS1016 error for consumers with skipLibCheck false. `opts` is now `PKPatchUpdateOptions | undefined`, matching the runtime signature. Also fixes the README example (missing comma) and the rollup JSON import (`assert` -> `with`, rejected by Node 22). Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- rollup.config.js | 2 +- src/placekit.d.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ed3dec3..0535345 100644 --- a/README.md +++ b/README.md @@ -348,7 +348,7 @@ pk.patch.create(record, { status: 'approved' }).then((record) => { // Fixing an existing location pk.patch.create( { population: 3849000 }, - { status: 'approved' } + { status: 'approved' }, originalRecord, // original record from `pk.search` or `pk.reverse` ).then((record) => { console.log(record); diff --git a/package-lock.json b/package-lock.json index c1003f0..7f52922 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@placekit/client-js", - "version": "2.3.0", + "version": "2.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@placekit/client-js", - "version": "2.3.0", + "version": "2.3.1", "license": "MIT", "devDependencies": { "@rollup/plugin-replace": "^5.0.5", diff --git a/package.json b/package.json index 3ec4c0e..82fc3df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@placekit/client-js", - "version": "2.3.0", + "version": "2.3.1", "author": "PlaceKit ", "description": "PlaceKit JavaScript client", "keywords": [ diff --git a/rollup.config.js b/rollup.config.js index 0e7d480..4b9f118 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,7 +2,7 @@ import replace from '@rollup/plugin-replace'; import cleanup from 'rollup-plugin-cleanup'; import copy from 'rollup-plugin-copy'; -import pkg from './package.json' assert { type: 'json' }; +import pkg from './package.json' with { type: 'json' }; const banner = [ `/*! ${pkg.name} v${pkg.version}`, '© placekit.io', diff --git a/src/placekit.d.ts b/src/placekit.d.ts index a7af2ca..254b99b 100644 --- a/src/placekit.d.ts +++ b/src/placekit.d.ts @@ -18,7 +18,7 @@ export interface PKClient { create(update: PKPatchUpdate, opts?: PKPatchUpdateOptions): Promise; create( update: AtLeastOne, - opts?: PKPatchUpdateOptions, + opts: PKPatchUpdateOptions | undefined, origin: PKResult, ): Promise; get(id: string, language?: string): Promise;