You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 658B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const {
  2. getLength,
  3. isFunction,
  4. isObject,
  5. identity,
  6. property,
  7. matcher,
  8. optimizeCb,
  9. cb,
  10. forEach,
  11. map,
  12. flatten
  13. } = require('./lib');
  14. const isNumber = obj => toString.call(obj) === '[object Number]';
  15. const isUndefined = obj => obj === void 0;
  16. const constant = value => () => value;
  17. const keyInObj = (value, key, obj) => key in obj;
  18. const allKeys = obj => {
  19. if (!isObject(obj)) return [];
  20. const keys = [];
  21. for (const key in obj) keys.push(key);
  22. return keys;
  23. };
  24. module.exports = {
  25. getLength,
  26. optimizeCb,
  27. isFunction,
  28. isNumber,
  29. isUndefined,
  30. property,
  31. matcher,
  32. identity,
  33. constant,
  34. keyInObj,
  35. allKeys,
  36. cb,
  37. forEach,
  38. map,
  39. flatten
  40. };