Skip to content

Commit 2eea81c

Browse files
authored
Merge pull request #93 from wilmoore/feature/add-github-actions
add github actions
2 parents 827708a + 29f9f2f commit 2eea81c

File tree

6 files changed

+14745
-35
lines changed

6 files changed

+14745
-35
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
22
npm-debug.log
3-
package-lock.json
43
selectn.js
54
selectn.min.js

index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict'
22

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
77

88
module.exports = curry2(selectn)
99

@@ -23,13 +23,13 @@ module.exports = curry2(selectn)
2323
* (3) returns undefined if path does not exist.
2424
*/
2525
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
3030

3131
while (++idx < end) {
32-
if (Object(ref) !== ref) return void 0
32+
if (Object(ref) !== ref) return undefined
3333
ref = ref[seg[idx]]
3434
}
3535

0 commit comments

Comments
 (0)