From 6ab9fcbe85b54d9f2edaa82365fa6280f7780b4b Mon Sep 17 00:00:00 2001 From: SEK1RO Date: Fri, 18 Apr 2025 21:46:47 +0300 Subject: [PATCH] fix(camelCase) --- src/containers/Sequence.js | 16 ++++++++-------- test/List.test.js | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/containers/Sequence.js b/src/containers/Sequence.js index 71f522c..f5376df 100644 --- a/src/containers/Sequence.js +++ b/src/containers/Sequence.js @@ -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', diff --git a/test/List.test.js b/test/List.test.js index 84d61b6..24b9244 100644 --- a/test/List.test.js +++ b/test/List.test.js @@ -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)