original_text
stringlengths 1
23.3k
| tokenized_code
stringlengths 1
25.1k
| masked_code
stringlengths 1
23.6k
|
---|---|---|
} | } | [MASK] |
private textInput: any | private textInput : any | private textInput : any |
super(props) | super ( props ) | super ( props ) |
} | } | [MASK] |
this.textInput.files = this.props.defaultValue | this.textInput.files = this.props.defaultValue | this.textInput.files = this.props.defaultValue |
}) | } ) | [MASK] ) |
}) | } ) | } ) |
}) | } ) | } ) |
this.setState({ hasFiles: false, files: null, infoText: '' }) | this.setState ( { hasFiles : false , files : null , infoText : `` } ) | this.setState ( { hasFiles : false , files : null , [MASK] : `` } ) |
) | ) | ) |
this.props.onClick() | this.props.onClick ( ) | this.props.onClick ( ) |
} | } | } |
}) | } ) | } ) |
if (this.textInput) this.textInput.value = '' | if ( this.textInput ) this.textInput.value = `` | if ( this.textInput ) this.textInput.value = `` |
} | } | } |
const files = Array.from(fileList) | const files = Array.from ( fileList ) | const files = Array.from ( fileList ) |
const indexToRemove = files.findIndex(file => file.name === fileNameToRemove) | const indexToRemove = files.findIndex ( file = > file.name === fileNameToRemove ) | const indexToRemove = files.findIndex [MASK] [MASK] = [MASK] file.name === fileNameToRemove ) |
files.splice(indexToRemove, 1) | files.splice ( indexToRemove , 1 ) | files.splice ( indexToRemove , 1 ) |
const newFileList = new DataTransfer() | const newFileList = new DataTransfer ( ) | const newFileList = [MASK] DataTransfer ( ) |
newFileList.items.add(file as File) | newFileList.items.add ( file as File ) | newFileList.items.add [MASK] file as File ) |
return newFileList.files | return newFileList.files | return newFileList.files |
} | } | } |
const newList = this.removeFileFromList(this.state.files, item.name) | const newList = this.removeFileFromList ( this.state.files , item.name ) | const newList = this.removeFileFromList ( this.state.files , item.name [MASK] |
}) | } ) | } ) |
if (this.textInput) this.textInput.value = '' | if ( this.textInput ) this.textInput.value = `` | if [MASK] this.textInput [MASK] this.textInput.value = `` |
this.props.onChange(e, newList) | this.props.onChange ( e , newList ) | this.props.onChange ( e , newList ) |
}) | } ) | } ) |
if (this.textInput) this.textInput.value = '' | if ( this.textInput ) this.textInput.value = `` | if ( this.textInput ) this.textInput.value = `` |
this.props.onChange(e, null) | this.props.onChange ( e , null ) | [MASK] ( e , null ) |
} | } | } |
e.preventDefault() | e.preventDefault ( ) | e.preventDefault [MASK] ) |
let selectedFiles = this.textInput.files | let selectedFiles = this.textInput.files | [MASK] selectedFiles = this.textInput.files |
let isMaxFileCountExceed = false | let isMaxFileCountExceed = false | let isMaxFileCountExceed = false |
let totalFileCount = selectedFiles.length + (this.state.files ? this.state.files.length : 0) | let totalFileCount = selectedFiles.length + ( this.state.files ? this.state.files.length : 0 ) | let totalFileCount = selectedFiles.length + ( this.state.files ? this.state.files.length : 0 ) |
isMaxFileCountExceed = totalFileCount > this.props.maxFileCount | isMaxFileCountExceed = totalFileCount > this.props.maxFileCount | isMaxFileCountExceed = [MASK] > this.props.maxFileCount |
selectedFiles = [...selectedFiles, ...this.state.files] | selectedFiles = [ ... selectedFiles , ... this.state.files ] | selectedFiles = [MASK] ... [MASK] , ... this.state.files ] |
this.performValidationRules(selectedFiles) | this.performValidationRules ( selectedFiles ) | this.performValidationRules ( selectedFiles ) |
this.loadFileDetails(e) | this.loadFileDetails ( e ) | [MASK] ( e [MASK] |
) | ) | ) |
}) | } ) | [MASK] ) |
} | } | } |
for (let i = 0 | for ( let i = 0 | [MASK] [MASK] [MASK] i = 0 |
i < files.length | i < files.length | i [MASK] [MASK] |
let isValid = this._validateFileType(files[i]) | let isValid = this._validateFileType ( files [ i ] ) | let [MASK] = this._validateFileType [MASK] files [ i ] ) |
if (isValid) this._validateFileSize(files[i]) | if ( isValid ) this._validateFileSize ( files [ i ] ) | if ( isValid ) [MASK] ( files [ i ] ) |
let isValid = false | let isValid = false | let isValid = false |
for (let i = 0 | for ( let i = 0 | for [MASK] [MASK] i = 0 |
i < this.state.fileTypes.length | i < this.state.fileTypes.length | i < this.state.fileTypes.length |
isValid = true | isValid = true | [MASK] = true |
file.isValid = isValid | file.isValid = isValid | file.isValid = isValid |
file.errorMessage = !isValid ? 'Dosya türü istenilen dosya türleriyle eşleşmedi.' : '' | file.errorMessage = ! isValid ? 'Dosya türü istenilen dosya türleriyle eşleşmedi . ' : `` | file.errorMessage = ! isValid [MASK] 'Dosya türü istenilen dosya türleriyle eşleşmedi [MASK] ' : `` |
file.isValid = true | file.isValid = true | file.isValid = true |
return file.isValid | return file.isValid | [MASK] file.isValid |
file.isValid = file.size <= this.props.maxFileSize | file.isValid = file.size < = this.props.maxFileSize | file.isValid [MASK] file.size < = this.props.maxFileSize |
: '' | : `` | [MASK] `` |
return file.isValid | return file.isValid | return file.isValid |
let errors = [] | let errors = [ ] | let errors = [ [MASK] |
let { files } = this.state | let { files } = this.state | let { files } = this.state |
let counter = 0 | let counter = 0 | let counter = 0 |
counter = counter + 1 | counter = counter + 1 | counter = counter + 1 |
let reader = new FileReader() | let reader = new FileReader ( ) | let reader = new FileReader [MASK] ) |
reader.readAsDataURL(file, 'UTF-8') | reader.readAsDataURL ( file , 'UTF-8 ' ) | reader.readAsDataURL [MASK] [MASK] , 'UTF-8 ' [MASK] |
let indexOfDelimeter = null | let indexOfDelimeter = null | let indexOfDelimeter = null |
indexOfDelimeter = reader.result.indexOf('base64,') + 6 | indexOfDelimeter = reader.result.indexOf ( 'base64 , ' ) + 6 | indexOfDelimeter = reader.result.indexOf ( 'base64 , ' ) + 6 |
let content = null | let content = null | let content = null |
} | } | } |
file.content = content | file.content = content | [MASK] = content |
} | } | } |
file.content = null | file.content = null | file.content = null |
}) | } ) | } ) |
} | } | } |
counter = counter - 1 | counter = counter - 1 | counter [MASK] counter - [MASK] |
}) | } ) | } ) |
this.props.onChange(e, files) | this.props.onChange ( e , files ) | this.props.onChange ( e , files ) |
} | } | } |
} | } | } |
let { files } = this.state | let { files } = this.state | let { files } = this.state |
let newFileList = [] | let newFileList = [ ] | [MASK] newFileList = [MASK] ] |
for (let i = 0 | for ( let i = 0 | for ( let i = [MASK] |
i < newFiles.length | i < newFiles.length | i < newFiles.length |
let isDuplicate = false | let isDuplicate = false | let isDuplicate = [MASK] |
for (let j = 0 | for ( let j = 0 | for ( let j = 0 |
j < files.length | j < files.length | j < files.length |
isDuplicate = true | isDuplicate = true | isDuplicate = true |
break | break | break |
if (!isDuplicate) newFileList.push(newFiles[i]) | if ( ! isDuplicate ) newFileList.push ( newFiles [ i ] ) | if ( ! isDuplicate ) newFileList.push ( newFiles [ [MASK] ] ) |
return [...files, ...newFileList] | return [ ... files , ... newFileList ] | return [ ... files , ... newFileList [MASK] |
return newFiles | return newFiles | return [MASK] |
} | } | } |
let fileInformations = '' | let fileInformations = `` | [MASK] [MASK] = [MASK] |
let totalSize = 0 | let totalSize = 0 | let totalSize = 0 |
for (let i = 0 | for ( let i = 0 | for ( let i = 0 |
i < files.length | i < files.length | i [MASK] files.length |
fileInformations += `${files[i].name} ${this.bytesToSize(files[i].size)}\n` | fileInformations += ` $ { files [ i ] .name } $ { this.bytesToSize ( files [ i ] .size ) } \n ` | fileInformations += ` $ { files [ [MASK] ] [MASK] } $ { this.bytesToSize ( files [ i ] .size ) } \n ` |
totalSize += files[i].size | totalSize += files [ i ] .size | totalSize [MASK] files [ i ] .size |
return `Toplam ${files.length} dosya, ${this.bytesToSize(totalSize)}` | return ` Toplam $ { files.length } dosya , $ { this.bytesToSize ( totalSize ) } ` | return ` Toplam $ { files.length } dosya , [MASK] [MASK] this.bytesToSize [MASK] totalSize ) } ` |
return fileInformations | return fileInformations | return fileInformations |
} | } | } |
return this.state.infoText | return this.state.infoText | return [MASK] |
return this.state.displayText | return this.state.displayText | return this.state.displayText |
Subsets and Splits