Oxidation number of Oxygen in peroxides: -2 or -1?

My textbook says that the oxidation number of Oxygen in peroxides is -2, but when I searched up the internet, I found it to be -1. It could probably be a misprint in my book, but I am still not sure. Not only that, the oxidation number of Hydrogen in hydrides is said to be +1 in my book, when it's supposed to be, I believe, -1? Please help me out on this.

My book says: " The oxidation number of oxygen in most of its compounds (except peroxides, superoxides and suboxides) is -2. In peroxides (e.g., H2O2, BaO2, etc.), the oxidation number of oxygen is -2.

The oxidation number of oxygen in superoxides (e.g., KO2) and suboxides (e.g., C3O2 ) depends upon the nature of the compound. Exceptions also occur when oxygen is attatched to a more electronegative atom. For example, in the compounds like OF2 and O2F2, the oxidation numbers of oxygen are +2 and +1 respectively."

• Oxygen has an oxidation state of -1 in peroxides; Hydrogen has an oxidation state of -1 in saline hydrides like $\ce{NaH}$ – Aniruddha Deb Jan 2 at 12:00
• The textbook might be referring to the charge of the peroxo group $\ce{O2^2-}$. I suggest adding the exact quote from the textbook alongside with a complete reference and examples of chemical substances. – andselisk Jan 2 at 12:01
• Ok, I will quote what my book says, just a minute.. – UserKunal123 Jan 2 at 12:03
• Seems like a typo in the book to me. One slip of my fat fingers on my cell phone, and suddenly there are 9 planets again instead of 8. – Oscar Lanzi Jan 2 at 12:31
• It must be a typo (the book would otherwise contradict itself). The correct oxidation number in pedoxides (and superoxides) is -1 – The_Vinz Jan 2 at 13:10