Skip to content

Commit

Permalink
More docs tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel committed Oct 2, 2024
1 parent 2327b0f commit dd772bd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Object.defineProperty(exports, '__esModule', {value: true});
const data = {
name: 'decodeEncodedVariant',
category: 'utilities',
subCategory: 'Product option value decoder',
isVisualComponent: false,
related: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
const data: ReferenceEntityTemplateSchema = {
name: 'decodeEncodedVariant',
category: 'utilities',
subCategory: 'Product option value decoder',
isVisualComponent: false,
related: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
const data: ReferenceEntityTemplateSchema = {
name: 'isOptionValueCombinationInEncodedVariant',
category: 'utilities',
subCategory: 'Product option value decoder',
isVisualComponent: false,
related: [
{
Expand Down Expand Up @@ -32,8 +31,7 @@ const data: ReferenceEntityTemplateSchema = {
{
title: 'Props',
type: 'IsOptionValueCombinationInEncodedVariantForDocs',
description:
'Determines whether an option value set is present in an encoded option value string.',
description: '',
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ isOptionValueCombinationInEncodedVariant([1, 0], encodedVariantExistence); // Re
isOptionValueCombinationInEncodedVariant([1, 1], encodedVariantExistence); // Return false - no variant exist for [Blue, M]
isOptionValueCombinationInEncodedVariant([1, 2], encodedVariantExistence); // Return true

// Returns false since there is no entry for the third option
isOptionValueCombinationInEncodedVariant([2], encodedVariantExistence); // Return false - no variant exist for [Green]
// Returns false since there is no variant exist for [Green]
isOptionValueCombinationInEncodedVariant([2], encodedVariantExistence); // Return false
8 changes: 2 additions & 6 deletions packages/hydrogen-react/src/optionValueDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ const V1_CONTROL_CHARS = {
};

export type IsOptionValueCombinationInEncodedVariantForDocs = (
/**
* Indices of option values to look up in the encoded option value string. A partial set of indices may be passed to determine whether a node or any children is present. For example, if a product has 3 options, passing [0] will return true if any option value combination for the first option's option value is present in the encoded string.
*/
/* Indices of option values to look up in the encoded option value string. A partial set of indices may be passed to determine whether a node or any children is present. For example, if a product has 3 options, passing [0] will return true if any option value combination for the first option's option value is present in the encoded string. */
targetOptionValueIndices: number[],
/**
* Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantavailability)
*/
/* Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2024-10/objects/Product#field-encodedvariantavailability) */
encodedVariantField: string,
) => boolean;

Expand Down

0 comments on commit dd772bd

Please sign in to comment.