Skip to content

Commit

Permalink
Merge pull request #2 from Gandi/feature/remove-useless-dependencies
Browse files Browse the repository at this point in the history
Remove usage of `except` helper package
  • Loading branch information
pascalduez authored Aug 29, 2024
2 parents abdf96c + 4acb452 commit 586bf25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"esversion": 11,
"undef": true,
"unused": "vars",
"asi": false,
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var extend = require('extend');
var sprintf = require("sprintf-js").sprintf;
var events = require('events');
var except = require('except');

var strftime = require('./strftime');

Expand Down Expand Up @@ -394,11 +393,12 @@ Counterpart.prototype._resolve = function(locale, scope, object, subject, option
};

Counterpart.prototype._fallback = function(locale, scope, object, subject, options) {
options = except(options, 'fallback');
/* jshint unused: false */
var { fallback, ...restOptions } = options;

if (Array.isArray(subject)) {
for (var i = 0, ii = subject.length; i < ii; i++) {
var result = this._resolve(locale, scope, object, subject[i], options);
var result = this._resolve(locale, scope, object, subject[i], restOptions);

if (result) {
return result;
Expand All @@ -407,7 +407,7 @@ Counterpart.prototype._fallback = function(locale, scope, object, subject, optio

return null;
} else {
return this._resolve(locale, scope, object, subject, options);
return this._resolve(locale, scope, object, subject, restOptions);
}
};

Expand Down
16 changes: 1 addition & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@
"packageManager": "npm@10.8.3+sha512.d08425c8062f56d43bb8e84315864218af2492eb769e1f1ca40740f44e85bd148969382d651660363942e5909cb7ffcbef7ca0ae963ddc2c57a51243b4da8f56",
"dependencies": {
"date-names": "^0.1.11",
"except": "^0.1.3",
"extend": "^3.0.0",
"pluralizers": "^0.1.7",
"sprintf-js": "^1.0.3"
},
"devDependencies": {
"jshint": "^2.5.10",
"jshint": "^2.13.6",
"mocha": "^2.0.1",
"time": "github:riyadshauk/node-time"
}
Expand Down

0 comments on commit 586bf25

Please sign in to comment.