source: imaps-frontend/node_modules/core-js/internals/to-set-like.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 570 bytes
Line 
1'use strict';
2var getBuiltIn = require('../internals/get-built-in');
3var isCallable = require('../internals/is-callable');
4var isIterable = require('../internals/is-iterable');
5var isObject = require('../internals/is-object');
6
7var Set = getBuiltIn('Set');
8
9var isSetLike = function (it) {
10 return isObject(it)
11 && typeof it.size == 'number'
12 && isCallable(it.has)
13 && isCallable(it.keys);
14};
15
16// fallback old -> new set methods proposal arguments
17module.exports = function (it) {
18 if (isSetLike(it)) return it;
19 return isIterable(it) ? new Set(it) : it;
20};
Note: See TracBrowser for help on using the repository browser.