<commit_before>// @license
// Copyright (c) 2017 Google Inc. All rights reserved.
// This code may only be used under the BSD style license found at
// http://polymer.github.io/LICENSE.txt
// Code distributed by Google as part of this project is also
// subject to an additional IP rights grant found at
// http://polymer.github.io/PATENTS.txt

"use strict";

const InnerPec = require('./inner-PEC.js');
const OuterPec = require('./outer-PEC.js');
const MessageChannel = require('./message-channel.js');
const Loader = require('./loader.js');

module.exports = function(loader, id) {
  var channel = new MessageChannel();
  new InnerPec(channel.port1, `${id}:inner`, new Loader());
  return new OuterPec(channel.port2, `${id}:outer`);
};<commit_msg>Comment about making fake-pec-factory less fake, more in-process.<commit_after>// @license
// Copyright (c) 2017 Google Inc. All rights reserved.
// This code may only be used under the BSD style license found at
// http://polymer.github.io/LICENSE.txt
// Code distributed by Google as part of this project is also
// subject to an additional IP rights grant found at
// http://polymer.github.io/PATENTS.txt

"use strict";

const InnerPec = require('./inner-PEC.js');
const OuterPec = require('./outer-PEC.js');
const MessageChannel = require('./message-channel.js');
const Loader = require('./loader.js');

// TODO: Make this generic so that it can also be used in-browser, or add a
// separate in-process browser pec-factory.
module.exports = function(loader, id) {
  var channel = new MessageChannel();
  new InnerPec(channel.port1, `${id}:inner`, new Loader());
  return new OuterPec(channel.port2, `${id}:outer`);
};
{'fraction_non_alphanumeric': 0.1467065868263473, 'fraction_numerical': 0.00718562874251497, 'mean_word_length': 4.110091743119266, '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': '3800308', 'n_tokens_mistral': 502, 'n_tokens_neox': 483, 'n_words': 176}