Skip to content

Commit 1e727b9

Browse files
committed
feat: drop Node.js v10 and v12 support
BREAKING CHANGE: Node.js v10 and v12 are no longer supported.
1 parent 7a049fa commit 1e727b9

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ${{ matrix.os }}
66
strategy:
77
matrix:
8-
node-version: [12, 14, 16]
8+
node-version: [14, 16, 18]
99
os: [ubuntu-latest]
1010
steps:
1111
- name: Node.js ${{ matrix.node-version }}

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/** @type {Window} */
12
var window = require('global/window');
23
var nodeCrypto = require('crypto');
34

5+
/**
6+
* @template {ArrayBufferView | null} T
7+
* @param {T} buf
8+
* @returns {T}
9+
*/
410
function getRandomValues(buf) {
511
if (window.crypto && window.crypto.getRandomValues) {
612
return window.crypto.getRandomValues(buf);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test": "test"
1818
},
1919
"engines": {
20-
"node": "10 || 12 || >=14"
20+
"node": "14 || 16 || >=18"
2121
},
2222
"scripts": {
2323
"release": "semantic-release",

test/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
var getRandomValues = require('../');
21
var test = require('tape');
32
var isFunction = require('lodash.isfunction');
43
var forEach = require('lodash.foreach');
54
var isBrowser = require('is-browser');
65

6+
var getRandomValues = require('../');
7+
78
test('exports a function', function(t) {
89
t.plan(1);
910
t.ok(isFunction(getRandomValues));
@@ -43,7 +44,7 @@ test('throws on length >65536', function(t) {
4344
}, new RegExp(/QuotaExceededError/));
4445
});
4546

46-
test('returns arguement', function(t) {
47+
test('returns argument', function(t) {
4748
t.plan(1);
4849
var argument = new Uint8Array(1024);
4950
t.equal(getRandomValues(argument), argument);

0 commit comments

Comments
 (0)