Skip to content

Commit

Permalink
chore: daily development
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtao25 committed Dec 19, 2024
1 parent c2ed8c6 commit 4ff4b27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/canyon-map/src/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import libCoverage from "istanbul-lib-coverage";
import libSourceMaps from "istanbul-lib-source-maps";


export async function remapCoverage(obj) {
export async function remapCoverage(obj:any) {
const res = await libSourceMaps
.createSourceMapStore()
.transformCoverage(libCoverage.createCoverageMap(obj));
Expand All @@ -24,20 +24,25 @@ export async function remapCoverage(obj) {
export async function remapCoverageByOld(obj:any) {
const aaa = await Promise.all(Object.values(obj).map(item=>{
return remapCoverage({
// @ts-ignore
[item.path]: item
}).then(res=>{
return Object.values(res)
}).then(res=>{
return res[0]
}).then(res=>{
return {
// @ts-ignore
...res,
// @ts-ignore
oldPath: item.path
}
})
}));
const obj2 = {};
// @ts-ignore
aaa.forEach(item=>{
// @ts-ignore
obj2[item.path] = item;
});
return obj2;
Expand Down

0 comments on commit 4ff4b27

Please sign in to comment.