Skip to content

Commit 40d2994

Browse files
committed
[INTERNAL] ResourceInfoList: Re-add getDebugName function
This reverts commit 6bbc8e9.
1 parent 6bbc8e9 commit 40d2994

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/lbt/resources/ResourceInfoList.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const ResourceInfo = require("./ResourceInfo");
22

33
const DEBUG_RESOURCES_PATTERN = /-dbg((?:\.view|\.fragment|\.controller|\.designtime|\.support)?\.js|\.css)$/;
4+
const RESOURCES_PATTERN = /((?:\.view|\.fragment|\.controller|\.designtime|\.support)?\.js|\.css)$/;
45

56
/**
67
* A list of ResourceInfo objects, suitable for (but not dependent on) JSON serialization.
@@ -113,6 +114,15 @@ class ResourceInfoList {
113114
}
114115
return null;
115116
}
117+
118+
static getDebugName(path) {
119+
if ( RESOURCES_PATTERN.test(path) ) {
120+
if (!path.replace(RESOURCES_PATTERN, "").endsWith("-dbg")) {
121+
return path.replace( RESOURCES_PATTERN, "-dbg$1");
122+
}
123+
}
124+
return null;
125+
}
116126
}
117127

118128
module.exports = ResourceInfoList;

0 commit comments

Comments
 (0)