<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

define([], function() {
  "use strict";

  var BUILT_IN_COMPONENTS = [
    "polymer-element",
    "ceci-app",
    "ceci-broadcast",
    "ceci-card",
    "ceci-element",
    "ceci-element-base",
    "ceci-listen"
  ];

  // Because of the way requirejs works, this is a singleton.
  var CeciDesigner = {
    // It's expected that the channel object being sent has a .id to uniquely identify it.
    addChannels: function(channels){
      var self = this;
      Array.prototype.forEach.call(channels, function(channel) {
        self.addChannel(channel);
      });
    },
    addChannel: function(channel){
      if (typeof channel !== 'object' || !("id" in channel)){
        throw new TypeError("Channel \"id\" missing.");
      }
      this.channels[channel.id] = channel;
      return this;
    },
    forEachChannel: function(fn){
      for (var x in this.channels){
        fn(this.channels[x]);
      }
      return this;
    },
    getRegisteredComponents: function(){
      var components = [];
      for (var tagName in window.CustomElements.registry){
        if (BUILT_IN_COMPONENTS.indexOf(tagName) === -1){
          components.push(window.CustomElements.registry[tagName]);
        }
      }
      return components;
    },<commit_msg>Components must have ceci definitions<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

define([], function() {
  "use strict";

  var BUILT_IN_COMPONENTS = [
    "polymer-element",
    "ceci-app",
    "ceci-broadcast",
    "ceci-card",
    "ceci-element",
    "ceci-element-base",
    "ceci-listen"
  ];

  // Because of the way requirejs works, this is a singleton.
  var CeciDesigner = {
    // It's expected that the channel object being sent has a .id to uniquely identify it.
    addChannels: function(channels){
      var self = this;
      Array.prototype.forEach.call(channels, function(channel) {
        self.addChannel(channel);
      });
    },
    addChannel: function(channel){
      if (typeof channel !== 'object' || !("id" in channel)){
        throw new TypeError("Channel \"id\" missing.");
      }
      this.channels[channel.id] = channel;
      return this;
    },
    forEachChannel: function(fn){
      for (var x in this.channels){
        fn(this.channels[x]);
      }
      return this;
    },
    getRegisteredComponents: function(){
      var components = [];
      for (var tagName in window.CustomElements.registry){
        if (BUILT_IN_COMPONENTS.indexOf(tagName) === -1){
          var component = window.CustomElements.registry[tagName];
          if (component.prototype.ceci){
            components.push(component);
          }
        }
      }
      return components;
    },
{'fraction_non_alphanumeric': 0.12835625409299278, 'fraction_numerical': 0.0032743942370661427, 'mean_word_length': 2.5114942528735633, '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': '4368182', 'n_tokens_mistral': 930, 'n_tokens_neox': 903, 'n_words': 261}