Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

componentsjs-generator

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

componentsjs-generator - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

7

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
<a name="v1.4.1"></a>
## [v1.4.1](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/compare/v1.4.0...v1.4.1) - 2020-11-09
### Fixed
* [Fix collectEntries params being required and unique](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/commit/93c3b42e2ad4600f8180a3efc63df2a1e9a4f9f9)
* [Fix indexed field names appearing twice in IRIs](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/commit/5abbcf2fbb9404a138fff7b319b864af705213e9)
<a name="v1.4.0"></a>

@@ -5,0 +12,0 @@ ## [v1.4.0](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/compare/v1.3.0...v1.4.0) - 2020-11-06

3

lib/serialize/ComponentConstructor.d.ts

@@ -101,2 +101,3 @@ import type { ContextParser, JsonLdContextNormalized } from 'jsonld-context-parser';

* @param subParamData The sub-parameter of the parameter with nested range.
* @param fieldId The @id of the field.
* @param scope The current field scope.

@@ -108,3 +109,3 @@ */

};
}, parameters: ParameterDefinition[], subParamData: ParameterData<ParameterRangeResolved>, scope: FieldScope): ConstructorFieldDefinition;
}, parameters: ParameterDefinition[], subParamData: ParameterData<ParameterRangeResolved>, fieldId: string, scope: FieldScope): ConstructorFieldDefinition;
/**

@@ -111,0 +112,0 @@ * Construct a parameter definition from the given parameter data with raw range.

@@ -190,6 +190,10 @@ "use strict";

parameterDataToConstructorArgument(context, classReference, parameterData, parameters, fieldId, scope) {
// Append the current field name to the scope
if (parameterData.type === 'field') {
scope = Object.assign(Object.assign({}, scope), { parentFieldNames: [...scope.parentFieldNames, parameterData.name] });
}
if (parameterData.range.type === 'nested') {
// Create a hash object with `fields` entries.
// Each entry's value is (indirectly) recursively handled by this method again.
const fields = parameterData.range.value.map(subParamData => this.constructFieldDefinitionNested(context, classReference, parameterData, parameters, subParamData, scope));
const fields = parameterData.range.value.map(subParamData => this.constructFieldDefinitionNested(context, classReference, parameterData, parameters, subParamData, fieldId, scope));
return { fields };

@@ -211,13 +215,10 @@ }

* @param subParamData The sub-parameter of the parameter with nested range.
* @param fieldId The @id of the field.
* @param scope The current field scope.
*/
constructFieldDefinitionNested(context, classReference, parameterData, parameters, subParamData, scope) {
constructFieldDefinitionNested(context, classReference, parameterData, parameters, subParamData, fieldId, scope) {
if (subParamData.type === 'field') {
const subScope = {
parentFieldNames: [...scope.parentFieldNames, subParamData.name],
fieldIdsHash: scope.fieldIdsHash,
};
return {
keyRaw: subParamData.name,
value: this.parameterDataToConstructorArgument(context, classReference, subParamData, parameters, this.fieldNameToId(context, classReference, subParamData.name, scope), subScope),
value: this.parameterDataToConstructorArgument(context, classReference, subParamData, parameters, this.fieldNameToId(context, classReference, subParamData.name, scope), scope),
};

@@ -230,4 +231,7 @@ }

}
// Remove the last element of the parent field names when we're in an indexed field,
// to avoid the field name to be in the IRI twice.
scope = Object.assign(Object.assign({}, scope), { parentFieldNames: scope.parentFieldNames.slice(0, -1) });
// Determine parameter id's
const idCollectEntries = this.fieldNameToId(context, classReference, parameterData.name, scope);
const idCollectEntries = fieldId;
const idKey = this.fieldNameToId(context, classReference, `${parameterData.name}_key`, scope);

@@ -253,2 +257,5 @@ const idValue = this.fieldNameToId(context, classReference, `${parameterData.name}_value`, scope);

};
// Params for collected entries are never required, and can have more than one entry.
parameterData.unique = false;
parameterData.required = false;
this.populateOptionalParameterFields(parameter, parameterData);

@@ -255,0 +262,0 @@ parameters.push(parameter);

{
"name": "componentsjs-generator",
"version": "1.4.0",
"version": "1.4.1",
"description": "Automatically generate component files from TypeScript classes for the Components.js dependency injection framework",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc