Skip to content
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
9 changes: 5 additions & 4 deletions .github/actions/build-and-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ inputs:
cc-test-reporter-id:
description: 'Code Climate Test Reporter ID'
required: true
qlty-coverage-token:
description: 'QLTY Coverage Token'
required: true

runs:
using: 'composite'
Expand Down Expand Up @@ -97,11 +100,9 @@ runs:
shell: bash
run: pnpm run test:cov

- name: Submit Code Quality
uses: qltysh/qlty-action/coverage@v1
if: inputs.cc-test-reporter-id != ''
- uses: qltysh/qlty-action/coverage@v2
with:
token: ${{ inputs.cc-test-reporter-id }}
token: ${{ inputs.qlty-coverage-token }}
files: coverage/lcov.info

- name: Upload build artifacts
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:
- name: Build and Test
uses: ./.github/actions/build-and-test
with:
node-auth-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cc-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
node-auth-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cc-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
qlty-coverage-token: ${{ secrets.QLTY_COVERAGE_TOKEN }}

check-releases:
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- name: Build and Test
uses: ./.github/actions/build-and-test
with:
node-auth-token: ${{ secrets.GHA_PACKAGES }}
sonar-token: ${{ secrets.SONARCLOUD_TOKEN }}
cc-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
node-auth-token: ${{ secrets.GHA_PACKAGES }}
sonar-token: ${{ secrets.SONARCLOUD_TOKEN }}
cc-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
qlty-coverage-token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

# js-utils

Repo for useful js utilities

[![GitHub Issues](https://img.shields.io/github/issues/codibre/js-utils.svg)](https://github.com/codibre/js-utils/issues)
[![GitHub Stars](https://img.shields.io/github/stars/codibre/js-utils.svg)](https://github.com/codibre/js-utils/stargazers)
[![Maintainability](https://qlty.sh/gh/codibre/projects/js-utils/maintainability.svg)](https://qlty.sh/gh/codibre/projects/js-utils)
[![Code Coverage](https://qlty.sh/gh/codibre/projects/js-utils/coverage.svg)](https://qlty.sh/gh/codibre/projects/js-utils)

---

Expand Down
3 changes: 3 additions & 0 deletions libs/js-tuple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
A high-performance JavaScript library for managed nested maps, nested set and creating immutable, cached tuples that can be safely used as Map keys.
The Nested classes are also high-performant and strong tree structures that can be used for high configurable traversals

[![Maintainability](https://qlty.sh/gh/codibre/projects/js-utils/maintainability.svg)](https://qlty.sh/gh/codibre/projects/js-utils)
[![Code Coverage](https://qlty.sh/gh/codibre/projects/js-utils/coverage.svg)](https://qlty.sh/gh/codibre/projects/js-utils)

## Why js-tuple?

In JavaScript, arrays are compared by reference, not by value. This means `[1, 2, 3] !== [1, 2, 3]`, which makes arrays unsuitable as Map keys when you want value-based equality. **js-tuple** solves this by providing cached, immutable arrays where identical element sequences always return the same reference.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Queue } from '../../src/internal';
import { ChunkedQueue } from 'dist/min';

describe('Queue (block-based)', () => {
it('should push and pop single items correctly', () => {
const queue = new Queue<number>(0);
const queue = new ChunkedQueue<number>(0);
expect(queue.length).toBe(1);
queue.push(1);
expect(queue.length).toBe(2);
Expand All @@ -13,7 +13,7 @@ describe('Queue (block-based)', () => {
});

it('should handle multiple pushes and pops across blocks', () => {
const queue = new Queue<number>(0);
const queue = new ChunkedQueue<number>(0);
for (let i = 1; i < 3000; i++) queue.push(i);
expect(queue.length).toBe(3000);
for (let i = 0; i < 3000; i++) expect(queue.pop()).toBe(i);
Expand All @@ -22,7 +22,7 @@ describe('Queue (block-based)', () => {
});

it('should work correctly with a 4000 size queue', () => {
const queue = new Queue<number>(0);
const queue = new ChunkedQueue<number>(0);
for (let i = 1; i < 4000; i++) queue.push(i);
expect(queue.length).toBe(4000);
for (let i = 0; i < 4000; i++) expect(queue.pop()).toBe(i);
Expand All @@ -31,7 +31,7 @@ describe('Queue (block-based)', () => {
});

it('should allow interleaved push and pop', () => {
const queue = new Queue<number>(0);
const queue = new ChunkedQueue<number>(0);
expect(queue.pop()).toBe(0);
queue.push(2);
queue.push(3);
Expand All @@ -43,7 +43,7 @@ describe('Queue (block-based)', () => {
});

it('should handle empty queue correctly', () => {
const queue = new Queue<number>(0);
const queue = new ChunkedQueue<number>(0);
expect(queue.pop()).toBe(0);
expect(queue.length).toBe(0);
expect(queue.pop()).toBeUndefined();
Expand Down
Loading