<commit_before>// app.shoppingListService.js

(function() {
  "use strict";

  angular.module("MyApp")
    .service("ShoppingListService", ShoppingListService);

  ShoppingListService.$inject = ["$q", "WeightLossFilterService"];

  function ShoppingListService($q, WeightLossFilterService) {
    let service = this;

    // List of Shopping items
    let items = [];

    service.addItem = addItem;

    function addItem(itemName, itemQuantity) {
      let promise = WeightLossFilterService.checkName(itemName);

      promise.then(response => {
        let nextPromise = WeightLossFilterService.checkQuantity(itemQuantity);

        nextPromise.then(result => {
          let item = {
            name: itemName,
            quantity: itemQuantity
          };

          items.push(item);
        }, errorResponse => {
          console.log(errorResponse.message);
        });
      }, errorResponse => {
        console.log(errorResponse.message);
      });
    }
  }
})();<commit_msg>Change app name. Added getItems method<commit_after>// app.shoppingListService.js

(function() {
  "use strict";

  angular.module("ShoppingListApp")
    .service("ShoppingListService", ShoppingListService);

  ShoppingListService.$inject = ["$q", "WeightLossFilterService"];

  function ShoppingListService($q, WeightLossFilterService) {
    let service = this;

    // List of Shopping items
    let items = [];

    service.addItem = addItem;
    service.getItems = getItems;

    function addItem(itemName, itemQuantity) {
      let promise = WeightLossFilterService.checkName(itemName);

      promise.then(response => {
        let nextPromise = WeightLossFilterService.checkQuantity(itemQuantity);

        nextPromise.then(result => {
          let item = {
            name: itemName,
            quantity: itemQuantity
          };

          items.push(item);
        }, errorResponse => {
          console.log(errorResponse.message);
        });
      }, errorResponse => {
        console.log(errorResponse.message);
      });
    }

    function getItems() {
      return items;
    }
  }
})();
{'fraction_non_alphanumeric': 0.1206485455412494, 'fraction_numerical': 0.0, 'mean_word_length': 2.642361111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5830738', 'n_tokens_mistral': 601, 'n_tokens_neox': 568, 'n_words': 105}