Socket
Socket
Sign inDemoInstall

bobril

Package Overview
Dependencies
Maintainers
1
Versions
313
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bobril - npm Package Compare versions

Comparing version 17.4.0 to 17.5.0

4

CHANGELOG.md
# CHANGELOG
## 17.5.0
Export `extractParams` router url parsing function.
## 17.4.0

@@ -4,0 +8,0 @@

2

package.json
{
"name": "bobril",
"version": "17.4.0",
"version": "17.5.0",
"description": "Component Oriented MVC Framework with virtual DOM and CSS",

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

@@ -36,5 +36,3 @@ import {

export interface Params {
[name: string]: string | undefined;
}
export interface Params extends Record<string, string | undefined> {}

@@ -189,9 +187,9 @@ // Just marker interface

// Extracts the portions of the given URL path that match the given pattern.
// Returns null if the pattern does not match the given path.
function extractParams(pattern: string, path: string): Params | null {
/// Extracts the portions of the given URL path that match the given pattern.
/// Returns undefined if the pattern does not match the given path.
export function extractParams(pattern: string, path: string): Params | undefined {
var object = compilePattern(pattern);
var match = decodeUrl(path).match(object.matcher);
if (!match) return null;
if (!match) return undefined;

@@ -209,5 +207,5 @@ var params: { [name: string]: string } = {};

// Returns a version of the given route path with params interpolated.
// Throws if there is a dynamic segment of the route path for which there is no param.
export function injectParams(pattern: string, params?: Params) {
/// Returns a version of the given route path with params interpolated.
/// Throws if there is a dynamic segment of the route path for which there is no param.
export function injectParams(pattern: string, params?: Params): string {
params = params || {};

@@ -251,3 +249,3 @@

var defaultRoute: IRoute | undefined;
var params: Params | null;
var params: Params | undefined;
for (var i = 0; i < l; i++) {

@@ -254,0 +252,0 @@ var r = rs[i]!;

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