@hawkeyexl/manni 2.8.1 → 2.8.2

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/README.md CHANGED
@@ -98,7 +98,7 @@ actually reads rather than hand-written:
98
98
  ```yaml
99
99
  repos:
100
100
  - repo: https://github.com/hawkeyexl/manni
101
- rev: v2.8.1
101
+ rev: v2.8.2
102
102
  hooks:
103
103
  - id: manni-meta
104
104
  ```
@@ -61,7 +61,7 @@ import {
61
61
  supportedExtensions,
62
62
  terminalConfirm,
63
63
  toJsonText
64
- } from "./chunk-RLHN765L.js";
64
+ } from "./chunk-KEW557TN.js";
65
65
 
66
66
  // src/meta/cli.ts
67
67
  import { existsSync } from "node:fs";
@@ -1517,4 +1517,4 @@ export {
1517
1517
  reportConfig,
1518
1518
  buildProgram
1519
1519
  };
1520
- //# sourceMappingURL=chunk-IQO55BTU.js.map
1520
+ //# sourceMappingURL=chunk-7UBCWTCO.js.map
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "@hawkeyexl/manni",
11
- version: "2.8.1",
11
+ version: "2.8.2",
12
12
  description: "One command line for documentation that is meant to be checked. `manni meta` validates the presence and format of document metadata (Markdown frontmatter and more) against JSON Schema, built for CI. Formerly docmeta.",
13
13
  type: "module",
14
14
  bin: {
@@ -11769,6 +11769,20 @@ function spliceManifestValue(text2, options) {
11769
11769
  );
11770
11770
  return { text: out, line };
11771
11771
  }
11772
+ function readManifestValue(text2, options) {
11773
+ const join11 = options.join ?? PATH_JOIN;
11774
+ const doc = parseDocument5(text2, { uniqueKeys: false });
11775
+ if (doc.errors.length > 0) return void 0;
11776
+ const root = doc.contents;
11777
+ if (!isMap5(root)) return void 0;
11778
+ const same = join11 === PATH_JOIN ? (a, b) => posix3.normalize(a) === posix3.normalize(b) : (a, b) => a === b;
11779
+ const pair = root.items.find((p) => same(keyString(p.key), options.entry));
11780
+ const held = pair?.value;
11781
+ if (!isMap5(held)) return void 0;
11782
+ const kv = held.items.find((p) => keyString(p.key) === options.key);
11783
+ const node = kv?.value;
11784
+ return isNode2(node) ? node.toJSON() : void 0;
11785
+ }
11772
11786
  function removeManifestKey(text2, options) {
11773
11787
  const { entry, key, file } = options;
11774
11788
  const join11 = options.join ?? PATH_JOIN;
@@ -19881,6 +19895,7 @@ export {
19881
19895
  orphanJoins,
19882
19896
  orphanError,
19883
19897
  spliceManifestValue,
19898
+ readManifestValue,
19884
19899
  removeManifestKey,
19885
19900
  LOCATION_KEYWORD,
19886
19901
  LOCATION_EXTERNAL_SCHEMA,
@@ -19947,4 +19962,4 @@ export {
19947
19962
  renderQuery,
19948
19963
  renderQueryCsv
19949
19964
  };
19950
- //# sourceMappingURL=chunk-RLHN765L.js.map
19965
+ //# sourceMappingURL=chunk-KEW557TN.js.map