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

hapi-decorators

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-decorators - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

.travis.yml

16

index.js

@@ -14,3 +14,3 @@ 'use strict'

exports.controller = function controller(baseUrl) {
exports.controller = function controller (baseUrl) {
return function (target) {

@@ -20,12 +20,14 @@ target.prototype.baseUrl = baseUrl

target.prototype.routes = function () {
var self = this
var base = trimslash(this.baseUrl)
if (!this.rawRoutes) {
return;
return
}
return this.rawRoutes.map(function (route) {
var url = (base + trimslash(route.path)) || '/';
var url = (base + trimslash(route.path)) || '/'
route.path = url
route.config.bind = self

@@ -38,3 +40,3 @@ return route

function route(method, path) {
function route (method, path) {
return function (target, key, descriptor) {

@@ -61,3 +63,3 @@ setRoute(target, key, {

function validate(config) {
function validate (config) {
return function (target, key, descriptor) {

@@ -76,3 +78,3 @@ setRoute(target, key, {

function setRoute(target, key, value) {
function setRoute (target, key, value) {
if (!target.rawRoutes) {

@@ -98,3 +100,3 @@ target.rawRoutes = []

function trimslash(s) {
function trimslash (s) {
return s[s.length - 1] === '/'

@@ -101,0 +103,0 @@ ? s.slice(0, s.length - 1)

{
"name": "hapi-decorators",
"version": "0.2.1",
"version": "0.2.2",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"lint": "snazzy index.js",
"test": "node test | tap-spec",
"posttest": "npm run lint",
"coverage": "babel-node node_modules/.bin/isparta cover test/*.js",
"coveralls": "npm run coverage -s && coveralls < coverage/lcov.info",
"postcoveralls": "rimraf ./coverage"
},
"author": "Ilya Radchenko <ilya@burstcreations.com> (https://github.com/knownasilya)",
"repository": {
"type": "git",
"url": "git+https://github.com/knownasilya/hapi-decorators.git"
},
"license": "ISC",

@@ -14,3 +23,11 @@ "dependencies": {

"lodash.find": "^3.2.1"
},
"devDependencies": {
"babel": "^5.8.23",
"coveralls": "^2.11.4",
"rimraf": "^2.4.3",
"snazzy": "^2.0.1",
"tap-spec": "^4.1.0",
"tape": "^4.2.0"
}
}

@@ -8,2 +8,6 @@ # hapi-decorators

[![npm version](https://badge.fury.io/js/hapi-decorators.svg)](http://badge.fury.io/js/hapi-decorators)
[![Build Status](https://travis-ci.org/knownasilya/hapi-decorators.svg)](https://travis-ci.org/knownasilya/hapi-decorators)
[![Coverage Status](https://coveralls.io/repos/knownasilya/hapi-decorators/badge.svg?branch=master&service=github)](https://coveralls.io/github/knownasilya/hapi-decorators?branch=master)
## Usage

@@ -26,3 +30,3 @@

}
@get('/world')

@@ -29,0 +33,0 @@ sayHello(request, reply) {

Sorry, the diff of this file is not supported yet

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