You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/compiler/validate/js/utils/checkForDupes.js

12 lines
287 B

export default function checkForDupes ( validator, properties ) {
const seen = Object.create( null );
properties.forEach( prop => {
if ( seen[ prop.key.name ] ) {
validator.error( `Duplicate property '${prop.key.name}'`, prop.start );
}
seen[ prop.key.name ] = true;
});
}