@lvce-editor/extension-host-worker 3.13.0 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4722,6 +4722,18 @@ const textSearch$1 = async (scheme, root, query) => {
|
|
|
4722
4722
|
return all;
|
|
4723
4723
|
};
|
|
4724
4724
|
|
|
4725
|
+
const matchesUri = (uri, relativeRoot, include, exclude) => {
|
|
4726
|
+
if (!uri.startsWith(relativeRoot)) {
|
|
4727
|
+
return false;
|
|
4728
|
+
}
|
|
4729
|
+
if (include && typeof include === 'string' && !uri.includes(include)) {
|
|
4730
|
+
return false;
|
|
4731
|
+
}
|
|
4732
|
+
if (exclude && typeof exclude === 'string' && uri.includes(exclude)) {
|
|
4733
|
+
return false;
|
|
4734
|
+
}
|
|
4735
|
+
return true;
|
|
4736
|
+
};
|
|
4725
4737
|
const textSearch = async (scheme, root, query, options, assetDir) => {
|
|
4726
4738
|
string(scheme);
|
|
4727
4739
|
string(root);
|
|
@@ -4730,7 +4742,7 @@ const textSearch = async (scheme, root, query, options, assetDir) => {
|
|
|
4730
4742
|
const relativeRoot = root.slice('memfs://'.length);
|
|
4731
4743
|
const allResults = [];
|
|
4732
4744
|
for (const [key, value] of Object.entries(files)) {
|
|
4733
|
-
if (!key.
|
|
4745
|
+
if (!matchesUri(key, relativeRoot, options.include, options.exclude)) {
|
|
4734
4746
|
continue;
|
|
4735
4747
|
}
|
|
4736
4748
|
if (value.type === File$1) {
|
package/package.json
CHANGED