Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
style: reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
rocwang committed Oct 31, 2023
1 parent 1867e86 commit fb19cee
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 79 deletions.
1 change: 1 addition & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/demo/Bem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
methods: {
bem(element, modifier, outputElement = false) {
const blockClass = kebabCase(
this.$options.className || this.$options.name
this.$options.className || this.$options.name,
);
const elementClass = `${blockClass}__${element}`;
const elementModifierClass = `${elementClass}--${modifier}`;
Expand Down
4 changes: 2 additions & 2 deletions src/demo/Money.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
number,
precision = 2,
thousands = ",",
decimal = "."
decimal = ".",
) {
if (isNaN(number) || number == null) {
return 0;
Expand All @@ -48,7 +48,7 @@ export default {
const parts = number.split(".");
const dollarsAmount = parts[0].replace(
/(\d)(?=(\d\d\d)+(?!\d))/g,
"$1" + thousands
"$1" + thousands,
);
const centsAmount = parts[1] ? decimal + parts[1] : "";
Expand Down
6 changes: 3 additions & 3 deletions src/demo/SmartImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default {
flatSrcSet
? `${flatSrcSet}, ${src} ${imgWidth}w`
: `${src} ${imgWidth}w`,
""
"",
)
: "";
},
Expand Down Expand Up @@ -171,7 +171,7 @@ export default {
},
{
// options
}
},
);
io.observe(this.$el);
Expand Down Expand Up @@ -208,7 +208,7 @@ export default {
},
resizeImage(masterSrc, size, pngToJpg = true) {
const matches = masterSrc.match(
/(^.*)\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?.*)?$/i
/(^.*)\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?.*)?$/i,
);
if (matches) {
Expand Down
8 changes: 4 additions & 4 deletions src/demo/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export const generalPageProvider = curry(
(
collection: Collection,
pageNumber: number,
pageSize: number
pageSize: number,
): Promise<unknown[]> =>
algoliasearch(
<string>import.meta.env.VITE_APP_ID,
<string>import.meta.env.VITE_SEARCH_ONLY_API_KEY
<string>import.meta.env.VITE_SEARCH_ONLY_API_KEY,
)
.initIndex("shopify_products")
.search("", {
Expand All @@ -34,9 +34,9 @@ export const generalPageProvider = curry(
facetFilters:
collection === "" ? undefined : [`collections:${collection}`],
})
.then(prop("hits"))
.then(prop("hits")),
);

export const pageProvider = computed(() =>
generalPageProvider(collection.value)
generalPageProvider(collection.value),
);
26 changes: 13 additions & 13 deletions src/pipeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function createGridRoot(
columnGap: string = "20px",
gridAutoFlow: string = "row",
gridTemplateColumns: string = "30px 30px 30px",
gridTemplateRows: string = "30px 30px 30px"
gridTemplateRows: string = "30px 30px 30px",
): HTMLElement {
const el = document.createElement("div");
Object.assign(el.style, {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe("getBufferMeta", () => {
const space = { width: 0, height: 0 };
const meta = getBufferMeta(1000, 1000)(
space,
createMockResizeMeasurement("row")
createMockResizeMeasurement("row"),
);

expect(meta).toEqual({ bufferedOffset: 0, bufferedLength: 132 });
Expand All @@ -150,7 +150,7 @@ describe("getBufferMeta", () => {
const space = { width: 0, height: 0 };
const meta = getBufferMeta(1000, 1000)(
space,
createMockResizeMeasurement("column")
createMockResizeMeasurement("column"),
);

expect(meta).toEqual({ bufferedOffset: 0, bufferedLength: 88 });
Expand All @@ -160,7 +160,7 @@ describe("getBufferMeta", () => {
const space = { width: 5000, height: 5000 };
const meta = getBufferMeta(1000, 1000)(
space,
createMockResizeMeasurement("row")
createMockResizeMeasurement("row"),
);

expect(meta).toEqual({ bufferedOffset: 267, bufferedLength: 132 });
Expand All @@ -170,7 +170,7 @@ describe("getBufferMeta", () => {
const space = { width: 5000, height: 5000 };
const meta = getBufferMeta(1000, 1000)(
space,
createMockResizeMeasurement("column")
createMockResizeMeasurement("column"),
);

expect(meta).toEqual({ bufferedOffset: 178, bufferedLength: 88 });
Expand All @@ -189,7 +189,7 @@ describe("getObservableOfVisiblePageNumbers", () => {
const pageNumber$ = getObservableOfVisiblePageNumbers(
{ bufferedOffset: 0, bufferedLength: 10 },
100,
20
20,
);
expectObservable(pageNumber$).toBe(expectedMarble, expectedPageNumbers);
});
Expand All @@ -202,7 +202,7 @@ describe("getObservableOfVisiblePageNumbers", () => {
const pageNumber$ = getObservableOfVisiblePageNumbers(
{ bufferedOffset: 50, bufferedLength: 80 },
200,
20
20,
);
expectObservable(pageNumber$).toBe(expectedMarble, expectedPageNumbers);
});
Expand All @@ -215,7 +215,7 @@ describe("getObservableOfVisiblePageNumbers", () => {
const pageNumber$ = getObservableOfVisiblePageNumbers(
{ bufferedOffset: 50, bufferedLength: 80 },
100,
20
20,
);
expectObservable(pageNumber$).toBe(expectedMarble, expectedPageNumbers);
});
Expand All @@ -236,7 +236,7 @@ describe("accumulateAllItems", () => {
it("can extend allItems", () => {
const allItems = accumulateAllItems(
[0, 1, 2, 3, 4, 5],
[{ pageNumber: 1, items: ["a", "b", "c"] }, 10, 3]
[{ pageNumber: 1, items: ["a", "b", "c"] }, 10, 3],
);

expect(allItems).toEqual([
Expand All @@ -256,7 +256,7 @@ describe("accumulateAllItems", () => {
it("can shrink allItems", () => {
const allItems = accumulateAllItems(
[0, 1, 2, 3, 4, 5, 6],
[{ pageNumber: 0, items: ["a", "b", "c"] }, 5, 3]
[{ pageNumber: 0, items: ["a", "b", "c"] }, 5, 3],
);

expect(allItems).toEqual(["a", "b", "c", 3, 4]);
Expand All @@ -265,7 +265,7 @@ describe("accumulateAllItems", () => {
it("behave properly when pageProvider returns fewer items than pageSize", () => {
const allItems = accumulateAllItems(
[0, 1, 2, 3, 4, 5],
[{ pageNumber: 0, items: ["a", "b"] }, 6, 3]
[{ pageNumber: 0, items: ["a", "b"] }, 6, 3],
);

expect(allItems).toEqual(["a", "b", undefined, 3, 4, 5]);
Expand All @@ -274,7 +274,7 @@ describe("accumulateAllItems", () => {
it("behave properly when pageProvider returns more items than pageSize", () => {
const allItems = accumulateAllItems(
[0, 1, 2, 3, 4, 5],
[{ pageNumber: 0, items: ["a", "b", "c", "d"] }, 6, 3]
[{ pageNumber: 0, items: ["a", "b", "c", "d"] }, 6, 3],
);

expect(allItems).toEqual(["a", "b", "c", 3, 4, 5]);
Expand All @@ -294,7 +294,7 @@ describe("getVisibleItems", () => {
itemHeightWithGap: 50,
itemWidthWithGap: 60,
},
["a", "b", "c", "d", "e", "f", "g"]
["a", "b", "c", "d", "e", "f", "g"],
);

expect(visibleItems).toEqual([
Expand Down
Loading

0 comments on commit fb19cee

Please sign in to comment.