Socket
Socket
Sign inDemoInstall

eslint-plugin-you-dont-need-lodash-underscore

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-you-dont-need-lodash-underscore - npm Package Compare versions

Comparing version 6.9.0 to 6.10.0

2

package.json
{
"name": "eslint-plugin-you-dont-need-lodash-underscore",
"version": "6.9.0",
"version": "6.10.0",
"description": "Check methods you can use natively without lodash/underscore",

@@ -5,0 +5,0 @@ "repository": {

@@ -42,7 +42,7 @@ 'use strict';

it('pickBy', () => {
var object = { 'a': 1, 'b': null, 'c': 3, 'd': false, 'e': undefined };
var object = { 'a': 1, 'b': null, 'c': 3, 'd': false, 'e': undefined, 'f': '', 'g': 0 };
function pickBy(object) {
const obj = {};
for (const key in object) {
if (object[key] !== null && object[key] !== false && object[key] !== undefined) {
if (object[key]) {
obj[key] = object[key];

@@ -152,8 +152,15 @@ }

Bar.prototype.f = 6;
const extend = (target, ...sources) => {
let source = [];
sources.forEach(src => {
source = source.concat([src, Object.getPrototypeOf(src)])
})
return Object.assign(target, ...source)
const length = sources.length;
if (length < 1 || target == null) return target;
for (let i = 0; i < length; i++) {
const source = sources[i];
for (const key in source) {
target[key] = source[key];
}
}
return target;
};

@@ -573,2 +580,24 @@

describe('clamp', () => {
const clamp = (number, boundOne, boundTwo) => {
if (!boundTwo) {
return Math.max(number, boundOne) === boundOne ? number : boundOne;
} else if (Math.min(number, boundOne) === number) {
return boundOne;
} else if (Math.max(number, boundTwo) === number) {
return boundTwo;
}
return number;
};
it('clamp(-10, -5, 5) returns lower bound if number is less than it', () => {
assert.deepStrictEqual(clamp(-10, -5, 5), -5);
});
it('clamp(10, -5, 5) returns upper bound if number is greater than it', () => {
assert.deepStrictEqual(clamp(10, -5, 5), 10);
});
it('clamp(10, -5) treats second parameter as upper bound', () => {
assert.deepStrictEqual(clamp(10, -5), -5);
});
});
describe('padStart', () => {

@@ -633,2 +662,26 @@ it('_.padStart("123", 5, "0")', () => {

describe('isString', () => {
function isString(str) {
if (str && typeof str.valueOf() === "string") {
return true
}
return false
}
it('_.isString(abc)', () => {
assert.deepEqual(_.isString("abc"),
isString("abc"))
});
it('_.isString(1)', () => {
assert.deepEqual(_.isString(1),
isString(1))
});
});
describe('isUndefined', () => {

@@ -635,0 +688,0 @@ const definedVariable = 1; //defined variable (will return false)

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc