<commit_before>'use strict';
var angularMeteorUtils = angular.module('angular-meteor.utils', []);

angularMeteorUtils.service('$meteorUtils', [ '$timeout',
  function ($timeout) {
    var self = this;
    this.getCollectionByName = function(string){
      return Mongo.Collection.get(string);
    };
    this.autorun = function(scope, fn) {
      // wrapping around Deps.autorun
      var comp = Tracker.autorun(function(c) {
        fn(c);

        // this is run immediately for the first call
        // but after that, we need to $apply to start Angular digest
        if (!c.firstRun) $timeout(angular.noop, 0);
      });
      // stop autorun when scope is destroyed
      scope.$on('$destroy', function() {
        comp.stop();
      });
      // return autorun object so that it can be stopped manually
      return comp;
    };
    // Borrowed from angularFire - https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454
    this.stripDollarPrefixedKeys = function (data) {
      if( !angular.isObject(data) ||
        data instanceof Date) {
        return data;
      }
      var out = angular.isArray(data)? [] : {};
      angular.forEach(data, function(v,k) {
        if(typeof k !== 'string' || k.charAt(0) !== '$') {
          out[k] = self.stripDollarPrefixedKeys(v);
        }
      });
      return out;
    };
  }]);<commit_msg>Fix CollectionFS file upload issue<commit_after>'use strict';
var angularMeteorUtils = angular.module('angular-meteor.utils', []);

angularMeteorUtils.service('$meteorUtils', [ '$timeout',
  function ($timeout) {
    var self = this;
    this.getCollectionByName = function(string){
      return Mongo.Collection.get(string);
    };
    this.autorun = function(scope, fn) {
      // wrapping around Deps.autorun
      var comp = Tracker.autorun(function(c) {
        fn(c);

        // this is run immediately for the first call
        // but after that, we need to $apply to start Angular digest
        if (!c.firstRun) $timeout(angular.noop, 0);
      });
      // stop autorun when scope is destroyed
      scope.$on('$destroy', function() {
        comp.stop();
      });
      // return autorun object so that it can be stopped manually
      return comp;
    };
    // Borrowed from angularFire - https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454
    this.stripDollarPrefixedKeys = function (data) {
      if( !angular.isObject(data) ||
        data instanceof Date ||
        (angular.isDefined(FS) && angular.isDefined(FS.File) && data instanceof FS.File)) {
        return data;
      }
      var out = angular.isArray(data)? [] : {};
      angular.forEach(data, function(v,k) {
        if(typeof k !== 'string' || k.charAt(0) !== '$') {
          out[k] = self.stripDollarPrefixedKeys(v);
        }
      });
      return out;
    };
  }]);
{'fraction_non_alphanumeric': 0.14290742696233721, 'fraction_numerical': 0.005631819781766983, 'mean_word_length': 2.512978986402967, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '904170', 'n_tokens_mistral': 872, 'n_tokens_neox': 852, 'n_words': 203}