New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

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?

  1. It is a plain object.
  2. 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

FAQs

Package last updated on 23 May 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc