Skip to content

Commit

Permalink
first version
Browse files Browse the repository at this point in the history
  • Loading branch information
2ue committed Apr 20, 2024
1 parent 4b2a386 commit ed5e8d4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ let hasSeted = false;
* @param list<Array>: 要校验的权限合集,如果没有任何权限支持传入空数组或者null
*
* */
export function setPermissions (list: Permissions) {
function setPermissions (list: Permissions) {
permissionList = [...(list || [])];
hasSeted = true;
}
export function getPermissions () {
function getPermissions () {
return [...permissionList];
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "validate-permission",
"version": "0.0.1",
"version": "0.0.0",
"description": "用户权限校验,支持react(函数式)调用,vue组件,vue指令等方式调用",
"main": "dist/validate-permission.cjs.js",
"module": "dist/validate-permission.esm.js",
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const banner = `/*!
* ${pkg.description}
* Author: ${pkg.author.name}
* Email: ${pkg.author.email}
* Repository: ${pkg.repository.homepage}
* Repository: ${pkg.homepage}
* Version: ${pkg.version}
* License: ${pkg.license}
*/`;
Expand All @@ -30,11 +30,13 @@ module.exports = defineConfig({
file: `dist/cjs/${libName}.cjs.js`,
format: 'cjs',
banner,
sourcemap: true,
},
{
file: `dist/es/${libName}.es.js`,
format: 'es',
banner,
sourcemap: true,
},
{
file: `dist/umd/${libName}.umd.js`,
Expand All @@ -43,6 +45,7 @@ module.exports = defineConfig({
name: libName,
exports: 'named',
banner,
sourcemap: true,
},
],
plugins: [
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"strict": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true
"esModuleInterop": true,
"sourceMap": true
},
"exclude": ["node_modules", "dist"]
}

0 comments on commit ed5e8d4

Please sign in to comment.