Socket
Socket
Sign inDemoInstall

grunt-generate-view-model

Package Overview
Dependencies
26
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.3 to 0.1.4

tasks/createViewModels.js

18

dist/tasks/pipes/classmeta.js

@@ -85,7 +85,10 @@ "use strict";

exports.getInfoFromImports = getInfoFromImports;
const updateFieldMetadataForIgnoreDecorators = (ignoreDecorators, classMeta, fldMetadata, decoratorsOnField, fileStructure) => {
const updateFieldMetadataForIgnoreDecorators = (ignoreDecorators_, classMeta, fldMetadata, decoratorsOnField, fileStructure) => {
const newFldMetadata = Object.assign({}, fldMetadata);
const noIgnoreDecorators = !ignoreDecorators.length;
const fieldIgnoreDecorators = [...(ignoreDecorators.map(dec => dec.arguments[0]) || []), ...ignoreDecorators];
const fieldIgnoreDecoratorsClasses = (ignoreDecorators.map(dec => dec.arguments[1]) || []);
const ignoreAllDecoratorsExist = ignoreDecorators_.find(d => { var _a; return ((_a = d.arguments) === null || _a === void 0 ? void 0 : _a.length) === 0; });
const ignoreDecoratorsForFieldArray = ignoreDecorators_.map(dec => dec.arguments[0]) || [];
const allIgnoreCustomFields = [];
ignoreDecoratorsForFieldArray.forEach((d) => allIgnoreCustomFields.push(...(d || [])));
const fieldIgnoreDecorators = [...allIgnoreCustomFields, ...ignoreDecorators_1.ignoreDecorators];
const fieldIgnoreDecoratorsClasses = (ignoreDecorators_.map(dec => dec.arguments[1]) || []);
if (!decoratorsOnField || !decoratorsOnField.length) {

@@ -100,4 +103,7 @@ newFldMetadata.decorators = [];

newFldMetadata.decorators = decoratorsOnField.filter(dec => {
const isDecoratorAvailableForField = noIgnoreDecorators && !fieldIgnoreDecorators.includes(dec.name);
const isDecoratorAvailableForClass = noIgnoreDecorators && !fieldIgnoreDecoratorsClasses.includes(classMeta.name);
if (ignoreAllDecoratorsExist) {
return false;
}
const isDecoratorAvailableForField = !fieldIgnoreDecorators.includes(dec.name);
const isDecoratorAvailableForClass = !fieldIgnoreDecoratorsClasses.includes(classMeta.name);
return isDecoratorAvailableForClass && isDecoratorAvailableForField;

@@ -104,0 +110,0 @@ });

{
"name": "grunt-generate-view-model",
"version": "0.1.3",
"version": "0.1.4",
"description": "Global task for generation view model",

@@ -5,0 +5,0 @@ "private": false,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc