Skip to content

Commit 0d71cf4

Browse files
refactor: use dotprop and dset instead of utils.js (robsontenorio#145)
Add dependencies `dotprop` and `dset` in order to remove `utils.js`.
1 parent ebfd9b5 commit 0d71cf4

File tree

5 files changed

+20
-269
lines changed

5 files changed

+20
-269
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,9 @@
5959
"eslint": "^6.8.0",
6060
"jest": "^24.1.0",
6161
"semantic-release": "^17.2.2"
62+
},
63+
"dependencies": {
64+
"dotprop": "^1.2.0",
65+
"dset": "^2.0.1"
6266
}
6367
}

src/Model.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import Builder from './Builder';
2-
import StaticModel from './StaticModel';
3-
import { getProp, setProp } from './utils'
1+
import getProp from 'dotprop'
2+
import setProp from 'dset'
3+
import Builder from './Builder'
4+
import StaticModel from './StaticModel'
45

56
export default class Model extends StaticModel {
67

src/utils.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

tests/utils.test.js

Lines changed: 0 additions & 186 deletions
This file was deleted.

yarn.lock

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,7 @@ debug@^4.0.0:
24372437
dependencies:
24382438
ms "2.1.2"
24392439

2440-
debuglog@*, debuglog@^1.0.1:
2440+
debuglog@^1.0.1:
24412441
version "1.0.1"
24422442
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
24432443
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
@@ -2584,6 +2584,16 @@ dotenv@^5.0.1:
25842584
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef"
25852585
integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow==
25862586

2587+
dotprop@^1.2.0:
2588+
version "1.2.0"
2589+
resolved "https://registry.yarnpkg.com/dotprop/-/dotprop-1.2.0.tgz#8fdf345c757da479ec8af218ae4239a73df721a7"
2590+
integrity sha512-mVQb8y5u3UkzNua2Hc8Ut/uKyCjm9GG2MRk/0fxJ9Mxo8Nb8XyWqaP0wVXerMucmu0mQmlcZm3S1mjOdcbCwQA==
2591+
2592+
dset@^2.0.1:
2593+
version "2.0.1"
2594+
resolved "https://registry.yarnpkg.com/dset/-/dset-2.0.1.tgz#a15fff3d1e4d60ac0c95634625cbd5441a76deb1"
2595+
integrity sha512-nI29OZMRYq36hOcifB6HTjajNAAiBKSXsyWZrq+VniusseuP2OpNlTiYgsaNRSGvpyq5Wjbc2gQLyBdTyWqhnQ==
2596+
25872597
duplexer2@~0.1.0:
25882598
version "0.1.4"
25892599
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
@@ -3676,7 +3686,7 @@ import-local@^2.0.0:
36763686
pkg-dir "^3.0.0"
36773687
resolve-cwd "^2.0.0"
36783688

3679-
imurmurhash@*, imurmurhash@^0.1.4:
3689+
imurmurhash@^0.1.4:
36803690
version "0.1.4"
36813691
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
36823692
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
@@ -4878,11 +4888,6 @@ lockfile@^1.0.4:
48784888
dependencies:
48794889
signal-exit "^3.0.2"
48804890

4881-
lodash._baseindexof@*:
4882-
version "3.1.0"
4883-
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
4884-
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=
4885-
48864891
lodash._baseuniq@~4.6.0:
48874892
version "4.6.0"
48884893
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
@@ -4891,33 +4896,11 @@ lodash._baseuniq@~4.6.0:
48914896
lodash._createset "~4.0.0"
48924897
lodash._root "~3.0.0"
48934898

4894-
lodash._bindcallback@*:
4895-
version "3.0.1"
4896-
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
4897-
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=
4898-
4899-
lodash._cacheindexof@*:
4900-
version "3.0.2"
4901-
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
4902-
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=
4903-
4904-
lodash._createcache@*:
4905-
version "3.1.2"
4906-
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
4907-
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
4908-
dependencies:
4909-
lodash._getnative "^3.0.0"
4910-
49114899
lodash._createset@~4.0.0:
49124900
version "4.0.3"
49134901
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
49144902
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
49154903

4916-
lodash._getnative@*, lodash._getnative@^3.0.0:
4917-
version "3.9.1"
4918-
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
4919-
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
4920-
49214904
lodash._root@~3.0.0:
49224905
version "3.0.1"
49234906
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
@@ -4953,11 +4936,6 @@ lodash.isstring@^4.0.1:
49534936
resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451"
49544937
integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=
49554938

4956-
lodash.restparam@*:
4957-
version "3.6.1"
4958-
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
4959-
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
4960-
49614939
lodash.sortby@^4.7.0:
49624940
version "4.7.0"
49634941
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"

0 commit comments

Comments
 (0)