Tabnine Logo For Javascript
isArray
Code IndexAdd Tabnine to your IDE (free)

How to use
isArray
function
in
ntils

Best JavaScript code snippets using ntils.isArray(Showing top 2 results out of 315)

origin: alibaba/dawn

const checkInstall = async (ctx, pkgs, flag) => {
  if (!pkgs) return;
  pkgs = isArray(pkgs) ? pkgs : [pkgs]
  if (!flag) flag = { 'save-dev': true };
  for (let pkg of pkgs) {
   try {
    const vIndex = pkg.lastIndexOf('@');
    const pkgName = vIndex > 0 ? pkg.substr(0, vIndex) : pkg;
    require.resolve(`${pkgName}/package.json`);
   } catch (err) {
    await ctx.mod.install(pkg, { flag });
   }
  }
 }
origin: alibaba/dawn

const checkInstall = async (ctx, pkgs, flag) => {
  if (!pkgs) return;
  pkgs = isArray(pkgs) ? pkgs : [pkgs]
  if (!flag) flag = { 'save-dev': true };
  for (let pkg of pkgs) {
   try {
    const vIndex = pkg.lastIndexOf('@');
    const pkgName = vIndex > 0 ? pkg.substr(0, vIndex) : pkg;
    require.resolve(`${pkgName}/package.json`);
   } catch (err) {
    await ctx.mod.install(pkg, { flag });
   }
  }
 }
ntils(npm)isArray

Most used ntils functions

    Popular in JavaScript

    • http
    • superagent
      elegant & feature rich browser / node HTTP with a fluent API
    • request
      Simplified HTTP request client.
    • fs-extra
      fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
    • qs
      A querystring parser that supports nesting and arrays, with a depth limit
    • cheerio
      Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
    • crypto
    • semver
      The semantic version parser used by npm.
    • q
      A library for promises (CommonJS/Promises/A,B,D)
    • From CI to AI: The AI layer in your organization
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
    Get Tabnine for your IDE now