JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q39042F
  • License ISC

a function that returns if a key is in a object

Package Exports

  • are-set
  • are-set/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (are-set) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

are-set

usage

import areSet, { areSetAndTheSameType, match } from "are-set";

const dataYouDontKnow = JSON.parse('{"hello": true}');

// use this:
cosnole.log(
  "are in the object and the same type (with object as key value pair)",
  // [[key, type]]
  match(dataYouDontKnow, { hello: "boolean" })
);

// dont need typecheck
console.log(
  "keys are in object",
  // keys in string array
  areSet(dataYouDontKnow, ["hello"])
);

// other style
cosnole.log(
  "are in the object and the same type",
  // [[key, type]]
  areSetAndTheSameType(dataYouDontKnow, [["hello", "boolean"]])
);

install

npm i are-set