Skip to content

Commit

Permalink
Fix casing
Browse files Browse the repository at this point in the history
  • Loading branch information
katydecorah committed Dec 19, 2023
1 parent 53926e0 commit 0231581
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 69 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35206,20 +35206,20 @@ function getBookStatus({ date, bookStatus, }) {
switch (bookStatus) {
case "abandoned":
return {
"date-abandoned": dateValue,
dateAbandoned: dateValue,
};
case "started":
return {
"date-started": dateValue,
dateStarted: dateValue,
};
case "finished":
return {
"date-finished": dateValue,
dateFinished: dateValue,
};
case "want to read":
default: {
return {
"date-added": dateValue,
dateAdded: dateValue,
};
}
}
Expand Down
26 changes: 13 additions & 13 deletions src/__tests__/clean-book.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("cleanBook", () => {
expect(
cleanBook(
{
dateType: { "date-finished": dateFinished },
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
providers: [],
Expand All @@ -41,7 +41,7 @@ describe("cleanBook", () => {
"categories": [
"Fiction",
],
"date-finished": "2020-09-12",
"dateFinished": "2020-09-12",
"description": "A novel about faith, science, religion, and family that tells the deeply moving portrait of a family of Ghanaian immigrants ravaged by depression and addiction and grief, narrated by a fifth year candidate in neuroscience at Stanford school of medicine studying the neural circuits of reward seeking behavior in mice…",
"isbn": "0525658181",
"language": "en",
Expand All @@ -60,7 +60,7 @@ describe("cleanBook", () => {
expect(
cleanBook(
{
dateType: { "date-finished": dateFinished },
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
providers: [],
Expand All @@ -78,7 +78,7 @@ describe("cleanBook", () => {
"categories": [
"Fiction",
],
"date-finished": "2020-09-12",
"dateFinished": "2020-09-12",
"description": "A novel about faith, science, religion, and family that tells the deeply moving portrait of a family of Ghanaian immigrants ravaged by depression and addiction and grief, narrated by a fifth year candidate in neuroscience at Stanford school of medicine studying the neural circuits of reward seeking behavior in mice…",
"isbn": "0525658181",
"language": "en",
Expand Down Expand Up @@ -133,7 +133,7 @@ describe("cleanBook", () => {
const warningSpy = jest.spyOn(core, "warning");
cleanBook(
{
dateType: { "date-started": "2022-01-01" },
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
providers: [],
bookStatus: "started",
Expand Down Expand Up @@ -181,7 +181,7 @@ describe("cleanBook", () => {
const exportVariableSpy = jest.spyOn(core, "exportVariable");
cleanBook(
{
dateType: { "date-started": "2022-01-01" },
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
providers: [],
bookStatus: "started",
Expand Down Expand Up @@ -230,7 +230,7 @@ describe("cleanBook", () => {
const exportVariableSpy = jest.spyOn(core, "exportVariable");
cleanBook(
{
dateType: { "date-started": "2022-01-01" },
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
providers: [],
bookStatus: "started",
Expand Down Expand Up @@ -279,7 +279,7 @@ describe("cleanBook", () => {
const exportVariableSpy = jest.spyOn(core, "exportVariable");
cleanBook(
{
dateType: { "date-started": "2022-01-01" },
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
providers: [],
bookStatus: "started",
Expand Down Expand Up @@ -331,7 +331,7 @@ describe("cleanBook", () => {
);
cleanBook(
{
dateType: { "date-started": "2022-01-01" },
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
providers: [],
bookStatus: "started",
Expand All @@ -358,7 +358,7 @@ describe("cleanBook", () => {
expect(
cleanBook(
{
dateType: { "date-finished": dateFinished },
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
providers: [],
Expand All @@ -376,7 +376,7 @@ describe("cleanBook", () => {
"categories": [
"Fiction",
],
"date-finished": "2020-09-12",
"dateFinished": "2020-09-12",
"description": "A novel about faith, science, religion, and family that tells the deeply moving portrait of a family of Ghanaian immigrants ravaged by depression and addiction and grief, narrated by a fifth year candidate in neuroscience at Stanford school of medicine studying the neural circuits of reward seeking behavior in mice…",
"isbn": "0525658181",
"language": "en",
Expand All @@ -398,7 +398,7 @@ describe("cleanBook", () => {
expect(
cleanBook(
{
dateType: { "date-finished": dateFinished },
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
providers: [],
Expand All @@ -416,7 +416,7 @@ describe("cleanBook", () => {
"categories": [
"Fiction",
],
"date-finished": "2020-09-12",
"dateFinished": "2020-09-12",
"description": "A novel about faith, science, religion, and family that tells the deeply moving portrait of a family of Ghanaian immigrants ravaged by depression and addiction and grief, narrated by a fifth year candidate in neuroscience at Stanford school of medicine studying the neural circuits of reward seeking behavior in mice…",
"isbn": "0525658181",
"language": "en",
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe("index", () => {
"categories": [
"Fiction",
],
"date-started": "2022-01-02",
"dateStarted": "2022-01-02",
"description": "NEW YORK TIMES BESTSELLER Winner of the 2020 Center for Fiction First Novel Prize Winner of the 2020 National Book Critics Circle's John Leonard Prize for Best First Book Winner of the 2020 Kirkus Prize for Fiction Winner of the 2021 Dylan Thomas Prize Finalist for the 2021 PEN/Hemingway Award for Best First Novel Longlisted for the 2021 Andrew Carnegie Medal for Excellence in Fiction Longlisted for the 2021 PEN/Jean Stein Book Award Longlisted for the 2021 Women's Prize for Fiction A New York Times Notable Book of the Year Named Best Book of the Year by O: the Oprah Magazine, Vanity Fair, Los Angeles Times, Town and Country, Amazon, Indigo, NPR, Harper’s Bazaar, Kirkus Reviews, Marie Claire, Good Housekeeping Sharp, comic, disruptive, and tender, Luster sees a young Black woman fall into art and someone else's open marriage. Edie is stumbling her way through her twenties—sharing a subpar apartment in Bushwick, clocking in and out of her admin job, making a series of inappropriate sexual choices. She's also, secretly, haltingly, figuring her way into life as an artist. And then she meets Eric, a digital archivist with a family in New Jersey, including an autopsist wife who has agreed to an open marriage—with rules. As if navigating the constantly shifting landscapes of contemporary sexual manners and racial politics weren't hard enough, Edie finds herself unemployed and falling into Eric's family life, his home. She becomes a hesitant friend to his wife and a de facto role model to his adopted daughter. Edie is the only Black woman who young Akila knows. Razor-sharp, darkly comic, sexually charged, socially disruptive, Luster is a portrait of a young woman trying to make sense of her life in a tumultuous era. It is also a haunting, aching description of how hard it is to believe in your own talent and the unexpected influences that bring us into ourselves along the way.",
"isbn": "9780385696005",
"language": "en",
Expand Down Expand Up @@ -202,7 +202,7 @@ describe("index", () => {
"categories": [
"Fiction",
],
"date-finished": "2021-09-30",
"dateFinished": "2021-09-30",
"dateStarted": "2021-09-26",
"description": "NEW YORK TIMES BESTSELLER",
"isbn": "9780525620792",
Expand Down Expand Up @@ -285,7 +285,7 @@ describe("index", () => {
"categories": [
"Fiction",
],
"date-finished": "2022-08-02",
"dateFinished": "2022-08-02",
"description": "NATIONAL BESTSELLER • A “dazzling, cinematic, intimate, lyrical” (Roxane Gay) epic of betrayal, love, and fate that spans five generations of an Indigenous Chicano family in the American West, from the author of the National Book Award finalist Sabrina & Corina “Sometimes you just step into a book and let it wash over you, like you’re swimming under a big, sparkling night sky.”—Celeste Ng, author of Little Fires Everywhere and Everything I Never Told You A PHENOMENAL BOOK CLUB PICK AND AN AUDACIOUS BOOK CLUB PICK • ONE OF THE BEST BOOKS OF THE YEAR: Book Riot There is one every generation, a seer who keeps the stories. Luz “Little Light” Lopez, a tea leaf reader and laundress, is left to fend for herself after her older brother, Diego, a snake charmer and factory worker, is run out of town by a violent white mob. As Luz navigates 1930s Denver, she begins to have visions that transport her to her Indigenous homeland in the nearby Lost Territory. Luz recollects her ancestors’ origins, how her family flourished, and how they were threatened. She bears witness to the sinister forces that have devastated her people and their homelands for generations. In the end, it is up to Luz to save her family stories from disappearing into oblivion. Written in Kali Fajardo-Anstine’s singular voice, the wildly entertaining and complex lives of the Lopez family fill the pages of this multigenerational western saga. Woman of Light is a transfixing novel about survival, family secrets, and love—filled with an unforgettable cast of characters, all of whom are just as special, memorable, and complicated as our beloved heroine, Luz. LONGLISTED FOR THE JOYCE CAROL OATES PRIZE • LONGLISTED FOR THE CAROL SHIELDS PRIZE FOR FICTION",
"isbn": "9780525511342",
"language": "en",
Expand Down Expand Up @@ -379,7 +379,7 @@ describe("index", () => {
"categories": [
"Fiction",
],
"date-added": "2022-10-01",
"dateAdded": "2022-10-01",
"description": "NEW YORK TIMES BESTSELLER Winner of the 2020 Center for Fiction First Novel Prize Winner of the 2020 National Book Critics Circle's John Leonard Prize for Best First Book Winner of the 2020 Kirkus Prize for Fiction Winner of the 2021 Dylan Thomas Prize Finalist for the 2021 PEN/Hemingway Award for Best First Novel Longlisted for the 2021 Andrew Carnegie Medal for Excellence in Fiction Longlisted for the 2021 PEN/Jean Stein Book Award Longlisted for the 2021 Women's Prize for Fiction A New York Times Notable Book of the Year Named Best Book of the Year by O: the Oprah Magazine, Vanity Fair, Los Angeles Times, Town and Country, Amazon, Indigo, NPR, Harper’s Bazaar, Kirkus Reviews, Marie Claire, Good Housekeeping Sharp, comic, disruptive, and tender, Luster sees a young Black woman fall into art and someone else's open marriage. Edie is stumbling her way through her twenties—sharing a subpar apartment in Bushwick, clocking in and out of her admin job, making a series of inappropriate sexual choices. She's also, secretly, haltingly, figuring her way into life as an artist. And then she meets Eric, a digital archivist with a family in New Jersey, including an autopsist wife who has agreed to an open marriage—with rules. As if navigating the constantly shifting landscapes of contemporary sexual manners and racial politics weren't hard enough, Edie finds herself unemployed and falling into Eric's family life, his home. She becomes a hesitant friend to his wife and a de facto role model to his adopted daughter. Edie is the only Black woman who young Akila knows. Razor-sharp, darkly comic, sexually charged, socially disruptive, Luster is a portrait of a young woman trying to make sense of her life in a tumultuous era. It is also a haunting, aching description of how hard it is to believe in your own talent and the unexpected influences that bring us into ourselves along the way.",
"isbn": "9780385696005",
"language": "en",
Expand Down Expand Up @@ -485,7 +485,7 @@ describe("index", () => {
"categories": [
"Fiction",
],
"date-added": "2022-10-01",
"dateAdded": "2022-10-01",
"description": "NEW YORK TIMES BESTSELLER Winner of the 2020 Center for Fiction First Novel Prize Winner of the 2020 National Book Critics Circle's John Leonard Prize for Best First Book Winner of the 2020 Kirkus Prize for Fiction Winner of the 2021 Dylan Thomas Prize Finalist for the 2021 PEN/Hemingway Award for Best First Novel Longlisted for the 2021 Andrew Carnegie Medal for Excellence in Fiction Longlisted for the 2021 PEN/Jean Stein Book Award Longlisted for the 2021 Women's Prize for Fiction A New York Times Notable Book of the Year Named Best Book of the Year by O: the Oprah Magazine, Vanity Fair, Los Angeles Times, Town and Country, Amazon, Indigo, NPR, Harper’s Bazaar, Kirkus Reviews, Marie Claire, Good Housekeeping Sharp, comic, disruptive, and tender, Luster sees a young Black woman fall into art and someone else's open marriage. Edie is stumbling her way through her twenties—sharing a subpar apartment in Bushwick, clocking in and out of her admin job, making a series of inappropriate sexual choices. She's also, secretly, haltingly, figuring her way into life as an artist. And then she meets Eric, a digital archivist with a family in New Jersey, including an autopsist wife who has agreed to an open marriage—with rules. As if navigating the constantly shifting landscapes of contemporary sexual manners and racial politics weren't hard enough, Edie finds herself unemployed and falling into Eric's family life, his home. She becomes a hesitant friend to his wife and a de facto role model to his adopted daughter. Edie is the only Black woman who young Akila knows. Razor-sharp, darkly comic, sexually charged, socially disruptive, Luster is a portrait of a young woman trying to make sense of her life in a tumultuous era. It is also a haunting, aching description of how hard it is to believe in your own talent and the unexpected influences that bring us into ourselves along the way.",
"isbn": "9780385696005",
"language": "en",
Expand Down
60 changes: 30 additions & 30 deletions src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,57 +48,57 @@ it("sortByDate", () => {

it("getBookStatus", () => {
expect(
getBookStatus({
date: "2020-01-01",
bookStatus: "abandoned",
})
).toMatchInlineSnapshot(`
getBookStatus({
date: "2020-01-01",
bookStatus: "abandoned"
})
).toMatchInlineSnapshot(`
{
"date-abandoned": "2020-01-01",
"dateAbandoned": "2020-01-01",
}
`);
expect(
getBookStatus({
date: "2020-01-01",
bookStatus: "finished",
})
).toMatchInlineSnapshot(`
getBookStatus({
date: "2020-01-01",
bookStatus: "finished"
})
).toMatchInlineSnapshot(`
{
"date-finished": "2020-01-01",
"dateFinished": "2020-01-01",
}
`);
expect(
getBookStatus({
date: "2020-01-01",
bookStatus: "started",
})
).toMatchInlineSnapshot(`
getBookStatus({
date: "2020-01-01",
bookStatus: "started"
})
).toMatchInlineSnapshot(`
{
"date-started": "2020-01-01",
"dateStarted": "2020-01-01",
}
`);
expect(
getBookStatus({
date: "2020-01-01",
bookStatus: "want to read",
})
).toMatchInlineSnapshot(`
getBookStatus({
date: "2020-01-01",
bookStatus: "want to read"
})
).toMatchInlineSnapshot(`
{
"date-added": "2020-01-01",
"dateAdded": "2020-01-01",
}
`);
expect(
getBookStatus({
date: "2020-01-01",
})
).toMatchInlineSnapshot(`
getBookStatus({
date: "2020-01-01"
})
).toMatchInlineSnapshot(`
{
"date-added": "2020-01-01",
"dateAdded": "2020-01-01",
}
`);
expect(getBookStatus({})).toMatchInlineSnapshot(`
{
"date-added": "2023-12-01",
"dateAdded": "2023-12-01",
}
`);
});
Loading

0 comments on commit 0231581

Please sign in to comment.