import React from 'react'; const methodList = Meteor.isServer ? Meteor.server.method_handlers : Meteor.connection._methodHandlers; const renderFunction = (func, name) => { const s = func.toString(); const openParen = s.indexOf("("); const closeParen = s.indexOf(")"); return (
  • {name}({s.substr(openParen+1, closeParen-openParen-1)})
  • ) } const renderCallback = (callbacks, key) => { if (Array.isArray(callbacks)) { return (

    {key}

    ) } else { return null } } const Cheatsheet = props => { return (

    Cheatsheet

    Users

    Helpers (Users.*)

      {_.map(Users, (item, key) => (key[0] !== "_" ? renderFunction(item, key) : null) )}

    Permissions (Users.can.*)

      {_.map(Users.can, renderFunction)}

    Roles (Users.is.*)

      {_.map(Users.is, renderFunction)}

    Methods

      {_.map(methodList, (item, key) => (key.indexOf("users.") !== -1 ? renderFunction(item, key) : null))}

    Posts

    Helpers (Posts.*)

      {_.map(Posts, (item, key) => (key[0] !== "_" ? renderFunction(item, key) : null) )}

    Methods

      {_.map(methodList, (item, key) => (key.indexOf("posts.") !== -1 ? renderFunction(item, key) : null))}

    Comments

    Helpers (Comments.*)

      {_.map(Comments, (item, key) => (key[0] !== "_" ? renderFunction(item, key) : null) )}

    Methods

      {_.map(methodList, (item, key) => (key.indexOf("comments.") !== -1 ? renderFunction(item, key) : null))}

    Callbacks

    Functions

    • add()
    • remove()
    • run()
    • runAsync()

    Hooks (Telescope.callbacks.*)

      {_.map(Telescope.callbacks, renderCallback)}

    Utils

    Helpers (Telescope.utils.*)

      {_.map(Telescope.utils, renderFunction)}
    ) } module.exports = Cheatsheet export default Cheatsheet