(ret, suffix, suffixRegexp)
| 7725 | return val ? isPromisified(val) : false; |
| 7726 | } |
| 7727 | function 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 | |
| 7742 | function promisifiableMethods(obj, suffix, suffixRegexp, filter) { |
| 7743 | var keys = util.inheritedDataKeys(obj); |
no outgoing calls
no test coverage detected