path-serializer 0.4.0 → 0.4.1

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/cjs/index.js CHANGED
@@ -869,7 +869,7 @@ function __webpack_require__(moduleId) {
869
869
  const normalizePathToPosix = (p)=>upath_default().normalizeSafe(external_node_path_default().normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`);
870
870
  // find the path in code and replace it with normalizePathToPosix
871
871
  const normalizeCodeToPosix = (code)=>code.replace(// ignore http, https, file
872
- /(?<![a-zA-Z])([a-zA-Z]:[\\/])([-\u4e00-\u9fa5\w\s.()~!@#$%^&()\[\]{}+=]+[\\/])*/g, (match, _diskName)=>normalizePathToPosix(match));
872
+ /(?<![a-zA-Z])([a-zA-Z]:[\\/]+)([-\u4e00-\u9fa5\w\s.()~!@#$%^&()\[\]{}+=]+[\\/]+)*/g, (match, _diskName)=>normalizePathToPosix(match.replace(/[\\]{2,}/g, '\\')));
873
873
  const normalizeCLR = (str)=>str.replace(/\u001b\[1m\u001b\[([0-9;]*)m/g, '<CLR=$1,BOLD>').replace(/\u001b\[1m/g, '<CLR=BOLD>').replace(/\u001b\[39m\u001b\[22m/g, '</CLR>').replace(/\u001b\[([0-9;]*)m/g, '<CLR=$1>') // CHANGE: The time unit display in Rspack is second
874
874
  // CHANGE2: avoid a bad case "./react/assets.svg" -> "./react/assetsXsvg"
875
875
  // modified based on https://github.com/webpack/webpack/blob/001cab14692eb9a833c6b56709edbab547e291a1/test/StatsTestCases.basictest.js#L199
@@ -844,7 +844,7 @@ var upath_default = /*#__PURE__*/ __webpack_require__.n(upath);
844
844
  const normalizePathToPosix = (p)=>upath_default().normalizeSafe(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`);
845
845
  // find the path in code and replace it with normalizePathToPosix
846
846
  const normalizeCodeToPosix = (code)=>code.replace(// ignore http, https, file
847
- /(?<![a-zA-Z])([a-zA-Z]:[\\/])([-\u4e00-\u9fa5\w\s.()~!@#$%^&()\[\]{}+=]+[\\/])*/g, (match, _diskName)=>normalizePathToPosix(match));
847
+ /(?<![a-zA-Z])([a-zA-Z]:[\\/]+)([-\u4e00-\u9fa5\w\s.()~!@#$%^&()\[\]{}+=]+[\\/]+)*/g, (match, _diskName)=>normalizePathToPosix(match.replace(/[\\]{2,}/g, '\\')));
848
848
  const normalizeCLR = (str)=>str.replace(/\u001b\[1m\u001b\[([0-9;]*)m/g, '<CLR=$1,BOLD>').replace(/\u001b\[1m/g, '<CLR=BOLD>').replace(/\u001b\[39m\u001b\[22m/g, '</CLR>').replace(/\u001b\[([0-9;]*)m/g, '<CLR=$1>') // CHANGE: The time unit display in Rspack is second
849
849
  // CHANGE2: avoid a bad case "./react/assets.svg" -> "./react/assetsXsvg"
850
850
  // modified based on https://github.com/webpack/webpack/blob/001cab14692eb9a833c6b56709edbab547e291a1/test/StatsTestCases.basictest.js#L199
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "path-serializer",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "path-serializer",
5
5
  "keywords": [
6
6
  "snapshot",