šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

is-vue-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-vue-component

Check if the given value is a valid Vue component.

0.1.0
Source
npm
Version published
Maintainers
1
Created
Source

is-vue-component

Build Status Downloads Version

Check if the given value is a valid Vue component.

What is a valid Vue component?

  • It is a plain object.
  • It has at least one of the following properties:
    • el: a non-empty string or an Element.
    • template: a non-empty string.
    • render: a function.
    • extends: a valid Vue component.
    • mixins: an array includes at least a valid Vue component.

Main

dist/
ā”œā”€ā”€ is-vue-component.js        (UMD)
ā”œā”€ā”€ is-vue-component.min.js    (UMD, compressed)
ā”œā”€ā”€ is-vue-component.common.js (CommonJS, default)
└── is-vue-component.esm.js    (ES Module)

Install

npm install is-vue-component

Usage

<div id="app"></div>
import isVueComponent from 'is-vue-component';

isVueComponent({
  el: '#app',
});
// > true

isVueComponent({
  el: document.getElementById('app'),
});
// > true

isVueComponent({
  template: '<p>Hello, World!</p>',
});
// > true

isVueComponent({
  render(createElement) {
    return createElement('p', 'Hello, World!');
  },
});
// > true

isVueComponent({
  extends: {
    render(createElement) {
      return createElement('p', 'Hello, World!');
    },
  },
});
// > true

isVueComponent({
  mixins: [
    {
      render(createElement) {
        return createElement('p', 'Hello, World!');
      },
    },
  ],
});
// > true

isVueComponent({});
// > false

License

MIT Ā© Chen Fengyuan

Keywords

is

FAQs

Package last updated on 15 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts