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/src/validate/js/utils/checkForComputedKeys.ts

11 lines
306 B

import { Validator } from '../../';
import { Node } from '../../../interfaces';
export default function checkForComputedKeys ( validator: Validator, properties: Node[] ) {
properties.forEach( prop => {
if ( prop.key.computed ) {
validator.error( `Cannot use computed keys`, prop.start );
}
});
}