Skip to content
This repository was archived by the owner on Aug 21, 2026. It is now read-only.
Open
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
15 changes: 8 additions & 7 deletions .github/workflows/benchmark-14.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This is a basic workflow to help you get started with Actions

name: benchmark-14

on:
push:
branches: [master]
Expand All @@ -13,14 +12,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
node-version: [26.x, 24.x, 22.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- name: install
cache: npm
- name: Install dependencies
run: npm ci
- name: "Benchmark"
- name: Benchmark
run: npm run test:benchmark
13 changes: 8 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This is a basic workflow to help you get started with Actions

name: lint

on:
push:
branches: [master]
Expand All @@ -11,10 +10,14 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v1
- name: install
uses: actions/setup-node@v7
with:
node-version: "26.x"
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This is a basic workflow to help you get started with Actions

name: test

on:
push:
branches: [master]
Expand All @@ -12,19 +11,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
node-version: [26.x]
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- name: install
cache: npm
- name: Install dependencies
run: npm ci
- name: 'Test'
uses: paambaati/codeclimate-action@v2.6.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm run test:coverage
coverageLocations: ${{github.workspace}}/coverage/lcov.info:lcov
- name: Run tests with coverage
run: npm run test:coverage
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[![Actions Status](https://github.com/Codibre/augmentative-iterable/workflows/test/badge.svg)](https://github.com/Codibre/augmentative-iterable/actions)
[![Actions Status](https://github.com/Codibre/augmentative-iterable/workflows/lint/badge.svg)](https://github.com/Codibre/augmentative-iterable/actions)
[![Test Coverage](https://api.codeclimate.com/v1/badges/950a74d0533a041725ce/test_coverage)](https://codeclimate.com/github/Codibre/augmentative-iterable/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/950a74d0533a041725ce/maintainability)](https://codeclimate.com/github/Codibre/augmentative-iterable/maintainability)
[![Packages](https://david-dm.org/Codibre/augmentative-iterable.svg)](https://david-dm.org/Codibre/augmentative-iterable)
[![npm version](https://badge.fury.io/js/augmentative-iterable.svg)](https://badge.fury.io/js/augmentative-iterable)

This library offers some operations over iterables with the intention of a better performance overall.
Expand Down
8 changes: 4 additions & 4 deletions lib/augmentative-async-iterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ function resolveState(augmentList, value) {
function recursive(chain) {
while (ai < length) {
ai++;
const next = augmentList[ai];
const entry = augmentList[ai];
if (ai !== 0) {
if (type === YIELD) value = chain;
else if (!chain) {
state = type;
break;
}
}
if (state === YIELD && next) {
type = next.type;
chain = next.action ? next.action(value) : value;
if (state === YIELD && entry) {
type = entry.type;
chain = entry.action ? entry.action(value) : value;
}
if (isPromiseLike(chain)) return chain.then(recursive);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/augmentative-iterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ function resolveState(augmentList, value) {
let ai = 0;
const { length } = augmentList;
while (ai < length) {
const { action, type } = augmentList[ai];
const actionResult = action ? action(value) : value;
if (type === YIELD) value = actionResult;
else if (!actionResult) return type === STOP ? end : undefined;
const entry = augmentList[ai];
const actionResult = entry.action ? entry.action(value) : value;
if (entry.type === YIELD) value = actionResult;
else if (!actionResult) return entry.type === STOP ? end : undefined;
ai++;
}
return {
Expand Down
Loading