Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
25
node_modules/eslint/lib/rules/object-curly-newline.js
generated
vendored
25
node_modules/eslint/lib/rules/object-curly-newline.js
generated
vendored
|
|
@ -10,7 +10,6 @@
|
|||
//------------------------------------------------------------------------------
|
||||
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
const lodash = require("lodash");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
|
@ -69,6 +68,24 @@ function normalizeOptionValue(value) {
|
|||
return { multiline, minProperties, consistent };
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a value is an object.
|
||||
* @param {any} value The value to check
|
||||
* @returns {boolean} `true` if the value is an object, otherwise `false`
|
||||
*/
|
||||
function isObject(value) {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an option is a node-specific option
|
||||
* @param {any} option The option to check
|
||||
* @returns {boolean} `true` if the option is node-specific, otherwise `false`
|
||||
*/
|
||||
function isNodeSpecificOption(option) {
|
||||
return isObject(option) || typeof option === "string";
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes a given option value.
|
||||
* @param {string|Object|undefined} options An option value to parse.
|
||||
|
|
@ -80,9 +97,7 @@ function normalizeOptionValue(value) {
|
|||
* }} Normalized option object.
|
||||
*/
|
||||
function normalizeOptions(options) {
|
||||
const isNodeSpecificOption = lodash.overSome([lodash.isPlainObject, lodash.isString]);
|
||||
|
||||
if (lodash.isPlainObject(options) && lodash.some(options, isNodeSpecificOption)) {
|
||||
if (isObject(options) && Object.values(options).some(isNodeSpecificOption)) {
|
||||
return {
|
||||
ObjectExpression: normalizeOptionValue(options.ObjectExpression),
|
||||
ObjectPattern: normalizeOptionValue(options.ObjectPattern),
|
||||
|
|
@ -134,7 +149,7 @@ module.exports = {
|
|||
type: "layout",
|
||||
|
||||
docs: {
|
||||
description: "enforce consistent line breaks inside braces",
|
||||
description: "enforce consistent line breaks after opening and before closing braces",
|
||||
category: "Stylistic Issues",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/rules/object-curly-newline"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue