fix(devDeps); fix(Iterator): get value - undefined

This commit is contained in:
2025-05-11 23:50:47 +03:00
parent c0fdb85a36
commit a25cf10084
5 changed files with 170 additions and 708 deletions

View File

@ -5,7 +5,7 @@ A data structures library based on iterators, inspired by libstdc++
## Operators
| Operator | Naming |
| ----------- | ------ |
| ----------- | ------------- |
| `+` | add |
| `-` | sub |
| `++obj` | inc |
@ -15,10 +15,10 @@ A data structures library based on iterators, inspired by libstdc++
| `%` | mod |
| `==` | eq |
| `!=` | neq |
| `<` | lt |
| `>` | gt |
| `<=` | lte |
| `>=` | gte |
| `<` | a.cmp(b) < 0 |
| `>` | a.cmp(b) > 0 |
| `<=` | a.cmp(b) <= 0 |
| `>=` | a.cmp(b) >= 0 |
| `&&` | and |
| `=` const & | copy |
| `=` && | move |

785
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@
"author": "Vlad Litvinov <vlad@sek1.ro>",
"license": "LGPL-3.0-only",
"type": "module",
"dependencies": {
"devDependencies": {
"vitest": "^3.1.1"
}
}

View File

@ -6,7 +6,7 @@ export class ForwardIterator {
}
get value() {
return this.deref().value
return this.deref()?.value
}
set value(value) {

View File

@ -49,6 +49,7 @@ test('move, empty', () => {
test('constructor, assign', () => {
expect(new List().size()).toEqual(0)
expect(new List().back).toEqual(undefined)
expect(listEquArray(new List(null), [null])).toBeTruthy()
expect(listEquArray(new List(null, 2), [null, null])).toBeTruthy()
{