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

Commit

Permalink
Org version (#4)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jsumners authored Mar 27, 2022
1 parent dcd6806 commit 83f4e93
Show file tree
Hide file tree
Showing 19 changed files with 843 additions and 1,037 deletions.
18 changes: 2 additions & 16 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
{
"plugins": [ "joyent" ],
"extends": [
"eslint:recommended",
"plugin:joyent/style",
"plugin:joyent/lint"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script",
"ecmaFeatures": {
}
},
"env": {
"node": true
},
"rules": {
}
"standard"
]
}
42 changes: 2 additions & 40 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,5 @@ on:
- master

jobs:

Test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
node_version: ['lts/*', node]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Node
uses: dcodeIO/setup-node-nvm@master
with:
node-version: ${{ matrix.node_version }}
- name: Install Dependencies
run: npm install
- name: Run Tests 👩🏽‍💻
run: npm run test

Lint:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Node
uses: dcodeIO/setup-node-nvm@master
with:
node-version: 'lts/*'
- name: Install Dependencies
run: npm install
- name: Lint ✨
run: npm run lint

Skip:
if: contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
- name: Skip CI 🚫
run: echo skip ci
call-core-ci:
uses: ldapjs/.github/.github/workflows/node-ci.yml@main
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build
/coverage
/node_modules
*.log
Expand Down
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# npm general settings

# pnpm specific settings
hoist=false
public-hoist-pattern[]=*eslint*
4 changes: 4 additions & 0 deletions .taprc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
check-coverage: false

files:
- 'lib/**/*.test.js'
8 changes: 2 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

This repository uses GitHub pull requests for code review.

See the [Joyent Engineering
Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general
best practices expected in this repository.

Contributions should be "make prepush" clean. The "prepush" target runs the
"check" target, which will check for linting and style errors.
See [this primer](https://jrfom.com/posts/2017/03/08/a-primer-on-contributing-to-projects-with-git/)
for instructions on how to make contributions to the project.

If you're changing something non-trivial or user-facing, you may want to submit
an issue first.
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
The MIT License (MIT)

Copyright (c) 2011 Mark Cavage, All rights reserved.
Copyright (c) 2022 The LDAPJS Collaborators.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 5 additions & 6 deletions lib/ber/errors.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// Copyright 2011 Mark Cavage <[email protected]> All rights reserved.


module.exports = {

newInvalidAsn1Error: function (msg) {
var e = new Error();
e.name = 'InvalidAsn1Error';
e.message = msg || '';
return e;
const e = new Error()
e.name = 'InvalidAsn1Error'
e.message = msg || ''
return e
}

};
}
23 changes: 9 additions & 14 deletions lib/ber/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Copyright 2011 Mark Cavage <[email protected]> All rights reserved.

var errors = require('./errors');
var types = require('./types');

var Reader = require('./reader');
var Writer = require('./writer');
const errors = require('./errors')
const types = require('./types')

const Reader = require('./reader')
const Writer = require('./writer')

// --- Exports

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

Writer: Writer

};
}

for (var t in types) {
if (Object.prototype.hasOwnProperty.call(types, t)) {
module.exports[t] = types[t];
}
for (const t in types) {
if (Object.prototype.hasOwnProperty.call(types, t)) { module.exports[t] = types[t] }
}
for (var e in errors) {
if (Object.prototype.hasOwnProperty.call(errors, e)) {
module.exports[e] = errors[e];
}
for (const e in errors) {
if (Object.prototype.hasOwnProperty.call(errors, e)) { module.exports[e] = errors[e] }
}
Loading

0 comments on commit 83f4e93

Please sign in to comment.