1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-26 23:04:32 +02:00

add simple type checker implementation

This commit is contained in:
fat
2015-05-13 14:46:50 -07:00
parent c2ced2292a
commit eaab1def7a
25 changed files with 258 additions and 28 deletions

View File

@@ -30,6 +30,12 @@ const ScrollSpy = (($) => {
target : ''
}
const DefaultType = {
offset : 'number',
method : 'string',
target : '(string|element)'
}
const Event = {
ACTIVATE : `activate${EVENT_KEY}`,
SCROLL : `scroll${EVENT_KEY}`,
@@ -164,6 +170,8 @@ const ScrollSpy = (($) => {
config.target = `#${id}`
}
Util.typeCheckConfig(NAME, config, DefaultType)
return config
}