Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
exotic / dist / types / attributes / species.js
Size: Mime:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// import { isNative } from 'exotic/types/NATIVE/isNative'
// import {
//   getPrototypeOf,
//   getConstructor,
//   getPrototypeConstructor,
// } from 'exotic/types/NATIVE/prototype/getPrototype'
// import isIterator from 'exotic/types/iterator/check/isIterator'
const isNative_1 = require("../NATIVE/isNative");
const getPrototype_1 = require("../NATIVE/prototype/getPrototype");
exports.getPrototypeOf = getPrototype_1.getPrototypeOf;
exports.getConstructor = getPrototype_1.getConstructor;
exports.getPrototypeConstructor = getPrototype_1.getPrototypeConstructor;
const isIterator_1 = require("../iterator/check/isIterator");
const hasOwnProperty_1 = require("./properties/hasOwnProperty");
const SYMBOL_SPECIES = Symbol.for('@@species');
exports.SYMBOL_SPECIES = SYMBOL_SPECIES;
const isTyped = (x) => hasOwnProperty_1.hasOwnProp(x, 'code');
exports.isTyped = isTyped;
const getSpecies = (x) => {
    if (isTyped(x)) {
        return x[SYMBOL_SPECIES];
    }
    else if (isNative_1.isNative(x)) {
        return x;
    }
    else {
        return isIterator_1.default(x) ? getPrototype_1.getPrototypeConstructor(x) : getPrototype_1.getConstructor(x);
    }
};
exports.getSpecies = getSpecies;
exports.toSpecies = getSpecies;
const getSpeciesProto = getSpecies;
exports.getSpeciesProto = getSpeciesProto;
//# sourceMappingURL=species.js.map