Skip to content

Drop ix lib. Node 22 has native iterator helper methods. #3426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"indent-string": "^5.0.0",
"ioredis": "^5.3.2",
"iso-3166-1": "^2.1.1",
"ix": "^5.0.0",
"jsonwebtoken": "^9.0.2",
"lazy-get-decorator": "^2.2.1",
"lodash": "npm:lodash-es@^4.17.21",
Expand Down
45 changes: 18 additions & 27 deletions src/common/xlsx.util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mapEntries, nonEnumerable } from '@seedcompany/common';
import { Iterable } from 'ix';
import { LazyGetter as Once } from 'lazy-get-decorator';
import { assert } from 'ts-essentials';
import {
Expand Down Expand Up @@ -274,38 +273,30 @@ abstract class Rangable<TSheet extends Sheet = Sheet> {
* Iterate through the rows in this range.
* Cell column is always the starting column.
*/
walkDown(): Iterable<Cell<TSheet>> {
return Iterable.from(
function* (this: Rangable<TSheet>) {
let current = this.start.row;
while (current <= this.end.row) {
const cell = current.cell(this.start.column);
if (cell.exists) {
yield cell;
}
current = current.move(1);
}
}.call(this),
);
*walkDown() {
let current = this.start.row;
while (current <= this.end.row) {
const cell = current.cell(this.start.column);
if (cell.exists) {
yield cell;
}
current = current.move(1);
}
}

/**
* Iterate through the columns in this range.
* Cell row is always the starting row.
*/
walkRight(): Iterable<Cell<TSheet>> {
return Iterable.from(
function* (this: Rangable<TSheet>) {
let current = this.start.column;
while (current <= this.end.column) {
const cell = current.cell(this.start.row);
if (cell.exists) {
yield cell;
}
current = current.move(1);
}
}.call(this),
);
*walkRight() {
let current = this.start.column;
while (current <= this.end.column) {
const cell = current.cell(this.start.row);
if (cell.exists) {
yield cell;
}
current = current.move(1);
}
}

get ref() {
Expand Down
3 changes: 0 additions & 3 deletions src/components/pnp/findStepColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { ProductStep as Step } from '../product/dto';
import { type PnpExtractionResult, PnpProblemType } from './extraction-result';
import { type PlanningSheet } from './planning-sheet';
import { type ProgressSheet } from './progress-sheet';
import 'ix/add/iterable-operators/filter.js';
import 'ix/add/iterable-operators/map.js';
import 'ix/add/iterable-operators/toarray.js';

/**
* Fuzzy match available steps to their column address.
Expand Down
20 changes: 1 addition & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4154,13 +4154,6 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:^13.7.4":
version: 13.13.52
resolution: "@types/node@npm:13.13.52"
checksum: 10c0/9224aaea219fe7f8b903039bb146d4c38b391d0166a8226a1efa2d43a35b5b7dddfe021c32941bb454a1543da94921c112687934da88e2a019f4bd44f9d517b5
languageName: node
linkType: hard

"@types/normalize-package-data@npm:^2.4.3":
version: 2.4.4
resolution: "@types/normalize-package-data@npm:2.4.4"
Expand Down Expand Up @@ -5901,7 +5894,6 @@ __metadata:
indent-string: "npm:^5.0.0"
ioredis: "npm:^5.3.2"
iso-3166-1: "npm:^2.1.1"
ix: "npm:^5.0.0"
jest: "npm:^29.7.0"
jsonwebtoken: "npm:^9.0.2"
lazy-get-decorator: "npm:^2.2.1"
Expand Down Expand Up @@ -9084,16 +9076,6 @@ __metadata:
languageName: node
linkType: hard

"ix@npm:^5.0.0":
version: 5.0.0
resolution: "ix@npm:5.0.0"
dependencies:
"@types/node": "npm:^13.7.4"
tslib: "npm:^2.3.0"
checksum: 10c0/2b9a1fd724fb9d42e2d0786ab03333148a776fe546cc7f27ed95d49c7d22231cc371bbc9b377a4f29cbaf8ac0cdc5ef80a21821e396cf5462f1d5b8f7a8f8624
languageName: node
linkType: hard

"jackspeak@npm:^3.1.2":
version: 3.4.3
resolution: "jackspeak@npm:3.4.3"
Expand Down Expand Up @@ -13632,7 +13614,7 @@ __metadata:
languageName: node
linkType: hard

"tslib@npm:2.8.1, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.8.1":
"tslib@npm:2.8.1, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.8.1":
version: 2.8.1
resolution: "tslib@npm:2.8.1"
checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62
Expand Down