<commit_before>﻿/// <reference path="../../../src/Dexie.js" />
/// <reference path="../Dexie.Observable/Dexie.Observable.js" />
/// <reference path="Dexie.Syncable.SyncProtocolAPI.js" />
(function (window, publish, isBrowser, undefined) {

    var override = Dexie.override,
        Promise = Dexie.Promise,
        setByKeyPath = Dexie.setByKeyPath;

    Dexie.Syncable = function (db) {
    	/// <param name="db" type="Dexie"></param>
        var activePeers = [];

        // Change Types
        var CREATE = 1,
            UPDATE = 2,
            DELETE = 3;

        // Statuses
        var Statuses = Dexie.Syncable.Statuses;

        var MAX_CHANGES_PER_CHUNK = 1000;

        db.on('message', function onMessage(msg) {
            // Message from other local node arrives...
            if (msg.type == 'connect') {
                // We are master node and another non-master node wants us to do the connect.
                db.syncable.connect(msg.protocolName, msg.url, msg.options).then(msg.resolve, msg.reject);
            } else if (msg.type == 'disconnect') {
                db.syncable.disconnect(msg.url);
            } else if (msg.type == 'syncStatusChanged') {
                // We are client and a master node informs us about syncStatus change.
                // Lookup the connectedProvider and call its event
                db.syncable.on.statusChanged.fire(msg.newStatus, msg.url);
            }
        });

        db.on('cleanup', function (nodes, changes, intercomm, trans, weBecameMaster) {
            /// <param name="nodes" type="db.WriteableTable"></param>
            /// <param name="changes" type="db.WriteableTable"></param>
            /// <param name="intercomm" type="db.WriteableTable"></param><commit_msg>Minor change<commit_after>﻿/// <reference path="../../../src/Dexie.js" />
/// <reference path="../Dexie.Observable/Dexie.Observable.js" />
/// <reference path="Dexie.Syncable.SyncProtocolAPI.js" />
(function (window, publish, isBrowser, undefined) {

    var override = Dexie.override,
        Promise = Dexie.Promise,
        setByKeyPath = Dexie.setByKeyPath;

    Dexie.Syncable = function (db) {
    	/// <param name="db" type="Dexie"></param>
        var activePeers = [];

        // Change Types
        var CREATE = 1,
            UPDATE = 2,
            DELETE = 3;

        // Statuses
        var Statuses = Dexie.Syncable.Statuses;

        var MAX_CHANGES_PER_CHUNK = 1000;

        db.on('message', function (msg) {
            // Message from other local node arrives...
            if (msg.type == 'connect') {
                // We are master node and another non-master node wants us to do the connect.
                db.syncable.connect(msg.protocolName, msg.url, msg.options).then(msg.resolve, msg.reject);
            } else if (msg.type == 'disconnect') {
                db.syncable.disconnect(msg.url);
            } else if (msg.type == 'syncStatusChanged') {
                // We are client and a master node informs us about syncStatus change.
                // Lookup the connectedProvider and call its event
                db.syncable.on.statusChanged.fire(msg.newStatus, msg.url);
            }
        });

        db.on('cleanup', function (nodes, changes, intercomm, trans, weBecameMaster) {
            /// <param name="nodes" type="db.WriteableTable"></param>
            /// <param name="changes" type="db.WriteableTable"></param>
            /// <param name="intercomm" type="db.WriteableTable"></param>
{'fraction_non_alphanumeric': 0.14179531160663236, 'fraction_numerical': 0.004002287021154946, 'mean_word_length': 2.0111876075731496, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6068838', 'n_tokens_mistral': 1042, 'n_tokens_neox': 983, 'n_words': 238}