@medyll/idae-engine 1.179.0 → 1.185.2
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/LICENSE +21 -21
- package/README.md +121 -121
- package/package.json +13 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 medyll
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 medyll
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
# @medyll/engine
|
|
2
|
-
|
|
3
|
-
The main base scripts for idae based modules.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Install the package using npm:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @medyll/idae-engine
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Or using yarn:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
yarn add @medyll/idae-engine
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
The `@medyll/idae-eengine` package contains several utility classes. This section focuses on the `dataOp` class, which provides various data manipulation methods.
|
|
22
|
-
|
|
23
|
-
### Importing
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
import { dataOp } from '@medyll/idae-engine';
|
|
27
|
-
```
|
|
28
|
-
## dataOp
|
|
29
|
-
### Methods
|
|
30
|
-
|
|
31
|
-
#### do
|
|
32
|
-
|
|
33
|
-
Performs a combination of sort, find, and group operations on data.
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
const result = dataOp.do({
|
|
37
|
-
sort: { arr: myArray, by: 'fieldName', sort: 'asc' },
|
|
38
|
-
find: { arr: myArray, kw: 'searchTerm', field: 'fieldName' },
|
|
39
|
-
group: { dataList: myArray, groupBy: 'fieldName' }
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
#### sortBy
|
|
44
|
-
|
|
45
|
-
Sorts an array of objects based on specified fields.
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
const sortedArray = dataOp.sortBy({
|
|
49
|
-
arr: myArray,
|
|
50
|
-
by: 'fieldName',
|
|
51
|
-
sort: 'asc'
|
|
52
|
-
});
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
#### find
|
|
56
|
-
|
|
57
|
-
Searches for objects in an array based on specified criteria.
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
const foundItems = dataOp.find({
|
|
61
|
-
arr: myArray,
|
|
62
|
-
kw: 'searchTerm',
|
|
63
|
-
field: 'fieldName'
|
|
64
|
-
});
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
#### findOne
|
|
68
|
-
|
|
69
|
-
Searches for the first object in an array that matches the specified criteria.
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
const foundItem = dataOp.findOne({
|
|
73
|
-
arr: myArray,
|
|
74
|
-
kw: 'searchTerm',
|
|
75
|
-
field: 'fieldName'
|
|
76
|
-
});
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### groupBy
|
|
80
|
-
|
|
81
|
-
Groups objects in an array based on specified fields or a custom grouping function.
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
const groupedData = dataOp.groupBy({
|
|
85
|
-
dataList: myArray,
|
|
86
|
-
groupBy: 'fieldName'
|
|
87
|
-
});
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
#### findByIndex
|
|
91
|
-
|
|
92
|
-
Finds the index of an object in an array based on a specified key-value pair.
|
|
93
|
-
|
|
94
|
-
```typescript
|
|
95
|
-
const index = dataOp.findByIndex(myArray, 'value', 'keyName');
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
#### resolveDotPath
|
|
99
|
-
|
|
100
|
-
Resolves a dot-notated path in an object.
|
|
101
|
-
|
|
102
|
-
```typescript
|
|
103
|
-
const value = dataOp.resolveDotPath(myObject, 'path.to.property');
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Testing
|
|
107
|
-
|
|
108
|
-
The `dataOp` class comes with a comprehensive test suite. To run the tests:
|
|
109
|
-
|
|
110
|
-
1. Clone the repository
|
|
111
|
-
2. Install dependencies: `npm install` or `yarn install`
|
|
112
|
-
3. Run tests: `npm test` or `yarn test`
|
|
113
|
-
|
|
114
|
-
The tests cover various scenarios for each method, ensuring the reliability and correctness of the `dataOp` class.
|
|
115
|
-
|
|
116
|
-
## Contributing
|
|
117
|
-
|
|
118
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
119
|
-
|
|
120
|
-
## License
|
|
121
|
-
|
|
1
|
+
# @medyll/engine
|
|
2
|
+
|
|
3
|
+
The main base scripts for idae based modules.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the package using npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @medyll/idae-engine
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or using yarn:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @medyll/idae-engine
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
The `@medyll/idae-eengine` package contains several utility classes. This section focuses on the `dataOp` class, which provides various data manipulation methods.
|
|
22
|
+
|
|
23
|
+
### Importing
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { dataOp } from '@medyll/idae-engine';
|
|
27
|
+
```
|
|
28
|
+
## dataOp
|
|
29
|
+
### Methods
|
|
30
|
+
|
|
31
|
+
#### do
|
|
32
|
+
|
|
33
|
+
Performs a combination of sort, find, and group operations on data.
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
const result = dataOp.do({
|
|
37
|
+
sort: { arr: myArray, by: 'fieldName', sort: 'asc' },
|
|
38
|
+
find: { arr: myArray, kw: 'searchTerm', field: 'fieldName' },
|
|
39
|
+
group: { dataList: myArray, groupBy: 'fieldName' }
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### sortBy
|
|
44
|
+
|
|
45
|
+
Sorts an array of objects based on specified fields.
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const sortedArray = dataOp.sortBy({
|
|
49
|
+
arr: myArray,
|
|
50
|
+
by: 'fieldName',
|
|
51
|
+
sort: 'asc'
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### find
|
|
56
|
+
|
|
57
|
+
Searches for objects in an array based on specified criteria.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
const foundItems = dataOp.find({
|
|
61
|
+
arr: myArray,
|
|
62
|
+
kw: 'searchTerm',
|
|
63
|
+
field: 'fieldName'
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### findOne
|
|
68
|
+
|
|
69
|
+
Searches for the first object in an array that matches the specified criteria.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
const foundItem = dataOp.findOne({
|
|
73
|
+
arr: myArray,
|
|
74
|
+
kw: 'searchTerm',
|
|
75
|
+
field: 'fieldName'
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### groupBy
|
|
80
|
+
|
|
81
|
+
Groups objects in an array based on specified fields or a custom grouping function.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
const groupedData = dataOp.groupBy({
|
|
85
|
+
dataList: myArray,
|
|
86
|
+
groupBy: 'fieldName'
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### findByIndex
|
|
91
|
+
|
|
92
|
+
Finds the index of an object in an array based on a specified key-value pair.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
const index = dataOp.findByIndex(myArray, 'value', 'keyName');
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### resolveDotPath
|
|
99
|
+
|
|
100
|
+
Resolves a dot-notated path in an object.
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
const value = dataOp.resolveDotPath(myObject, 'path.to.property');
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Testing
|
|
107
|
+
|
|
108
|
+
The `dataOp` class comes with a comprehensive test suite. To run the tests:
|
|
109
|
+
|
|
110
|
+
1. Clone the repository
|
|
111
|
+
2. Install dependencies: `npm install` or `yarn install`
|
|
112
|
+
3. Run tests: `npm test` or `yarn test`
|
|
113
|
+
|
|
114
|
+
The tests cover various scenarios for each method, ensuring the reliability and correctness of the `dataOp` class.
|
|
115
|
+
|
|
116
|
+
## Contributing
|
|
117
|
+
|
|
118
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
122
|
This project is licensed under the MIT License.
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medyll/idae-engine",
|
|
3
3
|
"scope": "@medyll",
|
|
4
|
-
"
|
|
4
|
+
"author": "Lebrun Meddy",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/medyll/idae.git"
|
|
8
|
+
},
|
|
9
|
+
"version": "1.185.2",
|
|
5
10
|
"description": "A powerful TypeScript library for data manipulation and operations across the idae-engine. Provides utility classes for sorting, finding, grouping, and more.",
|
|
6
11
|
"exports": {
|
|
7
12
|
".": {
|
|
@@ -17,7 +22,12 @@
|
|
|
17
22
|
"peerDependencies": {
|
|
18
23
|
"svelte": "^5.0.0-next"
|
|
19
24
|
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public",
|
|
27
|
+
"directory": "."
|
|
28
|
+
},
|
|
20
29
|
"devDependencies": {
|
|
30
|
+
"@semantic-release/github": "^10.3.5",
|
|
21
31
|
"@sveltejs/adapter-auto": "^5.0.0",
|
|
22
32
|
"@sveltejs/kit": "^2.20.2",
|
|
23
33
|
"@sveltejs/package": "^2.3.10",
|
|
@@ -28,7 +38,7 @@
|
|
|
28
38
|
"typescript": "^5.8.2",
|
|
29
39
|
"vite": "^6.2.3",
|
|
30
40
|
"vitest": "^3.0.9",
|
|
31
|
-
"@medyll/idae-
|
|
41
|
+
"@medyll/idae-eslint-config": "0.1.5"
|
|
32
42
|
},
|
|
33
43
|
"svelte": "./dist/index.js",
|
|
34
44
|
"types": "./dist/index.d.ts",
|
|
@@ -42,6 +52,6 @@
|
|
|
42
52
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
43
53
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
44
54
|
"test": "vitest",
|
|
45
|
-
"
|
|
55
|
+
"prepackage": "node scripts/package-pre.js"
|
|
46
56
|
}
|
|
47
57
|
}
|