@ldsg/resource 0.1.0-alpha.17 → 0.1.0-alpha.18
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/dist/resource.d.ts +8 -2
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +10 -2
- package/package.json +4 -3
package/dist/resource.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ResourceRecord, ResourceSettings, SpecificResourceSettings } from "@ldsg/types";
|
|
2
2
|
import { ListIterateeCustom } from "lodash";
|
|
3
3
|
type GetFilteredResourcesParams = ListIterateeCustom<Resource, boolean>;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
interface GetFilteredResourceRes {
|
|
5
|
+
resource: Resource | undefined;
|
|
6
|
+
}
|
|
7
|
+
type GetFilteredResource = (params: GetFilteredResourcesParams) => GetFilteredResourceRes;
|
|
8
|
+
interface GetFilteredResourcesRes {
|
|
9
|
+
resources: Resource[];
|
|
10
|
+
}
|
|
11
|
+
type GetFilteredResources = (params: GetFilteredResourcesParams) => GetFilteredResourcesRes;
|
|
6
12
|
export interface ResourceConstructorParams<T extends SpecificResourceSettings = SpecificResourceSettings> extends ResourceRecord<T> {
|
|
7
13
|
}
|
|
8
14
|
export declare class Resource<T extends SpecificResourceSettings = SpecificResourceSettings> implements ResourceRecord<T> {
|
package/dist/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAU,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE/C,KAAK,0BAA0B,GAAG,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAExE,KAAK,mBAAmB,GAAG,CACzB,MAAM,EAAE,0BAA0B,KAC/B,
|
|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,EAAE,oBAAoB,CAUxC;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -11,14 +11,22 @@ class Resource {
|
|
|
11
11
|
* Get Filtered Resource
|
|
12
12
|
*/
|
|
13
13
|
this.getFilteredResource = (params) => {
|
|
14
|
-
|
|
14
|
+
const getFilteredResourcesRes = this.getFilteredResources(params);
|
|
15
|
+
const res = {
|
|
16
|
+
resource: getFilteredResourcesRes.resources[0],
|
|
17
|
+
};
|
|
18
|
+
return res;
|
|
15
19
|
};
|
|
16
20
|
/**
|
|
17
21
|
* Get Filtered Resources
|
|
18
22
|
*/
|
|
19
23
|
this.getFilteredResources = (params) => {
|
|
20
24
|
const { resourceList } = Resource;
|
|
21
|
-
|
|
25
|
+
const filterRes = lodash_1.default.filter(resourceList, params);
|
|
26
|
+
const res = {
|
|
27
|
+
resources: filterRes,
|
|
28
|
+
};
|
|
29
|
+
return res;
|
|
22
30
|
};
|
|
23
31
|
const { id, kind, parentId, settings } = params;
|
|
24
32
|
this.id = id;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/resource",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@ldsg/types": "0.1.0-alpha.
|
|
18
|
+
"@ldsg/types": "0.1.0-alpha.18"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/lodash": "^4.14.202"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "
|
|
24
|
+
"build": "pnpm clean && tsc --project tsconfig.build.json",
|
|
25
|
+
"clean": "rm -rf dist"
|
|
25
26
|
}
|
|
26
27
|
}
|