<commit_before>import _ from 'lodash'
import renderField from './renderField'

export const isRequired = (schema, fieldName) => {
    if (!schema.required) {
        return false
    }
    return (schema.required.indexOf(fieldName) != -1)
}

const renderFields =
    (schema, theme, prefix = null, context = {}) =>
{
    let props = []
    for(let i in schema.properties) {
        props.push({ prop: i, propertyOrder: schema.properties[i].propertyOrder })
    }
    props = props.sort((a, b) => {
        if(a.propertyOrder > b.propertyOrder) {
            return 1
        }
        else if(a.propertyOrder < b.propertyOrder) {
            return -1
        }
        else{
            return 0
        }
    })
    return _.map(props, item => {
        const name = item.prop
        const field = schema.properties[name]
        return renderField(field, name, theme, prefix, context, isRequired(schema, name))<commit_msg>Fix lint errors<commit_after>import _ from 'lodash'
import renderField from './renderField'

export const isRequired = (schema, fieldName) => {
    if (!schema.required) {
        return false
    }
    return (schema.required.indexOf(fieldName) != -1)
}

const renderFields = (schema, theme, prefix = null, context = {}) => {
    let props = []
    for(let i in schema.properties) {
        props.push({ prop: i, propertyOrder: schema.properties[i].propertyOrder })
    }
    props = props.sort((a, b) => {
        if(a.propertyOrder > b.propertyOrder) {
            return 1
        }
        else if(a.propertyOrder < b.propertyOrder) {
            return -1
        }
        else{
            return 0
        }
    })
    return _.map(props, item => {
        const name = item.prop
        const field = schema.properties[name]
        return renderField(field, name, theme, prefix, context, isRequired(schema, name))
{'fraction_non_alphanumeric': 0.12432432432432433, 'fraction_numerical': 0.004324324324324324, 'mean_word_length': 2.230366492146597, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6676487', 'n_tokens_mistral': 541, 'n_tokens_neox': 536, 'n_words': 139}