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 ## Operators
| Operator | Naming | | Operator | Naming |
| ----------- | ------ | | ----------- | ------------- |
| `+` | add | | `+` | add |
| `-` | sub | | `-` | sub |
| `++obj` | inc | | `++obj` | inc |
@ -15,10 +15,10 @@ A data structures library based on iterators, inspired by libstdc++
| `%` | mod | | `%` | mod |
| `==` | eq | | `==` | eq |
| `!=` | neq | | `!=` | neq |
| `<` | lt | | `<` | a.cmp(b) < 0 |
| `>` | gt | | `>` | a.cmp(b) > 0 |
| `<=` | lte | | `<=` | a.cmp(b) <= 0 |
| `>=` | gte | | `>=` | a.cmp(b) >= 0 |
| `&&` | and | | `&&` | and |
| `=` const & | copy | | `=` const & | copy |
| `=` && | move | | `=` && | 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>", "author": "Vlad Litvinov <vlad@sek1.ro>",
"license": "LGPL-3.0-only", "license": "LGPL-3.0-only",
"type": "module", "type": "module",
"dependencies": { "devDependencies": {
"vitest": "^3.1.1" "vitest": "^3.1.1"
} }
} }

View File

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

View File

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