@alwatr/local-storage 1.0.0
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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/main.cjs +3 -0
- package/dist/main.cjs.map +7 -0
- package/dist/main.d.ts +56 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.mjs +3 -0
- package/dist/main.mjs.map +7 -0
- package/package.json +77 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## 1.0.0 (2024-01-16)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **local-storage:** Rewrite local storage module ([5ed0f39](https://github.com/Alwatr/nanolib/commit/5ed0f39d090c027bb600a5d061ede887b4669198)) by @AliMD
|
|
11
|
+
* **local-storage:** separate package from `@alwatr/util` ([4cc22ed](https://github.com/Alwatr/nanolib/commit/4cc22eda8d89f291783eef3b8917434489b628e1)) by @njfamirm
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **local-storage:** Remove unused dependency and update tsconfig references ([b1caaea](https://github.com/Alwatr/nanolib/commit/b1caaea8565cd497d31d91e4e2ea1becd84a82a4)) by @AliMD
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 S. Ali Mihandoost
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# localJsonStorage
|
|
2
|
+
|
|
3
|
+
`localJsonStorage` is a utility object in our TypeScript package that provides methods for interacting with the local storage in a structured and versioned manner.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Before you can use `localJsonStorage`, you need to install the package. If you're using npm, you can do this with:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @alwatr/local-storage
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
If you're using Yarn, you can do this with:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @alwatr/local-storage
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
First, you need to import `localJsonStorage` from the package:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { localJsonStorage } from '@alwatr/local-storage';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or for CommonJS:
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
const { localJsonStorage } = require('@alwatr/local-storage');
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Getting an Item
|
|
34
|
+
|
|
35
|
+
You can get an item from local storage and parse it as JSON using the `getItem` method. If the item is not found, it will return a default value:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
const defaultValue = { a: 1, b: 2 };
|
|
39
|
+
const value = localJsonStorage.getItem('item-name', defaultValue);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Setting an Item
|
|
43
|
+
|
|
44
|
+
You can set an item in local storage as JSON using the `setItem` method:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const value = { a: 1, b: 2 };
|
|
48
|
+
localJsonStorage.setItem('item-name', value);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Removing an Item
|
|
52
|
+
|
|
53
|
+
You can remove an item from local storage using the `removeItem` method:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
localJsonStorage.removeItem('item-name');
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Future Plans
|
|
60
|
+
|
|
61
|
+
We plan to add more methods to `localJsonStorage` for directly interacting with local storage. Stay tuned for updates!
|
package/dist/main.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* @alwatr/local-storage v1.0.0 */
|
|
2
|
+
"use strict";var l=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},u=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!c.call(t,o)&&o!==n&&l(t,o,{get:()=>e[o],enumerable:!(r=i(e,o))||r.enumerable});return t};var y=t=>u(l({},"__esModule",{value:!0}),t);var p={};g(p,{localJsonStorage:()=>J});module.exports=y(p);function m(t){try{return JSON.parse(t)}catch(e){return console.error("parseJson","invalid_json",e),null}}var J={key_(t,e=1){return`${t}.v${e}`},getItem(t,e,n=1){let r=this.key_(t,n),o=localStorage.getItem(r);if(o===null)return e;let s=m(o);return s===null||typeof s!="object"?e:s},setItem(t,e,n=1){let r=this.key_(t,n);localStorage.setItem(r,JSON.stringify(e))},removeItem(t,e=1){let n=this.key_(t,e);window.localStorage.removeItem(n)}};0&&(module.exports={localJsonStorage});
|
|
3
|
+
//# sourceMappingURL=main.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/main.ts"],
|
|
4
|
+
"sourcesContent": ["import type {Json, JsonValue} from '@alwatr/type-helper';\n\n/**\n * Parse json string without throwing error.\n *\n * @param content - json string\n * @returns json object or null if json is invalid\n * @example\n * ```typescript\n * const json = parseJson('{\"a\":1,\"b\":2}');\n * console.log(json.a); // 1\n * ```\n */\nfunction parseJson<T extends JsonValue>(content: string): T | null {\n try {\n return JSON.parse(content);\n }\n catch (err) {\n console.error('parseJson', 'invalid_json', err);\n return null;\n }\n}\n\n// @TODO: localStorage polyfill (memory fallback)\n\n\n/**\n * A utility object for working with local storage and JSON data.\n */\nexport const localJsonStorage = {\n /**\n * Generate local storage key.\n *\n * @param name - Name of the item.\n * @param version - Version of the item (default: 1).\n * @returns The generated local storage key.\n * @example\n * ```typescript\n * localJsonStorage.key_('myItem', 1); // myItem.v1\n * ```\n */\n key_(name: string, version = 1): string {\n return `${name}.v${version}`;\n },\n\n /**\n * Get local storage item and parse it as JSON.\n * If item is not found, return default value.\n *\n * @param name - Name of the item.\n * @param defaultValue - Default value of the item.\n * @param version - Data structure version of the item (default: 1).\n * @returns The parsed JSON value or the default value if item is not found.\n * @example\n * ```typescript\n * const value = localJsonStorage.getItem('myItem', {a: 1, b: 2});\n * ```\n */\n getItem<T extends Json>(name: string, defaultValue: T, version = 1): T {\n const key = this.key_(name, version);\n const value = localStorage.getItem(key);\n if (value === null) return defaultValue;\n const json = parseJson<T>(value);\n if (json === null || typeof json !== 'object') return defaultValue;\n return json;\n },\n\n /**\n * Set local storage item as JSON.\n *\n * @param name - Name of the item.\n * @param value - Value of the item.\n * @param version - Version of the item.\n * @example\n * ```typescript\n * localJsonStorage.setItem('myItem', {a: 1, b: 2});\n * ```\n */\n setItem<T extends Json>(name: string, value: T, version = 1): void {\n const key = this.key_(name, version);\n localStorage.setItem(key, JSON.stringify(value));\n },\n\n /**\n * Removes an item from the local storage.\n *\n * @param name - The name of the item to remove.\n * @param version - The version of the item to remove. Default is 1.\n * @example\n * ```typescript\n * localJsonStorage.removeItem('myItem');\n * ```\n */\n removeItem(name: string, version = 1): void {\n const key = this.key_(name, version);\n window.localStorage.removeItem(key);\n },\n} as const;\n"],
|
|
5
|
+
"mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAaA,SAASI,EAA+BC,EAA2B,CACjE,GAAI,CACF,OAAO,KAAK,MAAMA,CAAO,CAC3B,OACOC,EAAK,CACV,eAAQ,MAAM,YAAa,eAAgBA,CAAG,EACvC,IACT,CACF,CAQO,IAAMJ,EAAmB,CAY9B,KAAKK,EAAcC,EAAU,EAAW,CACtC,MAAO,GAAGD,CAAI,KAAKC,CAAO,EAC5B,EAeA,QAAwBD,EAAcE,EAAiBD,EAAU,EAAM,CACrE,IAAME,EAAM,KAAK,KAAKH,EAAMC,CAAO,EAC7BG,EAAQ,aAAa,QAAQD,CAAG,EACtC,GAAIC,IAAU,KAAM,OAAOF,EAC3B,IAAMG,EAAOR,EAAaO,CAAK,EAC/B,OAAIC,IAAS,MAAQ,OAAOA,GAAS,SAAiBH,EAC/CG,CACT,EAaA,QAAwBL,EAAcI,EAAUH,EAAU,EAAS,CACjE,IAAME,EAAM,KAAK,KAAKH,EAAMC,CAAO,EACnC,aAAa,QAAQE,EAAK,KAAK,UAAUC,CAAK,CAAC,CACjD,EAYA,WAAWJ,EAAcC,EAAU,EAAS,CAC1C,IAAME,EAAM,KAAK,KAAKH,EAAMC,CAAO,EACnC,OAAO,aAAa,WAAWE,CAAG,CACpC,CACF",
|
|
6
|
+
"names": ["main_exports", "__export", "localJsonStorage", "__toCommonJS", "parseJson", "content", "err", "name", "version", "defaultValue", "key", "value", "json"]
|
|
7
|
+
}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Json } from '@alwatr/type-helper';
|
|
2
|
+
/**
|
|
3
|
+
* A utility object for working with local storage and JSON data.
|
|
4
|
+
*/
|
|
5
|
+
export declare const localJsonStorage: {
|
|
6
|
+
/**
|
|
7
|
+
* Generate local storage key.
|
|
8
|
+
*
|
|
9
|
+
* @param name - Name of the item.
|
|
10
|
+
* @param version - Version of the item (default: 1).
|
|
11
|
+
* @returns The generated local storage key.
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* localJsonStorage.key_('myItem', 1); // myItem.v1
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
readonly key_: (name: string, version?: number) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Get local storage item and parse it as JSON.
|
|
20
|
+
* If item is not found, return default value.
|
|
21
|
+
*
|
|
22
|
+
* @param name - Name of the item.
|
|
23
|
+
* @param defaultValue - Default value of the item.
|
|
24
|
+
* @param version - Data structure version of the item (default: 1).
|
|
25
|
+
* @returns The parsed JSON value or the default value if item is not found.
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const value = localJsonStorage.getItem('myItem', {a: 1, b: 2});
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
readonly getItem: <T extends Json>(name: string, defaultValue: T, version?: number) => T;
|
|
32
|
+
/**
|
|
33
|
+
* Set local storage item as JSON.
|
|
34
|
+
*
|
|
35
|
+
* @param name - Name of the item.
|
|
36
|
+
* @param value - Value of the item.
|
|
37
|
+
* @param version - Version of the item.
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* localJsonStorage.setItem('myItem', {a: 1, b: 2});
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
readonly setItem: <T_1 extends Json>(name: string, value: T_1, version?: number) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Removes an item from the local storage.
|
|
46
|
+
*
|
|
47
|
+
* @param name - The name of the item to remove.
|
|
48
|
+
* @param version - The version of the item to remove. Default is 1.
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* localJsonStorage.removeItem('myItem');
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
readonly removeItem: (name: string, version?: number) => void;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAY,MAAM,qBAAqB,CAAC;AA0BzD;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;;;;;;;;;OAUG;0BACQ,MAAM,uBAAgB,MAAM;IAIvC;;;;;;;;;;;;OAYG;6CAC2B,MAAM;IASpC;;;;;;;;;;OAUG;+CAC2B,MAAM,mCAA0B,IAAI;IAKlE;;;;;;;;;OASG;gCACc,MAAM,uBAAgB,IAAI;CAInC,CAAC"}
|
package/dist/main.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* @alwatr/local-storage v1.0.0 */
|
|
2
|
+
function l(t){try{return JSON.parse(t)}catch(e){return console.error("parseJson","invalid_json",e),null}}var i={key_(t,e=1){return`${t}.v${e}`},getItem(t,e,n=1){let o=this.key_(t,n),s=localStorage.getItem(o);if(s===null)return e;let r=l(s);return r===null||typeof r!="object"?e:r},setItem(t,e,n=1){let o=this.key_(t,n);localStorage.setItem(o,JSON.stringify(e))},removeItem(t,e=1){let n=this.key_(t,e);window.localStorage.removeItem(n)}};export{i as localJsonStorage};
|
|
3
|
+
//# sourceMappingURL=main.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/main.ts"],
|
|
4
|
+
"sourcesContent": ["import type {Json, JsonValue} from '@alwatr/type-helper';\n\n/**\n * Parse json string without throwing error.\n *\n * @param content - json string\n * @returns json object or null if json is invalid\n * @example\n * ```typescript\n * const json = parseJson('{\"a\":1,\"b\":2}');\n * console.log(json.a); // 1\n * ```\n */\nfunction parseJson<T extends JsonValue>(content: string): T | null {\n try {\n return JSON.parse(content);\n }\n catch (err) {\n console.error('parseJson', 'invalid_json', err);\n return null;\n }\n}\n\n// @TODO: localStorage polyfill (memory fallback)\n\n\n/**\n * A utility object for working with local storage and JSON data.\n */\nexport const localJsonStorage = {\n /**\n * Generate local storage key.\n *\n * @param name - Name of the item.\n * @param version - Version of the item (default: 1).\n * @returns The generated local storage key.\n * @example\n * ```typescript\n * localJsonStorage.key_('myItem', 1); // myItem.v1\n * ```\n */\n key_(name: string, version = 1): string {\n return `${name}.v${version}`;\n },\n\n /**\n * Get local storage item and parse it as JSON.\n * If item is not found, return default value.\n *\n * @param name - Name of the item.\n * @param defaultValue - Default value of the item.\n * @param version - Data structure version of the item (default: 1).\n * @returns The parsed JSON value or the default value if item is not found.\n * @example\n * ```typescript\n * const value = localJsonStorage.getItem('myItem', {a: 1, b: 2});\n * ```\n */\n getItem<T extends Json>(name: string, defaultValue: T, version = 1): T {\n const key = this.key_(name, version);\n const value = localStorage.getItem(key);\n if (value === null) return defaultValue;\n const json = parseJson<T>(value);\n if (json === null || typeof json !== 'object') return defaultValue;\n return json;\n },\n\n /**\n * Set local storage item as JSON.\n *\n * @param name - Name of the item.\n * @param value - Value of the item.\n * @param version - Version of the item.\n * @example\n * ```typescript\n * localJsonStorage.setItem('myItem', {a: 1, b: 2});\n * ```\n */\n setItem<T extends Json>(name: string, value: T, version = 1): void {\n const key = this.key_(name, version);\n localStorage.setItem(key, JSON.stringify(value));\n },\n\n /**\n * Removes an item from the local storage.\n *\n * @param name - The name of the item to remove.\n * @param version - The version of the item to remove. Default is 1.\n * @example\n * ```typescript\n * localJsonStorage.removeItem('myItem');\n * ```\n */\n removeItem(name: string, version = 1): void {\n const key = this.key_(name, version);\n window.localStorage.removeItem(key);\n },\n} as const;\n"],
|
|
5
|
+
"mappings": ";AAaA,SAASA,EAA+BC,EAA2B,CACjE,GAAI,CACF,OAAO,KAAK,MAAMA,CAAO,CAC3B,OACOC,EAAK,CACV,eAAQ,MAAM,YAAa,eAAgBA,CAAG,EACvC,IACT,CACF,CAQO,IAAMC,EAAmB,CAY9B,KAAKC,EAAcC,EAAU,EAAW,CACtC,MAAO,GAAGD,CAAI,KAAKC,CAAO,EAC5B,EAeA,QAAwBD,EAAcE,EAAiBD,EAAU,EAAM,CACrE,IAAME,EAAM,KAAK,KAAKH,EAAMC,CAAO,EAC7BG,EAAQ,aAAa,QAAQD,CAAG,EACtC,GAAIC,IAAU,KAAM,OAAOF,EAC3B,IAAMG,EAAOT,EAAaQ,CAAK,EAC/B,OAAIC,IAAS,MAAQ,OAAOA,GAAS,SAAiBH,EAC/CG,CACT,EAaA,QAAwBL,EAAcI,EAAUH,EAAU,EAAS,CACjE,IAAME,EAAM,KAAK,KAAKH,EAAMC,CAAO,EACnC,aAAa,QAAQE,EAAK,KAAK,UAAUC,CAAK,CAAC,CACjD,EAYA,WAAWJ,EAAcC,EAAU,EAAS,CAC1C,IAAME,EAAM,KAAK,KAAKH,EAAMC,CAAO,EACnC,OAAO,aAAa,WAAWE,CAAG,CACpC,CACF",
|
|
6
|
+
"names": ["parseJson", "content", "err", "localJsonStorage", "name", "version", "defaultValue", "key", "value", "json"]
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alwatr/local-storage",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "`localJsonStorage` is a utility object in our TypeScript package that provides methods for interacting with the local storage in a structured and versioned manner.",
|
|
5
|
+
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"local-storage",
|
|
8
|
+
"storage",
|
|
9
|
+
"json",
|
|
10
|
+
"json-storage",
|
|
11
|
+
"JsonStorage",
|
|
12
|
+
"local-json-storage",
|
|
13
|
+
"cross-platform",
|
|
14
|
+
"ECMAScript",
|
|
15
|
+
"typescript",
|
|
16
|
+
"javascript",
|
|
17
|
+
"browser",
|
|
18
|
+
"esm",
|
|
19
|
+
"module",
|
|
20
|
+
"utility",
|
|
21
|
+
"util",
|
|
22
|
+
"utils",
|
|
23
|
+
"nanolib",
|
|
24
|
+
"alwatr"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/main.cjs",
|
|
28
|
+
"module": "./dist/main.mjs",
|
|
29
|
+
"types": "./dist/main.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": "./dist/main.mjs",
|
|
33
|
+
"require": "./dist/main.cjs",
|
|
34
|
+
"types": "./dist/main.d.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"files": [
|
|
39
|
+
"**/*.{js,mjs,cjs,map,d.ts,html,md}",
|
|
40
|
+
"!demo/**/*"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/Alwatr/nanolib",
|
|
48
|
+
"directory": "packages/local-storage"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/local-storage#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/Alwatr/nanolib/issues"
|
|
53
|
+
},
|
|
54
|
+
"prettier": "@alwatr/prettier-config",
|
|
55
|
+
"scripts": {
|
|
56
|
+
"b": "yarn run build",
|
|
57
|
+
"w": "yarn run watch",
|
|
58
|
+
"c": "yarn run clean",
|
|
59
|
+
"cb": "yarn run clean && yarn run build",
|
|
60
|
+
"d": "yarn run build:es && yarn node --enable-source-maps --trace-warnings",
|
|
61
|
+
"build": "yarn run build:ts & yarn run build:es",
|
|
62
|
+
"build:es": "nano-build --preset=module",
|
|
63
|
+
"build:ts": "tsc --build",
|
|
64
|
+
"watch": "yarn run watch:ts & yarn run watch:es",
|
|
65
|
+
"watch:es": "yarn run build:es --watch",
|
|
66
|
+
"watch:ts": "yarn run build:ts --watch --preserveWatchOutput",
|
|
67
|
+
"clean": "rm -rfv dist *.tsbuildinfo"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@alwatr/nano-build": "^1.3.1",
|
|
71
|
+
"@alwatr/prettier-config": "^1.0.4",
|
|
72
|
+
"@alwatr/tsconfig-base": "^1.1.1",
|
|
73
|
+
"@alwatr/type-helper": "^1.1.0",
|
|
74
|
+
"typescript": "^5.3.3"
|
|
75
|
+
},
|
|
76
|
+
"gitHead": "808ba074470a2a1482d692fdb477730b40385c1d"
|
|
77
|
+
}
|