-
-
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.
refactor(dictionary): use object wrapper functions and update spec.
- Loading branch information
1 parent
a349181
commit a68ed19
Showing
2 changed files
with
73 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,70 @@ | ||
@forward '../../../object'; | ||
// Sass. | ||
@use 'sass:meta'; | ||
|
||
// Modules. | ||
@use '../../../object' as dictionary; | ||
// Functions. | ||
@forward 'dictionary.translation.function'; | ||
@use 'dictionary.call.function' as *; | ||
|
||
// Variables. | ||
$-function: meta.get-function(call, false); | ||
|
||
// Object. | ||
@use '../../../object'; | ||
|
||
// Initialize. | ||
$debug: dictionary.create((), dictionary); | ||
$debug: dictionary.use(dictionary); | ||
$debug: object.create((), dictionary); | ||
|
||
// Wrapper function for `object.copy()`. | ||
@function copy($from, $to) { | ||
@return meta.call($-function, copy, $from, $to); | ||
} | ||
|
||
// Wrapper function for `object.get()`. | ||
@function get($key: null, $fallback: null) { | ||
@return meta.call($-function, get, $key, $fallback); | ||
} | ||
|
||
// Wrapper function for `object.has-key()`. | ||
@function has-key($key, $keys...) { | ||
@return meta.call($-function, has-key, $key, $keys...); | ||
} | ||
|
||
// Wrapper function for `object.keys()`. | ||
@function keys($key: null) { | ||
@return meta.call($-function, keys, $key); | ||
} | ||
|
||
// Wrapper function for `object.last-id()`. | ||
@function last-id() { | ||
@return meta.call($-function, last-id); | ||
} | ||
|
||
// Wrapper function for `object.last-name()`. | ||
@function last-name() { | ||
@return meta.call($-function, last-name); | ||
} | ||
|
||
// Wrapper function for `object.merge()`. | ||
@function merge($key: null, $objects...) { | ||
@return meta.call($-function, merge, $key, $objects...); | ||
} | ||
|
||
// Wrapper function for `object.move()`. | ||
@function move($from, $to) { | ||
@return meta.call($-function, move, $from, $to); | ||
} | ||
|
||
// Wrapper function for `object.pick()`. | ||
@function pick($key, $keys...) { | ||
@return meta.call($-function, pick, $key, $keys...); | ||
} | ||
|
||
// Wrapper function for `object.remove()`. | ||
@function remove($keys...) { | ||
@return meta.call($-function, remove, $keys...); | ||
} | ||
|
||
// Wrapper function for `object.set()`. | ||
@function set($key, $value, $allowed: ()) { | ||
@return meta.call($-function, set, $key, $value, $allowed); | ||
} |
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