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

sails-hook-route

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-hook-route - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

13

index.js

@@ -28,3 +28,3 @@ let _ = require('@sailshq/lodash')

if (!route) {
throw new Error('No named route : ' + routeName + '\n Maybe you missed the name field?')
throw new Error('No named route : ' + routeName + '\n Maybe you missed the name property?')
}

@@ -35,8 +35,11 @@

if (parameters) {
if (parameters.length !== parametersValues.length) {
console.warn('Length of named parameters (' + parameters.length + ') is not the same as the length of values ' + parametersValues.length + ' ')
let parametersLength = parameters.length
let valuesLength = parametersValues.length
if (parametersLength !== valuesLength) {
console.warn('Length of named parameters (' + parametersLength + ') is not the same as the length of values ' + valuesLength + ' ')
}
for (let key of parameters.keys()) {
route = route.replace(parameters[key], parametersValues[key])
for (let i = 0; i < parametersLength; ++i) {
route = route.replace(parameters[i], parametersValues[i])
}

@@ -43,0 +46,0 @@ }

{
"name": "sails-hook-route",
"version": "0.0.6",
"version": "0.0.7",
"description": "Bind route function to res.locals to get the URL of a route by it's name property and replace the named parameters by their values automatically",

@@ -5,0 +5,0 @@ "main": "index.js",

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