Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

handsome-exception

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handsome-exception

exceptions handler for error when chained calling from object

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

English | 中文

handsome-exception

simple exceptions handler for error when chained calling from object

Install

npm install --save handsome-exception

Usage

import handler from 'handsome-exception';

let obj = handler({name: 'jack'}, 'exception!');
console.log(obj.name()); // jack
console.log(obj.name.a.b.c.d()); // exception!
console.log(obj.e.r.r.o.r('other exception!')); // other exception!

Template syntax(vue)

<template>
  <div id="handsome">
    {{obj.name()}} <!-- jack -->
    {{obj.e.r.r.o.r()}} <!-- exception! -->
    {{obj.e.r.r.o.r("other exception!")}} <!-- other exception! -->
  </div>
</template>

<script>
import handler from 'handsome-exception';
export default {
  name: 'handsome',
  data() {
    return {
      obj: null
    }
  },
  created() {
    this.obj = handler({name: 'jack'}, 'exception!');
  },
  methods: {

  }
}
</script>
<style scoped>
</style>

Keywords

FAQs

Package last updated on 29 Apr 2022

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