@scrabble-solver/configs 2.8.1 → 2.8.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.
@@ -3,19 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var literaki_1 = __importDefault(require("./literaki"));
7
- var scrabble_1 = __importDefault(require("./scrabble"));
8
- var configs = [literaki_1.default, scrabble_1.default];
9
- var getConfig = function (configId) {
10
- var config = configs.find(function (_a) {
11
- var id = _a.id;
12
- return id === configId;
13
- });
6
+ const literaki_1 = __importDefault(require("./literaki"));
7
+ const scrabble_1 = __importDefault(require("./scrabble"));
8
+ const configs = [literaki_1.default, scrabble_1.default];
9
+ const getConfig = (configId) => {
10
+ const config = configs.find(({ id }) => id === configId);
14
11
  if (!config) {
15
- throw new Error("Invalid \"configId\" parameter: not one of ".concat(configs.map(function (_a) {
16
- var id = _a.id;
17
- return id;
18
- }).join('/')));
12
+ throw new Error(`Invalid "configId" parameter: not one of ${configs.map(({ id }) => id).join('/')}`);
19
13
  }
20
14
  return config;
21
15
  };
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var getConfig_1 = __importDefault(require("./getConfig"));
7
- var getLocaleConfig = function (configId, locale) {
6
+ const getConfig_1 = __importDefault(require("./getConfig"));
7
+ const getLocaleConfig = (configId, locale) => {
8
8
  return (0, getConfig_1.default)(configId)[locale];
9
9
  };
10
10
  exports.default = getLocaleConfig;
@@ -3,13 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var literaki_1 = __importDefault(require("./literaki"));
7
- var scrabble_1 = __importDefault(require("./scrabble"));
8
- var configs = [literaki_1.default, scrabble_1.default];
9
- var isConfigId = function (configId) {
10
- return configs.some(function (_a) {
11
- var id = _a.id;
12
- return id === configId;
13
- });
6
+ const literaki_1 = __importDefault(require("./literaki"));
7
+ const scrabble_1 = __importDefault(require("./scrabble"));
8
+ const configs = [literaki_1.default, scrabble_1.default];
9
+ const isConfigId = (configId) => {
10
+ return configs.some(({ id }) => id === configId);
14
11
  };
15
12
  exports.default = isConfigId;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var constants_1 = require("@scrabble-solver/constants");
4
- var bonuses = [
3
+ const constants_1 = require("@scrabble-solver/constants");
4
+ const bonuses = [
5
5
  { multiplier: 3, score: 5, type: constants_1.BONUS_CHARACTER, x: 0, y: 0 },
6
6
  { multiplier: 3, type: constants_1.BONUS_WORD, x: 2, y: 0 },
7
7
  { multiplier: 3, score: 2, type: constants_1.BONUS_CHARACTER, x: 5, y: 0 },
@@ -1,24 +1,12 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
- var _a;
17
5
  Object.defineProperty(exports, "__esModule", { value: true });
18
- var types_1 = require("@scrabble-solver/types");
19
- var bonuses_1 = __importDefault(require("./bonuses"));
20
- var tiles_1 = require("./tiles");
21
- var base = {
6
+ const types_1 = require("@scrabble-solver/types");
7
+ const bonuses_1 = __importDefault(require("./bonuses"));
8
+ const tiles_1 = require("./tiles");
9
+ const base = {
22
10
  allTilesBonusScore: 50,
23
11
  blankScore: 0,
24
12
  boardHeight: 15,
@@ -29,15 +17,14 @@ var base = {
29
17
  name: 'Literaki',
30
18
  numberOfBlanks: 2,
31
19
  };
32
- var literaki = (_a = {
33
- id: base.id,
34
- name: base.name
35
- },
36
- _a[types_1.Locale.DE_DE] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesDe })),
37
- _a[types_1.Locale.EN_GB] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesEn })),
38
- _a[types_1.Locale.EN_US] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesEn })),
39
- _a[types_1.Locale.ES_ES] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesEs })),
40
- _a[types_1.Locale.FR_FR] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesFr })),
41
- _a[types_1.Locale.PL_PL] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesPl })),
42
- _a);
20
+ const literaki = {
21
+ id: base.id,
22
+ name: base.name,
23
+ [types_1.Locale.DE_DE]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesDe }),
24
+ [types_1.Locale.EN_GB]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
25
+ [types_1.Locale.EN_US]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
26
+ [types_1.Locale.ES_ES]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEs }),
27
+ [types_1.Locale.FR_FR]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesFr }),
28
+ [types_1.Locale.PL_PL]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesPl }),
29
+ };
43
30
  exports.default = literaki;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesDe = [
3
+ const tilesDe = [
4
4
  { character: 'a', count: 5, score: 1 },
5
5
  { character: 'ä', count: 1, score: 6 },
6
6
  { character: 'b', count: 2, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesEn = [
3
+ const tilesEn = [
4
4
  { character: 'a', count: 9, score: 1 },
5
5
  { character: 'b', count: 2, score: 3 },
6
6
  { character: 'c', count: 2, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesEs = [
3
+ const tilesEs = [
4
4
  { character: 'a', count: 12, score: 1 },
5
5
  { character: 'b', count: 2, score: 3 },
6
6
  { character: 'c', count: 4, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesFr = [
3
+ const tilesFr = [
4
4
  { character: 'a', count: 9, score: 1 },
5
5
  { character: 'b', count: 2, score: 3 },
6
6
  { character: 'c', count: 2, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesPl = [
3
+ const tilesPl = [
4
4
  { character: 'a', count: 9, score: 1 },
5
5
  { character: 'ą', count: 1, score: 5 },
6
6
  { character: 'b', count: 2, score: 3 },
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var constants_1 = require("@scrabble-solver/constants");
4
- var bonuses = [
3
+ const constants_1 = require("@scrabble-solver/constants");
4
+ const bonuses = [
5
5
  { multiplier: 3, type: constants_1.BONUS_WORD, x: 0, y: 0 },
6
6
  { multiplier: 2, type: constants_1.BONUS_CHARACTER, x: 3, y: 0 },
7
7
  { multiplier: 3, type: constants_1.BONUS_WORD, x: 7, y: 0 },
@@ -1,24 +1,12 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
- var _a;
17
5
  Object.defineProperty(exports, "__esModule", { value: true });
18
- var types_1 = require("@scrabble-solver/types");
19
- var bonuses_1 = __importDefault(require("./bonuses"));
20
- var tiles_1 = require("./tiles");
21
- var base = {
6
+ const types_1 = require("@scrabble-solver/types");
7
+ const bonuses_1 = __importDefault(require("./bonuses"));
8
+ const tiles_1 = require("./tiles");
9
+ const base = {
22
10
  allTilesBonusScore: 50,
23
11
  blankScore: 0,
24
12
  boardHeight: 15,
@@ -29,15 +17,14 @@ var base = {
29
17
  name: 'Scrabble',
30
18
  numberOfBlanks: 2,
31
19
  };
32
- var scrabble = (_a = {
33
- id: base.id,
34
- name: base.name
35
- },
36
- _a[types_1.Locale.EN_GB] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesEn })),
37
- _a[types_1.Locale.DE_DE] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesDe })),
38
- _a[types_1.Locale.EN_US] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesEn })),
39
- _a[types_1.Locale.ES_ES] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesEs })),
40
- _a[types_1.Locale.FR_FR] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesFr })),
41
- _a[types_1.Locale.PL_PL] = types_1.Config.fromJson(__assign(__assign({}, base), { tiles: tiles_1.tilesPl })),
42
- _a);
20
+ const scrabble = {
21
+ id: base.id,
22
+ name: base.name,
23
+ [types_1.Locale.EN_GB]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
24
+ [types_1.Locale.DE_DE]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesDe }),
25
+ [types_1.Locale.EN_US]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
26
+ [types_1.Locale.ES_ES]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEs }),
27
+ [types_1.Locale.FR_FR]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesFr }),
28
+ [types_1.Locale.PL_PL]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesPl }),
29
+ };
43
30
  exports.default = scrabble;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesDe = [
3
+ const tilesDe = [
4
4
  { character: 'a', count: 5, score: 1 },
5
5
  { character: 'ä', count: 1, score: 6 },
6
6
  { character: 'b', count: 2, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesEn = [
3
+ const tilesEn = [
4
4
  { character: 'a', count: 9, score: 1 },
5
5
  { character: 'b', count: 2, score: 3 },
6
6
  { character: 'c', count: 2, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesEs = [
3
+ const tilesEs = [
4
4
  { character: 'a', count: 12, score: 1 },
5
5
  { character: 'b', count: 2, score: 3 },
6
6
  { character: 'c', count: 4, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesFr = [
3
+ const tilesFr = [
4
4
  { character: 'a', count: 9, score: 1 },
5
5
  { character: 'b', count: 2, score: 3 },
6
6
  { character: 'c', count: 2, score: 3 },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tilesPl = [
3
+ const tilesPl = [
4
4
  { character: 'a', count: 9, score: 1 },
5
5
  { character: 'ą', count: 1, score: 5 },
6
6
  { character: 'b', count: 2, score: 3 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/configs",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "description": "Scrabble Solver 2 - Configs",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  "clean:force": "npm run clean && rimraf package-lock.json"
25
25
  },
26
26
  "dependencies": {
27
- "@scrabble-solver/constants": "^2.8.1",
28
- "@scrabble-solver/types": "^2.8.1"
27
+ "@scrabble-solver/constants": "^2.8.3",
28
+ "@scrabble-solver/types": "^2.8.3"
29
29
  },
30
- "gitHead": "994d5ef4a195cda08f7a907b8b1343bbc145801e"
30
+ "gitHead": "116f214733e7ad071044f556bcf67e867da3d9ca"
31
31
  }