Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[weakref] disable in node >=12 #11

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var LruCache = require('./cache/lru');
var weak = require('weak-napi');
var weak = require('./weakref');

function noop(v) { return v; }
function is(v, type) { return typeof v === type; }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Throttle depending on function arguments.",
"main": "index.js",
"browser": {
"weak-napi": "./browser-weakref"
"./weakref": "./weakref-browser"
},
"engines": {
"node": "6.x.x"
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions weakref.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const nodeMajorVersion = parseInt(process.versions.node.replace(/\..*/, ''));

module.exports = nodeMajorVersion >= 12 ?
require('./weakref-browser') : // https://github.com/node-ffi-napi/weak-napi/issues/16
require('weak-napi');