Tweaks to cartesian rewrite
- remove type declaration of dropped dependency
- tiny code simplifications
diff --git a/packages/dom/src/range/cartesian.ts b/packages/dom/src/range/cartesian.ts
index 8c60cde..37e9876 100644
--- a/packages/dom/src/range/cartesian.ts
+++ b/packages/dom/src/range/cartesian.ts
@@ -33,7 +33,7 @@
for await (const value of iterable) {
yield { index, value };
}
- return { index, value: undefined };
+ return { index };
};
return generator();
});
@@ -76,7 +76,7 @@
// Synchronously compute and yield tuples of the partial product.
yield* scratch.reduce(
- (a, b) => a.flatMap((v) => Array.from(b).map((w) => [...v, w])),
+ (a, b) => a.flatMap((v) => b.map((w) => [...v, w])),
[[]] as T[][],
);
}
diff --git a/packages/dom/src/types/cartesian.d.ts b/packages/dom/src/types/cartesian.d.ts
deleted file mode 100644
index 9578e84..0000000
--- a/packages/dom/src/types/cartesian.d.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * @license
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-declare module 'cartesian' {
- export default function cartesian<T>(
- list: Array<Array<T>> | { [k: string]: Array<T> },
- ): Array<Array<T>>;
-}