Skip to main content
Version: 24.38.0

BrowserProvider.getName() 方法

🌐 BrowserProvider.getName() method

获取此提供者的名称。用于错误消息和日志记录目的。

🌐 Get the name of this provider. Used for error messages and logging purposes.

语法

🌐 Signature

interface BrowserProvider {
getName(): string;
}

返回:

string

提供者名称(例如,“DefaultProvider”、“CustomProvider”)

🌐 The provider name (e.g., "DefaultProvider", "CustomProvider")

附注

🌐 Remarks

此方法用于替代 constructor.name,以避免在生产构建中出现压缩问题。

🌐 This method is used instead of constructor.name to avoid issues with minification in production builds.

示例

🌐 Example

getName() {
return 'MyCustomProvider';
}