Skip to content

Commit

Permalink
🤖 config(xo): Configure import/order.
Browse files Browse the repository at this point in the history
These changes were automatically generated by a transform whose code can be found at:
  - https://github.com/make-github-pseudonymous-again/rejuvenate/blob/31b7e48f29789fa2e2ad9e16013ff277c3bbca57/src/transforms/xo:config-import-order.js
Please contact the author of the transform if you believe there was an error.
  • Loading branch information
a-flying-potato authored and make-github-pseudonymous-again committed Feb 28, 2024
1 parent f8de5f6 commit bec1457
Show file tree
Hide file tree
Showing 5 changed files with 1,000 additions and 603 deletions.
40 changes: 38 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"pinst": "3.0.0",
"power-assert": "1.6.1",
"regenerator-runtime": "0.14.1",
"xo": "0.53.1"
"xo": "0.57.0"
},
"ava": {
"files": [
Expand Down Expand Up @@ -228,7 +228,43 @@
}
],
"unicorn/prefer-node-protocol": "off",
"unicorn/prevent-abbreviations": "off"
"unicorn/prevent-abbreviations": "off",
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
],
"pathGroups": [
{
"pattern": "ava",
"group": "external",
"position": "before"
},
{
"pattern": "#module",
"group": "index",
"position": "after"
}
],
"pathGroupsExcludedImportTypes": [],
"distinctGroup": true,
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"orderImportKind": "asc",
"caseInsensitive": false
},
"warnOnUnassignedImports": true
}
]
},
"overrides": [
{
Expand Down
21 changes: 9 additions & 12 deletions src/diagonal.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {deque} from '@data-structure/deque';

import {count} from '@iterable-iterator/count';
import {iter} from '@iterable-iterator/iter';
import {_next} from '@iterable-iterator/next';
import {count} from '@iterable-iterator/count';

/**
* Computes the product of two iterables in a way that allows for one or both
Expand Down Expand Up @@ -35,12 +34,7 @@ export default function* diagonal(A, B) {
let _a = _next(itA);
let _b = _next(itB);
if (!_a.done) {
// eslint-disable-next-line no-negated-condition
if (!_b.done) {
_A.append(_a.value);
_B.append(_b.value);
for (let i = 0; i <= n; ++i) yield [_A.get(i), _B.get(n - i)];
} else {
if (_b.done) {
if (_B.length === 0) return;
do {
_A.append(_a.value);
Expand All @@ -50,9 +44,14 @@ export default function* diagonal(A, B) {
} while (!_a.done);

break;
} else {
_A.append(_a.value);
_B.append(_b.value);
for (let i = 0; i <= n; ++i) yield [_A.get(i), _B.get(n - i)];
}
// eslint-disable-next-line no-negated-condition
} else if (!_b.done) {
} else if (_b.done) {
break;
} else {
if (_A.length === 0) return;
do {
_B.append(_b.value);
Expand All @@ -61,8 +60,6 @@ export default function* diagonal(A, B) {
_b = _next(itB);
} while (!_b.done);

break;
} else {
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/product.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {list} from '@iterable-iterator/list';
import {reversed} from '@iterable-iterator/reversed';
import {ncycle} from '@iterable-iterator/cycle';
import {list} from '@iterable-iterator/list';
import {map} from '@iterable-iterator/map';
import {reversed} from '@iterable-iterator/reversed';

import _product from './_product.js';

Expand Down
11 changes: 5 additions & 6 deletions test/src/diagonal.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import test from 'ava';

import {increasing} from '@total-order/primitive';
import {lexicographical} from '@total-order/lex';

import {take} from '@iterable-iterator/slice';
import {sorted} from '@iterable-iterator/sorted';
import {count} from '@iterable-iterator/count';
import {list} from '@iterable-iterator/list';
import {range} from '@iterable-iterator/range';
import {count} from '@iterable-iterator/count';
import {take} from '@iterable-iterator/slice';
import {sorted} from '@iterable-iterator/sorted';
import {lexicographical} from '@total-order/lex';
import {increasing} from '@total-order/primitive';

import {product, diagonal} from '#module';

Expand Down
Loading

0 comments on commit bec1457

Please sign in to comment.