mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
rename const
This commit is contained in:
committed by
Junyoung Choi
parent
5b63bedc0d
commit
19fc1fd674
@@ -26,15 +26,15 @@ const { remote } = require('electron')
|
|||||||
const { dialog } = remote
|
const { dialog } = remote
|
||||||
const WP_POST_PATH = '/wp/v2/posts'
|
const WP_POST_PATH = '/wp/v2/posts'
|
||||||
|
|
||||||
const matchStartingTitleNumber = new RegExp('^([0-9]*\.?[0-9]+).*$')
|
const regexMatchStartingTitleNumber = new RegExp('^([0-9]*\.?[0-9]+).*$')
|
||||||
|
|
||||||
function sortByCreatedAt (a, b) {
|
function sortByCreatedAt (a, b) {
|
||||||
return new Date(b.createdAt) - new Date(a.createdAt)
|
return new Date(b.createdAt) - new Date(a.createdAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
function sortByAlphabetical (a, b) {
|
function sortByAlphabetical (a, b) {
|
||||||
const matchA = matchStartingTitleNumber.exec(a.title)
|
const matchA = regexMatchStartingTitleNumber.exec(a.title)
|
||||||
const matchB = matchStartingTitleNumber.exec(b.title)
|
const matchB = regexMatchStartingTitleNumber.exec(b.title)
|
||||||
|
|
||||||
if (matchA && matchA.length === 2 && matchB && matchB.length === 2) {
|
if (matchA && matchA.length === 2 && matchB && matchB.length === 2) {
|
||||||
// Both note titles are starting with a float. We will compare it now.
|
// Both note titles are starting with a float. We will compare it now.
|
||||||
|
|||||||
Reference in New Issue
Block a user