Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump flat from 5.0.2 to 6.0.1 #1815

Merged
merged 6 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@smithy/node-http-handler": "^3.0.0",
"@types/chai": "^4",
"@types/express": "^4.17.17",
"@types/flat": "^5.0.2",
"@types/fs-extra": "^11.0.1",
"@types/get-installed-path": "^4.0.1",
"@types/jest": "^29.5.11",
Expand All @@ -42,7 +41,7 @@
"dotenv": "^16.3.1",
"express": "^4.17.3",
"fast-xml-parser": "^4.2.7",
"flat": "^5.0.2",
"flat": "^6.0.1",
"form-data": "^4.0.0",
"fs-extra": "^11.1.1",
"get-installed-path": "^4.0.8",
Expand Down
7 changes: 6 additions & 1 deletion src/commands/validate/threshold.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Command, Flags} from '@oclif/core'
import flat from 'flat'
import YAML from 'yaml'
import fs from 'fs'
import {ContextualizedProfile, convertFileContextual} from 'inspecjs'
Expand All @@ -8,6 +7,12 @@ import {ThresholdValues} from '../../types/threshold'
import {calculateCompliance, exitNonZeroIfTrue, extractStatusCounts, getControlIdMap, renameStatusName, severityTargetsObject, statusSeverityPaths, totalMax, totalMin} from '../../utils/threshold'
import {expect} from 'chai'

let flat: any
// eslint-disable-next-line unicorn/prefer-top-level-await -- node/ts versions don't support top level await
(async () => {
flat = await import('flat')
})()

export default class Threshold extends Command {
static usage = 'validate threshold -i <hdf-json> [-h] [-T <flattened-threshold-json> | -F <template-file>]'

Expand Down
7 changes: 6 additions & 1 deletion src/utils/ohdf/calculations.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// utils/calculations.ts

import _ from 'lodash'
import flat from 'flat'
import {ContextualizedEvaluation, ContextualizedProfile} from 'inspecjs'
import {calculateCompliance, extractStatusCounts, renameStatusName, severityTargetsObject} from '../threshold'
import {createWinstonLogger} from '../logging'

let flat: any
// eslint-disable-next-line unicorn/prefer-top-level-await -- node/ts versions don't support top level await
(async () => {
flat = await import('flat')
})()

/**
* The logger for this command.
* It uses a Winston logger with the label 'view summary:'.
Expand Down
Loading