Skip to content

Commit

Permalink
Merge pull request #109 from newrelic/zstickles/hide-fist-party-funct…
Browse files Browse the repository at this point in the history
…ions

Ignore API-Specific Methods
  • Loading branch information
jerelmiller authored Jun 9, 2020
2 parents d01b3df + 5826967 commit bbbb192
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/hooks/useApiDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const IGNORED_METHODS = [
'defaultProps',
];

const IGNORED_METHODS_BY_LIB = {
logger: ['deprecate'],
};

const useApiDoc = (name) => {
if (typeof window === 'undefined') global.window = {};

Expand All @@ -31,6 +35,11 @@ const useApiDoc = (name) => {
!IGNORED_METHODS.includes(member) &&
typeof api[member] === 'function'
)
.filter(
(member) =>
!IGNORED_METHODS_BY_LIB[name] ||
!IGNORED_METHODS_BY_LIB[name].includes(member)
)
.map((member) => {
const methodDocs = api[member].__docs__;

Expand Down

0 comments on commit bbbb192

Please sign in to comment.