Skip to content

Commit f4fbf21

Browse files
authored
Refactor to replace is-plain-obj package (#34)
1 parent 66aa19c commit f4fbf21

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
'use strict';
22

3-
const isPlainObj = require('is-plain-obj');
43
const npmpackagejsonlintConfig = require('./npm-package-json-lint-config');
54

5+
function isObject(value) {
6+
return typeof value === 'object' && value !== null;
7+
}
8+
69
describe('npm-package-json-lint config tests', () => {
710
describe('npm-package-json-lint config object', () => {
811
test('should be an object', () => {
9-
expect(isPlainObj(npmpackagejsonlintConfig)).toBe(true);
12+
expect(isObject(npmpackagejsonlintConfig)).toBe(true);
1013
});
1114
});
1215

1316
describe('extends', () => {
1417
test('should not be an object', () => {
15-
expect(isPlainObj(npmpackagejsonlintConfig.extends)).toBe(false);
18+
expect(isObject(npmpackagejsonlintConfig.extends)).toBe(false);
1619
});
1720
});
1821

1922
describe('rules', () => {
2023
test('should be an object', () => {
21-
expect(isPlainObj(npmpackagejsonlintConfig.rules)).toBe(true);
24+
expect(isObject(npmpackagejsonlintConfig.rules)).toBe(true);
2225
});
2326
});
2427
});

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"eslint": "^6.8.0",
6060
"eslint-config-stylelint": "^12.0.0",
6161
"husky": "^4.2.5",
62-
"is-plain-obj": "^2.1.0",
6362
"jest": "^28.1.3",
6463
"lint-staged": "^10.1.3",
6564
"np": "^6.2.0",

0 commit comments

Comments
 (0)