s101-lodash 1.0.0
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/package.json +19 -0
- package/src/index.js +7 -0
- package/src/utils/array.js +12 -0
- package/test/README.md +42 -0
- package/test/array.test.js +6 -0
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "s101-lodash",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "This is a real-world practical project like lodash.",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "jest"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"s101-lodash": "./src/index.js"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"jest": "^30.2.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/index.js
ADDED
package/test/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Lodash-like NPM Package
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
A lightweight utility library providing a collection of helpful functions for common programming tasks. This package offers functional programming utilities similar to Lodash, designed to simplify data manipulation, array operations, and object transformations.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
```bash
|
|
8
|
+
npm install lodash-like
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage Examples
|
|
12
|
+
```javascript
|
|
13
|
+
const _ = require('lodash-like');
|
|
14
|
+
|
|
15
|
+
// Array operations
|
|
16
|
+
const {chunk} = require('lodash-like')
|
|
17
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
18
|
+
const size = 2;
|
|
19
|
+
console.log(chunk(numbers, size)); // output:[[1,2],[3,4],[5]]
|
|
20
|
+
|
|
21
|
+
// Object operations
|
|
22
|
+
const user = { name: 'John', age: 30 };
|
|
23
|
+
const clone = _.clone(user);
|
|
24
|
+
|
|
25
|
+
// Collection utilities
|
|
26
|
+
const unique = _.uniq([1, 2, 2, 3, 3, 4]);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Contributing
|
|
30
|
+
We welcome contributions! Please follow these guidelines:
|
|
31
|
+
|
|
32
|
+
1. Fork the repository
|
|
33
|
+
2. Create a feature branch: `git checkout -b feature/your-feature`
|
|
34
|
+
3. Write tests for new functionality
|
|
35
|
+
4. Commit with clear messages: `git commit -m 'Add feature description'`
|
|
36
|
+
5. Push to your branch and submit a pull request
|
|
37
|
+
6. Ensure all tests pass before submitting
|
|
38
|
+
|
|
39
|
+
## License
|
|
40
|
+
MIT
|
|
41
|
+
|
|
42
|
+
# Lodash Project
|