File tree Expand file tree Collapse file tree 6 files changed +14745
-35
lines changed Expand file tree Collapse file tree 6 files changed +14745
-35
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on :
4
+ push :
5
+ pull_request :
6
+ branches :
7
+ - main
8
+
9
+ jobs :
10
+ test :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout repository
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Setup Node.js
18
+ uses : actions/setup-node@v4
19
+ with :
20
+ node-version : 23.x
21
+ cache : ' npm'
22
+
23
+ - name : Install latest npm
24
+ run : npm install -g npm
25
+
26
+ - name : Install dependencies
27
+ run : npm install
28
+
29
+ - name : Run tests
30
+ run : npm test
Original file line number Diff line number Diff line change 1
1
node_modules
2
2
npm-debug.log
3
- package-lock.json
4
3
selectn.js
5
4
selectn.min.js
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- var curry2 = require ( 'curry2' )
4
- var dotted = require ( 'brackets2dots' )
5
- var splits = require ( 'dotsplit.js' )
6
- var string = Object . prototype . toString
3
+ const curry2 = require ( 'curry2' )
4
+ const dotted = require ( 'brackets2dots' )
5
+ const splits = require ( 'dotsplit.js' )
6
+ const string = Object . prototype . toString
7
7
8
8
module . exports = curry2 ( selectn )
9
9
@@ -23,13 +23,13 @@ module.exports = curry2(selectn)
23
23
* (3) returns undefined if path does not exist.
24
24
*/
25
25
function selectn ( path , object ) {
26
- var idx = - 1
27
- var seg = string . call ( path ) === '[object Array]' ? path : splits ( dotted ( path ) )
28
- var end = seg . length
29
- var ref = end ? object : void 0
26
+ let idx = - 1
27
+ const seg = string . call ( path ) === '[object Array]' ? path : splits ( dotted ( path ) )
28
+ const end = seg . length
29
+ let ref = end ? object : undefined
30
30
31
31
while ( ++ idx < end ) {
32
- if ( Object ( ref ) !== ref ) return void 0
32
+ if ( Object ( ref ) !== ref ) return undefined
33
33
ref = ref [ seg [ idx ] ]
34
34
}
35
35
You can’t perform that action at this time.
0 commit comments