@innet/server 1.5.3 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -795,14 +795,14 @@ async function Body () {
795
795
  }
796
796
  ```
797
797
 
798
- ## getRouter
798
+ ## useRouter
799
799
 
800
800
  You can get router data in a component
801
801
 
802
802
  ```typescript jsx
803
803
  import { useRouter } from '@innet/server'
804
804
 
805
- async function Router () {
805
+ function Router () {
806
806
  const { prefix, params } = useRouter()
807
807
 
808
808
  return <success>{{ prefix, params }}</success>
@@ -17,9 +17,9 @@ export declare type Files = Record<string, File | File[]>;
17
17
  export declare type Request = IncomingMessage;
18
18
  export declare type Response = ServerResponse;
19
19
  export interface ActionOptions {
20
+ search: Search;
21
+ cookies: Cookies;
20
22
  body?: Body;
21
- search?: Search;
22
- cookies?: Cookies;
23
23
  files?: Files;
24
24
  }
25
25
  export declare type Resources = Exclude<keyof ActionOptions, undefined>;
@@ -2,7 +2,7 @@ import { createHandler } from 'innet';
2
2
  import html from '@innet/html';
3
3
  import { jsxPlugins, jsxComponent, context, slot, slots } from '@innet/jsx';
4
4
  import { switchAsync } from '@innet/switch';
5
- import { promise, array, object, fn, arrayAsync, arrayClear, arraySingleLess, async } from '@innet/utils';
5
+ import { promise, array, nullish, stop, object, fn, arrayAsync, arrayClear, arraySingleLess, async } from '@innet/utils';
6
6
  import { serverFn } from '../experimental/serverFn/serverFn.es6.js';
7
7
  import { cookie } from '../plugins/cookie/cookie.es6.js';
8
8
  import { header } from '../plugins/header/header.es6.js';
@@ -56,6 +56,7 @@ const promisePlugins = [
56
56
  const handler = createHandler([
57
57
  promise(promisePlugins),
58
58
  array(arrayPlugins),
59
+ nullish([stop]),
59
60
  object(objectPlugins),
60
61
  fn(fnPlugins),
61
62
  ]);
@@ -64,6 +64,7 @@ var promisePlugins = [
64
64
  var handler = innet.createHandler([
65
65
  utils.promise(promisePlugins),
66
66
  utils.array(arrayPlugins),
67
+ utils.nullish([utils.stop]),
67
68
  utils.object(objectPlugins),
68
69
  utils.fn(fnPlugins),
69
70
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innet/server",
3
- "version": "1.5.3",
3
+ "version": "1.5.5",
4
4
  "description": "Create server-side application with innet",
5
5
  "main": "index.js",
6
6
  "module": "index.es6.js",