Skip to content

Commit b0ea4e5

Browse files
committed
fix(utils): rename talgistOrderParser to taglistOrderParser 🤦
1 parent edb5aa9 commit b0ea4e5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/scripts/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export const taglistOrderVariants = (taglistOrder) => {
245245
}
246246
};
247247

248-
export function talgistOrderParser(taglistOrder) {
248+
export const taglistOrderParser = (taglistOrder) => {
249249
const orders = taglistOrderVariants(taglistOrder)
250250
.split(';')
251251
.filter((e) => e)
@@ -261,4 +261,4 @@ export function talgistOrderParser(taglistOrder) {
261261
}, {});
262262

263263
return orders;
264-
}
264+
};

test/utils.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { taglistOrderVariants, talgistOrderParser } from '../src/scripts/utils.js';
1+
import { taglistOrderVariants, taglistOrderParser } from '../src/scripts/utils.js';
22
import { DockerRegistryUIError } from '../src/scripts/error.js';
33
import assert from 'assert';
44

@@ -36,35 +36,35 @@ describe('utils tests', () => {
3636
});
3737
});
3838

39-
describe('talgistOrderParser', () => {
39+
describe('taglistOrderParser', () => {
4040
it('should have default configuration when empty or undefined', () => {
4141
const expected = { numAsc: true, alphaAsc: true, numFirst: true };
42-
assert.deepEqual(talgistOrderParser(), expected);
43-
assert.deepEqual(talgistOrderParser(''), expected);
42+
assert.deepEqual(taglistOrderParser(), expected);
43+
assert.deepEqual(taglistOrderParser(''), expected);
4444
});
4545

4646
it('should parse correctly `num-asc;alpha-asc` and variants', () => {
4747
const expected = { numAsc: true, alphaAsc: true, numFirst: true };
4848
['asc', 'num-asc;alpha-asc', 'num-asc'].forEach((e) =>
49-
assert.deepEqual(talgistOrderParser(e), expected, `wrong result for ${e}`)
49+
assert.deepEqual(taglistOrderParser(e), expected, `wrong result for ${e}`)
5050
);
5151
});
5252

5353
it('should parse correctly `alpha-desc;num-desc` and variants', () => {
5454
const expected = { numAsc: false, alphaAsc: false, numFirst: false };
5555
['desc', 'alpha-desc;num-desc'].forEach((e) =>
56-
assert.deepEqual(talgistOrderParser(e), expected, `wrong result for ${e}`)
56+
assert.deepEqual(taglistOrderParser(e), expected, `wrong result for ${e}`)
5757
);
5858
});
5959

6060
it('should parse correctly `alpha-asc;num-desc` and variants', () => {
6161
const expected = { numAsc: false, alphaAsc: true, numFirst: false };
62-
assert.deepEqual(talgistOrderParser('alpha-asc;num-desc'), expected)
62+
assert.deepEqual(taglistOrderParser('alpha-asc;num-desc'), expected)
6363
});
6464

6565
it('should parse correctly `num-desc;alpha-desc` and variants', () => {
6666
const expected = { numAsc: false, alphaAsc: false, numFirst: true };
67-
assert.deepEqual(talgistOrderParser('num-desc;alpha-desc'), expected)
67+
assert.deepEqual(taglistOrderParser('num-desc;alpha-desc'), expected)
6868
});
6969
});
7070
});

0 commit comments

Comments
 (0)