Skip to content

Commit

Permalink
Version_0.1.8-test1
Browse files Browse the repository at this point in the history
  • Loading branch information
censujiang committed Jun 1, 2023
1 parent d09dbc9 commit 2c40dd9
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 807 deletions.
795 changes: 0 additions & 795 deletions dist/index.js

This file was deleted.

8 changes: 6 additions & 2 deletions esm/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ export const localCookie = {
return result;
},
setItem: (sKey, sValue, vEnd, sPath, sDomain, bSecure) => {
let result = false;
// #ifdef H5
origin.localCookie.setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure);
result = origin.localCookie.setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure);
// #endif
return result;
},
removeItem: (sKey, sPath, sDomain) => {
let result = false;
// #ifdef H5
origin.localCookie.removeItem(sKey, sPath, sDomain);
result = origin.localCookie.removeItem(sKey, sPath, sDomain);
// #endif
return result;
},
hasItem: (sKey) => {
let result = false;
Expand Down
1 change: 1 addition & 0 deletions esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export { checkNull, checkNotNull, strLength, formatBytes, checkPassword, checkEm
export { updateObjectFromImport } from 'galanga';
export { filterUniqueByProperty } from 'galanga';
export { formatNumber } from 'galanga';
export { afterTime } from 'galanga';
//导出自己的子模块
export { localCookie } from './cookie';
export { url } from './url';
Expand Down
13 changes: 13 additions & 0 deletions esm/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,18 @@ export const url = {
},
getHash: () => {
return undefined;
},
setHash: (value) => {
return false;
},
setPath: (value) => {
const uniRouter = getCurrentPages();
const currentRoute = uniRouter[uniRouter.length - 1];
currentRoute.$page.route = value;
},
setQuery: (key, value) => {
const uniRouter = getCurrentPages();
const currentRoute = uniRouter[uniRouter.length - 1];
currentRoute.$page.options[key] = value;
}
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uni-helper/galanga",
"version": "0.1.7-test3",
"version": "0.1.8-test1",
"description": "JS common function library(UNI-APP version of Galanga)",
"main": "esm/index.js",
"jsnext:main": "esm/index.js",
Expand Down Expand Up @@ -70,6 +70,6 @@
"typescript": "^5.0.4"
},
"dependencies": {
"galanga": "^0.1.7-fix1"
"galanga": "^0.1.8"
}
}
8 changes: 6 additions & 2 deletions src/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ export const localCookie = {
return result;
},
setItem:(sKey:string, sValue:string, vEnd?:number | string | Date, sPath?:string, sDomain?:string, bSecure?:boolean) => {
let result = false;
// #ifdef H5
origin.localCookie.setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure);
result= origin.localCookie.setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure);
// #endif
return result;
},
removeItem:(sKey:string, sPath?:string, sDomain?:string) => {
let result = false;
// #ifdef H5
origin.localCookie.removeItem(sKey, sPath, sDomain);
result = origin.localCookie.removeItem(sKey, sPath, sDomain);
// #endif
return result;
},
hasItem:(sKey:string) => {
let result = false;
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { checkNull, checkNotNull, strLength, formatBytes, checkPassword, checkEm
export { updateObjectFromImport } from 'galanga';
export { filterUniqueByProperty } from 'galanga';
export { formatNumber } from 'galanga';
export { afterTime } from 'galanga';

//导出自己的子模块
export { localCookie } from './cookie';
Expand Down
13 changes: 13 additions & 0 deletions src/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,18 @@ export const url = {
},
getHash: () => {
return undefined;
},
setHash: (value?: string) => {
return false;
},
setPath: (value: string) => {
const uniRouter = getCurrentPages();
const currentRoute = uniRouter[uniRouter.length - 1];
currentRoute.$page.route = value;
},
setQuery: (key: string, value: string) => {
const uniRouter = getCurrentPages();
const currentRoute = uniRouter[uniRouter.length - 1];
currentRoute.$page.options[key] = value;
}
}
4 changes: 2 additions & 2 deletions types/cookie.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export declare const localCookie: {
getItem: (sKey: string) => any;
setItem: (sKey: string, sValue: string, vEnd?: number | string | Date, sPath?: string, sDomain?: string, bSecure?: boolean) => void;
removeItem: (sKey: string, sPath?: string, sDomain?: string) => void;
setItem: (sKey: string, sValue: string, vEnd?: number | string | Date, sPath?: string, sDomain?: string, bSecure?: boolean) => boolean;
removeItem: (sKey: string, sPath?: string, sDomain?: string) => boolean;
hasItem: (sKey: string) => boolean;
keys: () => any[];
clear: () => void;
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export { checkNull, checkNotNull, strLength, formatBytes, checkPassword, checkEm
export { updateObjectFromImport } from 'galanga';
export { filterUniqueByProperty } from 'galanga';
export { formatNumber } from 'galanga';
export { afterTime } from 'galanga';
export { localCookie } from './cookie';
export { url } from './url';
export { checkDeviceType, clipboard } from './device';
Expand Down
3 changes: 3 additions & 0 deletions types/url.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ export declare const url: {
getPath: () => string;
getQuery: (value: string) => any;
getHash: () => any;
setHash: (value?: string) => boolean;
setPath: (value: string) => void;
setQuery: (key: string, value: string) => void;
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1600,10 +1600,10 @@ function-bind@^1.1.1:
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==

galanga@^0.1.7-fix1:
version "0.1.7-fix1"
resolved "https://registry.npmjs.org/galanga/-/galanga-0.1.7-fix1.tgz#23188d0387c96603a977c1d880c70aa277d9291b"
integrity sha512-TnxcVPwQ/VMUDwZ3xfZ4UzJDaXe10OXDi80DNugXZq9q5l1ydJWtO3qMb6QTIoIlhMInN5oiOeOqmwh23TBZ5g==
galanga@^0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/galanga/-/galanga-0.1.8.tgz#a4668b9f3303daf1233e0a8305ce243078804bbf"
integrity sha512-miv0pAFcoS8I09wDhIM16g7jL9l5uxlyu6ksmKClTfIJpr0q/E6rhuyWguV6wGYoSVkVKRaFPuBhCnLZL6ARBw==

gensync@^1.0.0-beta.2:
version "1.0.0-beta.2"
Expand Down

0 comments on commit 2c40dd9

Please sign in to comment.