@thetimes/methode-parser
Advanced tools
Comparing version 7.0.12 to 7.0.13
@@ -15,6 +15,6 @@ "use strict"; | ||
}); | ||
const substringStartPosition = (text, substring) => { | ||
const regex = text | ||
exports.substringStartPosition = (text, substring) => { | ||
const regex = exports.sanitiseString(text) | ||
.toLowerCase() | ||
.match(new RegExp(`\\b${substring.toLowerCase()}\\b`)); | ||
.match(new RegExp(`\\b${exports.sanitiseString(substring).toLowerCase()}\\b`)); | ||
const start = regex && typeof regex.index !== "undefined" ? regex.index : -1; | ||
@@ -37,3 +37,3 @@ return start; | ||
.map(({ slug, name }) => { | ||
const startPosition = substringStartPosition(exports.sanitiseString(cleanByline), exports.sanitiseString(name)); | ||
const startPosition = exports.substringStartPosition(cleanByline, name); | ||
return { | ||
@@ -79,2 +79,2 @@ start: startPosition, | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yLXRvLWJ5bGluZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9hdXRob3ItdG8tYnlsaW5lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsTUFBTSxpQkFBaUIsR0FBRyxDQUFDLElBQVksRUFBVSxFQUFFLENBQUMsQ0FBQztJQUNuRCxJQUFJLEVBQUUsUUFBUTtJQUNkLFFBQVEsRUFBRTtRQUNSO1lBQ0UsSUFBSSxFQUFFLE1BQU07WUFDWixVQUFVLEVBQUU7Z0JBQ1YsS0FBSyxFQUFFLElBQUk7YUFDWjtZQUNELFFBQVEsRUFBRSxFQUFFO1NBQ2I7S0FDRjtDQUNGLENBQUMsQ0FBQztBQUVILE1BQU0sc0JBQXNCLEdBQUcsQ0FBQyxJQUFZLEVBQUUsU0FBaUIsRUFBVSxFQUFFO0lBQ3pFLE1BQU0sS0FBSyxHQUFHLElBQUk7U0FDZixXQUFXLEVBQUU7U0FDYixLQUFLLENBQUMsSUFBSSxNQUFN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FO1lBQy9CLEdBQUcsQ0FBQyxJQUFJLENBQ04saUJBQWlCLENBQ2YsV0FBVyxDQUFDLFNBQVMsQ0FDbkIsU0FBUyxDQUFDLEtBQUssR0FBRyxTQUFTLENBQUMsTUFBTSxFQUNsQyxnQkFBZ0IsQ0FBQyxLQUFLLEdBQUcsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUNsQyxDQUNGLENBQ0YsQ0FBQztTQUNIO2FBQU0sSUFBSSxXQUFXLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQyxLQUFLLEdBQUcsU0FBUyxDQUFDLE1BQU0sRUFBRTtZQUNsRSxHQUFHLENBQUMsSUFBSSxDQUNOLGlCQUFpQixDQUNmLFdBQVcsQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLEtBQUssR0FBRyxTQUFTLENBQUMsTUFBTSxDQUFDLENBQ3ZELENBQ0YsQ0FBQztTQUNIO0lBQ0gsQ0FBQyxDQUFDLENBQUM7SUFFSCxPQUFPLEdBQUcsQ0FBQztBQUNiLENBQUMsQ0FBQyJ9 |
import { Slug } from "./markup"; | ||
export declare const substringStartPosition: (text: string, substring: string) => number; | ||
export declare const sanitiseString: (text: string) => string; | ||
@@ -3,0 +4,0 @@ declare type AuthorNameAndSlug = { |
{ | ||
"name": "@thetimes/methode-parser", | ||
"version": "7.0.12", | ||
"version": "7.0.13", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "lib/types/index.d.ts", |
61896
1056