MCPcopy Create free account
hub / github.com/IvanAdmaers/react-roulette-pro / getOptionsAsString

Function getOptionsAsString

example/src/App.js:100–123  ·  view source on GitHub ↗
(settings, design)

Source from the content-addressed store, hash-verified

98const isArrayOf = (type, array) => array.every((item) => typeof item === type);
99
100const getOptionsAsString = (settings, design) => {
101 let string = '';
102 const keys = Object.keys(settings);
103
104 keys.forEach((key) => {
105 const { options, value, forDesign } = settings[key];
106
107 if (!forDesign) {
108 return;
109 }
110
111 if (typeof forDesign !== 'boolean' && forDesign !== design) {
112 return;
113 }
114
115 if (options[0] === value) {
116 return;
117 }
118
119 string += `${key}: ${value},\n`;
120 });
121
122 return string;
123};
124
125const API = {
126 getPrizeIndex: async () => {

Callers 1

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected