Skip to content

Commit

Permalink
fix: import with .js extension (#18)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kevinschaul authored Jul 27, 2023
1 parent f2efbe5 commit b23edfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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})`);
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit b23edfd

Please sign in to comment.