MCPcopy Create free account
hub / github.com/TruthHun/BookStack / checkValid

Function checkValid

static/word2md/mammoth.browser.js:7727–7740  ·  view source on GitHub ↗
(ret, suffix, suffixRegexp)

Source from the content-addressed store, hash-verified

7725 return val ? isPromisified(val) : false;
7726}
7727function checkValid(ret, suffix, suffixRegexp) {
7728 for (var i = 0; i < ret.length; i += 2) {
7729 var key = ret[i];
7730 if (suffixRegexp.test(key)) {
7731 var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");
7732 for (var j = 0; j < ret.length; j += 2) {
7733 if (ret[j] === keyWithoutAsyncSuffix) {
7734 throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a"
7735 .replace("%s", suffix));
7736 }
7737 }
7738 }
7739 }
7740}
7741
7742function promisifiableMethods(obj, suffix, suffixRegexp, filter) {
7743 var keys = util.inheritedDataKeys(obj);

Callers 1

promisifiableMethodsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected