-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(object.has-key()): add checking the key in any object name.
- Loading branch information
1 parent
112747d
commit 25b7bff
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Sass. | ||
@use 'sass:map'; | ||
|
||
// Variables. | ||
@use 'object.var' as object; | ||
|
||
// Functions. | ||
@use 'object.get-key.function' as *; | ||
|
||
// Status: TODO: key | ||
// The `object.has-key()` function checks whether object in use has key. | ||
// @param `$key` Required key to check object in use has. | ||
// @arbitrary `$keys...` Additional keys to check nested key. | ||
// @returns The returned value is a `bool` indicating object in use has key. | ||
@function has-key($key, $keys...) { | ||
@if type-of($key) == map { | ||
@each $name, $key in $key { | ||
@return map.has-key(object.$object, get-key($name, $key)...); | ||
} | ||
} | ||
@return map.has-key(object.$object, get-key($key: $key)...); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters