grantcore 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -11
  2. package/package.json +3 -1
package/dist/index.js CHANGED
@@ -1,11 +1 @@
1
- export function createGrant(grant) {
2
- if (!grant.principalId || !grant.resource)
3
- throw new TypeError("Grant principal and resource are required.");
4
- return Object.freeze({
5
- ...grant,
6
- permissions: Object.freeze([...new Set(grant.permissions)]),
7
- });
8
- }
9
- export function grantsPermission(grant, permission) {
10
- return grant.permissions.includes(permission);
11
- }
1
+ function i(e){if(!e.principalId||!e.resource)throw new TypeError("Grant principal and resource are required.");return Object.freeze({...e,permissions:Object.freeze([...new Set(e.permissions)])})}function n(e,r){return e.permissions.includes(r)}export{i as createGrant,n as grantsPermission};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grantcore",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Small, framework-neutral primitives for representing authorization grants.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,6 +19,8 @@
19
19
  "sideEffects": false,
20
20
  "scripts": {
21
21
  "build": "tsc --project tsconfig.json",
22
+ "postbuild": "npm run dist --prefix \"$npm_config_local_prefix\" -- \"$PWD\"",
23
+ "prepack": "npm run build",
22
24
  "prepublishOnly": "npm run build"
23
25
  },
24
26
  "keywords": [