Skip to content

Commit

Permalink
Merge pull request #314 from happo/matchall
Browse files Browse the repository at this point in the history
Remove string.prototype.matchall dependency
  • Loading branch information
lencioni authored Feb 13, 2025
2 parents 093c587 + e38c3fe commit cc38953
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"require-relative": "^0.8.7",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"string.prototype.matchall": "^4.0.0",
"supports-color": "^7.1.0"
},
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions src/findCSSAssetPaths.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import path from 'path';

import matchAll from 'string.prototype.matchall';

import stripQueryStringAndHash from './stripQueryStringAndHash';

const URL_PATTERN = /url\(['"]?(\/?[^)"']+)['"]?\)/g;
Expand All @@ -16,7 +14,7 @@ const URL_PATTERN = /url\(['"]?(\/?[^)"']+)['"]?\)/g;
* path where we should attempt to locate the file in the filesystem.
*/
export default function findCSSAssetPaths({ css, source }) {
const paths = Array.from(matchAll(css, URL_PATTERN))
const paths = Array.from(css.matchAll(URL_PATTERN))
.map((match) => match[1])
.filter((url) => !/^http|\/\//.test(url))
.map(stripQueryStringAndHash);
Expand Down
14 changes: 0 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6600,20 +6600,6 @@ string-width@^5.0.1, string-width@^5.1.2:
emoji-regex "^9.2.2"
strip-ansi "^7.0.1"

string.prototype.matchall@^4.0.0:
version "4.0.8"
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3"
integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.4"
es-abstract "^1.20.4"
get-intrinsic "^1.1.3"
has-symbols "^1.0.3"
internal-slot "^1.0.3"
regexp.prototype.flags "^1.4.3"
side-channel "^1.0.4"

string.prototype.matchall@^4.0.12:
version "4.0.12"
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz#6c88740e49ad4956b1332a911e949583a275d4c0"
Expand Down

0 comments on commit cc38953

Please sign in to comment.