This is an automated email from the ASF dual-hosted git repository.

randall pushed a commit to branch esm-tests
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git

commit 8a40a3f9174bb83ed2f8c16682f31c226143a193
Author: Randall Leeds <[email protected]>
AuthorDate: Sun Oct 31 22:38:30 2021 -0700

    Use the named exports of optimal-select
    
    When importing a CommonJS module from an ECAMAScript module, Node.js
    treats the exports object as the default export. Make the import of
    optimal-select more compliant by removing use of the transpiled default
    export in favor of named exports.
---
 packages/dom/src/css.ts              | 4 ++--
 packages/dom/src/optimal-select.d.ts | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/dom/src/css.ts b/packages/dom/src/css.ts
index 6123b5d..2946dc1 100644
--- a/packages/dom/src/css.ts
+++ b/packages/dom/src/css.ts
@@ -20,7 +20,7 @@
  * under the License.
  */
 
-import optimalSelect from 'optimal-select';
+import { select } from 'optimal-select';
 import type { CssSelector, Matcher } from '@apache-annotator/selector';
 import { ownerDocument } from './owner-document.js';
 import { toRange } from './to-range.js';
@@ -114,7 +114,7 @@ export async function describeCss(
   element: HTMLElement,
   scope: Node = element.ownerDocument,
 ): Promise<CssSelector> {
-  const selector = optimalSelect(element, { root: scope });
+  const selector = select(element, { root: scope });
   return {
     type: 'CssSelector',
     value: selector,
diff --git a/packages/dom/src/optimal-select.d.ts 
b/packages/dom/src/optimal-select.d.ts
index ff7d826..bcf47d1 100644
--- a/packages/dom/src/optimal-select.d.ts
+++ b/packages/dom/src/optimal-select.d.ts
@@ -22,7 +22,7 @@
 
 // Partial declaration, just to cover the pieces we need.
 declare module 'optimal-select' {
-  export default function optimalSelect(
+  export function select(
     element: Element,
     options: {
       root: Node,

Reply via email to