We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03d9d9f commit d6aea9eCopy full SHA for d6aea9e
packages/firestore/src/util/input_validation.ts
@@ -132,14 +132,10 @@ export function valueDescription(input: unknown): string {
132
}
133
134
135
-/** Hacky method to try to get the constructor name for an object. */
+/** try to get the constructor name for an object. */
136
export function tryGetCustomObjectType(input: object): string | null {
137
if (input.constructor) {
138
- const funcNameRegex = /function\s+([^\s(]+)\s*\(/;
139
- const results = funcNameRegex.exec(input.constructor.toString());
140
- if (results && results.length > 1) {
141
- return results[1];
142
- }
+ return input.constructor.name;
143
144
return null;
145
0 commit comments