@digitalculture/ochre-sdk 0.2.2 → 0.2.3

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/index.cjs CHANGED
@@ -622,6 +622,9 @@ function parseIdentification(identification) {
622
622
  }
623
623
  }
624
624
  function parseLanguages(language) {
625
+ if (language == null) {
626
+ return ["eng"];
627
+ }
625
628
  if (Array.isArray(language)) {
626
629
  return language.map((lang) => parseStringContent(lang));
627
630
  } else {
package/dist/index.d.cts CHANGED
@@ -752,7 +752,7 @@ type OchreMetadata = {
752
752
  publisher: OchreStringContent;
753
753
  dataset: OchreStringContent;
754
754
  project?: { identification: OchreIdentification };
755
- language: OchreLanguage | Array<OchreLanguage>;
755
+ language?: OchreLanguage | Array<OchreLanguage>;
756
756
  description: OchreStringContent;
757
757
  };
758
758
 
@@ -1506,7 +1506,7 @@ declare function parseIdentification(identification: OchreIdentification): Ident
1506
1506
  * @param language - Raw language data, either single or array
1507
1507
  * @returns Array of language codes as strings
1508
1508
  */
1509
- declare function parseLanguages(language: OchreLanguage | Array<OchreLanguage>): Array<string>;
1509
+ declare function parseLanguages(language: OchreLanguage | Array<OchreLanguage> | undefined): Array<string>;
1510
1510
  /**
1511
1511
  * Parses raw metadata into the standardized Metadata type
1512
1512
  *
package/dist/index.d.ts CHANGED
@@ -752,7 +752,7 @@ type OchreMetadata = {
752
752
  publisher: OchreStringContent;
753
753
  dataset: OchreStringContent;
754
754
  project?: { identification: OchreIdentification };
755
- language: OchreLanguage | Array<OchreLanguage>;
755
+ language?: OchreLanguage | Array<OchreLanguage>;
756
756
  description: OchreStringContent;
757
757
  };
758
758
 
@@ -1506,7 +1506,7 @@ declare function parseIdentification(identification: OchreIdentification): Ident
1506
1506
  * @param language - Raw language data, either single or array
1507
1507
  * @returns Array of language codes as strings
1508
1508
  */
1509
- declare function parseLanguages(language: OchreLanguage | Array<OchreLanguage>): Array<string>;
1509
+ declare function parseLanguages(language: OchreLanguage | Array<OchreLanguage> | undefined): Array<string>;
1510
1510
  /**
1511
1511
  * Parses raw metadata into the standardized Metadata type
1512
1512
  *
package/dist/index.js CHANGED
@@ -545,6 +545,9 @@ function parseIdentification(identification) {
545
545
  }
546
546
  }
547
547
  function parseLanguages(language) {
548
+ if (language == null) {
549
+ return ["eng"];
550
+ }
548
551
  if (Array.isArray(language)) {
549
552
  return language.map((lang) => parseStringContent(lang));
550
553
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data",
@@ -44,16 +44,16 @@
44
44
  "zod": "^3.24.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@antfu/eslint-config": "^4.1.0",
47
+ "@antfu/eslint-config": "^4.1.1",
48
48
  "@arethetypeswrong/cli": "^0.17.3",
49
49
  "@changesets/cli": "^2.27.12",
50
50
  "@total-typescript/ts-reset": "^0.6.1",
51
- "@types/node": "^22.10.10",
51
+ "@types/node": "^22.13.1",
52
52
  "eslint-plugin-unused-imports": "^4.1.4",
53
53
  "prettier": "^3.4.2",
54
54
  "tsup": "^8.3.6",
55
55
  "typescript": "^5.7.3",
56
- "vitest": "^3.0.4"
56
+ "vitest": "^3.0.5"
57
57
  },
58
58
  "scripts": {
59
59
  "dev": "tsup src/index.ts --watch",