fix: Code unity at "for in"

Where for in is used, it seems to be unified as either a variable 'k' or a 'key'.
It's simple, but this gives the code some unity.
pull/6287/head
차승호 5 years ago committed by GitHub
parent 7b6526ed70
commit e3e50402ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -127,14 +127,14 @@ export function update_slot_spread(slot, slot_definition, ctx, $$scope, dirty, g
export function exclude_internal_props(props) {
const result = {};
for (const k in props) if (k[0] !== '$') result[k] = props[k];
for (const key in props) if (key[0] !== '$') result[key] = props[key];
return result;
}
export function compute_rest_props(props, keys) {
const rest = {};
keys = new Set(keys);
for (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];
for (const key in props) if (!keys.has(key) && key[0] !== '$') rest[key] = props[key];
return rest;
}

Loading…
Cancel
Save