@@ -4,15 +4,313 @@ Object.defineProperty(exports, '__esModule', { value: true });
44
55function _interopDefault ( ex ) { return ( ex && ( typeof ex === 'object' ) && 'default' in ex ) ? ex [ 'default' ] : ex ; }
66
7- var _ = _interopDefault ( require ( 'lodash/lodash.min' ) ) ;
87var Vue = _interopDefault ( require ( 'vue' ) ) ;
98
9+ /* eslint-disable */
10+ function isArray ( obj ) {
11+ return Array . isArray ( obj ) ;
12+ }
13+
14+ isArray . _accepts = [ 'ANY' ] ;
15+
16+ /* eslint-disable */
17+ function forEach ( obj , fn ) {
18+ try {
19+ if ( isArray ( obj ) ) {
20+ var idx = 0 ;
21+ var _iteratorNormalCompletion = true ;
22+ var _didIteratorError = false ;
23+ var _iteratorError = undefined ;
24+
25+ try {
26+ for ( var _iterator = obj [ Symbol . iterator ] ( ) , _step ; ! ( _iteratorNormalCompletion = ( _step = _iterator . next ( ) ) . done ) ; _iteratorNormalCompletion = true ) {
27+ var val = _step . value ;
28+
29+ if ( fn ( val , idx ) === false ) break ;
30+ idx ++ ;
31+ }
32+ } catch ( err ) {
33+ _didIteratorError = true ;
34+ _iteratorError = err ;
35+ } finally {
36+ try {
37+ if ( ! _iteratorNormalCompletion && _iterator . return ) {
38+ _iterator . return ( ) ;
39+ }
40+ } finally {
41+ if ( _didIteratorError ) {
42+ throw _iteratorError ;
43+ }
44+ }
45+ }
46+ } else {
47+ for ( var key in obj ) {
48+ if ( fn ( obj [ key ] , key ) === false ) break ;
49+ }
50+ }
51+ } catch ( err ) {
52+ return ;
53+ }
54+ }
55+
56+ forEach . _accepts = [ Object , Array ] ;
57+
1058var _typeof = typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ? function ( obj ) {
1159 return typeof obj ;
1260} : function ( obj ) {
1361 return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ;
1462} ;
1563
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+
112+
113+
114+
115+
116+
117+
118+ var toConsumableArray = function ( arr ) {
119+ if ( Array . isArray ( arr ) ) {
120+ for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) arr2 [ i ] = arr [ i ] ;
121+
122+ return arr2 ;
123+ } else {
124+ return Array . from ( arr ) ;
125+ }
126+ } ;
127+
128+ /* eslint-disable */
129+ function uniq ( list ) {
130+ return isArray ( list ) ? [ ] . concat ( toConsumableArray ( new Set ( list ) ) ) : [ ] ;
131+ }
132+
133+ uniq . _accepts = [ Array ] ;
134+
135+ /* eslint-disable */
136+ function isString ( obj ) {
137+ return typeof obj === 'string' ;
138+ }
139+
140+ isString . _accepts = [ 'ANY' ] ;
141+
142+ /* eslint-disable */
143+ function isObject ( obj ) {
144+ return ( typeof obj === 'undefined' ? 'undefined' : _typeof ( obj ) ) === 'object' && obj !== null ;
145+ }
146+
147+ isObject . _accepts = [ 'ANY' ] ;
148+
149+ /* eslint-disable */
150+ function isFunction ( obj ) {
151+ return typeof obj === 'function' ;
152+ }
153+
154+ isFunction . _accepts = [ 'ANY' ] ;
155+
156+ /* eslint-disable */
157+ function identity ( value ) {
158+ return value ;
159+ }
160+
161+ identity . _accepts = [ 'ANY' ] ;
162+
163+ /* eslint-disable */
164+ function isNumber ( obj ) {
165+ return typeof obj === 'number' && ! isNaN ( obj ) ;
166+ }
167+
168+ isNumber . _accepts = [ 'ANY' ] ;
169+
170+ /* eslint-disable */
171+ /*
172+ function range (number = 0, increment = 1) {
173+ return [ ...Array(number).keys() ].map(i => i * increment)
174+ }
175+ */
176+
177+ function range ( start , end , step ) {
178+ if ( end === undefined && step === undefined ) {
179+ end = start ;
180+ start = 0 ;
181+ step = 1 ;
182+ } else if ( step === undefined ) {
183+ step = 1 ;
184+ }
185+
186+ // non numbers return empty array
187+ if ( ! isNumber ( start ) || ! isNumber ( end ) || ! isNumber ( step ) || ! step ) return [ ] ;
188+ if ( start === end ) return [ start ] ;
189+
190+ var count = start ;
191+ var _range = [ ] ;
192+
193+ if ( start < end ) {
194+ while ( count < end ) {
195+ _range . push ( count ) ;
196+ count += Math . abs ( step ) ;
197+ }
198+ } else {
199+ while ( count > end ) {
200+ _range . push ( count ) ;
201+ count -= Math . abs ( step ) ;
202+ }
203+ }
204+
205+ return _range ;
206+ }
207+
208+ range . _accepts = [ Number ] ;
209+
210+ /* eslint-disable */
211+ function keys ( obj ) {
212+ try {
213+ return isArray ( obj ) ? range ( obj . length ) : Object . keys ( obj ) ;
214+ } catch ( err ) {
215+ return [ ] ;
216+ }
217+ }
218+
219+ keys . _accepts = [ Object , Array ] ;
220+ keys . _dependencies = [ 'dash.isArray' , 'dash.range' ] ;
221+
222+ /* eslint-disable */
223+ function reduce ( collection , iteratee , accumulator ) {
224+ if ( ! isObject ( collection ) && ! isArray ( collection ) ) return undefined ;
225+ if ( ! isFunction ( iteratee ) ) {
226+ accumulator = iteratee ;
227+ iteratee = identity ;
228+ }
229+
230+ accumulator = accumulator !== undefined ? accumulator : isArray ( collection ) ? collection . length ? collection [ 0 ] : undefined : keys ( collection ) . length ? collection [ keys ( collection ) [ 0 ] ] : undefined ;
231+
232+ forEach ( collection , function ( value , key ) {
233+ accumulator = iteratee ( accumulator , value , key , collection ) ;
234+ } ) ;
235+
236+ return accumulator ;
237+ }
238+
239+ reduce . _accepts = [ Object , Array ] ;
240+ reduce . _dependencies = [ 'dash.forEach' , 'dash.isObject' , 'dash.isArray' , 'dash.isFunction' , 'dash.identity' , 'dash.keys' ] ;
241+
242+ /* eslint-disable */
243+ function toPath ( pathString ) {
244+ // taken from lodash - https://github.com/lodash/lodash
245+ var pathRx = / [ ^ . [ \] ] + | \[ (?: ( - ? \d + (?: \. \d + ) ? ) | ( [ " ' ] ) ( (?: (? ! \2) [ ^ \\ ] | \\ .) * ?) \2) \] | (? = ( \. | \[ \] ) (?: \4| $ ) ) / g;
246+ var pathArray = [ ] ;
247+
248+ if ( isString ( pathString ) ) {
249+ pathString . replace ( pathRx , function ( match , number , quote , string ) {
250+ pathArray . push ( quote ? string : number !== undefined ? Number ( number ) : match ) ;
251+ return pathArray [ pathArray . length - 1 ] ;
252+ } ) ;
253+ }
254+ return pathArray ;
255+ }
256+
257+ toPath . _accepts = [ String ] ;
258+
259+ /* eslint-disable */
260+ function has ( obj , path ) {
261+ var found = true ;
262+ var fields = isArray ( path ) ? path : toPath ( path ) ;
263+ if ( ! fields . length ) return false ;
264+ forEach ( fields , function ( field ) {
265+ if ( obj [ field ] === undefined ) {
266+ found = false ;
267+ return false ;
268+ }
269+ obj = obj [ field ] ;
270+ } ) ;
271+ return found ;
272+ }
273+
274+ has . _accepts = [ Object , Array ] ;
275+ has . _dependencies = [ 'dash.forEach' , 'dash.isArray' , 'dash.toPath' ] ;
276+
277+ /* eslint-disable */
278+ function get$1 ( obj , path , defaultValue ) {
279+ var value = obj ;
280+ var fields = isArray ( path ) ? path : toPath ( path ) ;
281+ if ( fields . length === 0 ) return defaultValue ;
282+
283+ try {
284+ for ( var f in fields ) {
285+ if ( ! value [ fields [ f ] ] ) return defaultValue ; else value = value [ fields [ f ] ] ;
286+ }
287+ } catch ( err ) {
288+ return defaultValue ;
289+ }
290+ return value ;
291+ }
292+
293+ get$1 . _accepts = [ Object , Array ] ;
294+ get$1 . _dependencies = [ 'dash.isArray' , 'dash.toPath' ] ;
295+
296+ /* eslint-disable */
297+ var _ = {
298+ forEach : forEach ,
299+ uniq : uniq ,
300+ isString : isString ,
301+ reduce : reduce ,
302+ toPath : toPath ,
303+ isArray : isArray ,
304+ has : has ,
305+ isNumber : isNumber ,
306+ get : get$1 ,
307+ isObject : isObject ,
308+ isFunction : isFunction ,
309+ identity : identity ,
310+ keys : keys ,
311+ range : range
312+ } ;
313+
16314/*
17315 * @author Branden Horiuchi <[email protected] > 18316 * @description Deep set Vue.js objects
@@ -161,7 +459,7 @@ function vuexModel(vuexPath) {
161459 vuexSet . call ( _this , pathJoin ( vuexPath , property ) , value ) ;
162460 return true ;
163461 } ,
164- has : function has ( target , property ) {
462+ has : function has$$1 ( target , property ) {
165463 return true ;
166464 }
167465 } ) ;
@@ -202,7 +500,7 @@ function vueModel(obj) {
202500 vueSet . call ( _this2 , target , property , value ) ;
203501 return true ;
204502 } ,
205- has : function has ( target , property ) {
503+ has : function has$$1 ( target , property ) {
206504 return true ;
207505 }
208506 } ) ;
0 commit comments