@apollo/core-schema
Version:
Apollo Core Schema processing library
16 lines • 666 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.print = exports.test = void 0;
const test = (val) => !!val && typeof val === 'object' && !Array.isArray(val) && typeof val[Symbol.iterator] === 'function';
exports.test = test;
const print = (val, serialize, indent) => [...lines(val, serialize, indent)].join('\n');
exports.print = print;
function* lines(val, serialize, indent) {
var _a;
yield (((_a = val.constructor) === null || _a === void 0 ? void 0 : _a.name) || 'Iterable') + ' [';
for (const item of val) {
yield indent(serialize(item)) + ',';
}
yield ']';
}
//# sourceMappingURL=iterable.js.map