json-server 1.0.0-beta.13 → 1.0.0-beta.14

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
@@ -97,7 +97,7 @@ Run `json-server --help` for a list of options
97
97
  | <a href="https://mockend.com/" target="_blank"><img src="https://jsonplaceholder.typicode.com/mockend.svg" height="100px"></a> |
98
98
  | <a href="https://zuplo.link/json-server-gh"><img src="https://github.com/user-attachments/assets/adfee31f-a8b6-4684-9a9b-af4f03ac5b75" height="100px"></a> |
99
99
  | <a href="https://www.mintlify.com/"><img src="https://github.com/user-attachments/assets/bcc8cc48-b2d9-4577-8939-1eb4196b7cc5" height="100px"></a> |
100
- | <a href="http://git-tower.com/?utm_source=husky&utm_medium=referral"><img height="100px" alt="tower-dock-icon-light" src="https://github.com/user-attachments/assets/b6b4ab20-beff-4e5c-9845-bb9d60057196" /></a> |
100
+ | <a href="http://git-tower.com/?utm_source=husky&utm_medium=referral"><img height="100px" alt="tower-dock-icon-light" src="https://jsonplaceholder.typicode.com/tower-icon-and-logo-1400x260.png" /></a> |
101
101
  | <a href="https://serpapi.com/?utm_source=typicode"><img height="100px" src="https://github.com/user-attachments/assets/52b3039d-1e4c-4c68-951c-93f0f1e73611" /></a>
102
102
 
103
103
 
package/lib/random-id.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { randomBytes } from 'node:crypto';
2
2
  export function randomId() {
3
- return randomBytes(2).toString('hex');
3
+ return randomBytes(8).toString('base64url');
4
4
  }
package/lib/service.js CHANGED
@@ -104,7 +104,7 @@ export class Service {
104
104
  const items = this.#get(name);
105
105
  if (items === undefined || !Array.isArray(items))
106
106
  return;
107
- const item = { id: randomId(), ...data };
107
+ const item = { ...data, id: randomId() };
108
108
  items.push(item);
109
109
  await this.#db.write();
110
110
  return item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-server",
3
- "version": "1.0.0-beta.13",
3
+ "version": "1.0.0-beta.14",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "JSON",