MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / normalizeType

Method normalizeType

tools/ffi.js:325–340  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

323 }
324 }
325 normalizeType(type) {
326 this.count = undefined;
327 if (type.endsWith(" *")) {
328 type = type.slice(0, -2) + "*";
329 }
330 else if (type.endsWith("]")) {
331 const bracket = type.indexOf("[");
332 if (bracket > 0) {
333 const count = type.slice(bracket + 1, -1);
334 if (/^[1-9][0-9]*$/.test(count)) {
335 type = type.slice(0, bracket) + "[]";
336 }
337 }
338 }
339 return type;
340 }
341 parseSignatures(functions) {
342 const tool = this.tool;
343 const signatures = [];

Callers 1

parseSignaturesMethod · 0.95

Calls 2

testMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected