@fgv/ts-sudoku-lib 4.0.2 → 4.2.0

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/CHANGELOG.json CHANGED
@@ -1,6 +1,30 @@
1
1
  {
2
2
  "name": "@fgv/ts-sudoku-lib",
3
3
  "entries": [
4
+ {
5
+ "version": "4.2.0",
6
+ "tag": "@fgv/ts-sudoku-lib_v4.2.0",
7
+ "date": "Mon, 20 Jan 2025 09:46:53 GMT",
8
+ "comments": {}
9
+ },
10
+ {
11
+ "version": "4.1.0",
12
+ "tag": "@fgv/ts-sudoku-lib_v4.1.0",
13
+ "date": "Thu, 09 Jan 2025 05:33:39 GMT",
14
+ "comments": {
15
+ "none": [
16
+ {
17
+ "comment": "update dependencies"
18
+ }
19
+ ]
20
+ }
21
+ },
22
+ {
23
+ "version": "4.0.2",
24
+ "tag": "@fgv/ts-sudoku-lib_v4.0.2",
25
+ "date": "Tue, 14 May 2024 14:45:53 GMT",
26
+ "comments": {}
27
+ },
4
28
  {
5
29
  "version": "4.0.1",
6
30
  "tag": "@fgv/ts-sudoku-lib_v4.0.1",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,23 @@
1
1
  # Change Log - @fgv/ts-sudoku-lib
2
2
 
3
- This log was last generated on Tue, 14 May 2024 05:02:20 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 20 Jan 2025 09:46:53 GMT and should not be manually modified.
4
+
5
+ ## 4.2.0
6
+ Mon, 20 Jan 2025 09:46:53 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.1.0
11
+ Thu, 09 Jan 2025 05:33:39 GMT
12
+
13
+ ### Updates
14
+
15
+ - update dependencies
16
+
17
+ ## 4.0.2
18
+ Tue, 14 May 2024 14:45:53 GMT
19
+
20
+ _Version update only_
4
21
 
5
22
  ## 4.0.1
6
23
  Tue, 14 May 2024 05:02:20 GMT
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.43.4"
8
+ "packageVersion": "7.49.1"
9
9
  }
10
10
  ]
11
11
  }
package/lib/index.js CHANGED
@@ -38,13 +38,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
38
38
  }) : function(o, v) {
39
39
  o["default"] = v;
40
40
  });
41
- var __importStar = (this && this.__importStar) || function (mod) {
42
- if (mod && mod.__esModule) return mod;
43
- var result = {};
44
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
45
- __setModuleDefault(result, mod);
46
- return result;
47
- };
41
+ var __importStar = (this && this.__importStar) || (function () {
42
+ var ownKeys = function(o) {
43
+ ownKeys = Object.getOwnPropertyNames || function (o) {
44
+ var ar = [];
45
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
46
+ return ar;
47
+ };
48
+ return ownKeys(o);
49
+ };
50
+ return function (mod) {
51
+ if (mod && mod.__esModule) return mod;
52
+ var result = {};
53
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
54
+ __setModuleDefault(result, mod);
55
+ return result;
56
+ };
57
+ })();
48
58
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
49
59
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
50
60
  };
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sDAAwC;AAK/B,oBAAI;AAJb,4DAA8C;AAI/B,0BAAO;AAFtB,yDAAuC;AACvC,oDAAkC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as File from './packlets/file';\nimport * as Puzzles from './packlets/puzzles';\n\nexport * from './packlets/collections';\nexport * from './packlets/common';\nexport { File, Puzzles };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sDAAwC;AAK/B,oBAAI;AAJb,4DAA8C;AAI/B,0BAAO;AAFtB,yDAAuC;AACvC,oDAAkC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as File from './packlets/file';\nimport * as Puzzles from './packlets/puzzles';\n\nexport * from './packlets/collections';\nexport * from './packlets/common';\nexport { File, Puzzles };\n"]}
@@ -38,13 +38,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
38
38
  }) : function(o, v) {
39
39
  o["default"] = v;
40
40
  });
41
- var __importStar = (this && this.__importStar) || function (mod) {
42
- if (mod && mod.__esModule) return mod;
43
- var result = {};
44
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
45
- __setModuleDefault(result, mod);
46
- return result;
47
- };
41
+ var __importStar = (this && this.__importStar) || (function () {
42
+ var ownKeys = function(o) {
43
+ ownKeys = Object.getOwnPropertyNames || function (o) {
44
+ var ar = [];
45
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
46
+ return ar;
47
+ };
48
+ return ownKeys(o);
49
+ };
50
+ return function (mod) {
51
+ if (mod && mod.__esModule) return mod;
52
+ var result = {};
53
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
54
+ __setModuleDefault(result, mod);
55
+ return result;
56
+ };
57
+ })();
48
58
  var __importDefault = (this && this.__importDefault) || function (mod) {
49
59
  return (mod && mod.__esModule) ? mod : { "default": mod };
50
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/packlets/collections/collections.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAoC;AACpC,oDAAsC;AAEtC,4CAAqE;AAErE,sCAA8D;AAC9D,uEAAiD;AAEjD;;;GAGG;AACH,MAAa,gBAAgB;IAQ3B,YAAoB,OAAoC;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAClB,IAAI,CAAC,OAAO;aACT,GAAG,CAAC,CAAC,CAAC,EAA4C,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;aAC/D,MAAM,CAAC,CAAC,CAAC,EAAqC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CACrE,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,IAAiC;QACpD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,IAAI,CAAC,IAAY;QAC7B,OAAO,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,EAAU;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;aAC3B,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC,CAAC;aACD,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACpB,OAAO,sBAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACI,cAAc,CAAC,EAAU;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,IAAA,eAAI,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;IACvB,CAAC;CACF;AAlED,4CAkEC;AAED;;;GAGG;AACH,MAAa,iBAAiB;IAG5B;;OAEG;IACI,MAAM,KAAK,OAAO;QACvB,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;YAChC,iBAAiB,CAAC,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW;iBACzD,OAAO,CAAC,sBAAc,CAAC;iBACvB,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC;iBAClC,OAAO,EAAE,CAAC;QACf,CAAC;QACD,OAAO,iBAAiB,CAAC,QAAQ,CAAC;IACpC,CAAC;;AAdH,8CAeC;AAdgB,0BAAQ,GAAiC,SAAS,CAAC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as FileData from '../file';\nimport * as Puzzles from '../puzzles';\n\nimport { Result, captureResult, fail, succeed } from '@fgv/ts-utils';\n\nimport { IPuzzleDescription, PuzzleSession } from '../common';\nimport DefaultPuzzles from './data/puzzles.json';\n\n/**\n * A collection of puzzles of various types.\n * @public\n */\nexport class PuzzleCollection {\n /**\n * All puzzles in the collection.\n */\n public readonly puzzles: readonly IPuzzleDescription[];\n\n private readonly _byId: Map<string, IPuzzleDescription>;\n\n private constructor(puzzles: FileData.Model.IPuzzlesFile) {\n this.puzzles = puzzles.puzzles;\n this._byId = new Map(\n this.puzzles\n .map((p): [string | undefined, IPuzzleDescription] => [p.id, p])\n .filter((p): p is [string, IPuzzleDescription] => p !== undefined)\n );\n }\n\n /**\n * Creates a new puzzle from a loaded {@link File.Model.IPuzzlesFile | PuzzlesFile}\n * @param from - The {@link File.Model.IPuzzlesFile | puzzles file} to be loaded.\n * @returns `Success` with the resulting {@link PuzzleCollection | PuzzleCollection}\n * or `Failure` with details if an error occurs.\n */\n public static create(from: FileData.Model.IPuzzlesFile): Result<PuzzleCollection> {\n return captureResult(() => new PuzzleCollection(from));\n }\n\n /**\n * Creates a new puzzle from a JSON file.\n * @param path - path to the JSON file to be loaded.\n * @returns `Success` with the resulting {@link PuzzleCollection | PuzzleCollection}\n * or `Failure` with details if an error occurs.\n */\n public static load(path: string): Result<PuzzleCollection> {\n return FileData.Converters.loadJsonPuzzlesFileSync(path).onSuccess(PuzzleCollection.create);\n }\n\n /**\n * Gets a puzzle by id from this collection.\n * @param id - The string ID of the puzzle to be returned.\n * @returns `Success` with the requested {@link PuzzleSession | puzzle}, or\n * `Failure` with details if an error occurs.\n */\n public getPuzzle(id: string): Result<PuzzleSession> {\n return this.getDescription(id)\n .onSuccess((desc) => {\n return Puzzles.Any.create(desc);\n })\n .onSuccess((puzzle) => {\n return PuzzleSession.create(puzzle);\n });\n }\n\n /**\n * Gets a puzzle by id from this collection.\n * @param id - The string ID of the puzzle to be returned.\n * @returns `Success` with the requested {@link PuzzleSession | puzzle}, or\n * `Failure` with details if an error occurs.\n */\n public getDescription(id: string): Result<IPuzzleDescription> {\n const desc = this._byId.get(id);\n if (!desc) {\n return fail(`Puzzle \"${id}\" not found`);\n }\n return succeed(desc);\n }\n}\n\n/**\n * Get well-known {@link PuzzleCollection | puzzle collections}.\n * @public\n */\nexport class PuzzleCollections {\n private static _default: PuzzleCollection | undefined = undefined;\n\n /**\n * The default {@link PuzzleCollection | puzzle collection}.\n */\n public static get default(): PuzzleCollection {\n if (!PuzzleCollections._default) {\n PuzzleCollections._default = FileData.Converters.puzzlesFile\n .convert(DefaultPuzzles)\n .onSuccess(PuzzleCollection.create)\n .orThrow();\n }\n return PuzzleCollections._default;\n }\n}\n"]}
1
+ {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/packlets/collections/collections.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAoC;AACpC,oDAAsC;AAEtC,4CAAqE;AAErE,sCAA8D;AAC9D,uEAAiD;AAEjD;;;GAGG;AACH,MAAa,gBAAgB;IAQ3B,YAAoB,OAAoC;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAClB,IAAI,CAAC,OAAO;aACT,GAAG,CAAC,CAAC,CAAC,EAA4C,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;aAC/D,MA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QAAQ,CAAC,UAAU,CAAC,WAAW;iBACzD,OAAO,CAAC,sBAAc,CAAC;iBACvB,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC;iBAClC,OAAO,EAAE,CAAC;QACf,CAAC;QACD,OAAO,iBAAiB,CAAC,QAAQ,CAAC;IACpC,CAAC;;AAdH,8CAeC;AAdgB,0BAAQ,GAAiC,SAAS,CAAC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as FileData from '../file';\nimport * as Puzzles from '../puzzles';\n\nimport { Result, captureResult, fail, succeed } from '@fgv/ts-utils';\n\nimport { IPuzzleDescription, PuzzleSession } from '../common';\nimport DefaultPuzzles from './data/puzzles.json';\n\n/**\n * A collection of puzzles of various types.\n * @public\n */\nexport class PuzzleCollection {\n /**\n * All puzzles in the collection.\n */\n public readonly puzzles: readonly IPuzzleDescription[];\n\n private readonly _byId: Map<string, IPuzzleDescription>;\n\n private constructor(puzzles: FileData.Model.IPuzzlesFile) {\n this.puzzles = puzzles.puzzles;\n this._byId = new Map(\n this.puzzles\n .map((p): [string | undefined, IPuzzleDescription] => [p.id, p])\n .filter((p): p is [string, IPuzzleDescription] => p !== undefined)\n );\n }\n\n /**\n * Creates a new puzzle from a loaded {@link File.Model.IPuzzlesFile | PuzzlesFile}\n * @param from - The {@link File.Model.IPuzzlesFile | puzzles file} to be loaded.\n * @returns `Success` with the resulting {@link PuzzleCollection | PuzzleCollection}\n * or `Failure` with details if an error occurs.\n */\n public static create(from: FileData.Model.IPuzzlesFile): Result<PuzzleCollection> {\n return captureResult(() => new PuzzleCollection(from));\n }\n\n /**\n * Creates a new puzzle from a JSON file.\n * @param path - path to the JSON file to be loaded.\n * @returns `Success` with the resulting {@link PuzzleCollection | PuzzleCollection}\n * or `Failure` with details if an error occurs.\n */\n public static load(path: string): Result<PuzzleCollection> {\n return FileData.Converters.loadJsonPuzzlesFileSync(path).onSuccess(PuzzleCollection.create);\n }\n\n /**\n * Gets a puzzle by id from this collection.\n * @param id - The string ID of the puzzle to be returned.\n * @returns `Success` with the requested {@link PuzzleSession | puzzle}, or\n * `Failure` with details if an error occurs.\n */\n public getPuzzle(id: string): Result<PuzzleSession> {\n return this.getDescription(id)\n .onSuccess((desc) => {\n return Puzzles.Any.create(desc);\n })\n .onSuccess((puzzle) => {\n return PuzzleSession.create(puzzle);\n });\n }\n\n /**\n * Gets a puzzle by id from this collection.\n * @param id - The string ID of the puzzle to be returned.\n * @returns `Success` with the requested {@link PuzzleSession | puzzle}, or\n * `Failure` with details if an error occurs.\n */\n public getDescription(id: string): Result<IPuzzleDescription> {\n const desc = this._byId.get(id);\n if (!desc) {\n return fail(`Puzzle \"${id}\" not found`);\n }\n return succeed(desc);\n }\n}\n\n/**\n * Get well-known {@link PuzzleCollection | puzzle collections}.\n * @public\n */\nexport class PuzzleCollections {\n private static _default: PuzzleCollection | undefined = undefined;\n\n /**\n * The default {@link PuzzleCollection | puzzle collection}.\n */\n public static get default(): PuzzleCollection {\n if (!PuzzleCollections._default) {\n PuzzleCollections._default = FileData.Converters.puzzlesFile\n .convert(DefaultPuzzles)\n .onSuccess(PuzzleCollection.create)\n .orThrow();\n }\n return PuzzleCollections._default;\n }\n}\n"]}
@@ -38,13 +38,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
38
38
  }) : function(o, v) {
39
39
  o["default"] = v;
40
40
  });
41
- var __importStar = (this && this.__importStar) || function (mod) {
42
- if (mod && mod.__esModule) return mod;
43
- var result = {};
44
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
45
- __setModuleDefault(result, mod);
46
- return result;
47
- };
41
+ var __importStar = (this && this.__importStar) || (function () {
42
+ var ownKeys = function(o) {
43
+ ownKeys = Object.getOwnPropertyNames || function (o) {
44
+ var ar = [];
45
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
46
+ return ar;
47
+ };
48
+ return ownKeys(o);
49
+ };
50
+ return function (mod) {
51
+ if (mod && mod.__esModule) return mod;
52
+ var result = {};
53
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
54
+ __setModuleDefault(result, mod);
55
+ return result;
56
+ };
57
+ })();
48
58
  Object.defineProperty(exports, "__esModule", { value: true });
49
59
  exports.Ids = void 0;
50
60
  const ts_utils_1 = require("@fgv/ts-utils");
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../src/packlets/common/ids.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAAsD;AAEtD,yDAA2C;AAG3C,MAAM,cAAc,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACjD,MAAM,cAAc,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,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ik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, fail, succeed } from '@fgv/ts-utils';\nimport { CageId, CellId, IRowColumn } from './common';\nimport * as Converters from './converters';\nimport { ICage, ICell } from './public';\n\nconst firstRowIdChar: number = 'A'.charCodeAt(0);\nconst firstColIdChar: number = '1'.charCodeAt(0);\n\nfunction isRowColumn(from: unknown): from is IRowColumn {\n return typeof from === 'object' && from !== null && 'row' in from && `col` in from;\n}\n\n/**\n * @public\n */\nexport class Ids {\n public static cageId(from: string | ICage): Result<CageId> {\n if (typeof from === 'string') {\n return Converters.cageId.convert(from);\n }\n return succeed(from.id);\n }\n\n public static cellId(spec: string | IRowColumn | ICell): Result<CellId> {\n if (isRowColumn(spec)) {\n if ('id' in spec) {\n return succeed(spec.id);\n }\n const row = String.fromCharCode(firstRowIdChar + spec.row);\n const col = String.fromCharCode(firstColIdChar + spec.col);\n return succeed(`${row}${col}` as CellId);\n }\n return Converters.cellId.convert(spec);\n }\n\n public static rowCageId(row: number): CageId {\n return `R${String.fromCharCode(firstRowIdChar + row)}` as CageId;\n }\n\n public static columnCageId(col: number): CageId {\n return `C${String.fromCharCode(firstColIdChar + col)}` as CageId;\n }\n\n public static sectionCageId(row: number, col: number): CageId {\n row = Math.floor(row / 3) * 3;\n col = Math.floor(col / 3) * 3;\n return `S${String.fromCharCode(firstRowIdChar + row)}${String.fromCharCode(\n firstColIdChar + col\n )}` as CageId;\n }\n\n public static cellIds(\n firstRow: number,\n numRows: number,\n firstCol: number,\n numCols: number\n ): Result<CellId[]> {\n const cellIds: CellId[] = [];\n for (let row = firstRow; row < firstRow + numRows; row++) {\n for (let col = firstCol; col < firstCol + numCols; col++) {\n const result = this.cellId({ row, col }).onSuccess((id) => {\n cellIds.push(id);\n return succeed(id);\n });\n\n /* c8 ignore next 3 - defense in depth should not happen */\n if (result.isFailure()) {\n return fail(result.message);\n }\n }\n }\n return succeed(cellIds);\n }\n}\n"]}
1
+ {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../src/packlets/common/ids.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAAsD;AAEtD,yDAA2C;AAG3C,MAAM,cAAc,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACjD,MAAM,cAAc,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAEjD,SAAS,WAAW,CAAC,IAAa;IAChC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC;AACrF,CAAC;AAED;;GAEG;AACH,MAAa,GAAG;IACP,MAAM,CAAC,MAAM,CAAC,IAAoB;QACvC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,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EAAY,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,OAAO,CACnB,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,OAAe;QAEf,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,IAAI,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,GAAG,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;YACzD,KAAK,IAAI,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,GAAG,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;gBACzD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE;oBACxD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACjB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;gBACrB,CAAC,CAAC,CAAC;gBAEH,2DAA2D;gBAC3D,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;oBACvB,OAAO,IAAA,eAAI,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC9B,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF;AA1DD,kBA0DC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, fail, succeed } from '@fgv/ts-utils';\nimport { CageId, CellId, IRowColumn } from './common';\nimport * as Converters from './converters';\nimport { ICage, ICell } from './public';\n\nconst firstRowIdChar: number = 'A'.charCodeAt(0);\nconst firstColIdChar: number = '1'.charCodeAt(0);\n\nfunction isRowColumn(from: unknown): from is IRowColumn {\n return typeof from === 'object' && from !== null && 'row' in from && `col` in from;\n}\n\n/**\n * @public\n */\nexport class Ids {\n public static cageId(from: string | ICage): Result<CageId> {\n if (typeof from === 'string') {\n return Converters.cageId.convert(from);\n }\n return succeed(from.id);\n }\n\n public static cellId(spec: string | IRowColumn | ICell): Result<CellId> {\n if (isRowColumn(spec)) {\n if ('id' in spec) {\n return succeed(spec.id);\n }\n const row = String.fromCharCode(firstRowIdChar + spec.row);\n const col = String.fromCharCode(firstColIdChar + spec.col);\n return succeed(`${row}${col}` as CellId);\n }\n return Converters.cellId.convert(spec);\n }\n\n public static rowCageId(row: number): CageId {\n return `R${String.fromCharCode(firstRowIdChar + row)}` as CageId;\n }\n\n public static columnCageId(col: number): CageId {\n return `C${String.fromCharCode(firstColIdChar + col)}` as CageId;\n }\n\n public static sectionCageId(row: number, col: number): CageId {\n row = Math.floor(row / 3) * 3;\n col = Math.floor(col / 3) * 3;\n return `S${String.fromCharCode(firstRowIdChar + row)}${String.fromCharCode(\n firstColIdChar + col\n )}` as CageId;\n }\n\n public static cellIds(\n firstRow: number,\n numRows: number,\n firstCol: number,\n numCols: number\n ): Result<CellId[]> {\n const cellIds: CellId[] = [];\n for (let row = firstRow; row < firstRow + numRows; row++) {\n for (let col = firstCol; col < firstCol + numCols; col++) {\n const result = this.cellId({ row, col }).onSuccess((id) => {\n cellIds.push(id);\n return succeed(id);\n });\n\n /* c8 ignore next 3 - defense in depth should not happen */\n if (result.isFailure()) {\n return fail(result.message);\n }\n }\n }\n return succeed(cellIds);\n }\n}\n"]}
@@ -38,13 +38,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
38
38
  }) : function(o, v) {
39
39
  o["default"] = v;
40
40
  });
41
- var __importStar = (this && this.__importStar) || function (mod) {
42
- if (mod && mod.__esModule) return mod;
43
- var result = {};
44
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
45
- __setModuleDefault(result, mod);
46
- return result;
47
- };
41
+ var __importStar = (this && this.__importStar) || (function () {
42
+ var ownKeys = function(o) {
43
+ ownKeys = Object.getOwnPropertyNames || function (o) {
44
+ var ar = [];
45
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
46
+ return ar;
47
+ };
48
+ return ownKeys(o);
49
+ };
50
+ return function (mod) {
51
+ if (mod && mod.__esModule) return mod;
52
+ var result = {};
53
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
54
+ __setModuleDefault(result, mod);
55
+ return result;
56
+ };
57
+ })();
48
58
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
49
59
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
50
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AAYlC,gCAAU;AAVnB,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,gDAA8B","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Converters from './converters';\n\nexport * from './cage';\nexport * from './cell';\nexport * from './common';\nexport { Ids } from './ids';\nexport * from './model';\nexport * from './public';\nexport * from './puzzle';\nexport * from './puzzleSession';\nexport * from './puzzleState';\n\nexport { Converters };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AAYlC,gCAAU;AAVnB,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,gDAA8B","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Converters from './converters';\n\nexport * from './cage';\nexport * from './cell';\nexport * from './common';\nexport { Ids } from './ids';\nexport * from './model';\nexport * from './public';\nexport * from './puzzle';\nexport * from './puzzleSession';\nexport * from './puzzleState';\n\nexport { Converters };\n"]}
@@ -23,7 +23,8 @@
23
23
  * SOFTWARE.
24
24
  */
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.loadJsonPuzzlesFileSync = exports.puzzlesFile = void 0;
26
+ exports.puzzlesFile = void 0;
27
+ exports.loadJsonPuzzlesFileSync = loadJsonPuzzlesFileSync;
27
28
  const ts_utils_1 = require("@fgv/ts-utils");
28
29
  const ts_json_base_1 = require("@fgv/ts-json-base");
29
30
  const common_1 = require("../common");
@@ -45,5 +46,4 @@ exports.puzzlesFile = ts_utils_1.Converters.strictObject({
45
46
  function loadJsonPuzzlesFileSync(path) {
46
47
  return ts_json_base_1.JsonFile.convertJsonFileSync(path, exports.puzzlesFile);
47
48
  }
48
- exports.loadJsonPuzzlesFileSync = loadJsonPuzzlesFileSync;
49
49
  //# sourceMappingURL=converters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/packlets/file/converters.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,4CAA8D;AAG9D,oDAA6C;AAC7C,sCAA2D;AAE3D;;;GAGG;AACU,QAAA,WAAW,GAA4B,qBAAU,CAAC,YAAY,CAAe;IACxF,OAAO,EAAE,qBAAU,CAAC,OAAO,CAAC,mBAAgB,CAAC,iBAAiB,CAAC;CAChE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAC,IAAY;IAClD,OAAO,uBAAQ,CAAC,mBAAmB,CAAC,IAAI,EAAE,mBAAW,CAAC,CAAC;AACzD,CAAC;AAFD,0DAEC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, Result } from '@fgv/ts-utils';\nimport { IPuzzlesFile } from './model';\n\nimport { JsonFile } from '@fgv/ts-json-base';\nimport { Converters as CommonConverters } from '../common';\n\n/**\n * Converts an arbitrary object to a {@link File.Model.IPuzzlesFile | IPuzzlesFile}.\n * @public\n */\nexport const puzzlesFile: Converter<IPuzzlesFile> = Converters.strictObject<IPuzzlesFile>({\n puzzles: Converters.arrayOf(CommonConverters.puzzleDescription)\n});\n\n/**\n * Loads an arbitrary JSON file and parses it to return a validated\n * {@link File.Model.IPuzzlesFile | IPuzzlesFile}.\n * @param path - String path to the file\n * @returns `Success` with the resulting file, or `Failure` with details if an\n * error occurs.\n * @public\n */\nexport function loadJsonPuzzlesFileSync(path: string): Result<IPuzzlesFile> {\n return JsonFile.convertJsonFileSync(path, puzzlesFile);\n}\n"]}
1
+ {"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/packlets/file/converters.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAwBH,0DAEC;AAxBD,4CAA8D;AAG9D,oDAA6C;AAC7C,sCAA2D;AAE3D;;;GAGG;AACU,QAAA,WAAW,GAA4B,qBAAU,CAAC,YAAY,CAAe;IACxF,OAAO,EAAE,qBAAU,CAAC,OAAO,CAAC,mBAAgB,CAAC,iBAAiB,CAAC;CAChE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAC,IAAY;IAClD,OAAO,uBAAQ,CAAC,mBAAmB,CAAC,IAAI,EAAE,mBAAW,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, Result } from '@fgv/ts-utils';\nimport { IPuzzlesFile } from './model';\n\nimport { JsonFile } from '@fgv/ts-json-base';\nimport { Converters as CommonConverters } from '../common';\n\n/**\n * Converts an arbitrary object to a {@link File.Model.IPuzzlesFile | IPuzzlesFile}.\n * @public\n */\nexport const puzzlesFile: Converter<IPuzzlesFile> = Converters.strictObject<IPuzzlesFile>({\n puzzles: Converters.arrayOf(CommonConverters.puzzleDescription)\n});\n\n/**\n * Loads an arbitrary JSON file and parses it to return a validated\n * {@link File.Model.IPuzzlesFile | IPuzzlesFile}.\n * @param path - String path to the file\n * @returns `Success` with the resulting file, or `Failure` with details if an\n * error occurs.\n * @public\n */\nexport function loadJsonPuzzlesFileSync(path: string): Result<IPuzzlesFile> {\n return JsonFile.convertJsonFileSync(path, puzzlesFile);\n}\n"]}
@@ -38,13 +38,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
38
38
  }) : function(o, v) {
39
39
  o["default"] = v;
40
40
  });
41
- var __importStar = (this && this.__importStar) || function (mod) {
42
- if (mod && mod.__esModule) return mod;
43
- var result = {};
44
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
45
- __setModuleDefault(result, mod);
46
- return result;
47
- };
41
+ var __importStar = (this && this.__importStar) || (function () {
42
+ var ownKeys = function(o) {
43
+ ownKeys = Object.getOwnPropertyNames || function (o) {
44
+ var ar = [];
45
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
46
+ return ar;
47
+ };
48
+ return ownKeys(o);
49
+ };
50
+ return function (mod) {
51
+ if (mod && mod.__esModule) return mod;
52
+ var result = {};
53
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
54
+ __setModuleDefault(result, mod);
55
+ return result;
56
+ };
57
+ })();
48
58
  Object.defineProperty(exports, "__esModule", { value: true });
49
59
  exports.Model = exports.Converters = void 0;
50
60
  const Converters = __importStar(require("./converters"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/file/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AAGlC,gCAAU;AAFnB,+CAAiC;AAEZ,sBAAK","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Converters from './converters';\nimport * as Model from './model';\n\nexport { Converters, Model };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/file/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AAGlC,gCAAU;AAFnB,+CAAiC;AAEZ,sBAAK","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Converters from './converters';\nimport * as Model from './model';\n\nexport { Converters, Model };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fgv/ts-sudoku-lib",
3
- "version": "4.0.2",
3
+ "version": "4.2.0",
4
4
  "description": "Sudoku rules library",
5
5
  "main": "lib/index.js",
6
6
  "types": "dist/ts-json.d.ts",
@@ -16,45 +16,44 @@
16
16
  "homepage": "https://github.com/ErikFortune/fgv/libraries/ts-sudoku-lib#readme",
17
17
  "sideEffects": false,
18
18
  "devDependencies": {
19
- "@fgv/ts-utils": "4.0.2",
20
- "@fgv/ts-utils-jest": "4.0.2",
21
- "@microsoft/api-documenter": "^7.24.5",
22
- "@microsoft/api-extractor": "^7.43.4",
23
- "@types/jest": "^29.5.12",
24
- "@types/node": "^20.12.11",
25
- "@typescript-eslint/eslint-plugin": "^7.9.0",
26
- "@typescript-eslint/parser": "^7.9.0",
19
+ "@fgv/ts-utils": "4.2.0",
20
+ "@fgv/ts-utils-jest": "4.2.0",
21
+ "@microsoft/api-documenter": "^7.26.5",
22
+ "@microsoft/api-extractor": "^7.49.1",
23
+ "@types/jest": "^29.5.14",
24
+ "@types/node": "^20.14.9",
25
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
26
+ "@typescript-eslint/parser": "^7.14.1",
27
27
  "cspell": "^8.3.2",
28
28
  "eslint": "^8.57.0",
29
29
  "eslint-config-prettier": "^9.1.0",
30
- "eslint-config-standard": "^17.1.0",
31
30
  "eslint-plugin-header": "^3.1.1",
32
- "eslint-plugin-import": "^2.29.1",
31
+ "eslint-plugin-import": "^2.31.0",
33
32
  "eslint-plugin-node": "^11.1.0",
34
- "eslint-plugin-prettier": "^5.1.3",
35
- "eslint-plugin-promise": "^6.1.1",
33
+ "eslint-plugin-prettier": "^5.2.1",
34
+ "eslint-plugin-promise": "^6.2.0",
36
35
  "jest": "^29.7.0",
37
- "prettier": "^3.2.5",
36
+ "prettier": "^3.4.2",
38
37
  "rimraf": "^5.0.7",
39
- "ts-jest": "^29.1.2",
38
+ "ts-jest": "^29.2.5",
40
39
  "ts-node": "^10.9.2",
41
- "typescript": "^5.4.5",
40
+ "typescript": "^5.7.3",
42
41
  "eslint-plugin-n": "^16.6.2",
43
- "@rushstack/heft": "~0.66.6",
44
- "@rushstack/heft-node-rig": "~2.6.3",
42
+ "@rushstack/heft": "~0.68.13",
43
+ "@rushstack/heft-node-rig": "~2.6.49",
45
44
  "@types/heft-jest": "1.0.6",
46
- "@rushstack/eslint-config": "~3.6.9",
47
- "@rushstack/heft-jest-plugin": "~0.11.27",
48
- "eslint-plugin-tsdoc": "~0.2.17",
49
- "@fgv/ts-json-base": "4.0.2"
45
+ "@rushstack/eslint-config": "~3.7.0",
46
+ "@rushstack/heft-jest-plugin": "~0.14.3",
47
+ "eslint-plugin-tsdoc": "~0.4.0",
48
+ "@fgv/ts-json-base": "4.2.0"
50
49
  },
51
50
  "peerDependencies": {
52
- "@fgv/ts-utils": "4.0.2"
51
+ "@fgv/ts-utils": "4.2.0"
53
52
  },
54
53
  "scripts": {
55
54
  "build": "heft test --clean",
56
55
  "clean": "heft clean",
57
- "test": "heft test",
56
+ "test": "heft test --clean",
58
57
  "build-docs": "api-documenter markdown --input-folder ./temp --output-folder docs",
59
58
  "build-all": "rushx build; rushx build-docs",
60
59
  "test-handles": "jest --runInBand --detectOpenHandles",