You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Basic object cache with `get`, `set`, `del`, and `has` methods for node.js/javascript projects.
4
4
@@ -126,7 +126,26 @@ console.log(app);
126
126
//=> {name: 'Halle', foo: 'bar', baz: 'quux'}
127
127
```
128
128
129
-
### [.get](index.js#L109)
129
+
### [.union](index.js#L106)
130
+
131
+
Union `array` to `key`. Also emits `set` with the key and value.
132
+
133
+
**Params**
134
+
135
+
*`key`**{String}**
136
+
*`value`**{any}**
137
+
*`returns`**{Object}**: Returns the instance for chaining.
138
+
139
+
**Example**
140
+
141
+
```js
142
+
app.union('a.b', ['foo']);
143
+
app.union('a.b', ['bar']);
144
+
console.log(app.get('a'));
145
+
//=> {b: ['foo', 'bar']}
146
+
```
147
+
148
+
### [.get](index.js#L132)
130
149
131
150
Return the value of `key`. Dot notation may be used to get [nested property values][get-value].
132
151
@@ -150,7 +169,7 @@ app.get(['a', 'b']);
150
169
//=> {c: 'd'}
151
170
```
152
171
153
-
### [.has](index.js#L136)
172
+
### [.has](index.js#L159)
154
173
155
174
Return true if app has a stored value for `key`, false only if value is `undefined`.
156
175
@@ -171,7 +190,7 @@ app.has('foo');
171
190
//=> true
172
191
```
173
192
174
-
### [.del](index.js#L164)
193
+
### [.del](index.js#L187)
175
194
176
195
Delete one or more properties from the instance.
177
196
@@ -194,7 +213,7 @@ app.del('foo');
194
213
app.del(['foo', 'bar']);
195
214
```
196
215
197
-
### [.clear](index.js#L183)
216
+
### [.clear](index.js#L206)
198
217
199
218
Reset the entire cache to an empty object.
200
219
@@ -204,7 +223,7 @@ Reset the entire cache to an empty object.
204
223
app.clear();
205
224
```
206
225
207
-
### [.visit](index.js#L200)
226
+
### [.visit](index.js#L223)
208
227
209
228
Visit `method` over the properties in the given object, or map
210
229
visit over the object-elements in an array.
@@ -217,8 +236,10 @@ visit over the object-elements in an array.
217
236
218
237
## Related projects
219
238
239
+
You might also be interested in these projects:
240
+
220
241
*[base-methods](https://www.npmjs.com/package/base-methods): base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://www.npmjs.com/package/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods)
221
-
*[get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value)
242
+
*[get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value)
222
243
*[has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://www.npmjs.com/package/has-value) | [homepage](https://github.com/jonschlinkert/has-value)
223
244
*[option-cache](https://www.npmjs.com/package/option-cache): Simple API for managing options in JavaScript applications. | [homepage](https://github.com/jonschlinkert/option-cache)
224
245
*[set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value)
0 commit comments