<commit_before>/*global document*/
// var CssPrefix = require('./CssPrefix');
var el;

if (typeof window !== 'undefined') {
    el = document.createElement('div');
}

var cache = {};
// var prefix = JSON.stringify(el.style).match(/(moz|webkit|ms)/)[0];
var prefixes = ["ms", "Moz", "Webkit", "O"];
var properties = [
    'transform',
    'transition',
    'transformOrigin',
    'transformStyle',
    'transitionProperty',
    'transitionDuration',
    'transitionTimingFunction',
    'transitionDelay',
    'borderImage',
    'borderImageSlice',
    'boxShadow',
    'backgroundClip',
    'backfaceVisibility',
    'perspective',
    'perspectiveOrigin',
    'animation',
    'animationDuration',
    'animationName',
    'animationDelay',
    'animationDirection',
    'animationIterationCount',
    'animationTimingFunction',
    'animationPlayState',
    'animationFillMode',
    'appearance'
];

var getVendorPrefix = function getVendorPrefix(property) {
    if(properties.indexOf(property) === -1 || typeof el.style[property] !== 'undefined'){
        return property;
    }

    property = property[0].toUpperCase() + property.slice(1);
    var temp;

    for(var i = 0; i < prefixes.length; i++){
        temp = prefixes[i] + property;
        if(typeof el.style[temp] !== 'undefined'){
            prefixes = [prefixes[i]]; // we only need to check this one prefix from now on.
            return temp;
        }
    }
            
    return property[0].toLowerCase() + property.slice(1);
};

// var hasRule = function hasRule(rule) {
//     return el.style[rule] === '' || el.style[prefix+rule] === '';
// };


//
// CSS Object
// 

var CSS = function CSS(props) {
    this.styles = props;
};

CSS.prototype.rule = function rule(name, value) {
    this.styles[name] = value;
};

CSS.prototype.prefix = function prefix() {
    var result = {};

    for (var key in this.styles) {
        if(cache[key] === undefined){
            cache[key] = getVendorPrefix(key);  
        }
        result[cache[key]] = this.styles[key];
    }

    return result;
};


//
// Shortcuts
// 

CSS.prototype.translateY = function translateY(value) {
    this.rule('transform', 'translateY('+ value +')');
};

CSS.prototype.rotate = function translateY(value) {
    this.rule('transform', 'rotate('+ (value * 3.6) +'deg)');<commit_msg>style fix<commit_after>/*global document*/
// var CssPrefix = require('./CssPrefix');
var el;

if (typeof window !== 'undefined') {
    el = document.createElement('div');
}

var cache = {};
// var prefix = JSON.stringify(el.style).match(/(moz|webkit|ms)/)[0];
var prefixes = ["ms", "Moz", "Webkit", "O"];
var properties = [
    'transform',
    'transition',
    'transformOrigin',
    'transformStyle',
    'transitionProperty',
    'transitionDuration',
    'transitionTimingFunction',
    'transitionDelay',
    'borderImage',
    'borderImageSlice',
    'boxShadow',
    'backgroundClip',
    'backfaceVisibility',
    'perspective',
    'perspectiveOrigin',
    'animation',
    'animationDuration',
    'animationName',
    'animationDelay',
    'animationDirection',
    'animationIterationCount',
    'animationTimingFunction',
    'animationPlayState',
    'animationFillMode',
    'appearance'
];

var getVendorPrefix = function getVendorPrefix(property) {
    if(properties.indexOf(property) === -1 || typeof el.style[property] !== 'undefined'){
        return property;
    }

    property = property[0].toUpperCase() + property.slice(1);
    var temp;

    for(var i = 0; i < prefixes.length; i++){
        temp = prefixes[i] + property;
        if(typeof el.style[temp] !== 'undefined'){
            prefixes = [prefixes[i]]; // we only need to check this one prefix from now on.
            return temp;
        }
    }
            
    return property[0].toLowerCase() + property.slice(1);
};

// var hasRule = function hasRule(rule) {
//     return el.style[rule] === '' || el.style[prefix+rule] === '';
// };


//
// CSS Object
// 

var _ = require('lodash');

var CSS = function CSS(props) {
    this.styles = props || {};
};

CSS.prototype.rule = function rule(name, value) {
    var nextStyles = {};
    nextStyles[name] = value;

    this.styles = _.defaults(nextStyles, this.styles);
};

CSS.prototype.prefix = function prefix() {
    var result = {};

    for (var key in this.styles) {
        if(cache[key] === undefined){
            cache[key] = getVendorPrefix(key);  
        }
        result[cache[key]] = this.styles[key];
    }

    return result;
};


//
// Shortcuts
// 

CSS.prototype.translateY = function translateY(value) {
    this.rule('transform', 'translateY('+ value +')');
};

CSS.prototype.rotate = function translateY(value) {
    this.rule('transform', 'rotate('+ (value * 3.6) +'deg)');
{'fraction_non_alphanumeric': 0.17030659386812264, 'fraction_numerical': 0.0037799244015119695, 'mean_word_length': 3.0025210084033613, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2167783', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1475, 'n_words': 309}