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

hyped

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyped - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

3

CHANGELOG.md
## 0.2.x
### 0.2.4
Bug fix - resources with custom urlPrefixes did not get hypermedia middleware
### 0.2.3

@@ -4,0 +7,0 @@

2

package.json
{
"name": "hyped",
"version": "0.2.3",
"version": "0.2.4",
"description": "Hypermedia response generation engine",

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

@@ -341,3 +341,4 @@ ## hyped

// callback gets invoked once all resources are loaded
// this is largely to support test setups
// this is where you should call start on the host variable
host.start();
} );

@@ -344,0 +345,0 @@ ```

@@ -38,2 +38,3 @@ var _ = require( "lodash" );

].join( "" ).replace( "//", "/" );
host.http.middleware( prefixUrl, state.optionsMiddleware, "options" );

@@ -44,2 +45,13 @@ host.http.middleware( prefixUrl, state.hyperMiddleware, "hyped" );

function addResourceMiddleware( state, host ) {
var resourcePrefixes = _.filter( _.unique( _.pluck( _.values( state.resources ), "urlPrefix" ) ) );
_.each( resourcePrefixes, function( resourcePrefix ) {
var resourcePrefixUrl = [
resourcePrefix,
state.prefix.apiPrefix
].join( "" ).replace( "//", "/" );
host.http.middleware( resourcePrefixUrl, state.hyperMiddleware, "hyped" );
} );
}
function addResource( state, resource, resourceName ) { // jshint ignore:line

@@ -67,2 +79,3 @@ state.resources[ resourceName ] = resource;

state.addResources( resources );
addResourceMiddleware( state, host );
subscription.unsubscribe();

@@ -69,0 +82,0 @@ if ( done ) {

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