@rainte/js 0.0.50 → 0.0.54

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.
@@ -0,0 +1,2 @@
1
+ export declare const flattenTree: <T, K extends string = 'children'>(tree: T[], prop?: K) => Omit<T, K>[];
2
+ export declare const findByValue: <T = any>(list: T[], value: unknown, prop?: string) => T | undefined;
@@ -0,0 +1,14 @@
1
+ import Dexie, { type Table } from 'dexie';
2
+ export interface DexieRow {
3
+ id?: number;
4
+ key: string;
5
+ value: any;
6
+ }
7
+ export declare class SubDexie extends Dexie {
8
+ rows: Table<DexieRow, number>;
9
+ constructor(name?: string);
10
+ }
11
+ export declare const getDB: (name?: string) => SubDexie;
12
+ export declare const db: SubDexie;
13
+ export declare const get: <T = any>(key: string, raw?: boolean) => Promise<T | undefined>;
14
+ export declare const set: (key: string, value: any) => import("dexie").PromiseExtended<number>;
@@ -1,3 +1,3 @@
1
- export declare const SHA256: (input: unknown, toJson?: Boolean) => Promise<string>;
1
+ export declare const SHA256: (input: unknown, toJson?: boolean) => Promise<string>;
2
2
  export declare const random: () => number;
3
3
  export declare const id: () => string;
@@ -3,5 +3,5 @@ export declare const message: <T = string>(data: any, text?: string) => T;
3
3
  export declare const axios: import("axios").AxiosInstance;
4
4
  export declare const tokenRequestInterceptor: () => number;
5
5
  export declare const responseInterceptor: (onRejected?: ((error: any) => any) | null) => number;
6
- export declare const retry: (error: any, refreshURL: string, refreshRequest: () => Promise<any>) => Promise<unknown>;
6
+ export declare const retry: (error: any, refreshRequest: () => Promise<unknown>) => Promise<unknown>;
7
7
  export default axios;
@@ -0,0 +1,6 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ export * from './axios';
3
+ export declare const get: (url: string, params?: ObjectProps) => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
4
+ export declare const post: (url: string, data?: ObjectProps) => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
5
+ export declare const download: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
6
+ export declare const request: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
@@ -1,3 +1,3 @@
1
- import { Options } from 'jsan';
1
+ import { type Options } from 'jsan';
2
2
  export declare const stringify: (value?: unknown, replacer?: (key: string, value: unknown) => unknown | Array<number | string> | null, space?: string | number, _options?: Options | boolean) => string;
3
3
  export declare const parse: <T = any>(text: string, reviver?: (key: string, value: unknown) => unknown) => T;
@@ -0,0 +1,10 @@
1
+ export * as array from './array';
2
+ export * as blob from './blob';
3
+ export * as database from './database';
4
+ export * as date from './date';
5
+ export * as hash from './hash';
6
+ export * as http from './http';
7
+ export * as json from './json';
8
+ export * as storage from './storage';
9
+ export * as system from './system';
10
+ export * as url from './url';
@@ -1,3 +1,3 @@
1
1
  export declare const search: () => URLSearchParams;
2
2
  export declare const params: () => ObjectProps;
3
- export declare const open: (url?: string | URL, target?: string, features?: string) => void;
3
+ export declare const open: (url?: string | URL, target?: string, features?: string) => Window | null;
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  type ObjectProps = Record<string, any>
2
- type ProviderProps = { children: ReactNode }
3
- type FunctionProps = (...args: any[]) => any
2
+ type ProviderProps<T = any> = { children: T }
3
+ type FunctionProps<T = any> = (...args: any[]) => T
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainte/js",
3
- "version": "0.0.50",
3
+ "version": "0.0.54",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -11,10 +11,10 @@
11
11
  ],
12
12
  "main": "./dist/index.umd.cjs",
13
13
  "module": "./dist/index.js",
14
- "types": "./dist/types/lib/index.d.ts",
14
+ "types": "./dist/types/lib.d.ts",
15
15
  "exports": {
16
16
  ".": {
17
- "types": "./dist/types/lib/index.d.ts",
17
+ "types": "./dist/types/lib.d.ts",
18
18
  "import": "./dist/index.js",
19
19
  "require": "./dist/index.umd.cjs"
20
20
  },
@@ -24,24 +24,30 @@
24
24
  },
25
25
  "scripts": {
26
26
  "dev": "vite",
27
- "build": "vite build && tsc",
27
+ "build": "vite build && tsc -b",
28
+ "lint": "oxlint",
28
29
  "preview": "vite preview",
29
- "overhaul": "pnpm up -L --registry=https://registry.npmjs.org",
30
+ "upgrade": "pnpm up -L --registry=https://registry.npmjs.org",
30
31
  "commit": "git add -A && git commit -m commit && git push || git push",
31
32
  "release": "npm publish --registry=https://registry.npmjs.org",
32
33
  "prepublishOnly": "npm run build && npm run commit && npm version patch",
33
- "postpublish": "git push"
34
+ "postpublish": "git push",
35
+ "test": "vitest"
34
36
  },
35
37
  "dependencies": {
36
- "axios": "^1.8.4",
37
- "dayjs": "^1.11.13",
38
- "dexie": "^4.0.11",
38
+ "axios": "^1.21.0",
39
+ "dayjs": "^1.11.23",
40
+ "dexie": "^4.4.7",
39
41
  "jsan": "^3.1.14"
40
42
  },
41
43
  "devDependencies": {
42
44
  "@types/jsan": "^3.1.5",
43
- "@types/node": "^22.13.14",
44
- "typescript": "^5.8.2",
45
- "vite": "^6.2.3"
45
+ "@types/node": "^26.6.6",
46
+ "fake-indexeddb": "^6.2.7",
47
+ "happy-dom": "^21.0.4",
48
+ "oxlint": "^1.90.0",
49
+ "typescript": "^7.0.2",
50
+ "vite": "^8.3.5",
51
+ "vitest": "^5.1.0"
46
52
  }
47
53
  }
@@ -1,10 +0,0 @@
1
- export * as array from '../src/array';
2
- export * as blob from '../src/blob';
3
- export * as database from '../src/database';
4
- export * as date from '../src/date';
5
- export * as hash from '../src/hash';
6
- export * as http from '../src/http';
7
- export * as json from '../src/json';
8
- export * as storage from '../src/storage';
9
- export * as system from '../src/system';
10
- export * as url from '../src/url';
@@ -1,2 +0,0 @@
1
- export declare const flattenTree: <T = any>(tree: T[], prop?: string) => Omit<T, typeof prop>[];
2
- export declare const findByValue: <T = any>(list: T[], value: any, prop?: string) => T | undefined;
@@ -1,13 +0,0 @@
1
- import Dexie, { Table } from 'dexie';
2
- export interface DexieRow {
3
- id?: number;
4
- key: string;
5
- value: any;
6
- }
7
- export declare class SubDexie extends Dexie {
8
- rows: Table<DexieRow>;
9
- constructor();
10
- }
11
- export declare const db: SubDexie;
12
- export declare const get: <T = any>(key: string, raw?: boolean) => Promise<T | undefined>;
13
- export declare const set: (key: string, value: any) => Promise<any>;
@@ -1,6 +0,0 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- export * from './axios';
3
- export declare const get: (url: string, params?: ObjectProps) => Promise<import("axios").AxiosResponse<any, any>>;
4
- export declare const post: (url: string, data?: ObjectProps) => Promise<import("axios").AxiosResponse<any, any>>;
5
- export declare const download: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
6
- export declare const request: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
File without changes
File without changes
File without changes
File without changes
File without changes