path-serializer 0.0.3 → 0.0.4

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/main.cjs CHANGED
@@ -1,6 +1,216 @@
1
+ var __webpack_modules__ = ({
2
+ "./node_modules/.pnpm/upath@2.0.1/node_modules/upath/build/code/upath.js": (function (__unused_webpack_module, exports, __webpack_require__) {
3
+ /**
4
+ * upath http://github.com/anodynos/upath/
5
+ *
6
+ * A proxy to `path`, replacing `\` with `/` for all results (supports UNC paths) & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.
7
+ * Version 2.0.1 - Compiled on 2020-11-07 16:59:47
8
+ * Repository git://github.com/anodynos/upath
9
+ * Copyright(c) 2020 Angelos Pikoulas <agelos.pikoulas@gmail.com>
10
+ * License MIT
11
+ */
12
+
13
+ // Generated by uRequire v0.7.0-beta.33 target: 'lib' template: 'nodejs'
14
+
15
+
16
+ var VERSION = '2.0.1'; // injected by urequire-rc-inject-version
17
+
18
+ var extraFn, extraFunctions, isFunction, isString, isValidExt, name, path, propName, propValue, toUnix, upath, slice = [].slice, indexOf = [].indexOf || function (item) {
19
+ for (var i = 0, l = this.length; i < l; i++) {
20
+ if (i in this && this[i] === item)
21
+ return i;
22
+ }
23
+ return -1;
24
+ }, hasProp = {}.hasOwnProperty;
25
+ path = __webpack_require__("path");
26
+ isFunction = function (val) {
27
+ return typeof val === "function";
28
+ };
29
+ isString = function (val) {
30
+ return typeof val === "string" || !!val && typeof val === "object" && Object.prototype.toString.call(val) === "[object String]";
31
+ };
32
+ upath = exports;
33
+ upath.VERSION = typeof VERSION !== "undefined" && VERSION !== null ? VERSION : "NO-VERSION";
34
+ toUnix = function (p) {
35
+ p = p.replace(/\\/g, "/");
36
+ p = p.replace(/(?<!^)\/+/g, "/");
37
+ return p;
38
+ };
39
+ for (propName in path) {
40
+ propValue = path[propName];
41
+ if (isFunction(propValue)) {
42
+ upath[propName] = function (propName) {
43
+ return function () {
44
+ var args, result;
45
+ args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
46
+ args = args.map(function (p) {
47
+ if (isString(p)) {
48
+ return toUnix(p);
49
+ } else {
50
+ return p;
51
+ }
52
+ });
53
+ result = path[propName].apply(path, args);
54
+ if (isString(result)) {
55
+ return toUnix(result);
56
+ } else {
57
+ return result;
58
+ }
59
+ };
60
+ }(propName);
61
+ } else {
62
+ upath[propName] = propValue;
63
+ }
64
+ }
65
+ upath.sep = "/";
66
+ extraFunctions = {
67
+ toUnix: toUnix,
68
+ normalizeSafe: function (p) {
69
+ var result;
70
+ p = toUnix(p);
71
+ result = upath.normalize(p);
72
+ if (p.startsWith("./") && !result.startsWith("./") && !result.startsWith("..")) {
73
+ result = "./" + result;
74
+ } else if (p.startsWith("//") && !result.startsWith("//")) {
75
+ if (p.startsWith("//./")) {
76
+ result = "//." + result;
77
+ } else {
78
+ result = "/" + result;
79
+ }
80
+ }
81
+ return result;
82
+ },
83
+ normalizeTrim: function (p) {
84
+ p = upath.normalizeSafe(p);
85
+ if (p.endsWith("/")) {
86
+ return p.slice(0, +(p.length - 2) + 1 || 9000000000);
87
+ } else {
88
+ return p;
89
+ }
90
+ },
91
+ joinSafe: function () {
92
+ var p, p0, result;
93
+ p = 1 <= arguments.length ? slice.call(arguments, 0) : [];
94
+ result = upath.join.apply(null, p);
95
+ if (p.length > 0) {
96
+ p0 = toUnix(p[0]);
97
+ if (p0.startsWith("./") && !result.startsWith("./") && !result.startsWith("..")) {
98
+ result = "./" + result;
99
+ } else if (p0.startsWith("//") && !result.startsWith("//")) {
100
+ if (p0.startsWith("//./")) {
101
+ result = "//." + result;
102
+ } else {
103
+ result = "/" + result;
104
+ }
105
+ }
106
+ }
107
+ return result;
108
+ },
109
+ addExt: function (file, ext) {
110
+ if (!ext) {
111
+ return file;
112
+ } else {
113
+ if (ext[0] !== ".") {
114
+ ext = "." + ext;
115
+ }
116
+ return file + (file.endsWith(ext) ? "" : ext);
117
+ }
118
+ },
119
+ trimExt: function (filename, ignoreExts, maxSize) {
120
+ var oldExt;
121
+ if (maxSize == null) {
122
+ maxSize = 7;
123
+ }
124
+ oldExt = upath.extname(filename);
125
+ if (isValidExt(oldExt, ignoreExts, maxSize)) {
126
+ return filename.slice(0, +(filename.length - oldExt.length - 1) + 1 || 9000000000);
127
+ } else {
128
+ return filename;
129
+ }
130
+ },
131
+ removeExt: function (filename, ext) {
132
+ if (!ext) {
133
+ return filename;
134
+ } else {
135
+ ext = ext[0] === "." ? ext : "." + ext;
136
+ if (upath.extname(filename) === ext) {
137
+ return upath.trimExt(filename, [], ext.length);
138
+ } else {
139
+ return filename;
140
+ }
141
+ }
142
+ },
143
+ changeExt: function (filename, ext, ignoreExts, maxSize) {
144
+ if (maxSize == null) {
145
+ maxSize = 7;
146
+ }
147
+ return upath.trimExt(filename, ignoreExts, maxSize) + (!ext ? "" : ext[0] === "." ? ext : "." + ext);
148
+ },
149
+ defaultExt: function (filename, ext, ignoreExts, maxSize) {
150
+ var oldExt;
151
+ if (maxSize == null) {
152
+ maxSize = 7;
153
+ }
154
+ oldExt = upath.extname(filename);
155
+ if (isValidExt(oldExt, ignoreExts, maxSize)) {
156
+ return filename;
157
+ } else {
158
+ return upath.addExt(filename, ext);
159
+ }
160
+ }
161
+ };
162
+ isValidExt = function (ext, ignoreExts, maxSize) {
163
+ if (ignoreExts == null) {
164
+ ignoreExts = [];
165
+ }
166
+ return ext && ext.length <= maxSize && indexOf.call(ignoreExts.map(function (e) {
167
+ return (e && e[0] !== "." ? "." : "") + e;
168
+ }), ext) < 0;
169
+ };
170
+ for (name in extraFunctions) {
171
+ if (!hasProp.call(extraFunctions, name))
172
+ continue;
173
+ extraFn = extraFunctions[name];
174
+ if (upath[name] !== void 0) {
175
+ throw new Error("path." + name + " already exists.");
176
+ } else {
177
+ upath[name] = extraFn;
178
+ }
179
+ }
180
+
181
+ ;
182
+
183
+ }),
184
+ "path": (function (module) {
1
185
  "use strict";
2
- // The require scope
3
- var __webpack_require__ = {};
186
+ module.exports = require("path");
187
+
188
+ }),
189
+
190
+ });
191
+ /************************************************************************/
192
+ // The module cache
193
+ var __webpack_module_cache__ = {};
194
+
195
+ // The require function
196
+ function __webpack_require__(moduleId) {
197
+
198
+ // Check if module is in cache
199
+ var cachedModule = __webpack_module_cache__[moduleId];
200
+ if (cachedModule !== undefined) {
201
+ return cachedModule.exports;
202
+ }
203
+ // Create a new module (and put it into the cache)
204
+ var module = (__webpack_module_cache__[moduleId] = {
205
+ exports: {}
206
+ });
207
+ // Execute the module function
208
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
209
+
210
+ // Return the exports of the module
211
+ return module.exports;
212
+
213
+ }
4
214
 
5
215
  /************************************************************************/
6
216
  // webpack/runtime/compat_get_default_export
@@ -48,6 +258,9 @@ __webpack_require__.r = function(exports) {
48
258
  })();
49
259
  /************************************************************************/
50
260
  var __webpack_exports__ = {};
261
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
262
+ (() => {
263
+ "use strict";
51
264
  // ESM COMPAT FLAG
52
265
  __webpack_require__.r(__webpack_exports__);
53
266
 
@@ -770,184 +983,14 @@ function escapeRegExp(string) {
770
983
 
771
984
  /* harmony default export */ const lodash_es_escapeRegExp = (escapeRegExp);
772
985
 
773
- ;// CONCATENATED MODULE: ./src/upath.mjs
774
- // @ts-nocheck
775
- /**
776
- * upath http://github.com/anodynos/upath/
777
- *
778
- * A proxy to `path`, replacing `\` with `/` for all results (supports UNC paths) & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.
779
- * Version 2.0.1 - Compiled on 2020-11-07 16:59:47
780
- * Repository git://github.com/anodynos/upath
781
- * Copyright(c) 2020 Angelos Pikoulas <agelos.pikoulas@gmail.com>
782
- * License MIT
783
- */ // Generated by uRequire v0.7.0-beta.33 target: 'lib' template: 'nodejs'
784
-
785
- const VERSION = '2.0.1';
786
- // injected by urequire-rc-inject-version
787
- let extraFn;
788
- let extraFunctions;
789
- let isFunction;
790
- let isString;
791
- let isValidExt;
792
- let upath_name;
793
- let upath_propName;
794
- let propValue;
795
- let toUnix;
796
- let upath;
797
- const slice = [].slice;
798
- const indexOf = [].indexOf || function(item) {
799
- for(let i = 0, l = this.length; i < l; i++){
800
- if (i in this && this[i] === item) return i;
801
- }
802
- return -1;
803
- };
804
- const hasProp = {}.hasOwnProperty;
805
- isFunction = (val)=>typeof val === 'function';
806
- isString = (val)=>typeof val === 'string' || !!val && typeof val === 'object' && Object.prototype.toString.call(val) === '[object String]';
807
- upath.VERSION = typeof VERSION !== 'undefined' && VERSION !== null ? VERSION : 'NO-VERSION';
808
- toUnix = (p)=>{
809
- p = p.replace(/\\/g, '/');
810
- p = p.replace(/(?<!^)\/+/g, '/');
811
- return p;
812
- };
813
- for(upath_propName in (external_node_path_default())){
814
- propValue = (external_node_path_default())[upath_propName];
815
- if (isFunction(propValue)) {
816
- upath[upath_propName] = ((propName)=>()=>{
817
- let args;
818
- let result;
819
- args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
820
- args = args.map((p)=>{
821
- if (isString(p)) {
822
- return toUnix(p);
823
- }
824
- return p;
825
- });
826
- result = (external_node_path_default())[propName].apply((external_node_path_default()), args);
827
- if (isString(result)) {
828
- return toUnix(result);
829
- }
830
- return result;
831
- })(upath_propName);
832
- } else {
833
- upath[upath_propName] = propValue;
834
- }
835
- }
836
- upath.sep = '/';
837
- extraFunctions = {
838
- toUnix: toUnix,
839
- normalizeSafe: (p)=>{
840
- let result;
841
- p = toUnix(p);
842
- result = upath.normalize(p);
843
- if (p.startsWith('./') && !result.startsWith('./') && !result.startsWith('..')) {
844
- result = `./${result}`;
845
- } else if (p.startsWith('//') && !result.startsWith('//')) {
846
- if (p.startsWith('//./')) {
847
- result = `//.${result}`;
848
- } else {
849
- result = `/${result}`;
850
- }
851
- }
852
- return result;
853
- },
854
- normalizeTrim: (p)=>{
855
- p = upath.normalizeSafe(p);
856
- if (p.endsWith('/')) {
857
- return p.slice(0, +(p.length - 2) + 1 || 9000000000);
858
- }
859
- return p;
860
- },
861
- joinSafe: ()=>{
862
- let p;
863
- let p0;
864
- let result;
865
- p = 1 <= arguments.length ? slice.call(arguments, 0) : [];
866
- result = upath.join.apply(null, p);
867
- if (p.length > 0) {
868
- p0 = toUnix(p[0]);
869
- if (p0.startsWith('./') && !result.startsWith('./') && !result.startsWith('..')) {
870
- result = `./${result}`;
871
- } else if (p0.startsWith('//') && !result.startsWith('//')) {
872
- if (p0.startsWith('//./')) {
873
- result = `//.${result}`;
874
- } else {
875
- result = `/${result}`;
876
- }
877
- }
878
- }
879
- return result;
880
- },
881
- addExt: (file, ext)=>{
882
- if (!ext) {
883
- return file;
884
- }
885
- if (ext[0] !== '.') {
886
- ext = `.${ext}`;
887
- }
888
- return file + (file.endsWith(ext) ? '' : ext);
889
- },
890
- trimExt: (filename, ignoreExts, maxSize)=>{
891
- let oldExt;
892
- if (maxSize == null) {
893
- maxSize = 7;
894
- }
895
- oldExt = upath.extname(filename);
896
- if (isValidExt(oldExt, ignoreExts, maxSize)) {
897
- return filename.slice(0, +(filename.length - oldExt.length - 1) + 1 || 9000000000);
898
- }
899
- return filename;
900
- },
901
- removeExt: (filename, ext)=>{
902
- if (!ext) {
903
- return filename;
904
- }
905
- ext = ext[0] === '.' ? ext : `.${ext}`;
906
- if (upath.extname(filename) === ext) {
907
- return upath.trimExt(filename, [], ext.length);
908
- }
909
- return filename;
910
- },
911
- changeExt: (filename, ext, ignoreExts, maxSize)=>{
912
- if (maxSize == null) {
913
- maxSize = 7;
914
- }
915
- return upath.trimExt(filename, ignoreExts, maxSize) + (!ext ? '' : ext[0] === '.' ? ext : `.${ext}`);
916
- },
917
- defaultExt: (filename, ext, ignoreExts, maxSize)=>{
918
- let oldExt;
919
- if (maxSize == null) {
920
- maxSize = 7;
921
- }
922
- oldExt = upath.extname(filename);
923
- if (isValidExt(oldExt, ignoreExts, maxSize)) {
924
- return filename;
925
- }
926
- return upath.addExt(filename, ext);
927
- }
928
- };
929
- isValidExt = (ext, ignoreExts, maxSize)=>{
930
- if (ignoreExts == null) {
931
- ignoreExts = [];
932
- }
933
- return ext && ext.length <= maxSize && indexOf.call(ignoreExts.map((e)=>(e && e[0] !== '.' ? '.' : '') + e), ext) < 0;
934
- };
935
- for(upath_name in extraFunctions){
936
- if (!hasProp.call(extraFunctions, upath_name)) continue;
937
- extraFn = extraFunctions[upath_name];
938
- if (upath[upath_name] !== void 0) {
939
- throw new Error(`path.${upath_name} already exists.`);
940
- }
941
- upath[upath_name] = extraFn;
942
- }
943
-
944
-
986
+ // EXTERNAL MODULE: ./node_modules/.pnpm/upath@2.0.1/node_modules/upath/build/code/upath.js
987
+ var upath = __webpack_require__("./node_modules/.pnpm/upath@2.0.1/node_modules/upath/build/code/upath.js");
988
+ var upath_default = /*#__PURE__*/__webpack_require__.n(upath);
945
989
  ;// CONCATENATED MODULE: ./src/utils.ts
946
990
 
947
991
 
948
992
 
949
993
 
950
- // @ts-ignore
951
994
 
952
995
  const isPathString = (test)=>external_node_path_default().posix.basename(test) !== test || external_node_path_default().win32.basename(test) !== test;
953
996
  function getRealTemporaryDirectory() {
@@ -959,7 +1002,7 @@ function getRealTemporaryDirectory() {
959
1002
  return ret;
960
1003
  }
961
1004
  const normalizeToPosixPath = (p)=>{
962
- return upath.normalizeSafe(external_node_path_default().normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`);
1005
+ return upath_default().normalizeSafe(external_node_path_default().normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`);
963
1006
  };
964
1007
  /**
965
1008
  * Compile path string to RegExp.
@@ -1059,6 +1102,8 @@ function createSnapshotSerializer(options) {
1059
1102
  ;// CONCATENATED MODULE: ./src/index.ts
1060
1103
 
1061
1104
 
1105
+ })();
1106
+
1062
1107
  var __webpack_export_target__ = exports;
1063
1108
  for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
1064
1109
  if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', { value: true });
package/dist/esm/main.js CHANGED
@@ -1,10 +1,236 @@
1
+ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
1
2
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs__ from "node:fs";
2
3
  import * as __WEBPACK_EXTERNAL_MODULE_node_os__ from "node:os";
3
4
  import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path";
4
- // The require scope
5
- var __webpack_require__ = {};
5
+ var __webpack_modules__ = ({
6
+ "./node_modules/.pnpm/upath@2.0.1/node_modules/upath/build/code/upath.js": (function (__unused_webpack_module, exports, __webpack_require__) {
7
+ /**
8
+ * upath http://github.com/anodynos/upath/
9
+ *
10
+ * A proxy to `path`, replacing `\` with `/` for all results (supports UNC paths) & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.
11
+ * Version 2.0.1 - Compiled on 2020-11-07 16:59:47
12
+ * Repository git://github.com/anodynos/upath
13
+ * Copyright(c) 2020 Angelos Pikoulas <agelos.pikoulas@gmail.com>
14
+ * License MIT
15
+ */
16
+
17
+ // Generated by uRequire v0.7.0-beta.33 target: 'lib' template: 'nodejs'
18
+
6
19
 
20
+ var VERSION = '2.0.1'; // injected by urequire-rc-inject-version
21
+
22
+ var extraFn, extraFunctions, isFunction, isString, isValidExt, name, path, propName, propValue, toUnix, upath, slice = [].slice, indexOf = [].indexOf || function (item) {
23
+ for (var i = 0, l = this.length; i < l; i++) {
24
+ if (i in this && this[i] === item)
25
+ return i;
26
+ }
27
+ return -1;
28
+ }, hasProp = {}.hasOwnProperty;
29
+ path = __webpack_require__("path");
30
+ isFunction = function (val) {
31
+ return typeof val === "function";
32
+ };
33
+ isString = function (val) {
34
+ return typeof val === "string" || !!val && typeof val === "object" && Object.prototype.toString.call(val) === "[object String]";
35
+ };
36
+ upath = exports;
37
+ upath.VERSION = typeof VERSION !== "undefined" && VERSION !== null ? VERSION : "NO-VERSION";
38
+ toUnix = function (p) {
39
+ p = p.replace(/\\/g, "/");
40
+ p = p.replace(/(?<!^)\/+/g, "/");
41
+ return p;
42
+ };
43
+ for (propName in path) {
44
+ propValue = path[propName];
45
+ if (isFunction(propValue)) {
46
+ upath[propName] = function (propName) {
47
+ return function () {
48
+ var args, result;
49
+ args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
50
+ args = args.map(function (p) {
51
+ if (isString(p)) {
52
+ return toUnix(p);
53
+ } else {
54
+ return p;
55
+ }
56
+ });
57
+ result = path[propName].apply(path, args);
58
+ if (isString(result)) {
59
+ return toUnix(result);
60
+ } else {
61
+ return result;
62
+ }
63
+ };
64
+ }(propName);
65
+ } else {
66
+ upath[propName] = propValue;
67
+ }
68
+ }
69
+ upath.sep = "/";
70
+ extraFunctions = {
71
+ toUnix: toUnix,
72
+ normalizeSafe: function (p) {
73
+ var result;
74
+ p = toUnix(p);
75
+ result = upath.normalize(p);
76
+ if (p.startsWith("./") && !result.startsWith("./") && !result.startsWith("..")) {
77
+ result = "./" + result;
78
+ } else if (p.startsWith("//") && !result.startsWith("//")) {
79
+ if (p.startsWith("//./")) {
80
+ result = "//." + result;
81
+ } else {
82
+ result = "/" + result;
83
+ }
84
+ }
85
+ return result;
86
+ },
87
+ normalizeTrim: function (p) {
88
+ p = upath.normalizeSafe(p);
89
+ if (p.endsWith("/")) {
90
+ return p.slice(0, +(p.length - 2) + 1 || 9000000000);
91
+ } else {
92
+ return p;
93
+ }
94
+ },
95
+ joinSafe: function () {
96
+ var p, p0, result;
97
+ p = 1 <= arguments.length ? slice.call(arguments, 0) : [];
98
+ result = upath.join.apply(null, p);
99
+ if (p.length > 0) {
100
+ p0 = toUnix(p[0]);
101
+ if (p0.startsWith("./") && !result.startsWith("./") && !result.startsWith("..")) {
102
+ result = "./" + result;
103
+ } else if (p0.startsWith("//") && !result.startsWith("//")) {
104
+ if (p0.startsWith("//./")) {
105
+ result = "//." + result;
106
+ } else {
107
+ result = "/" + result;
108
+ }
109
+ }
110
+ }
111
+ return result;
112
+ },
113
+ addExt: function (file, ext) {
114
+ if (!ext) {
115
+ return file;
116
+ } else {
117
+ if (ext[0] !== ".") {
118
+ ext = "." + ext;
119
+ }
120
+ return file + (file.endsWith(ext) ? "" : ext);
121
+ }
122
+ },
123
+ trimExt: function (filename, ignoreExts, maxSize) {
124
+ var oldExt;
125
+ if (maxSize == null) {
126
+ maxSize = 7;
127
+ }
128
+ oldExt = upath.extname(filename);
129
+ if (isValidExt(oldExt, ignoreExts, maxSize)) {
130
+ return filename.slice(0, +(filename.length - oldExt.length - 1) + 1 || 9000000000);
131
+ } else {
132
+ return filename;
133
+ }
134
+ },
135
+ removeExt: function (filename, ext) {
136
+ if (!ext) {
137
+ return filename;
138
+ } else {
139
+ ext = ext[0] === "." ? ext : "." + ext;
140
+ if (upath.extname(filename) === ext) {
141
+ return upath.trimExt(filename, [], ext.length);
142
+ } else {
143
+ return filename;
144
+ }
145
+ }
146
+ },
147
+ changeExt: function (filename, ext, ignoreExts, maxSize) {
148
+ if (maxSize == null) {
149
+ maxSize = 7;
150
+ }
151
+ return upath.trimExt(filename, ignoreExts, maxSize) + (!ext ? "" : ext[0] === "." ? ext : "." + ext);
152
+ },
153
+ defaultExt: function (filename, ext, ignoreExts, maxSize) {
154
+ var oldExt;
155
+ if (maxSize == null) {
156
+ maxSize = 7;
157
+ }
158
+ oldExt = upath.extname(filename);
159
+ if (isValidExt(oldExt, ignoreExts, maxSize)) {
160
+ return filename;
161
+ } else {
162
+ return upath.addExt(filename, ext);
163
+ }
164
+ }
165
+ };
166
+ isValidExt = function (ext, ignoreExts, maxSize) {
167
+ if (ignoreExts == null) {
168
+ ignoreExts = [];
169
+ }
170
+ return ext && ext.length <= maxSize && indexOf.call(ignoreExts.map(function (e) {
171
+ return (e && e[0] !== "." ? "." : "") + e;
172
+ }), ext) < 0;
173
+ };
174
+ for (name in extraFunctions) {
175
+ if (!hasProp.call(extraFunctions, name))
176
+ continue;
177
+ extraFn = extraFunctions[name];
178
+ if (upath[name] !== void 0) {
179
+ throw new Error("path." + name + " already exists.");
180
+ } else {
181
+ upath[name] = extraFn;
182
+ }
183
+ }
184
+
185
+ ;
186
+
187
+ }),
188
+ "path": (function (module) {
189
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path");
190
+
191
+ }),
192
+
193
+ });
7
194
  /************************************************************************/
195
+ // The module cache
196
+ var __webpack_module_cache__ = {};
197
+
198
+ // The require function
199
+ function __webpack_require__(moduleId) {
200
+
201
+ // Check if module is in cache
202
+ var cachedModule = __webpack_module_cache__[moduleId];
203
+ if (cachedModule !== undefined) {
204
+ return cachedModule.exports;
205
+ }
206
+ // Create a new module (and put it into the cache)
207
+ var module = (__webpack_module_cache__[moduleId] = {
208
+ exports: {}
209
+ });
210
+ // Execute the module function
211
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
212
+
213
+ // Return the exports of the module
214
+ return module.exports;
215
+
216
+ }
217
+
218
+ /************************************************************************/
219
+ // webpack/runtime/compat_get_default_export
220
+ (() => {
221
+ // getDefaultExport function for compatibility with non-harmony modules
222
+ __webpack_require__.n = function (module) {
223
+ var getter = module && module.__esModule ?
224
+ function () { return module['default']; } :
225
+ function () { return module; };
226
+ __webpack_require__.d(getter, { a: getter });
227
+ return getter;
228
+ };
229
+
230
+
231
+
232
+
233
+ })();
8
234
  // webpack/runtime/define_property_getters
9
235
  (() => {
10
236
  __webpack_require__.d = function(exports, definition) {
@@ -23,6 +249,7 @@ __webpack_require__.o = function (obj, prop) {
23
249
 
24
250
  })();
25
251
  /************************************************************************/
252
+ var __webpack_exports__ = {};
26
253
 
27
254
  ;// CONCATENATED MODULE: ./node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js
28
255
  /**
@@ -747,184 +974,14 @@ function escapeRegExp(string) {
747
974
 
748
975
  /* harmony default export */ const lodash_es_escapeRegExp = (escapeRegExp);
749
976
 
750
- ;// CONCATENATED MODULE: ./src/upath.mjs
751
- // @ts-nocheck
752
- /**
753
- * upath http://github.com/anodynos/upath/
754
- *
755
- * A proxy to `path`, replacing `\` with `/` for all results (supports UNC paths) & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.
756
- * Version 2.0.1 - Compiled on 2020-11-07 16:59:47
757
- * Repository git://github.com/anodynos/upath
758
- * Copyright(c) 2020 Angelos Pikoulas <agelos.pikoulas@gmail.com>
759
- * License MIT
760
- */ // Generated by uRequire v0.7.0-beta.33 target: 'lib' template: 'nodejs'
761
-
762
- const VERSION = '2.0.1';
763
- // injected by urequire-rc-inject-version
764
- let extraFn;
765
- let extraFunctions;
766
- let isFunction;
767
- let isString;
768
- let isValidExt;
769
- let upath_name;
770
- let upath_propName;
771
- let propValue;
772
- let toUnix;
773
- let upath;
774
- const slice = [].slice;
775
- const indexOf = [].indexOf || function(item) {
776
- for(let i = 0, l = this.length; i < l; i++){
777
- if (i in this && this[i] === item) return i;
778
- }
779
- return -1;
780
- };
781
- const hasProp = {}.hasOwnProperty;
782
- isFunction = (val)=>typeof val === 'function';
783
- isString = (val)=>typeof val === 'string' || !!val && typeof val === 'object' && Object.prototype.toString.call(val) === '[object String]';
784
- upath.VERSION = typeof VERSION !== 'undefined' && VERSION !== null ? VERSION : 'NO-VERSION';
785
- toUnix = (p)=>{
786
- p = p.replace(/\\/g, '/');
787
- p = p.replace(/(?<!^)\/+/g, '/');
788
- return p;
789
- };
790
- for(upath_propName in external_node_path_namespaceObject["default"]){
791
- propValue = external_node_path_namespaceObject["default"][upath_propName];
792
- if (isFunction(propValue)) {
793
- upath[upath_propName] = ((propName)=>()=>{
794
- let args;
795
- let result;
796
- args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
797
- args = args.map((p)=>{
798
- if (isString(p)) {
799
- return toUnix(p);
800
- }
801
- return p;
802
- });
803
- result = external_node_path_namespaceObject["default"][propName].apply(external_node_path_namespaceObject["default"], args);
804
- if (isString(result)) {
805
- return toUnix(result);
806
- }
807
- return result;
808
- })(upath_propName);
809
- } else {
810
- upath[upath_propName] = propValue;
811
- }
812
- }
813
- upath.sep = '/';
814
- extraFunctions = {
815
- toUnix: toUnix,
816
- normalizeSafe: (p)=>{
817
- let result;
818
- p = toUnix(p);
819
- result = upath.normalize(p);
820
- if (p.startsWith('./') && !result.startsWith('./') && !result.startsWith('..')) {
821
- result = `./${result}`;
822
- } else if (p.startsWith('//') && !result.startsWith('//')) {
823
- if (p.startsWith('//./')) {
824
- result = `//.${result}`;
825
- } else {
826
- result = `/${result}`;
827
- }
828
- }
829
- return result;
830
- },
831
- normalizeTrim: (p)=>{
832
- p = upath.normalizeSafe(p);
833
- if (p.endsWith('/')) {
834
- return p.slice(0, +(p.length - 2) + 1 || 9000000000);
835
- }
836
- return p;
837
- },
838
- joinSafe: ()=>{
839
- let p;
840
- let p0;
841
- let result;
842
- p = 1 <= arguments.length ? slice.call(arguments, 0) : [];
843
- result = upath.join.apply(null, p);
844
- if (p.length > 0) {
845
- p0 = toUnix(p[0]);
846
- if (p0.startsWith('./') && !result.startsWith('./') && !result.startsWith('..')) {
847
- result = `./${result}`;
848
- } else if (p0.startsWith('//') && !result.startsWith('//')) {
849
- if (p0.startsWith('//./')) {
850
- result = `//.${result}`;
851
- } else {
852
- result = `/${result}`;
853
- }
854
- }
855
- }
856
- return result;
857
- },
858
- addExt: (file, ext)=>{
859
- if (!ext) {
860
- return file;
861
- }
862
- if (ext[0] !== '.') {
863
- ext = `.${ext}`;
864
- }
865
- return file + (file.endsWith(ext) ? '' : ext);
866
- },
867
- trimExt: (filename, ignoreExts, maxSize)=>{
868
- let oldExt;
869
- if (maxSize == null) {
870
- maxSize = 7;
871
- }
872
- oldExt = upath.extname(filename);
873
- if (isValidExt(oldExt, ignoreExts, maxSize)) {
874
- return filename.slice(0, +(filename.length - oldExt.length - 1) + 1 || 9000000000);
875
- }
876
- return filename;
877
- },
878
- removeExt: (filename, ext)=>{
879
- if (!ext) {
880
- return filename;
881
- }
882
- ext = ext[0] === '.' ? ext : `.${ext}`;
883
- if (upath.extname(filename) === ext) {
884
- return upath.trimExt(filename, [], ext.length);
885
- }
886
- return filename;
887
- },
888
- changeExt: (filename, ext, ignoreExts, maxSize)=>{
889
- if (maxSize == null) {
890
- maxSize = 7;
891
- }
892
- return upath.trimExt(filename, ignoreExts, maxSize) + (!ext ? '' : ext[0] === '.' ? ext : `.${ext}`);
893
- },
894
- defaultExt: (filename, ext, ignoreExts, maxSize)=>{
895
- let oldExt;
896
- if (maxSize == null) {
897
- maxSize = 7;
898
- }
899
- oldExt = upath.extname(filename);
900
- if (isValidExt(oldExt, ignoreExts, maxSize)) {
901
- return filename;
902
- }
903
- return upath.addExt(filename, ext);
904
- }
905
- };
906
- isValidExt = (ext, ignoreExts, maxSize)=>{
907
- if (ignoreExts == null) {
908
- ignoreExts = [];
909
- }
910
- return ext && ext.length <= maxSize && indexOf.call(ignoreExts.map((e)=>(e && e[0] !== '.' ? '.' : '') + e), ext) < 0;
911
- };
912
- for(upath_name in extraFunctions){
913
- if (!hasProp.call(extraFunctions, upath_name)) continue;
914
- extraFn = extraFunctions[upath_name];
915
- if (upath[upath_name] !== void 0) {
916
- throw new Error(`path.${upath_name} already exists.`);
917
- }
918
- upath[upath_name] = extraFn;
919
- }
920
-
921
-
977
+ // EXTERNAL MODULE: ./node_modules/.pnpm/upath@2.0.1/node_modules/upath/build/code/upath.js
978
+ var upath = __webpack_require__("./node_modules/.pnpm/upath@2.0.1/node_modules/upath/build/code/upath.js");
979
+ var upath_default = /*#__PURE__*/__webpack_require__.n(upath);
922
980
  ;// CONCATENATED MODULE: ./src/utils.ts
923
981
 
924
982
 
925
983
 
926
984
 
927
- // @ts-ignore
928
985
 
929
986
  const isPathString = (test)=>external_node_path_namespaceObject["default"].posix.basename(test) !== test || external_node_path_namespaceObject["default"].win32.basename(test) !== test;
930
987
  function getRealTemporaryDirectory() {
@@ -936,7 +993,7 @@ function getRealTemporaryDirectory() {
936
993
  return ret;
937
994
  }
938
995
  const normalizeToPosixPath = (p)=>{
939
- return upath.normalizeSafe(external_node_path_namespaceObject["default"].normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`);
996
+ return upath_default().normalizeSafe(external_node_path_namespaceObject["default"].normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`);
940
997
  };
941
998
  /**
942
999
  * Compile path string to RegExp.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "path-serializer",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "path-serializer",
5
5
  "keywords": [
6
6
  "snapshot",