This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function verifyCustomHeaders(optionsResponse,originalHeaders){ | |
| const accessControlAllowHeader=optionsResponse.headers.find(header=>header.key.toLowerCase()==='access-control-allow-headers') | |
| const originalHeadersArray=originalHeaders.split(', ') | |
| if(!accessControlAllowHeader){ | |
| console.error('header "Access-Control-Allow-Headers" missing in option request') | |
| }else{ | |
| const missingInaccessControlAllowHeader=originalHeadersArray.filter(n => !accessControlAllowHeader.value.split(', ').includes(n)) | |
| if(missingInaccessControlAllowHeader.length>0){ | |
| console.error(`missing "${missingInaccessControlAllowHeader.join(', ')}" "Access-Control-Allow-Headers"`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Homebrew build logs for macvim on macOS 10.15 | |
| Build date: 2019-10-26 14:16:41 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const validator = { | |
| getMessage(field, args) { | |
| return `The field ${field} is not a valid RUT`; | |
| }, | |
| validate(value, args) { | |
| const toValidate=value.slice(-1).toUpperCase(); | |
| let validador=11-rut.toString().split('').reverse().reduce((sum,el,i)=>sum+=el*(i%6+2),0)%11; | |
| validador==10?'K':validador; | |
| return validador===toValidate; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function(rut){ | |
| const toValidate=rut.slice(-1).toUpperCase(); | |
| let validador=11-rut.toString().split('').reverse().reduce((sum,el,i)=>sum+=el*(i%6+2),0)%11; | |
| validador==10?'K':validador; | |
| return validador===toValidate; | |
| } |