hebrew-transliteration 2.0.2 → 2.0.5

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.esm.js CHANGED
@@ -272,6 +272,7 @@ var Schema = class {
272
272
  };
273
273
  var SBL = class extends Schema {
274
274
  constructor(schema) {
275
+ var _a, _b, _c, _d, _e, _f;
275
276
  super({
276
277
  VOCAL_SHEVA: schema.VOCAL_SHEVA || "\u01DD",
277
278
  HATAF_SEGOL: schema.HATAF_SEGOL || "\u0115",
@@ -344,7 +345,6 @@ var SBL = class extends Schema {
344
345
  wawShureq: (_e = schema.wawShureq) != null ? _e : true,
345
346
  article: (_f = schema.article) != null ? _f : true
346
347
  });
347
- var _a, _b, _c, _d, _e, _f;
348
348
  }
349
349
  };
350
350
 
@@ -368,8 +368,10 @@ var getSylOpts = (schema) => {
368
368
  var transliterate = (text, schema) => {
369
369
  const transSchema = schema instanceof Schema ? schema : new SBL(schema != null ? schema : {});
370
370
  const isText = text instanceof Text2;
371
- if (!isText && !vowels.test(text))
372
- return mapChars(text, transSchema);
371
+ if (!isText && !vowels.test(text)) {
372
+ const sin = new RegExp(transSchema.SHIN + "\u05C2", "gu");
373
+ return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/\u{05C1}/gu, "");
374
+ }
373
375
  const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
374
376
  const newText = isText ? text : new Text2(text, sylOptions);
375
377
  return newText.words.map((word) => {
package/dist/index.js CHANGED
@@ -2,24 +2,19 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
7
  __defProp(target, name, { get: all[name], enumerable: true });
9
8
  };
10
- var __reExport = (target, module2, copyDefault, desc) => {
11
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
12
- for (let key of __getOwnPropNames(module2))
13
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
14
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
14
  }
16
- return target;
15
+ return to;
17
16
  };
18
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
19
- return (module2, temp) => {
20
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
- };
22
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
18
 
24
19
  // src/index.ts
25
20
  var src_exports = {};
@@ -30,6 +25,7 @@ __export(src_exports, {
30
25
  sequence: () => sequence,
31
26
  transliterate: () => transliterate
32
27
  });
28
+ module.exports = __toCommonJS(src_exports);
33
29
  var import_havarotjs3 = require("havarotjs");
34
30
 
35
31
  // src/sequence.ts
@@ -303,6 +299,7 @@ var Schema = class {
303
299
  };
304
300
  var SBL = class extends Schema {
305
301
  constructor(schema) {
302
+ var _a, _b, _c, _d, _e, _f;
306
303
  super({
307
304
  VOCAL_SHEVA: schema.VOCAL_SHEVA || "\u01DD",
308
305
  HATAF_SEGOL: schema.HATAF_SEGOL || "\u0115",
@@ -375,7 +372,6 @@ var SBL = class extends Schema {
375
372
  wawShureq: (_e = schema.wawShureq) != null ? _e : true,
376
373
  article: (_f = schema.article) != null ? _f : true
377
374
  });
378
- var _a, _b, _c, _d, _e, _f;
379
375
  }
380
376
  };
381
377
 
@@ -399,8 +395,10 @@ var getSylOpts = (schema) => {
399
395
  var transliterate = (text, schema) => {
400
396
  const transSchema = schema instanceof Schema ? schema : new SBL(schema != null ? schema : {});
401
397
  const isText = text instanceof import_havarotjs2.Text;
402
- if (!isText && !vowels.test(text))
403
- return mapChars(text, transSchema);
398
+ if (!isText && !vowels.test(text)) {
399
+ const sin = new RegExp(transSchema.SHIN + "\u05C2", "gu");
400
+ return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/\u{05C1}/gu, "");
401
+ }
404
402
  const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
405
403
  const newText = isText ? text : new import_havarotjs2.Text(text, sylOptions);
406
404
  return newText.words.map((word) => {
@@ -426,7 +424,6 @@ var remove = (text, { removeVowels = false, removeShinDot = false, removeSinDot
426
424
  const remShin = removeShinDot ? removeItem(remVowels, shinDot) : remVowels;
427
425
  return removeSinDot ? removeItem(remShin, sinDot) : remShin;
428
426
  };
429
- module.exports = __toCommonJS(src_exports);
430
427
  // Annotate the CommonJS export names for ESM import in node:
431
428
  0 && (module.exports = {
432
429
  Schema,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hebrew-transliteration",
3
- "version": "2.0.2",
4
- "description": "a package for transliterating Hebrew according to SBL guidelines",
3
+ "version": "2.0.5",
4
+ "description": "a package for transliterating Hebrew",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "module": "dist/indes.esm.js",
@@ -37,22 +37,22 @@
37
37
  "author": "Charles Loder",
38
38
  "license": "MIT",
39
39
  "devDependencies": {
40
- "@types/jest": "^27.4.0",
41
- "@typescript-eslint/eslint-plugin": "^5.10.2",
42
- "esbuild": "^0.14.18",
43
- "eslint": "^8.8.0",
44
- "eslint-config-prettier": "^8.3.0",
45
- "eslint-plugin-jest": "^26.0.0",
46
- "eslint-plugin-jsdoc": "^37.7.1",
40
+ "@types/jest": "^27.4.1",
41
+ "@typescript-eslint/eslint-plugin": "^5.19.0",
42
+ "esbuild": "^0.14.34",
43
+ "eslint": "^8.13.0",
44
+ "eslint-config-prettier": "^8.5.0",
45
+ "eslint-plugin-jest": "^26.1.4",
46
+ "eslint-plugin-jsdoc": "^39.1.0",
47
47
  "eslint-plugin-prefer-arrow": "^1.2.3",
48
- "jest": "^27.4.7",
49
- "npm-check-updates": "^12.2.1",
48
+ "jest": "^27.5.1",
49
+ "npm-check-updates": "^12.5.8",
50
50
  "npm-dts": "^1.3.11",
51
- "prettier": "^2.5.1",
52
- "ts-jest": "^27.1.3",
53
- "typescript": "^4.5.5"
51
+ "prettier": "^2.6.2",
52
+ "ts-jest": "^27.1.4",
53
+ "typescript": "^4.6.3"
54
54
  },
55
55
  "dependencies": {
56
- "havarotjs": "^0.7.2"
56
+ "havarotjs": "^0.7.4"
57
57
  }
58
58
  }