Skip to content

Commit

Permalink
feat: be possible to skip re2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 16, 2023
1 parent ba30cbe commit e302d47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/metascraper-helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

const memoizeOne = require('memoize-one').default || require('memoize-one')
const urlRegex = require('url-regex-safe')({ exact: true, parens: true })
const condenseWhitespace = require('condense-whitespace')
const { getExtension: mimeExtension } = require('mime')
const capitalize = require('microsoft-capitalize')
Expand All @@ -19,6 +18,12 @@ const isUri = require('is-uri')
const { URL } = require('url')
const tldts = require('tldts')

const urlRegex = require('url-regex-safe')({
exact: true,
parens: true,
re2: !process.env.METASCRAPER_RE2_SKIP_INSTALL
})

const {
chain,
eq,
Expand Down
2 changes: 1 addition & 1 deletion packages/metascraper-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"re2": "~1.20.1",
"smartquotes": "~2.3.2",
"tldts": "~6.0.12",
"url-regex-safe": "~3.0.0",
"url-regex-safe": "~4.0.0",
"video-extensions": "~1.2.0"
},
"devDependencies": {
Expand Down

0 comments on commit e302d47

Please sign in to comment.