mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
discard LSEP
This commit is contained in:
@@ -14,7 +14,7 @@ function validateInput (input) {
|
||||
|
||||
if (input.title != null) {
|
||||
if (!_.isString(input.title)) validatedInput.title = ''
|
||||
else validatedInput.title = input.title
|
||||
else validatedInput.title = input.title.replace(/[\u2028]+/g, '')
|
||||
}
|
||||
|
||||
if (input.isStarred != null) {
|
||||
@@ -26,13 +26,13 @@ function validateInput (input) {
|
||||
case 'MARKDOWN_NOTE':
|
||||
if (input.content != null) {
|
||||
if (!_.isString(input.content)) validatedInput.content = ''
|
||||
else validatedInput.content = input.content
|
||||
else validatedInput.content = input.content.replace(/[\u2028]+/g, '')
|
||||
}
|
||||
return input
|
||||
return validatedInput
|
||||
case 'SNIPPET_NOTE':
|
||||
if (input.description != null) {
|
||||
if (!_.isString(input.description)) validatedInput.description = ''
|
||||
else validatedInput.description = input.description
|
||||
else validatedInput.description = input.description.replace(/[\u2028]+/g, '')
|
||||
}
|
||||
if (input.snippets != null) {
|
||||
if (!_.isArray(input.snippets)) {
|
||||
@@ -44,12 +44,19 @@ function validateInput (input) {
|
||||
} else {
|
||||
validatedInput.snippets = input.snippets
|
||||
}
|
||||
validatedInput.snippets.filter((snippet) => {
|
||||
validatedInput.snippets
|
||||
.filter((snippet) => {
|
||||
if (!_.isString(snippet.name)) return false
|
||||
if (!_.isString(snippet.mode)) return false
|
||||
if (!_.isString(snippet.content)) return false
|
||||
return true
|
||||
})
|
||||
.map((snippet) => {
|
||||
snippet.name = snippet.name.replace(/[\u2028]+/g, '')
|
||||
snippet.mode = snippet.mode.replace(/[\u2028]+/g, '')
|
||||
snippet.content = snippet.content.replace(/[\u2028]+/g, '')
|
||||
return snippet
|
||||
})
|
||||
}
|
||||
return validatedInput
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user