remove unused code
This commit is contained in:
parent
3556f29a24
commit
b9c986db59
@ -1,19 +0,0 @@
|
||||
import { showModal } from '../../scripts/notify'
|
||||
|
||||
export default function (message: string, reason: string[]): void {
|
||||
const div = document.createElement('div')
|
||||
const p = document.createElement('p')
|
||||
p.textContent = message
|
||||
div.appendChild(p)
|
||||
const ul = document.createElement('ul')
|
||||
reason.forEach(item => {
|
||||
const li = document.createElement('li')
|
||||
li.textContent = item
|
||||
ul.appendChild(li)
|
||||
})
|
||||
div.appendChild(ul)
|
||||
showModal({
|
||||
mode: 'alert',
|
||||
dangerousHTML: div.outerHTML,
|
||||
})
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
export function truthy(message: string) {
|
||||
return (value?: unknown): string | undefined => {
|
||||
if (!value) {
|
||||
return message
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import * as validators from '@/scripts/validators'
|
||||
|
||||
test('truthy', () => {
|
||||
const validator = validators.truthy('invalid')
|
||||
expect(validator()).toBe('invalid')
|
||||
expect(validator(null)).toBe('invalid')
|
||||
expect(validator(undefined)).toBe('invalid')
|
||||
expect(validator(0)).toBe('invalid')
|
||||
expect(validator('')).toBe('invalid')
|
||||
expect(validator([])).toBeUndefined()
|
||||
expect(validator({})).toBeUndefined()
|
||||
})
|
Loading…
Reference in New Issue
Block a user