36 lines
975 B
JavaScript
36 lines
975 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.IterResult = void 0;
|
|
exports.staticImplements = staticImplements;
|
|
exports.isPlainObject = isPlainObject;
|
|
exports.isFunction = isFunction;
|
|
exports.isIterable = isIterable;
|
|
exports.isString = isString;
|
|
exports.isNumber = isNumber;
|
|
function staticImplements() {
|
|
return (constructor) => { constructor; };
|
|
}
|
|
function isPlainObject(value) {
|
|
return Object.getPrototypeOf(value) === Object.prototype;
|
|
}
|
|
function isFunction(value) {
|
|
return value != null && typeof value === 'function';
|
|
}
|
|
function isIterable(value) {
|
|
return isFunction(value[Symbol.iterator]);
|
|
}
|
|
function isString(value) {
|
|
return typeof value === 'string';
|
|
}
|
|
function isNumber(value) {
|
|
return !isNaN(value);
|
|
}
|
|
class IterResult {
|
|
static Next(value) {
|
|
return { done: false, value };
|
|
}
|
|
static Done() {
|
|
return { done: true, value: undefined };
|
|
}
|
|
}
|
|
exports.IterResult = IterResult;
|