Skip to content

Commit

Permalink
SwG Release March 31, 2021 (ampproject#33574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijah Soria authored and rochapablo committed Aug 30, 2021
1 parent 4626024 commit ebcc798
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 88 deletions.
17 changes: 9 additions & 8 deletions third_party/subscriptions-project/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Version: 0.1.22.152 */
/** Version: 0.1.22.154 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down Expand Up @@ -875,20 +875,21 @@ class JsonLdParser {
possibleConfigs = [possibleConfigs];
}

for (let i = 0; i < /** @type {Array} */ (possibleConfigs).length; i++) {
const possibleConfig = possibleConfigs[i];
const configs = /** @type {!Array<!JsonObject>} */ (possibleConfigs);
for (let i = 0; i < configs.length; i++) {
const config = configs[i];

// Must be an ALLOWED_TYPE
if (!this.checkType_.checkValue(possibleConfig['@type'], ALLOWED_TYPES)) {
if (!this.checkType_.checkValue(config['@type'], ALLOWED_TYPES)) {
continue;
}

// Must have a isPartOf[@type=Product].
let productId = null;
const partOfArray = this.valueArray_(possibleConfig, 'isPartOf');
const partOfArray = this.valueArray_(config, 'isPartOf');
if (partOfArray) {
for (let i = 0; i < partOfArray.length; i++) {
productId = this.discoverProductId_(partOfArray[i]);
for (let j = 0; j < partOfArray.length; j++) {
productId = this.discoverProductId_(partOfArray[j]);
if (productId) {
break;
}
Expand All @@ -900,7 +901,7 @@ class JsonLdParser {

// Found product id, just check for the access flag.
const isAccessibleForFree = this.bool_(
this.singleValue_(possibleConfig, 'isAccessibleForFree'),
this.singleValue_(config, 'isAccessibleForFree'),
/* default */ true
);

Expand Down
2 changes: 1 addition & 1 deletion third_party/subscriptions-project/swg-gaa.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Version: 0.1.22.152 */
/** Version: 0.1.22.154 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down
Loading

0 comments on commit ebcc798

Please sign in to comment.