Skip to content

Commit fad0879

Browse files
hulkishSteven Hargrove
and
Steven Hargrove
authored
removed dependency on lodash, removed pnpm-lock.json (#591)
Co-authored-by: Steven Hargrove <[email protected]>
1 parent cc9c009 commit fad0879

21 files changed

+86
-2281
lines changed

lib/nodeJavaBridge.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
process.env.PATH += require('../build/jvm_dll_path.json');
44

5-
var _ = require('lodash');
65
var async = require('async');
76
var path = require('path');
87
var fs = require('fs');
@@ -152,15 +151,15 @@ java.ensureJvm = function(callback) {
152151

153152
// First see if the promise-style API should be used.
154153
// This must be done first in order to ensure the proper API is used.
155-
if (_.isUndefined(callback) && java.asyncOptions && _.isFunction(java.asyncOptions.promisify)) {
154+
if (typeof callback === 'undefined' && java.asyncOptions && typeof java.asyncOptions.promisify === 'function') {
156155
// Create a promisified version of this function.
157156
var launchJvmPromise = java.asyncOptions.promisify(java.ensureJvm.bind(java));
158157
// Call the promisified function, returning its result, which should be a promise.
159158
return launchJvmPromise();
160159
}
161160

162161
// If we get here, callback must be a node-style callback function. If not, throw an error.
163-
else if (!_.isFunction(callback)) {
162+
else if (typeof callback !== 'function') {
164163
throw new Error('java.launchJvm(cb) requires its one argument to be a callback function.');
165164
}
166165

@@ -196,7 +195,7 @@ java.onJvmCreated = function() {
196195
throw new Error('In asyncOptions, if either promiseSuffix or promisify is defined, both most be.');
197196
}
198197

199-
if (_.isString(java.asyncOptions.ifReadOnlySuffix) && java.asyncOptions.ifReadOnlySuffix !== '') {
198+
if (typeof java.asyncOptions.ifReadOnlySuffix === 'string' && java.asyncOptions.ifReadOnlySuffix !== '') {
200199
ifReadOnlySuffix = java.asyncOptions.ifReadOnlySuffix;
201200
}
202201
} else {
@@ -272,17 +271,17 @@ java.import = function(name) {
272271
&& ((modifiers & MODIFIER_STATIC) === MODIFIER_STATIC)) {
273272
var methodName = SyncCall(methods[i], 'getName')();
274273

275-
if (_.isString(syncSuffix)) {
274+
if (typeof syncSuffix === 'string') {
276275
var syncName = usableName(methodName + syncSuffix);
277276
result[syncName] = callStaticMethodSync.bind(java, name, methodName);
278277
}
279278

280-
if (_.isString(asyncSuffix)) {
279+
if (typeof asyncSuffix === 'string') {
281280
var asyncName = usableName(methodName + asyncSuffix);
282281
result[asyncName] = callStaticMethod.bind(java, name, methodName);
283282
}
284283

285-
if (promisify && _.isString(promiseSuffix)) {
284+
if (promisify && typeof promiseSuffix === 'string') {
286285
var promiseName = usableName(methodName + promiseSuffix);
287286
result[promiseName] = promisify(callStaticMethod.bind(java, name, methodName));
288287
}

package-lock.json

+2-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"async": "^3.2.5",
3030
"find-java-home": "^2.0.0",
3131
"glob": "^10.3.10",
32-
"lodash": "^4.17.21",
3332
"nan": "^2.18.0",
3433
"node-gyp": "^10.0.1"
3534
},

0 commit comments

Comments
 (0)