String array now stored as a function to make self defending possible

This commit is contained in:
sanex
2021-07-26 21:04:32 +03:00
parent 7920538a51
commit cbe1bfc505
6 changed files with 55 additions and 11 deletions
@@ -33,6 +33,12 @@ export class StringArrayCodeHelper extends AbstractCustomCodeHelper {
@initializable()
private stringArrayName!: string;
/**
* @type {string}
*/
@initializable()
private stringArrayFunctionName!: string;
/**
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
* @param {ICustomCodeHelperFormatter} customCodeHelperFormatter
@@ -59,13 +65,16 @@ export class StringArrayCodeHelper extends AbstractCustomCodeHelper {
/**
* @param {IStringArrayStorage} stringArrayStorage
* @param {string} stringArrayFunctionName
* @param {string} stringArrayName
*/
public initialize (
stringArrayStorage: IStringArrayStorage,
stringArrayFunctionName: string,
stringArrayName: string
): void {
this.stringArrayStorage = stringArrayStorage;
this.stringArrayFunctionName = stringArrayFunctionName;
this.stringArrayName = stringArrayName;
}
@@ -83,6 +92,7 @@ export class StringArrayCodeHelper extends AbstractCustomCodeHelper {
protected override getCodeHelperTemplate (): string {
return this.customCodeHelperFormatter.formatTemplate(StringArrayTemplate(), {
stringArrayName: this.stringArrayName,
stringArrayFunctionName: this.stringArrayFunctionName,
stringArrayStorageItems: this.getEncodedStringArrayStorageItems()
});
}