20 lines
314 B
JavaScript
20 lines
314 B
JavaScript
|
import * as R from "remeda";
|
||
|
|
||
|
export default function (code) {
|
||
|
const size = 14;
|
||
|
let index = size;
|
||
|
|
||
|
while (true) {
|
||
|
if (
|
||
|
R.pipe(
|
||
|
code,
|
||
|
(c) => c.substr(index - size, size).split(""),
|
||
|
R.uniq,
|
||
|
(c) => c.length
|
||
|
) === size
|
||
|
)
|
||
|
return index;
|
||
|
index++;
|
||
|
}
|
||
|
}
|