HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/must-contain.ts.tar
plugins/woocommerce/packages/woocommerce-blocks/packages/checkout/utils/validation/must-contain.ts000064400000001124151555303430042152 0ustar00var/www/vhosts/uyarreklam.com.tr/httpdocs/wp-content/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';

/**
 * Ensures that a given value contains a string, or throws an error.
 */
const mustContain = ( value: string, requiredValue: string ): true | never => {
	if ( ! value.includes( requiredValue ) ) {
		throw Error(
			sprintf(
				/* translators: %1$s value passed to filter, %2$s : value that must be included. */
				__(
					'Returned value must include %1$s, you passed "%2$s"',
					'woo-gutenberg-products-block'
				),
				requiredValue,
				value
			)
		);
	}
	return true;
};

export default mustContain;