class-resolver 2.1.0 → 2.1.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/resolver.js +6 -2
- package/dist/resolver.js.map +1 -1
- package/libs/resolver.ts +6 -2
- package/package.json +1 -1
package/dist/resolver.js
CHANGED
|
@@ -58,11 +58,15 @@ class Resolver {
|
|
|
58
58
|
*/
|
|
59
59
|
resolve(type) {
|
|
60
60
|
if (this.updaters.length < 1) {
|
|
61
|
-
throw new Error('
|
|
61
|
+
throw new Error('Unassigned resolve target.');
|
|
62
62
|
}
|
|
63
63
|
const target = this.updaters.find(updater => updater.supports(type));
|
|
64
64
|
if (!target) {
|
|
65
|
-
|
|
65
|
+
// Determine the string representation of the unsupported type
|
|
66
|
+
// If it's a non-null object, use JSON.stringify for detailed output
|
|
67
|
+
// Otherwise, use String() for basic conversion
|
|
68
|
+
const typeString = typeof type === 'object' && type !== null ? JSON.stringify(type) : String(type);
|
|
69
|
+
throw new Error(`Unsupported type: ${typeString}`);
|
|
66
70
|
}
|
|
67
71
|
return target;
|
|
68
72
|
}
|
package/dist/resolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../libs/resolver.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AACH,MAAM,QAAQ;IAOZ;;;OAGG;IACH,YAAY,GAAG,IAAa;QAV5B;;;WAGG;QACK,aAAQ,GAAY,EAAE,CAAC;QAO7B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACK,OAAO,CAAC,IAAa;QAC3B,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACnB,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,QAAiB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAA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MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAErE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,8DAA8D;YAC9D,oEAAoE;YACpE,+CAA+C;YAC/C,MAAM,UAAU,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACnG,MAAM,IAAI,KAAK,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,kBAAe,QAAQ,CAAC"}
|
package/libs/resolver.ts
CHANGED
|
@@ -64,13 +64,17 @@ class Resolver<TBase extends ResolveTarget<any[], any, any> = ResolveTarget<any[
|
|
|
64
64
|
*/
|
|
65
65
|
public resolve(type: TType): TBase {
|
|
66
66
|
if (this.updaters.length < 1) {
|
|
67
|
-
throw new Error('
|
|
67
|
+
throw new Error('Unassigned resolve target.');
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
const target = this.updaters.find(updater => updater.supports(type));
|
|
71
71
|
|
|
72
72
|
if (!target) {
|
|
73
|
-
|
|
73
|
+
// Determine the string representation of the unsupported type
|
|
74
|
+
// If it's a non-null object, use JSON.stringify for detailed output
|
|
75
|
+
// Otherwise, use String() for basic conversion
|
|
76
|
+
const typeString = typeof type === 'object' && type !== null ? JSON.stringify(type) : String(type);
|
|
77
|
+
throw new Error(`Unsupported type: ${typeString}`);
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
return target;
|