mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-03 08:38:41 -04:00
Clean code. Add tests.
This commit is contained in:
parent
d591dbc0cd
commit
908c49c584
4 changed files with 210 additions and 14 deletions
|
@ -7,7 +7,11 @@ modulejs.define('model/item', ['_', 'core/event', 'core/location', 'core/server'
|
|||
|
||||
function startsWith(sequence, part) {
|
||||
|
||||
return sequence.slice && part.length && sequence.slice(0, part.length) === part;
|
||||
if (!sequence || !sequence.substr || !part || !part.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return sequence.substr(0, part.length) === part;
|
||||
}
|
||||
|
||||
function createLabel(sequence) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue