<commit_before>var chafe = require('./chafe');

var party = function() {
  return {
    guests: [],

    invite: function(name) {
      this.guests.push(name);
    },

    describe: function() {
      return this.guests.join(" and ") + " are dancing";
    }
  };
};

// sane: chain method calls on any object

var birthday = party();
var chain = chafe(birthday)                  // this: { guests: [] }
  .invite("Mary")                            // this: { guests: ["Mary"] }
  .invite("Isla")                            // this: { guests: ["Mary", "Isla"] }
  .invite("Sam");                            // this: { guests: ["Mary", "Isla", "Sam"] }
console.log(chain.describe().chafe.value()); // prints "Mary and Isla and Sam are dancing"

// sanish: switch to pass mode to
//         have each return value be
//         `this` in the next function

chain.chafe.pass()                           // this: "Mary and Isla and Sam are dancing"
  .toUpperCase();                            // this: "MARY AND ISLA AND SAM ARE DANCING"
console.log(chain.chafe.value());            // prints "MARY AND ISLA AND SAM ARE DANCING"

// mental: bind a function as a method
//         to the current `this`

                                             // this: "MARY AND ISLA AND SAM ARE DANCING"
chain.chafe.adhoc(function(punc) {
  return this + punc;
}, "!");                                     // this: "MARY AND ISLA AND SAM ARE DANCING!"
console.log(chain.chafe.value());            // prints "MARY AND ISLA AND SAM ARE DANCING!"<commit_msg>Remove comments from test now they are in the readme<commit_after>var chafe = require('./chafe');

var party = function() {
  return {
    guests: [],

    invite: function(name) {
      this.guests.push(name);
    },

    describe: function() {
      return this.guests.join(" and ") + " are dancing";
    }
  };
};


 var birthday = party();
    var chain = chafe(birthday);                 // this: { guests: [] }
    chain.invite("Mary")                            // this: { guests: ["Mary"] }
      .invite("Isla")                            // this: { guests: ["Mary", "Isla"] }
      .invite("Sam")                            // this: { guests: ["Mary", "Isla", "Sam"] }
      .describe();
    console.log(chain.chafe.value());

chain.chafe.pass()                           // this: "Mary and Isla and Sam are dancing"
      .toUpperCase();                            // this: "MARY AND ISLA AND SAM ARE DANCING"
    console.log(chain.chafe.value());

                                                 // this: "MARY AND ISLA AND SAM ARE DANCING"
    chain.chafe.adhoc(function(punc) {
      return this + punc;
    }, "!");                                     // this: "MARY AND ISLA AND SAM ARE DANCING!"
    console.log(chain.chafe.value());            // prints "MARY AND ISLA AND SAM ARE DANCING!"
{'fraction_non_alphanumeric': 0.14742014742014742, 'fraction_numerical': 0.0, 'mean_word_length': 1.5815217391304348, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '991437', 'n_tokens_mistral': 865, 'n_tokens_neox': 806, 'n_words': 239}