Skip to content

Commit

Permalink
chore: update module sizes;
Browse files Browse the repository at this point in the history
- related #29
  • Loading branch information
lukeed committed Oct 27, 2021
1 parent fa0f75c commit c29c251
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "dset",
"version": "3.1.0",
"repository": "lukeed/dset",
"description": "A tiny (196B) utility for safely writing deep Object values~!",
"description": "A tiny (194B) utility for safely writing deep Object values~!",
"unpkg": "dist/index.min.js",
"umd:main": "dist/index.min.js",
"module": "dist/index.mjs",
Expand Down
6 changes: 3 additions & 3 deletions readme.md
@@ -1,6 +1,6 @@
# dset [![CI](https://github.com/lukeed/dset/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/lukeed/dset/actions) [![codecov](https://badgen.net/codecov/c/github/lukeed/dset)](https://codecov.io/gh/lukeed/dset)

> A tiny (196B) utility for safely writing deep Object values~!
> A tiny (194B) utility for safely writing deep Object values~!
For _accessing_ deep object properties, please see [`dlv`](https://github.com/developit/dlv).

Expand All @@ -17,15 +17,15 @@ $ npm install --save dset
There are two "versions" of `dset` available:

#### `dset`
> **Size (gzip):** 196 bytes<br>
> **Size (gzip):** 194 bytes<br>
> **Availability:** [CommonJS](https://unpkg.com/dset/dist/index.js), [ES Module](https://unpkg.com/dset/dist/index.mjs), [UMD](https://unpkg.com/dset/dist/index.min.js)
```js
import { dset } from 'dset';
```

#### `dset/merge`
> **Size (gzip):** 289 bytes<br>
> **Size (gzip):** 288 bytes<br>
> **Availability:** [CommonJS](https://unpkg.com/dset/merge/index.js), [ES Module](https://unpkg.com/dset/merge/index.mjs), [UMD](https://unpkg.com/dset/merge/index.min.js)
```js
Expand Down
2 changes: 1 addition & 1 deletion src/merge.js
Expand Up @@ -17,7 +17,7 @@ export function merge(a, b, k) {
export function dset(obj, keys, val) {
keys.split && (keys=keys.split('.'));
var i=0, l=keys.length, t=obj, x, k;
for (; i < l;) {
while (i < l) {
k = keys[i++];
if (k === '__proto__' || k === 'constructor' || k === 'prototype') break;
t = t[k] = (i === l) ? merge(t[k],val) : (typeof(x=t[k])===typeof keys) ? x : (keys[i]*0 !== 0 || !!~(''+keys[i]).indexOf('.')) ? {} : [];
Expand Down

0 comments on commit c29c251

Please sign in to comment.