This repository was archived by the owner on Sep 14, 2022. It is now read-only.
File tree 2 files changed +14
-8
lines changed 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 4
4
"license" : " MIT" ,
5
5
"main" : " underscore.getSet.js" ,
6
6
"homepage" : " https://github.com/clementprevot/underscore.getSet" ,
7
- "version" : " 1 .0.0" ,
7
+ "version" : " 2 .0.0" ,
8
8
"repository" :
9
9
{
10
10
"type" : " git" ,
Original file line number Diff line number Diff line change 1
1
/**
2
2
* @license
3
- * underscore.getSet 1 .0.0
3
+ * underscore.getSet 2 .0.0
4
4
* Copyright 2015 Clément Prévot <clementp at lumapps dot com>
5
5
* Largely based on Lodash 3.10.1 <https://lodash.com/license>
6
6
* Available under MIT license
158
158
159
159
160
160
// Defining underscore.getSet
161
- var _gs = {
162
- VERSION : '1 .0.0' ,
161
+ var gs = {
162
+ VERSION : '2 .0.0' ,
163
163
164
164
get : function ( object , path , defaultValue ) {
165
165
var result = object == null ? undefined : baseGet ( object , toPath ( path ) , ( path + '' ) ) ;
202
202
if ( typeof exports !== 'undefined' ) {
203
203
if ( typeof module !== 'undefined' && module . exports )
204
204
{
205
- module . exports = _gs ;
205
+ module . exports = gs ;
206
206
}
207
207
208
- exports . _gs = _gs ;
208
+ exports . gs = gs ;
209
+ exports . _gs = gs ;
209
210
}
210
211
211
212
212
213
// Register as a named module with AMD.
213
214
if ( typeof define === 'function' && define . amd )
214
215
{
215
- define ( 'underscore.getSet' , [ ] , function ( ) { return _gs ; } ) ;
216
+ define ( 'underscore.getSet' , [ ] , function ( ) { return gs ; } ) ;
216
217
}
217
218
218
219
219
220
// Integrate with Underscore.js if defined
220
221
// or create our own underscore object.
221
222
root . _ = root . _ || { } ;
222
- root . _ . getSet = root . _ . gs = _gs ;
223
+ for ( var functionName in gs ) {
224
+ if ( gs . hasOwnProperties ( functionName ) && typeof gs [ functionName ] === 'function' ) {
225
+ root . _ [ functionName ] = gs [ functionName ] ;
226
+ }
227
+ }
228
+ root . _ . getSet = root . _ . gs = gs ;
223
229
} ( this ) ;
224
230
You can’t perform that action at this time.
0 commit comments