<commit_before>//
//  Signal+Validator.swift
//  ModelsTreeKit
//
//  Created by aleksey on 04.06.16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation

extension Signal {
  
  func filterValidWith(validator: (T -> Bool)) -> Signal<T> {
    return self.filter { validator($0) }
  }
  
  func mapValidWith(validator: (T -> Bool)) -> Signal<Bool> {
    return self.map { validator($0) }
  }
  
}<commit_msg>public signal+validator<commit_after>//
//  Signal+Validator.swift
//  ModelsTreeKit
//
//  Created by aleksey on 04.06.16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation

extension Signal {
  
  public func filterValidWith(validator: (T -> Bool)) -> Signal<T> {
    return self.filter { validator($0) }
  }
  
  public func mapValidWith(validator: (T -> Bool)) -> Signal<Bool> {
    return self.map { validator($0) }
  }
  
}
{'fraction_non_alphanumeric': 0.15375854214123008, 'fraction_numerical': 0.02733485193621868, 'mean_word_length': 2.8893805309734515, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '7033270', 'n_tokens_mistral': 326, 'n_tokens_neox': 297, 'n_words': 73}