* Strips protocol prefix and trailing slashes from a site URL so the * WordPress.com API receives a bare domain (e.g. "mysite.wordpress.com").
(raw: string)
| 14 | * WordPress.com API receives a bare domain (e.g. "mysite.wordpress.com"). |
| 15 | */ |
| 16 | function normalizeSiteUrl(raw: string): string { |
| 17 | return raw.replace(/^https?:\/\//, '').replace(/\/+$/, '') |
| 18 | } |
| 19 | |
| 20 | const POSTS_PER_PAGE = 20 |
| 21 |