@rsdoctor/utils 1.5.2-beta.0 → 1.5.3-alpha.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.
package/dist/common.cjs CHANGED
@@ -593,11 +593,14 @@ for(var __rspack_i in (()=>{
593
593
  let list = getLoadersTransformData(loaders);
594
594
  return {
595
595
  ...data,
596
- loaders: data.loaders.map((el)=>({
597
- ...el,
596
+ loaders: data.loaders.map((el)=>{
597
+ let { input, result, ...loaderWithoutCode } = el;
598
+ return {
599
+ ...loaderWithoutCode,
598
600
  loader: getLoadrName(el.loader),
599
601
  costs: getLoaderCosts(el, list)
600
- }))
602
+ };
603
+ })
601
604
  };
602
605
  }
603
606
  function getLoaderFolderStatistics(folder, loaders) {
@@ -669,14 +672,10 @@ for(var __rspack_i in (()=>{
669
672
  let item = loaders[i];
670
673
  if (item.resource.path === file) for(let j = 0; j < item.loaders.length; j++){
671
674
  let l = item.loaders[j];
672
- if (l.loader === loader && l.loaderIndex === loaderIndex) return {
675
+ if (getLoadrName(l.loader) === loader && l.loaderIndex === loaderIndex) return {
673
676
  input: l.input || '',
674
677
  output: l.result || ''
675
678
  };
676
- return {
677
- input: '',
678
- output: ''
679
- };
680
679
  }
681
680
  }
682
681
  return {
@@ -1108,7 +1107,7 @@ for(var __rspack_i in (()=>{
1108
1107
  case types_.SDK.ServerAPI.API.GetLoaderFileFirstInput:
1109
1108
  return this.loader.loadData('loader').then((res)=>getLoaderFileFirstInput(body.file, res || []));
1110
1109
  case types_.SDK.ServerAPI.API.GetLoaderFileInputAndOutput:
1111
- return this.loader.loadData('loader').then((res)=>getLoaderFileFirstInput(body.file, res || []));
1110
+ return this.loader.loadData('loader').then((res)=>getLoaderFileInputAndOutput(body.file, body.loader, body.loaderIndex, res || []));
1112
1111
  case types_.SDK.ServerAPI.API.GetResolverFileTree:
1113
1112
  return this.loader.loadData('resolver').then((res)=>getResolverFileTree(res || []));
1114
1113
  case types_.SDK.ServerAPI.API.GetResolverFileDetails:
package/dist/common.js CHANGED
@@ -329,11 +329,14 @@ function getLoaderFileDetails(path, loaders) {
329
329
  let list = getLoadersTransformData(loaders);
330
330
  return {
331
331
  ...data,
332
- loaders: data.loaders.map((el)=>({
333
- ...el,
332
+ loaders: data.loaders.map((el)=>{
333
+ let { input, result, ...loaderWithoutCode } = el;
334
+ return {
335
+ ...loaderWithoutCode,
334
336
  loader: getLoadrName(el.loader),
335
337
  costs: getLoaderCosts(el, list)
336
- }))
338
+ };
339
+ })
337
340
  };
338
341
  }
339
342
  function getLoaderFolderStatistics(folder, loaders) {
@@ -404,14 +407,10 @@ function getLoaderFileInputAndOutput(file, loader, loaderIndex, loaders) {
404
407
  let item = loaders[i];
405
408
  if (item.resource.path === file) for(let j = 0; j < item.loaders.length; j++){
406
409
  let l = item.loaders[j];
407
- if (l.loader === loader && l.loaderIndex === loaderIndex) return {
410
+ if (getLoadrName(l.loader) === loader && l.loaderIndex === loaderIndex) return {
408
411
  input: l.input || '',
409
412
  output: l.result || ''
410
413
  };
411
- return {
412
- input: '',
413
- output: ''
414
- };
415
414
  }
416
415
  }
417
416
  return {
@@ -945,7 +944,7 @@ class APIDataLoader {
945
944
  case SDK.ServerAPI.API.GetLoaderFileFirstInput:
946
945
  return this.loader.loadData('loader').then((res)=>getLoaderFileFirstInput(body.file, res || []));
947
946
  case SDK.ServerAPI.API.GetLoaderFileInputAndOutput:
948
- return this.loader.loadData('loader').then((res)=>getLoaderFileFirstInput(body.file, res || []));
947
+ return this.loader.loadData('loader').then((res)=>getLoaderFileInputAndOutput(body.file, body.loader, body.loaderIndex, res || []));
949
948
  case SDK.ServerAPI.API.GetResolverFileTree:
950
949
  return this.loader.loadData('resolver').then((res)=>getResolverFileTree(res || []));
951
950
  case SDK.ServerAPI.API.GetResolverFileDetails:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/utils",
3
- "version": "1.5.2-beta.0",
3
+ "version": "1.5.3-alpha.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -76,7 +76,7 @@
76
76
  "picocolors": "^1.1.1",
77
77
  "rslog": "^1.2.11",
78
78
  "strip-ansi": "^6.0.1",
79
- "@rsdoctor/types": "1.5.2-beta.0"
79
+ "@rsdoctor/types": "1.5.3-alpha.0"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@types/babel__code-frame": "7.27.0",