Skip to content

Commit

Permalink
chore: refactor arraynge into arraysure dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
catalandres committed Dec 18, 2023
1 parent 7f31cd4 commit e2ac919
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@salesforce/sf-plugins-core": "^5.0.5",
"@types/shelljs": "^0.8.15",
"@types/xml2js": "^0.4.14",
"arraysure": "^1.0.1",
"exceljs": "^4.4.0",
"shelljs": "^0.8.5",
"xml2js": "^0.6.2"
Expand Down
4 changes: 2 additions & 2 deletions src/shared/XmlParser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as xml2js from 'xml2js';
import { array } from 'arraysure';
import * as Metadata from '../types/metadata.js';
import { Named, FullNamed, ObjectNamed } from '../types/metadata-addon.js';
import { arraynge } from './arraynge.js';

const nameRegEx = new RegExp('.+/([^.]*)');
const parserOptions: xml2js.ParserOptions = {
Expand Down Expand Up @@ -75,7 +75,7 @@ export class XmlParser {
const objectName = nameRegEx.exec(fileName)?.[1] as string;
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
xml2js.parseString(xml, parserOptions, (err, result: { Workflow: Metadata.Workflow }) => {
for (const thisRule of arraynge(result.Workflow.rules) as Array<ObjectNamed<FullNamed<Metadata.WorkflowRule>>>) {
for (const thisRule of array(result.Workflow.rules) as Array<ObjectNamed<FullNamed<Metadata.WorkflowRule>>>) {
thisRule.objectName = objectName;
workflowRules.push(thisRule);
}
Expand Down
7 changes: 0 additions & 7 deletions src/shared/arraynge.ts

This file was deleted.

5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,11 @@ arraybuffer.prototype.slice@^1.0.2:
is-array-buffer "^3.0.2"
is-shared-array-buffer "^1.0.2"

arraysure@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/arraysure/-/arraysure-1.0.1.tgz#6b4e882bd71c912f0c22e056d09599dd37c2ce58"
integrity sha512-4KNGGiOXrbDxcLbwxvWSYOX1PuYVOmnwRwu1rxiZooBk5PO49tasq51K9Iy6wM7CoBWDGPTmHimVSklpRN1JGw==

arrify@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz"
Expand Down

0 comments on commit e2ac919

Please sign in to comment.