MCPcopy Index your code
hub / github.com/processing/p5.js / getSymbols

Function getSymbols

src/core/friendly_errors/fes_core.js:1024–1050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1022 const uniqueNamesFound = {};
1023
1024 const getSymbols = obj =>
1025 Object.getOwnPropertyNames(obj)
1026 .filter(name => {
1027 if (name[0] === '_') {
1028 return false;
1029 }
1030 if (name in uniqueNamesFound) {
1031 return false;
1032 }
1033
1034 uniqueNamesFound[name] = true;
1035
1036 return true;
1037 })
1038 .map(name => {
1039 let type;
1040
1041 if (typeof obj[name] === 'function') {
1042 type = 'function';
1043 } else if (name === name.toUpperCase()) {
1044 type = 'constant';
1045 } else {
1046 type = 'variable';
1047 }
1048
1049 return { name, type };
1050 });
1051
1052 misusedAtTopLevelCode = [].concat(
1053 getSymbols(fn),

Callers 1

fesCoreFunction · 0.85

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected