Skip to content

Commit 6d1cafc

Browse files
committed
docs(home): better features section
1 parent 711a7fd commit 6d1cafc

3 files changed

Lines changed: 26 additions & 14 deletions

File tree

docs/index.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,30 @@ hero:
2020
link: https://github.com/ChronicStone/array-ql
2121

2222
features:
23+
- title: Type-Safe Querying
24+
details: Enjoy 100% type-safe query configurations with keys inferred from your dataset, enhancing developer experience and reducing errors.
25+
icon: "🛡️"
2326
- title: Powerful Pagination
24-
details: Easily paginate through large datasets with built-in support
27+
details: Effortlessly navigate through large datasets with built-in, performant pagination support.
2528
icon: "📄"
26-
- title: Full-Text Search
27-
details: Perform comprehensive searches across multiple fields in your data
28-
icon: "🔎"
2929
- title: Advanced Filtering
30-
details: Apply complex filters with various match modes for precise data retrieval
30+
details: Apply complex, multi-level filters with various match modes for precise and flexible data retrieval.
3131
icon: "🧭"
32+
- title: Full-Text Search
33+
details: Perform lightning-fast, comprehensive searches across multiple fields in your data.
34+
icon: "🔎"
35+
- title: Zero Dependencies
36+
details: Benefit from a lightweight, bloat-free library that won't burden your project with unnecessary code.
37+
icon: "🪶"
3238
- title: Flexible Sorting
33-
details: Order results based on any field, with support for ascending and descending orders
39+
details: Order results based on multiple fields, with support for custom sorting logic and directional control.
3440
icon: "🔢"
41+
- title: Optimized Performance
42+
details: Process millions of rows in milliseconds, with speed that scales for even the largest datasets.
43+
icon: ""
44+
- title: Intuitive API
45+
details: Enjoy a clean, elegant API that makes complex data operations simple and readable.
46+
icon: "🧩"
3547

3648
footer:
3749
message: "Licensed under the MIT License. Created by [Your Name]. Extensible and customizable for developers."

src/query.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ export function query<T extends GenericObject, P extends QueryParams<T>>(
55
data: T[],
66
params: P,
77
): QueryResult<T, P> {
8-
let result: Iterable<T> = lazyQuery(data, params)
9-
10-
if (params.sort)
11-
result = lazySortedQuery(result, params.sort)
12-
8+
let result = lazyQuery(data, params)
9+
result = lazySortedQuery(result, params.sort)
1310
return paginateQuery(Array.from(result), params)
1411
}
1512

test/index.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ for (const fixture of fixtures) {
4141
describe('performance check', () => {
4242
// VAL BETWEEN 1 & 100
4343
const getValue = () => Math.floor(Math.random() * 100)
44+
const startItems = performance.now()
4445
const items = Array.from({ length: 1000000 }, (_, i) => ({
4546
id: i,
4647
name: `Item ${i}`,
@@ -49,7 +50,9 @@ describe('performance check', () => {
4950
address: { city: 'New York', country: 'USA' },
5051
age: Math.floor(Math.random() * 100),
5152
}))
52-
it('query 1M rows - paginate + sort + search + filter in less than 500ms', () => {
53+
const endItems = performance.now()
54+
it('query 1M rows - paginate + sort + search + filter in less than 30ms', () => {
55+
console.info('Time taken to generate 1M items:', endItems - startItems)
5356
const start = performance.now()
5457
query(items, {
5558
limit: 100,
@@ -65,7 +68,7 @@ describe('performance check', () => {
6568
})
6669

6770
const end = performance.now()
68-
console.info('Time taken:', end - start)
69-
expect(end - start).toBeLessThan(500)
71+
console.info('Time taken to query 1M items:', end - start)
72+
expect(end - start).toBeLessThan(30)
7073
})
7174
})

0 commit comments

Comments
 (0)