* @return {?PageConfig}
()
| 689 | * @return {?PageConfig} |
| 690 | */ |
| 691 | check() { |
| 692 | // Already resolved. |
| 693 | if (!this.configResolver_) { |
| 694 | return null; |
| 695 | } |
| 696 | const config = |
| 697 | this.metaParser_.check() || |
| 698 | this.ldParser_.check() || |
| 699 | this.microdataParser_.check(); |
| 700 | if (config) { |
| 701 | // Product ID has been found: initialize the rest of the config. |
| 702 | this.configResolver_(config); |
| 703 | this.configResolver_ = null; |
| 704 | } else if (this.doc_.isReady()) { |
| 705 | this.configResolver_( |
| 706 | Promise.reject( |
| 707 | user().createError('No config could be discovered in the page') |
| 708 | ) |
| 709 | ); |
| 710 | this.configResolver_ = null; |
| 711 | } |
| 712 | debugLog(config); |
| 713 | return config; |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | class TypeChecker { |
nothing calls this directly
no test coverage detected