Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 37fbae1

Browse files
abhiomkarcopybara-github
authored andcommitted
refactor: Remove MDC theme's deep-get, used sass:map's get API instead.
BREAKING CHANGE: Removed `deep-get()` API from mdc-theme, use `sass:map`'s get() API instead. PiperOrigin-RevId: 345257138
1 parent 4f33473 commit 37fbae1

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

packages/mdc-theme/_theme.scss

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -180,24 +180,3 @@
180180
);
181181
}
182182
}
183-
184-
/// Perform a recursive map.get on a nested map structure
185-
/// Returns a value, or `null` if `$map` does not contain `$path`.
186-
///
187-
/// @example scss
188-
/// $color: deep-get((foo: (bar: black)), (foo, bar));
189-
/// $color === black;
190-
///
191-
/// @param {Map} $map - Map to recurse down
192-
/// @param {List} $path - List of keys to traverse the map
193-
/// @return {*} The deep value or `null`
194-
@function deep-get($map: (), $keys: ()) {
195-
$result: $map;
196-
@each $key in $keys {
197-
$result: map.get($result, $key);
198-
@if $result == null {
199-
@return null;
200-
}
201-
}
202-
@return $result;
203-
}

0 commit comments

Comments
 (0)