Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 83f4e93

Browse files
authored
Org version (#4)
* Convert to org standards * Remove safer-buffer dependency * Configure pnpm * Move and clean up writer tests * Move and clean up reader tests * Add more test scripts * Update package.json * Fix test glob pattern * Project details cleanup * Update CI config * Use reusable workflow * Bump to initial version
1 parent dcd6806 commit 83f4e93

File tree

19 files changed

+843
-1037
lines changed

19 files changed

+843
-1037
lines changed

.eslintrc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
{
2-
"plugins": [ "joyent" ],
32
"extends": [
4-
"eslint:recommended",
5-
"plugin:joyent/style",
6-
"plugin:joyent/lint"
7-
],
8-
"parserOptions": {
9-
"ecmaVersion": 5,
10-
"sourceType": "script",
11-
"ecmaFeatures": {
12-
}
13-
},
14-
"env": {
15-
"node": true
16-
},
17-
"rules": {
18-
}
3+
"standard"
4+
]
195
}

.github/workflows/main.yml

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,5 @@ on:
66
- master
77

88
jobs:
9-
10-
Test:
11-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
12-
strategy:
13-
matrix:
14-
node_version: ['lts/*', node]
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Checkout Code
18-
uses: actions/checkout@v2
19-
- name: Install Node
20-
uses: dcodeIO/setup-node-nvm@master
21-
with:
22-
node-version: ${{ matrix.node_version }}
23-
- name: Install Dependencies
24-
run: npm install
25-
- name: Run Tests 👩🏽‍💻
26-
run: npm run test
27-
28-
Lint:
29-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
30-
runs-on: ubuntu-latest
31-
steps:
32-
- name: Checkout Code
33-
uses: actions/checkout@v2
34-
- name: Install Node
35-
uses: dcodeIO/setup-node-nvm@master
36-
with:
37-
node-version: 'lts/*'
38-
- name: Install Dependencies
39-
run: npm install
40-
- name: Lint ✨
41-
run: npm run lint
42-
43-
Skip:
44-
if: contains(github.event.head_commit.message, '[skip ci]')
45-
runs-on: ubuntu-latest
46-
steps:
47-
- name: Skip CI 🚫
48-
run: echo skip ci
9+
call-core-ci:
10+
uses: ldapjs/.github/.github/workflows/node-ci.yml@main

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/build
12
/coverage
23
/node_modules
34
*.log

.npmrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# npm general settings
2+
3+
# pnpm specific settings
4+
hoist=false
5+
public-hoist-pattern[]=*eslint*

.taprc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
check-coverage: false
2+
3+
files:
4+
- 'lib/**/*.test.js'

CONTRIBUTING.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
This repository uses GitHub pull requests for code review.
44

5-
See the [Joyent Engineering
6-
Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general
7-
best practices expected in this repository.
8-
9-
Contributions should be "make prepush" clean. The "prepush" target runs the
10-
"check" target, which will check for linting and style errors.
5+
See [this primer](https://jrfom.com/posts/2017/03/08/a-primer-on-contributing-to-projects-with-git/)
6+
for instructions on how to make contributions to the project.
117

128
If you're changing something non-trivial or user-facing, you may want to submit
139
an issue first.

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
The MIT License (MIT)
2+
13
Copyright (c) 2011 Mark Cavage, All rights reserved.
4+
Copyright (c) 2022 The LDAPJS Collaborators.
25

36
Permission is hereby granted, free of charge, to any person obtaining a copy
47
of this software and associated documentation files (the "Software"), to deal

lib/ber/errors.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
22

3-
43
module.exports = {
54

65
newInvalidAsn1Error: function (msg) {
7-
var e = new Error();
8-
e.name = 'InvalidAsn1Error';
9-
e.message = msg || '';
10-
return e;
6+
const e = new Error()
7+
e.name = 'InvalidAsn1Error'
8+
e.message = msg || ''
9+
return e
1110
}
1211

13-
};
12+
}

lib/ber/index.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
22

3-
var errors = require('./errors');
4-
var types = require('./types');
5-
6-
var Reader = require('./reader');
7-
var Writer = require('./writer');
3+
const errors = require('./errors')
4+
const types = require('./types')
85

6+
const Reader = require('./reader')
7+
const Writer = require('./writer')
98

109
// --- Exports
1110

@@ -15,15 +14,11 @@ module.exports = {
1514

1615
Writer: Writer
1716

18-
};
17+
}
1918

20-
for (var t in types) {
21-
if (Object.prototype.hasOwnProperty.call(types, t)) {
22-
module.exports[t] = types[t];
23-
}
19+
for (const t in types) {
20+
if (Object.prototype.hasOwnProperty.call(types, t)) { module.exports[t] = types[t] }
2421
}
25-
for (var e in errors) {
26-
if (Object.prototype.hasOwnProperty.call(errors, e)) {
27-
module.exports[e] = errors[e];
28-
}
22+
for (const e in errors) {
23+
if (Object.prototype.hasOwnProperty.call(errors, e)) { module.exports[e] = errors[e] }
2924
}

0 commit comments

Comments
 (0)