How to use the core-js/library.Array function in core-js

To help you get started, we’ve selected a few core-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github indiejames / vscode-clojure-debug / src / clojureCompletionItemProvider.ts View on Github external
rval = new Promise((resolve, reject) => {

        // Sometimes vscode freaks out and sends the whole source as the prefix
        // so I check for newlines and reject them here.
        if (prefix == "") {
          let ci =  new CompletionItem("");
          resolve(new CompletionList([], true));
        } else {

          // get string match completions
          let allWords = src.match(/[^\s\(\)"',;~@#$%^&{}\[\]\\`\n]+/g);
          let wordSet = new core.Set(allWords);
          let words = core.Array.from(wordSet);

          // find the actual matching words
          let matches = words.filter((val: string): boolean => {
            return (val.substr(0, prefix.length) == prefix);
          }).sort();

          let textCompletions = matches.map((val: string) => {
            let ci =  new CompletionItem(val);
            ci.kind = CompletionItemKind.Text;
            return ci;
          });

          // Call Compliment to get the completions
          // TODO - add optimization to check the length of the prefix and set isInComplete in the CompletionList
          // to false if the length is > 3 chars (or whatever length namespace show up in the list at).
          self.connection.findCompletions(ns, prefix, src, offset, (err: any, result: any) => {
github babel / babel / test / fixtures / transformation / optional-core-aliasing / es6-spread / expected.js View on Github external
var _toArray = function (arr) {
  return Array.isArray(arr) ? arr : _core.Array.from(arr);
};
github UltCombo / atom-sublime-block-comment / lib / sublime-block-comment.js View on Github external
'use babel';

import { Point, Range } from 'atom';

import core from 'core-js/library';
const { find } = core.Array.prototype;

const disposables = [];

const Lang = (rLangScope, openCommentToken, closeCommentToken) => ({
  test: (scope) => rLangScope.test(scope),
  commentTokens: { open: openCommentToken, close: closeCommentToken },
});
const langs = [
  Lang(/^source\.js\.?/ ,   '/*'  , '*/' ),
  Lang(/^source\.css\.?/,   '/*'  , '*/' ),
  Lang(/^source\.php\.?/,   '/*'  , '*/' ),
  Lang(/^text\.html\.?/ ,   ''),
  Lang(/^source\.python\.?/, "'''", "'''"),
];

export const config = {