flagstaff 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/import.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const DEFAULT_INTERVAL = 80;
2
2
  const DEFAULT_STATIC = '…';
3
- export function fromCliSpinners(corpus, { name = 'cli-spinners', staticFor = () => DEFAULT_STATIC } = {}) {
3
+ const defaultStatic = () => DEFAULT_STATIC;
4
+ export function fromCliSpinners(corpus, { name = 'cli-spinners', staticFor = defaultStatic } = {}) {
4
5
  const spinners = Object.fromEntries(Object.entries(corpus)
5
6
  .filter(([, spinner]) => Array.isArray(spinner?.frames) && spinner.frames.length > 0)
6
7
  .map(([style, spinner]) => [style, { frames: spinner.frames, interval: spinner.interval ?? DEFAULT_INTERVAL, static: staticFor(style, spinner) }]));
package/dist/progress.js CHANGED
@@ -12,8 +12,8 @@ function suffix(state) {
12
12
  const label = state.label === undefined || state.label === '' ? '' : ` ${state.label}`;
13
13
  return `${state.done}/${state.total}${label}`;
14
14
  }
15
+ const percentage = (state) => `${Math.round(ratio(state) * PERCENT)}%`;
15
16
  export function progress({ width = DEFAULT_WIDTH, glyphs = { filled: FILLED, empty: EMPTY } } = {}) {
16
- const percentage = (state) => `${Math.round(ratio(state) * PERCENT)}%`;
17
17
  return {
18
18
  name: 'progress',
19
19
  static: (state) => `${suffix(state)} · ${percentage(state)}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flagstaff",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "The staff the flag flies from. A terminal frame loop with a static projection for agents and screen readers, and a plugin host for spinners, progress, boxes and tables. Drop-in paths for ora, log-update, boxen and cli-table3. No dependency outside the burgee family.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -121,13 +121,13 @@
121
121
  "json"
122
122
  ],
123
123
  "dependencies": {
124
- "closeout": "^0.5.3",
124
+ "closeout": "^0.5.4",
125
125
  "linegauge": "^0.5.4",
126
126
  "paratext": "^0.7.2",
127
- "roundel": "^0.5.3"
127
+ "roundel": "^0.5.4"
128
128
  },
129
129
  "devDependencies": {
130
- "fast-check": "^4.10.1",
130
+ "fast-check": "^4.10.2",
131
131
  "vitest": "^5.0.1"
132
132
  }
133
133
  }