From b23edfdc42648c756e066fa15e01f4f141a878a8 Mon Sep 17 00:00:00 2001 From: Kevin Schaul Date: Thu, 27 Jul 2023 17:50:20 -0500 Subject: [PATCH] fix: import with .js extension (#18) * fix: import with .js extension ES modules with relative imports must include extensions. `.js` is the extension of the output of `.ts`, so apparently this is the way. For more detail see https://www.typescriptlang.org/docs/handbook/esm-node.html * docs: fix transform code in example --- README.md | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 321b707..9993f2b 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ avoidOverlap.run( const selected = select(node); const [x, y] = selected .attr('transform') - .match(/([0-9]+)/g) + .match(/([0-9\-\.]+)/g) .map((d) => +d); select(node).attr('transform', `translate(${x + dx}, ${y + dy})`); diff --git a/src/index.ts b/src/index.ts index 87ad6e1..64c934e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import RBush from 'rbush'; import uniqWith from 'lodash/uniqWith.js'; -import { defaultDebugFunc } from './debug'; +import { defaultDebugFunc } from './debug.js'; export interface Bounds { x: number;