mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-27 03:09:43 +02:00
Fix:Include Watcher as lib with no dependencies and fix tiny-readdir bug #610
This commit is contained in:
parent
160dac109d
commit
ec6e70725c
34 changed files with 2187 additions and 281 deletions
17
server/libs/watcher/string-indexes.js
Normal file
17
server/libs/watcher/string-indexes.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
"use strict";
|
||||
/* STRING INDEXES */
|
||||
function indexes(str, substr) {
|
||||
var indexes = [], rangeLength = substr.length;
|
||||
var indexFrom = 0;
|
||||
while (true) {
|
||||
var index = str.indexOf(substr, indexFrom);
|
||||
if (index === -1)
|
||||
return indexes;
|
||||
indexes.push(index);
|
||||
indexFrom = index + rangeLength;
|
||||
}
|
||||
}
|
||||
/* EXPORT */
|
||||
module.exports = indexes;
|
||||
module.exports.default = indexes;
|
||||
Object.defineProperty(module.exports, "__esModule", { value: true });
|
Loading…
Add table
Add a link
Reference in a new issue