mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 23:25:26 +00:00
Moar VSCode autofixes
This commit is contained in:
@@ -51,7 +51,7 @@ export class AbstractModel {
|
|||||||
|
|
||||||
constructor(options: AbstractModelOptions) {
|
constructor(options: AbstractModelOptions) {
|
||||||
this[abmModel] = options.bundle;
|
this[abmModel] = options.bundle;
|
||||||
this[abmCertificates] = options.certificates,
|
this[abmCertificates] = options.certificates;
|
||||||
this[abmOverrides] = options.overrides
|
this[abmOverrides] = options.overrides
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export async function createPass(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalBuffers) {
|
if (additionalBuffers) {
|
||||||
const [ additionalL10n, additionalBundle ] = splitBufferBundle(additionalBuffers);
|
const [additionalL10n, additionalBundle] = splitBufferBundle(additionalBuffers);
|
||||||
Object.assign(options.bundle["l10nBundle"], additionalL10n);
|
Object.assign(options.bundle["l10nBundle"], additionalL10n);
|
||||||
Object.assign(options.bundle["bundle"], additionalBundle);
|
Object.assign(options.bundle["bundle"], additionalBundle);
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ export async function createPass(
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if (additionalBuffers) {
|
if (additionalBuffers) {
|
||||||
const [ additionalL10n, additionalBundle ] = splitBufferBundle(additionalBuffers);
|
const [additionalL10n, additionalBundle] = splitBufferBundle(additionalBuffers);
|
||||||
Object.assign(bundle["l10nBundle"], additionalL10n);
|
Object.assign(bundle["l10nBundle"], additionalL10n);
|
||||||
Object.assign(bundle["bundle"], additionalBundle);
|
Object.assign(bundle["bundle"], additionalBundle);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export default class FieldsArray extends Array {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
pop(): schema.Field {
|
pop(): schema.Field {
|
||||||
const element: schema.Field = Array.prototype.pop.call(this);
|
const element: schema.Field = Array.prototype.pop.call(this);
|
||||||
this[poolSymbol].delete(element.key);
|
this[poolSymbol].delete(element.key);
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ export default class FieldsArray extends Array {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
splice(start: number, deleteCount: number, ...items: schema.Field[]): schema.Field[] {
|
splice(start: number, deleteCount: number, ...items: schema.Field[]): schema.Field[] {
|
||||||
const removeList = this.slice(start, deleteCount+start);
|
const removeList = this.slice(start, deleteCount + start);
|
||||||
removeList.forEach(item => this[poolSymbol].delete(item.key));
|
removeList.forEach(item => this[poolSymbol].delete(item.key));
|
||||||
|
|
||||||
return Array.prototype.splice.call(this, start, deleteCount, items);
|
return Array.prototype.splice.call(this, start, deleteCount, items);
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ export function generateStringFile(lang: { [index: string]: string }): Buffer {
|
|||||||
type PartitionedBundleElements = [PartitionedBundle["l10nBundle"], PartitionedBundle["bundle"]];
|
type PartitionedBundleElements = [PartitionedBundle["l10nBundle"], PartitionedBundle["bundle"]];
|
||||||
|
|
||||||
export function splitBufferBundle(origin: any): PartitionedBundleElements {
|
export function splitBufferBundle(origin: any): PartitionedBundleElements {
|
||||||
return Object.keys(origin).reduce<PartitionedBundleElements>(([ l10n, bundle ], current) => {
|
return Object.keys(origin).reduce<PartitionedBundleElements>(([l10n, bundle], current) => {
|
||||||
if (!current.includes(".lproj")) {
|
if (!current.includes(".lproj")) {
|
||||||
return [ l10n, { ...bundle, [current]: origin[current] }];
|
return [l10n, { ...bundle, [current]: origin[current] }];
|
||||||
}
|
}
|
||||||
|
|
||||||
const pathComponents = current.split(sep);
|
const pathComponents = current.split(sep);
|
||||||
@@ -103,8 +103,8 @@ export function splitBufferBundle(origin: any): PartitionedBundleElements {
|
|||||||
|
|
||||||
(l10n[lang] || (l10n[lang] = {}))[file] = origin[current];
|
(l10n[lang] || (l10n[lang] = {}))[file] = origin[current];
|
||||||
|
|
||||||
return [ l10n, bundle ];
|
return [l10n, bundle];
|
||||||
}, [{},{}]);
|
}, [{}, {}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
type StringSearchMode = "includes" | "startsWith" | "endsWith";
|
type StringSearchMode = "includes" | "startsWith" | "endsWith";
|
||||||
|
|||||||
Reference in New Issue
Block a user