<commit_before>/* globals $*/
$(document).ready(function () {
    $('.quantitySetter').on('change',function(){

        const quantity=$(this).val();
        $(this).next().attr('data-quantity',quantity);


    });

    $('.addToBasket').on('click', function (e) {
        let counter = localStorage.getItem('counter');
        if (counter === null) {
            counter = 0;
        }
        counter++;
        localStorage.setItem('counter', counter);

        const productId = $(e.target).attr('data-id');
        const shopId = $(e.target).attr('data-shop');
        const productName = $(e.target).attr('data-name');
        const productPrice = $(e.target).attr('data-price');
        let productQuantity = $(e.target).attr('data-quantity');
        if(productQuantity===undefined){productQuantity=0}
        const prodTotal=(+productPrice*+productQuantity).toFixed(2);


        const product = {
            key:counter,
            id: productId,
            shopId: shopId,
            name: productName,<commit_msg>add to basket client side js<commit_after>/* globals $*/
$(document).ready(function () {
    $('.quantitySetter').on('change',function(){

        const quantity=$(this).val();
        $(this).next().attr('data-quantity',quantity);


    });

    $('.addToBasket').on('click', function (e) {
        let counter = localStorage.getItem('counter');
        if (counter === null) {
            counter = 0;
        }
        counter++;
        localStorage.setItem('counter', counter);

        const productId = $(e.target).attr('data-id');
        const shopId = $(e.target).attr('data-shop');
        const productName = $(e.target).attr('data-name');
        const productPrice = $(e.target).attr('data-price');
        let productQuantity = $(e.target).attr('data-quantity');
        if(productQuantity===undefined){productQuantity=0}
        const prodTotal=(+productPrice*+productQuantity).toFixed(2);


        const product = {
            id: productId,
            shopId: shopId,
            name: productName,
{'fraction_non_alphanumeric': 0.177734375, 'fraction_numerical': 0.0029296875, 'mean_word_length': 2.551126516464471, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7116069', 'n_tokens_mistral': 590, 'n_tokens_neox': 555, 'n_words': 99}