Skip to content

Commit d603707

Browse files
committed
Update docs
1 parent 63aacd4 commit d603707

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "populate-array",
33
"version": "0.1.1",
4-
"description": "",
4+
"description": "Populate an array of objects with a set of properties",
55
"main": "index.js",
66
"module": "index.esm.js",
77
"scripts": {
@@ -12,7 +12,11 @@
1212
"test:dev": "npx tsnd --respawn ./bin/test.ts",
1313
"prepublishOnly": "npm run bundle && npm run test"
1414
},
15-
"keywords": [],
15+
"keywords": [
16+
"populate",
17+
"populate-array",
18+
"objects"
19+
],
1620
"author": "trapcodeio",
1721
"repository": "https://github.com/trapcodeio/populate-array.git",
1822
"license": "ISC",

readme.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,21 @@ populateArray(users, 'country', {
6161
// @formatter:on
6262
```
6363

64+
## Arguments
65+
The populateArray function takes three arguments:
66+
67+
- `array`: The array of objects to populate.
68+
- `path`: The path of the objects to populate.
69+
- `options`: The options object.
70+
71+
**Path Note:**
72+
This package makes use of `lodash.get` to get the value of a key in an object and `lodash.set` to set the value of a key in an object.
73+
So nested keys are supported. e.g. `user.address.city` using dot notation.
74+
6475
## Just that?
6576

66-
No!! There's more to the `populateArray` function, and they are packed in its options.
77+
No!! ☺️ There's more to the `populateArray` function, and they are packed in its options.
78+
6779

6880
## Options
6981

0 commit comments

Comments
 (0)