Any way to remove key/value pairs from a map? #1032

Closed
mirisuzanne opened this Issue Dec 4, 2013 · 3 comments

Projects

None yet

3 participants

@mirisuzanne
Collaborator

For now, I've written my own function as a work-around:

@function map-unset(
  $map,
  $keys...
) {
  $return: ();

  @each $key, $value in $map {
    $return: if(index($keys, $key), $return, map-merge($return, ($key: $value)));
  }

  @return $return;
}

That seems like something that should be included, though.

@nex3
Collaborator
nex3 commented Dec 14, 2013

I think this is a useful enough function to be worth including.

@HugoGiraudel

Any chance we could see the same thing for lists?

@nex3
Collaborator
nex3 commented Dec 16, 2013

@HugoGiraudel file a separate issue and we'll discuss it there.

@nex3 nex3 closed this Jan 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment