Contains
Checks if an object contains all the given keys
๐ฌ Usage
<script>
import {contains} from "@sveu/shared/dicts"
const obj = {a: 1, b: 2, c: 3}
contains(obj, "a", "b") // true
</script>
๐ฉโ๐ปAPI
๐ป Arguments
Name | Description | Type | Required |
---|---|---|---|
obj | The object to check | Record<string, any> | yes |
...keys | The keys to check | string[] | yes |
โฉ๏ธ Returns
Boolean
๐งช Playground
Source Code ๐
Source Code
Last update: 2023-02-14
Authors: Mohamed-Kaizen