remove unused code

This commit is contained in:
Pig Fang 2020-05-13 18:49:47 +08:00
parent 3556f29a24
commit b9c986db59
3 changed files with 0 additions and 38 deletions

View File

@ -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,
})
}

View File

@ -1,7 +0,0 @@
export function truthy(message: string) {
return (value?: unknown): string | undefined => {
if (!value) {
return message
}
}
}

View File

@ -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()
})