Use String#startsWith instead of String#indexOf

This commit is contained in:
Maximilian Krög
2022-08-04 23:59:17 +02:00
parent 0b945f2321
commit bb3c5bf144
14 changed files with 51 additions and 53 deletions

View File

@@ -29,10 +29,10 @@ exports.handlers = {
observable.name = name;
observable.readonly =
typeof observable.readonly == 'boolean' ? observable.readonly : true;
if (doclet.name.indexOf('get') === 0) {
if (doclet.name.startsWith('get')) {
observable.type = doclet.returns[0].type;
observable.description = doclet.returns[0].description;
} else if (doclet.name.indexOf('set') === 0) {
} else if (doclet.name.startsWith('set')) {
observable.readonly = false;
}
if (doclet.stability) {