hebrew-transliteration 2.0.5 → 2.0.8

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.d.ts CHANGED
@@ -649,7 +649,7 @@ declare module 'hebrew-transliteration/transliterate' {
649
649
  * ```
650
650
  *
651
651
  */
652
- export const transliterate: (text: string | Text, schema?: Schema | Partial<Schema> | undefined) => string;
652
+ export const transliterate: (text: string | Text, schema?: Partial<Schema> | Schema) => string;
653
653
 
654
654
  }
655
655
  declare module 'hebrew-transliteration' {
package/dist/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { Text as Text3 } from "havarotjs";
3
3
 
4
4
  // src/sequence.ts
5
5
  import { Text } from "havarotjs";
6
- var vowels = /[\u{05B0}-\u{05BD}\u{05BF}\u{05C7}]/u;
6
+ var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
7
7
  var sequence = (text, qametsQatan = false) => {
8
8
  return vowels.test(text) ? new Text(text, { qametsQatan }).text : text;
9
9
  };
@@ -250,6 +250,8 @@ var wordRules = (word, schema) => {
250
250
  return schema.DIVINE_NAME;
251
251
  if (word.hasDivineName)
252
252
  return `${sylRules(word.syllables[0], schema)}-${schema.DIVINE_NAME}`;
253
+ if (word.isNotHebrew)
254
+ return word.text;
253
255
  if ((_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.length) {
254
256
  const wordSeqs = schema.ADDITIONAL_FEATURES.filter((s) => s.FEATURE === "word");
255
257
  for (const seq of wordSeqs) {
@@ -370,7 +372,7 @@ var transliterate = (text, schema) => {
370
372
  const isText = text instanceof Text2;
371
373
  if (!isText && !vowels.test(text)) {
372
374
  const sin = new RegExp(transSchema.SHIN + "\u05C2", "gu");
373
- return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/\u{05C1}/gu, "");
375
+ return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/[\u{0590}-\u{05AF}\u{05BD}-\u{05C6}]/gu, "");
374
376
  }
375
377
  const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
376
378
  const newText = isText ? text : new Text2(text, sylOptions);
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -30,7 +31,7 @@ var import_havarotjs3 = require("havarotjs");
30
31
 
31
32
  // src/sequence.ts
32
33
  var import_havarotjs = require("havarotjs");
33
- var vowels = /[\u{05B0}-\u{05BD}\u{05BF}\u{05C7}]/u;
34
+ var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
34
35
  var sequence = (text, qametsQatan = false) => {
35
36
  return vowels.test(text) ? new import_havarotjs.Text(text, { qametsQatan }).text : text;
36
37
  };
@@ -277,6 +278,8 @@ var wordRules = (word, schema) => {
277
278
  return schema.DIVINE_NAME;
278
279
  if (word.hasDivineName)
279
280
  return `${sylRules(word.syllables[0], schema)}-${schema.DIVINE_NAME}`;
281
+ if (word.isNotHebrew)
282
+ return word.text;
280
283
  if ((_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.length) {
281
284
  const wordSeqs = schema.ADDITIONAL_FEATURES.filter((s) => s.FEATURE === "word");
282
285
  for (const seq of wordSeqs) {
@@ -397,7 +400,7 @@ var transliterate = (text, schema) => {
397
400
  const isText = text instanceof import_havarotjs2.Text;
398
401
  if (!isText && !vowels.test(text)) {
399
402
  const sin = new RegExp(transSchema.SHIN + "\u05C2", "gu");
400
- return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/\u{05C1}/gu, "");
403
+ return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/[\u{0590}-\u{05AF}\u{05BD}-\u{05C6}]/gu, "");
401
404
  }
402
405
  const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
403
406
  const newText = isText ? text : new import_havarotjs2.Text(text, sylOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hebrew-transliteration",
3
- "version": "2.0.5",
3
+ "version": "2.0.8",
4
4
  "description": "a package for transliterating Hebrew",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,22 +37,22 @@
37
37
  "author": "Charles Loder",
38
38
  "license": "MIT",
39
39
  "devDependencies": {
40
- "@types/jest": "^27.4.1",
41
- "@typescript-eslint/eslint-plugin": "^5.19.0",
42
- "esbuild": "^0.14.34",
43
- "eslint": "^8.13.0",
40
+ "@types/jest": "^28.1.4",
41
+ "@typescript-eslint/eslint-plugin": "^5.35.1",
42
+ "esbuild": "^0.15.5",
43
+ "eslint": "^8.23.0",
44
44
  "eslint-config-prettier": "^8.5.0",
45
- "eslint-plugin-jest": "^26.1.4",
46
- "eslint-plugin-jsdoc": "^39.1.0",
45
+ "eslint-plugin-jest": "^26.8.7",
46
+ "eslint-plugin-jsdoc": "^39.3.6",
47
47
  "eslint-plugin-prefer-arrow": "^1.2.3",
48
- "jest": "^27.5.1",
49
- "npm-check-updates": "^12.5.8",
50
- "npm-dts": "^1.3.11",
51
- "prettier": "^2.6.2",
52
- "ts-jest": "^27.1.4",
53
- "typescript": "^4.6.3"
48
+ "jest": "^28.1.2",
49
+ "npm-check-updates": "^16.0.6",
50
+ "npm-dts": "^1.3.12",
51
+ "prettier": "^2.7.1",
52
+ "ts-jest": "^28.0.5",
53
+ "typescript": "^4.8.2"
54
54
  },
55
55
  "dependencies": {
56
- "havarotjs": "^0.7.4"
56
+ "havarotjs": "^0.8.1"
57
57
  }
58
58
  }