mirror of
https://github.com/dergigi/boris.git
synced 2026-02-23 07:54:59 +01:00
fix: use ES6 import instead of require in helpers.ts
- Replace require() call with ES6 import for READING_PROGRESS constant - Fixes linter error: 'require' is not defined (no-undef) - All linter checks now pass with no warnings or errors
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
// Extract pubkeys from nprofile strings in content
|
||||
import { READING_PROGRESS } from '../config/kinds'
|
||||
|
||||
export const extractNprofilePubkeys = (content: string): string[] => {
|
||||
const nprofileRegex = /nprofile1[a-z0-9]+/gi
|
||||
const matches = content.match(nprofileRegex) || []
|
||||
@@ -128,7 +130,6 @@ export function createParallelReqStreams(
|
||||
* Minimum 1000 characters (roughly 150 words)
|
||||
*/
|
||||
export const shouldTrackReadingProgress = (html: string | undefined, markdown: string | undefined): boolean => {
|
||||
const { READING_PROGRESS } = require('../config/kinds')
|
||||
const content = (html || markdown || '').trim()
|
||||
// Strip HTML tags to get character count
|
||||
const plainText = content.replace(/<[^>]*>/g, '').trim()
|
||||
|
||||
Reference in New Issue
Block a user