mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
Added unit tests for "parser.js" and "util.js"
This commit is contained in:
@@ -11,7 +11,7 @@ var types = [
|
||||
{
|
||||
name: 'px',
|
||||
regexp: new RegExp(`^${floatRegexp}px\$`)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '%',
|
||||
regexp: new RegExp(`^${floatRegexp}%\$`)
|
||||
@@ -48,15 +48,15 @@ var getType = (value) => {
|
||||
}
|
||||
}
|
||||
|
||||
var parse = (value) => {
|
||||
export const parse = (value) => {
|
||||
switch (typeof value) {
|
||||
case 'number':
|
||||
return { type: 'px', value }
|
||||
case 'string':
|
||||
return getType(value)
|
||||
default:
|
||||
default:
|
||||
return { type: '', value }
|
||||
}
|
||||
}
|
||||
|
||||
export default parse
|
||||
export default parse
|
||||
|
||||
Reference in New Issue
Block a user