New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sheet-router

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sheet-router - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

index.js

@@ -49,4 +49,4 @@ const wayfarer = require('wayfarer')

assert.equal(typeof route, 'string', 'route must be a string')
router.apply(null, sliced(arguments))
return router.apply(null, sliced(arguments))
}
}
{
"name": "sheet-router",
"version": "1.0.2",
"version": "1.0.3",
"description": "Fast, modular client router",

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

@@ -87,2 +87,47 @@ # sheet-router [![stability][0]][1]

### virtual-dom example
```js
const render = require('virtual-dom/create-element')
const sheetRouter = require('sheet-router')
const h = require('virtual-dom/h')
const router = sheetRouter(function (route) {
return [
route('/foo/bar', function (params, h, state) {
h('div', null, 'hello world')
}
]
})
const node = render(router('/foo', h, { name: 'Jane' }))
document.body.appendChild(node)
```
```html
<body>
<div>hello world</div>
</body>
```
### react example
```js
const sheetRouter = require('sheet-router')
const render = require('react-dom')
const react = require('react')
const router = sheetRouter(function (route) {
return [
route('/foo/bar', function (params, h, state) {
h('div', null, 'hello world')
}
]
})
render(router('/foo', react.createElement, { name: 'Jane' }), document.body)
```
```html
<body>
<div>hello world</div>
</body>
```
## API

@@ -100,2 +145,3 @@ ### router = sheetRouter(dft?, createTree(route))

- [virtual-dom][13]
- [hyperx][14]

@@ -118,2 +164,3 @@ ## License

[12]: https://github.com/yoshuawuyts/wayfarer
[13]: https://github.com/matt-esch/virtual-dom
[13]: https://github.com/Matt-Esch/virtual-dom
[14]: https://github.com/substack/hyperx
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