MCPcopy Create free account
hub / github.com/ampproject/amphtml / getOptions_

Method getOptions_

third_party/subscriptions-project/swg.js:8933–8946  ·  view source on GitHub ↗

* * @param {../api/subscriptions.ButtonOptions|../api/subscriptions.SmartButtonOptions|function()} optionsOrCallback * @return {!../api/subscriptions.ButtonOptions|!../api/subscriptions.SmartButtonOptions} * @private

(optionsOrCallback)

Source from the content-addressed store, hash-verified

8931 * @private
8932 */
8933 getOptions_(optionsOrCallback) {
8934 const options =
8935 /** @type {!../api/subscriptions.ButtonOptions|!../api/subscriptions.SmartButtonOptions} */ (
8936 optionsOrCallback && typeof optionsOrCallback != 'function'
8937 ? optionsOrCallback
8938 : {'theme': Theme.LIGHT}
8939 );
8940
8941 const theme = options['theme'];
8942 if (theme !== Theme.LIGHT && theme !== Theme.DARK) {
8943 options['theme'] = Theme.LIGHT;
8944 }
8945 return options;
8946 }
8947
8948 /**
8949 *

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected