npm package diff
Package: @forge/lint
Versions: 5.3.5-next.2 - 5.4.0-next.3
File: package/out/lint/linters/permission-linter/visitors/content-property-visitor.js
Index: package/out/lint/linters/permission-linter/visitors/content-property-visitor.js
===================================================================
--- package/out/lint/linters/permission-linter/visitors/content-property-visitor.js
+++ package/out/lint/linters/permission-linter/visitors/content-property-visitor.js
@@ -1,38 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.ContentPropertyVisitor = exports.CONTENT_PROPERTY_METHODS = void 0;
-const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
-const api_call_interface_1 = require("../api-call-interface");
-const content_property_verifier_1 = require("../verifiers/content-property-verifier");
-exports.CONTENT_PROPERTY_METHODS = Object.keys(content_property_verifier_1.CONTENT_PROPERTY_PERMISSIONS_MAP);
-class ContentPropertyVisitor {
- visit(node, parent, callback) {
- if (node.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
- node.object.type === typescript_estree_1.AST_NODE_TYPES.CallExpression &&
- node.object.callee.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
- this.nodeIsPropertiesObject(node.object.callee.object) &&
- node.object.callee.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
- exports.CONTENT_PROPERTY_METHODS.includes(node.object.callee.property.name) &&
- node.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
- node.property.name.match(/^get|set|delete$/)) {
- const apiCall = {
- type: api_call_interface_1.ApiCallTypes.CONTENT_PROPERTY,
- line: node.property.loc.start.line,
- column: node.property.loc.start.column,
- context: node.object.callee.property.name,
- method: node.property.name
- };
- callback(apiCall);
- }
- }
- nodeIsPropertiesObject(objectNode) {
- const isProperties = objectNode.type === typescript_estree_1.AST_NODE_TYPES.Identifier && objectNode.name === 'properties';
- const isApiProperties = objectNode.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
- objectNode.object.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
- objectNode.object.name === 'api' &&
- objectNode.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
- objectNode.property.name === 'properties';
- return isApiProperties || isProperties;
- }
-}
-exports.ContentPropertyVisitor = ContentPropertyVisitor;