@locker/eslint-rule-maker
Advanced tools
Comparing version 0.13.1 to 0.13.2
@@ -47,2 +47,14 @@ /** | ||
} | ||
function defaults(target, source) { | ||
if (typeof target === 'function' || (typeof target === 'object' && target !== null)) { | ||
const props = shared.ReflectOwnKeys(source); | ||
for (let i = 0, len = props.length; i < len; i += 1) { | ||
const name = props[i]; | ||
if (target[name] === undefined || !shared.ObjectHasOwnProperty(target, name)) { | ||
target[name] = source[name]; | ||
} | ||
} | ||
} | ||
return target; | ||
} | ||
function getGlobalScopeByContext(context) { | ||
@@ -202,6 +214,6 @@ return context.getSourceCode().scopeManager.globalScope; | ||
// Populate first level default properties. | ||
shared.defaults(configClone, defaultConfigClone); | ||
defaults(configClone, defaultConfigClone); | ||
// Populate second level default properties. | ||
configClone.meta = shared.defaults(configClone.meta, defaultConfigClone.meta); | ||
configClone.rule = shared.defaults(configClone.rule, defaultConfigClone.rule); | ||
configClone.meta = defaults(configClone.meta, defaultConfigClone.meta); | ||
configClone.rule = defaults(configClone.rule, defaultConfigClone.rule); | ||
// Populate third level default properties. | ||
@@ -225,2 +237,2 @@ configClone.rule.search = ast.expandPatterns(configClone.rule.search); | ||
exports.matchers = matchers; | ||
/** version: 0.13.1 */ | ||
/** version: 0.13.2 */ |
/** | ||
* Copyright (C) 2020 salesforce.com, inc. | ||
*/ | ||
import { defaults, isObject, ObjectHasOwnProperty } from '@locker/shared'; | ||
import { isObject, ReflectOwnKeys, ObjectHasOwnProperty } from '@locker/shared'; | ||
import { createLib } from '@locker/ast-lib-maker'; | ||
@@ -43,2 +43,14 @@ | ||
} | ||
function defaults(target, source) { | ||
if (typeof target === 'function' || (typeof target === 'object' && target !== null)) { | ||
const props = ReflectOwnKeys(source); | ||
for (let i = 0, len = props.length; i < len; i += 1) { | ||
const name = props[i]; | ||
if (target[name] === undefined || !ObjectHasOwnProperty(target, name)) { | ||
target[name] = source[name]; | ||
} | ||
} | ||
} | ||
return target; | ||
} | ||
function getGlobalScopeByContext(context) { | ||
@@ -218,2 +230,2 @@ return context.getSourceCode().scopeManager.globalScope; | ||
export { ast, createRule, matchers }; | ||
/** version: 0.13.1 */ | ||
/** version: 0.13.2 */ |
{ | ||
"name": "@locker/eslint-rule-maker", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"license": "Salesforce Developer Agreement", | ||
@@ -24,4 +24,4 @@ "author": "Salesforce UI Security Team", | ||
"dependencies": { | ||
"@locker/ast-lib-maker": "0.13.1", | ||
"@locker/shared": "0.13.1" | ||
"@locker/ast-lib-maker": "0.13.2", | ||
"@locker/shared": "0.13.2" | ||
}, | ||
@@ -31,3 +31,3 @@ "files": [ | ||
], | ||
"gitHead": "e45e156c181f1db0923287cff16a283b5eacff7a" | ||
"gitHead": "8821f240966fb91cce5be32deca204095d133308" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22647
458
+ Added@locker/ast-lib-maker@0.13.2(transitive)
+ Added@locker/shared@0.13.2(transitive)
- Removed@locker/ast-lib-maker@0.13.1(transitive)
- Removed@locker/shared@0.13.1(transitive)
Updated@locker/ast-lib-maker@0.13.2
Updated@locker/shared@0.13.2