fix(camelCase)

This commit is contained in:
2025-04-18 21:53:37 +03:00
parent 8d22fe9309
commit c0fdb85a36
3 changed files with 15 additions and 15 deletions

View File

@ -78,7 +78,7 @@ export class List {
List.from = function (obj) {
const list = new List()
for (const value of obj) {
list.push_back(value)
list.pushBack(value)
}
return list
}

View File

@ -103,19 +103,19 @@ export class SequenceContainer {
this.erase(this.begin(), this.end())
}
push_front(value) {
pushFront(value) {
this.insert(this.begin(), value)
}
push_back(value) {
pushBack(value) {
this.insert(this.end(), value)
}
pop_front() {
popFront() {
this.erase(this.begin())
}
pop_back() {
popBack() {
this.erase(this.end().dec())
}
@ -166,10 +166,10 @@ SequenceContainer.is = function (obj, ...args) {
'assign',
'erase',
'clear',
'push_front',
'push_back',
'pop_front',
'pop_back',
'pushFront',
'pushBack',
'popFront',
'popBack',
Symbol.iterator,
'toJSON',
'toString',

View File

@ -115,13 +115,13 @@ test('erase, clear', () => {
}
})
test('push_back, push_front, pop_back, pop_front, back, front', () => {
test('pushBack, pushFront, popBack, popFront, back, front', () => {
const list = List.from([1, 2, 3])
list.pop_front()
list.push_front(5)
list.pop_back()
list.pop_back()
list.push_back(10)
list.popFront()
list.pushFront(5)
list.popBack()
list.popBack()
list.pushBack(10)
expect(listEquArray(list, [5, 10])).toBeTruthy()
expect(list.front).toEqual(5)
expect(list.back).toEqual(10)