@accelint/geo 0.3.0 → 0.4.1

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/catalog-info.yaml +1 -1
  3. package/dist/cartesian.d.ts +3 -1
  4. package/dist/cartesian.js +34 -5
  5. package/dist/cartesian.js.map +1 -1
  6. package/dist/coordinates/coordinate.d.ts +37 -25
  7. package/dist/coordinates/coordinate.js +71 -77
  8. package/dist/coordinates/coordinate.js.map +1 -1
  9. package/dist/coordinates/latlon/decimal-degrees/formatter.d.ts +16 -2
  10. package/dist/coordinates/latlon/decimal-degrees/formatter.js +17 -3
  11. package/dist/coordinates/latlon/decimal-degrees/formatter.js.map +1 -1
  12. package/dist/coordinates/latlon/decimal-degrees/parser.d.ts +17 -4
  13. package/dist/coordinates/latlon/decimal-degrees/parser.js +60 -62
  14. package/dist/coordinates/latlon/decimal-degrees/parser.js.map +1 -1
  15. package/dist/coordinates/latlon/decimal-degrees/system.d.ts +16 -5
  16. package/dist/coordinates/latlon/decimal-degrees/system.js +26 -14
  17. package/dist/coordinates/latlon/decimal-degrees/system.js.map +1 -1
  18. package/dist/coordinates/latlon/degrees-decimal-minutes/formatter.d.ts +16 -2
  19. package/dist/coordinates/latlon/degrees-decimal-minutes/formatter.js +19 -8
  20. package/dist/coordinates/latlon/degrees-decimal-minutes/formatter.js.map +1 -1
  21. package/dist/coordinates/latlon/degrees-decimal-minutes/parser.d.ts +17 -4
  22. package/dist/coordinates/latlon/degrees-decimal-minutes/parser.js +79 -71
  23. package/dist/coordinates/latlon/degrees-decimal-minutes/parser.js.map +1 -1
  24. package/dist/coordinates/latlon/degrees-decimal-minutes/system.d.ts +16 -5
  25. package/dist/coordinates/latlon/degrees-decimal-minutes/system.js +30 -19
  26. package/dist/coordinates/latlon/degrees-decimal-minutes/system.js.map +1 -1
  27. package/dist/coordinates/latlon/degrees-minutes-seconds/formatter.d.ts +16 -2
  28. package/dist/coordinates/latlon/degrees-minutes-seconds/formatter.js +21 -10
  29. package/dist/coordinates/latlon/degrees-minutes-seconds/formatter.js.map +1 -1
  30. package/dist/coordinates/latlon/degrees-minutes-seconds/parser.d.ts +17 -4
  31. package/dist/coordinates/latlon/degrees-minutes-seconds/parser.js +81 -70
  32. package/dist/coordinates/latlon/degrees-minutes-seconds/parser.js.map +1 -1
  33. package/dist/coordinates/latlon/degrees-minutes-seconds/system.d.ts +16 -5
  34. package/dist/coordinates/latlon/degrees-minutes-seconds/system.js +32 -21
  35. package/dist/coordinates/latlon/degrees-minutes-seconds/system.js.map +1 -1
  36. package/dist/coordinates/latlon/internal/coordinate-system.d.ts +22 -9
  37. package/dist/coordinates/latlon/internal/coordinate-system.js +11 -2
  38. package/dist/coordinates/latlon/internal/create-cache.d.ts +17 -3
  39. package/dist/coordinates/latlon/internal/create-cache.js +27 -7
  40. package/dist/coordinates/latlon/internal/create-cache.js.map +1 -1
  41. package/dist/coordinates/latlon/internal/exhaustive-errors.d.ts +4 -2
  42. package/dist/coordinates/latlon/internal/exhaustive-errors.js +107 -62
  43. package/dist/coordinates/latlon/internal/exhaustive-errors.js.map +1 -1
  44. package/dist/coordinates/latlon/internal/format.d.ts +8 -6
  45. package/dist/coordinates/latlon/internal/format.js +24 -11
  46. package/dist/coordinates/latlon/internal/format.js.map +1 -1
  47. package/dist/coordinates/latlon/internal/in-range.d.ts +3 -1
  48. package/dist/coordinates/latlon/internal/in-range.js +22 -8
  49. package/dist/coordinates/latlon/internal/in-range.js.map +1 -1
  50. package/dist/coordinates/latlon/internal/index.d.ts +35 -33
  51. package/dist/coordinates/latlon/internal/index.js +64 -102
  52. package/dist/coordinates/latlon/internal/index.js.map +1 -1
  53. package/dist/coordinates/latlon/internal/lexer.d.ts +4 -2
  54. package/dist/coordinates/latlon/internal/lexer.js +54 -33
  55. package/dist/coordinates/latlon/internal/lexer.js.map +1 -1
  56. package/dist/coordinates/latlon/internal/ordinal.d.ts +3 -1
  57. package/dist/coordinates/latlon/internal/ordinal.js +17 -5
  58. package/dist/coordinates/latlon/internal/ordinal.js.map +1 -1
  59. package/dist/coordinates/latlon/internal/parse-format.d.ts +23 -10
  60. package/dist/coordinates/latlon/internal/parse-format.js +37 -54
  61. package/dist/coordinates/latlon/internal/parse-format.js.map +1 -1
  62. package/dist/coordinates/latlon/internal/parse.d.ts +18 -4
  63. package/dist/coordinates/latlon/internal/parse.js +55 -9
  64. package/dist/coordinates/latlon/internal/parse.js.map +1 -1
  65. package/dist/coordinates/latlon/internal/pipes/check-ambiguous.d.ts +17 -3
  66. package/dist/coordinates/latlon/internal/pipes/check-ambiguous.js +31 -16
  67. package/dist/coordinates/latlon/internal/pipes/check-ambiguous.js.map +1 -1
  68. package/dist/coordinates/latlon/internal/pipes/check-numbers.d.ts +16 -2
  69. package/dist/coordinates/latlon/internal/pipes/check-numbers.js +30 -28
  70. package/dist/coordinates/latlon/internal/pipes/check-numbers.js.map +1 -1
  71. package/dist/coordinates/latlon/internal/pipes/fix-bearings.d.ts +18 -4
  72. package/dist/coordinates/latlon/internal/pipes/fix-bearings.js +66 -54
  73. package/dist/coordinates/latlon/internal/pipes/fix-bearings.js.map +1 -1
  74. package/dist/coordinates/latlon/internal/pipes/fix-dividers.d.ts +18 -4
  75. package/dist/coordinates/latlon/internal/pipes/fix-dividers.js +42 -25
  76. package/dist/coordinates/latlon/internal/pipes/fix-dividers.js.map +1 -1
  77. package/dist/coordinates/latlon/internal/pipes/genome.d.ts +16 -2
  78. package/dist/coordinates/latlon/internal/pipes/genome.js +46 -25
  79. package/dist/coordinates/latlon/internal/pipes/genome.js.map +1 -1
  80. package/dist/coordinates/latlon/internal/pipes/index.d.ts +18 -4
  81. package/dist/coordinates/latlon/internal/pipes/index.js +58 -35
  82. package/dist/coordinates/latlon/internal/pipes/index.js.map +1 -1
  83. package/dist/coordinates/latlon/internal/pipes/simpler.d.ts +16 -2
  84. package/dist/coordinates/latlon/internal/pipes/simpler.js +25 -1
  85. package/dist/coordinates/latlon/internal/pipes/simpler.js.map +1 -1
  86. package/dist/coordinates/latlon/internal/violation.d.ts +3 -1
  87. package/dist/coordinates/latlon/internal/violation.js +15 -1
  88. package/dist/coordinates/latlon/internal/violation.js.map +1 -1
  89. package/dist/coordinates/mgrs/parser.d.ts +16 -4
  90. package/dist/coordinates/mgrs/parser.js +32 -35
  91. package/dist/coordinates/mgrs/parser.js.map +1 -1
  92. package/dist/coordinates/mgrs/system.d.ts +16 -5
  93. package/dist/coordinates/mgrs/system.js +28 -18
  94. package/dist/coordinates/mgrs/system.js.map +1 -1
  95. package/dist/coordinates/utm/parser.d.ts +16 -4
  96. package/dist/coordinates/utm/parser.js +32 -29
  97. package/dist/coordinates/utm/parser.js.map +1 -1
  98. package/dist/coordinates/utm/system.d.ts +16 -5
  99. package/dist/coordinates/utm/system.js +29 -18
  100. package/dist/coordinates/utm/system.js.map +1 -1
  101. package/dist/index.d.ts +24 -15
  102. package/dist/index.js +26 -13
  103. package/dist/patterning.d.ts +3 -1
  104. package/dist/patterning.js +75 -11
  105. package/dist/patterning.js.map +1 -1
  106. package/package.json +49 -15
  107. package/dist/coordinates/latlon/internal/coordinate-system.js.map +0 -1
  108. package/dist/index.js.map +0 -1
  109. package/dist/metafile-esm.json +0 -1
@@ -1,8 +1,19 @@
1
- import { CoordinateSystem } from '../internal/coordinate-system.js';
2
- import '../internal/index.js';
3
- import '../internal/parse.js';
4
- import '../internal/lexer.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
5
12
 
6
- declare const systemDecimalDegrees: CoordinateSystem;
13
+ import { CoordinateSystem } from "../internal/coordinate-system.js";
7
14
 
15
+ //#region src/coordinates/latlon/decimal-degrees/system.d.ts
16
+ declare const systemDecimalDegrees: CoordinateSystem;
17
+ //#endregion
8
18
  export { systemDecimalDegrees };
19
+ //# sourceMappingURL=system.d.ts.map
@@ -1,20 +1,32 @@
1
- import { BEARINGS, SYMBOLS, SYMBOL_PATTERNS } from '../internal/index.js';
2
- import { parseDecimalDegrees } from './parser.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
3
12
 
13
+
14
+ import { BEARINGS, SYMBOLS, SYMBOL_PATTERNS } from "../internal/index.js";
15
+ import { parseDecimalDegrees } from "./parser.js";
16
+
17
+ //#region src/coordinates/latlon/decimal-degrees/system.ts
4
18
  const systemDecimalDegrees = {
5
- name: "Decimal Degrees",
6
- parse: parseDecimalDegrees,
7
- toFloat(arg) {
8
- const [num, bear] = arg;
9
- return Number.parseFloat(num) * (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1);
10
- },
11
- toFormat(format, [left, right]) {
12
- return [left, right].map(
13
- (num, index) => `${Math.abs(num)} ${BEARINGS[format][index][+(num < 0)]}`
14
- ).join(` ${SYMBOLS.DIVIDER} `);
15
- }
19
+ name: "Decimal Degrees",
20
+ parse: parseDecimalDegrees,
21
+ toFloat(arg) {
22
+ const [num, bear] = arg;
23
+ return Number.parseFloat(num) * (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1);
24
+ },
25
+ toFormat(format, [left, right]) {
26
+ return [left, right].map((num, index) => `${Math.abs(num)} ${BEARINGS[format][index][+(num < 0)]}`).join(` ${SYMBOLS.DIVIDER} `);
27
+ }
16
28
  };
17
29
 
30
+ //#endregion
18
31
  export { systemDecimalDegrees };
19
- //# sourceMappingURL=system.js.map
20
32
  //# sourceMappingURL=system.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/coordinates/latlon/decimal-degrees/system.ts"],"names":[],"mappings":";;;AAuBO,MAAM,oBAAA,GAAyC;AAAA,EACpD,IAAA,EAAM,iBAAA;AAAA,EAEN,KAAA,EAAO,mBAAA;AAAA,EAEP,QAAQ,GAAA,EAAK;AACX,IAAA,MAAM,CAAC,GAAA,EAAK,IAAI,CAAA,GAAI,GAAA;AAEpB,IAAA,OACE,MAAA,CAAO,WAAW,GAAG,CAAA,IACpB,gBAAgB,iBAAA,CAAkB,IAAA,CAAK,IAAI,CAAA,GAAI,EAAA,GAAK,CAAA,CAAA;AAAA,EAEzD,CAAA;AAAA,EAEA,QAAA,CAAS,MAAA,EAAgB,CAAC,IAAA,EAAM,KAAK,CAAA,EAAqB;AACxD,IAAA,OAAO,CAAC,IAAA,EAAM,KAAK,CAAA,CAChB,GAAA;AAAA,MACC,CAAC,GAAA,EAAK,KAAA,KACJ,CAAA,EAAG,IAAA,CAAK,IAAI,GAAG,CAAC,CAAA,CAAA,EAAI,QAAA,CAAS,MAAM,CAAA,CAAE,KAAc,EAAE,EAAE,GAAA,GAAM,EAAE,CAAC,CAAA;AAAA,KACpE,CACC,IAAA,CAAK,CAAA,CAAA,EAAI,OAAA,CAAQ,OAAO,CAAA,CAAA,CAAG,CAAA;AAAA,EAChC;AACF","file":"system.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n BEARINGS,\n type Compass,\n type Format,\n SYMBOL_PATTERNS,\n SYMBOLS,\n} from '../internal';\nimport { parseDecimalDegrees } from './parser';\nimport type { CoordinateSystem } from '../internal/coordinate-system';\n\nexport const systemDecimalDegrees: CoordinateSystem = {\n name: 'Decimal Degrees',\n\n parse: parseDecimalDegrees,\n\n toFloat(arg) {\n const [num, bear] = arg as [string, Compass];\n\n return (\n Number.parseFloat(num) *\n (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)\n );\n },\n\n toFormat(format: Format, [left, right]: [number, number]) {\n return [left, right]\n .map(\n (num, index) =>\n `${Math.abs(num)} ${BEARINGS[format][index as 0 | 1][+(num < 0)]}`,\n )\n .join(` ${SYMBOLS.DIVIDER} `);\n },\n};\n"]}
1
+ {"version":3,"file":"system.js","names":["systemDecimalDegrees: CoordinateSystem"],"sources":["../../../../src/coordinates/latlon/decimal-degrees/system.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n BEARINGS,\n type Compass,\n type Format,\n SYMBOL_PATTERNS,\n SYMBOLS,\n} from '../internal';\nimport { parseDecimalDegrees } from './parser';\nimport type { CoordinateSystem } from '../internal/coordinate-system';\n\nexport const systemDecimalDegrees: CoordinateSystem = {\n name: 'Decimal Degrees',\n\n parse: parseDecimalDegrees,\n\n toFloat(arg) {\n const [num, bear] = arg as [string, Compass];\n\n return (\n Number.parseFloat(num) *\n (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)\n );\n },\n\n toFormat(format: Format, [left, right]: [number, number]) {\n return [left, right]\n .map(\n (num, index) =>\n `${Math.abs(num)} ${BEARINGS[format][index as 0 | 1][+(num < 0)]}`,\n )\n .join(` ${SYMBOLS.DIVIDER} `);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,MAAaA,uBAAyC;CACpD,MAAM;CAEN,OAAO;CAEP,QAAQ,KAAK;EACX,MAAM,CAAC,KAAK,QAAQ;AAEpB,SACE,OAAO,WAAW,IAAI,IACrB,gBAAgB,kBAAkB,KAAK,KAAK,GAAG,KAAK;;CAIzD,SAAS,QAAgB,CAAC,MAAM,QAA0B;AACxD,SAAO,CAAC,MAAM,MAAM,CACjB,KACE,KAAK,UACJ,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,SAAS,QAAQ,OAAgB,EAAE,MAAM,MAChE,CACA,KAAK,IAAI,QAAQ,QAAQ,GAAG;;CAElC"}
@@ -1,5 +1,19 @@
1
- import { FormatOptions } from '../internal/format.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
2
12
 
3
- declare const formatDegreesDecimalMinutes: (coordinates: [number, number], config?: FormatOptions) => string;
13
+ import { FormatOptions } from "../internal/format.js";
4
14
 
15
+ //#region src/coordinates/latlon/degrees-decimal-minutes/formatter.d.ts
16
+ declare const formatDegreesDecimalMinutes: (coordinates: [number, number], config?: FormatOptions) => string;
17
+ //#endregion
5
18
  export { formatDegreesDecimalMinutes };
19
+ //# sourceMappingURL=formatter.d.ts.map
@@ -1,14 +1,25 @@
1
- import { createFormatter } from '../internal/format.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
2
12
 
13
+
14
+ import { createFormatter } from "../internal/format.js";
15
+
16
+ //#region src/coordinates/latlon/degrees-decimal-minutes/formatter.ts
3
17
  const toDegreesDecimalMinutes = (num) => {
4
- const degrees = Math.floor(Math.abs(num));
5
- const minutes = ((Math.abs(num) - degrees) * 60).toFixed(4);
6
- return `${degrees}\xB0 ${minutes}'`;
18
+ const degrees = Math.floor(Math.abs(num));
19
+ return `${degrees}° ${((Math.abs(num) - degrees) * 60).toFixed(4)}'`;
7
20
  };
8
- const formatDegreesDecimalMinutes = createFormatter(
9
- toDegreesDecimalMinutes
10
- );
21
+ const formatDegreesDecimalMinutes = createFormatter(toDegreesDecimalMinutes);
11
22
 
23
+ //#endregion
12
24
  export { formatDegreesDecimalMinutes };
13
- //# sourceMappingURL=formatter.js.map
14
25
  //# sourceMappingURL=formatter.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/coordinates/latlon/degrees-decimal-minutes/formatter.ts"],"names":[],"mappings":";;AAcA,MAAM,uBAAA,GAA0B,CAAC,GAAA,KAAwB;AACvD,EAAA,MAAM,UAAU,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,GAAA,CAAI,GAAG,CAAC,CAAA;AACxC,EAAA,MAAM,OAAA,GAAA,CAAA,CAAY,KAAK,GAAA,CAAI,GAAG,IAAI,OAAA,IAAW,EAAA,EAAI,QAAQ,CAAC,CAAA;AAE1D,EAAA,OAAO,CAAA,EAAG,OAAO,CAAA,KAAA,EAAK,OAAO,CAAA,CAAA,CAAA;AAC/B,CAAA;AAEO,MAAM,2BAAA,GAA8B,eAAA;AAAA,EACzC;AACF","file":"formatter.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { createFormatter } from '../internal/format';\n\nconst toDegreesDecimalMinutes = (num: number): string => {\n const degrees = Math.floor(Math.abs(num));\n const minutes = ((Math.abs(num) - degrees) * 60).toFixed(4);\n\n return `${degrees}° ${minutes}'`;\n};\n\nexport const formatDegreesDecimalMinutes = createFormatter(\n toDegreesDecimalMinutes,\n);\n"]}
1
+ {"version":3,"file":"formatter.js","names":[],"sources":["../../../../src/coordinates/latlon/degrees-decimal-minutes/formatter.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { createFormatter } from '../internal/format';\n\nconst toDegreesDecimalMinutes = (num: number): string => {\n const degrees = Math.floor(Math.abs(num));\n const minutes = ((Math.abs(num) - degrees) * 60).toFixed(4);\n\n return `${degrees}° ${minutes}'`;\n};\n\nexport const formatDegreesDecimalMinutes = createFormatter(\n toDegreesDecimalMinutes,\n);\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAM,2BAA2B,QAAwB;CACvD,MAAM,UAAU,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC;AAGzC,QAAO,GAAG,QAAQ,MAFA,KAAK,IAAI,IAAI,GAAG,WAAW,IAAI,QAAQ,EAAE,CAE7B;;AAGhC,MAAa,8BAA8B,gBACzC,wBACD"}
@@ -1,8 +1,21 @@
1
- import { Format } from '../internal/index.js';
2
- import { ParseResults } from '../internal/parse.js';
3
- import '../internal/lexer.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
4
12
 
13
+ import { Format } from "../internal/index.js";
14
+ import { ParseResults } from "../internal/parse.js";
15
+
16
+ //#region src/coordinates/latlon/degrees-decimal-minutes/parser.d.ts
5
17
  /** Parse a Degrees Decimal Minutes coordinate. */
6
18
  declare const parseDegreesDecimalMinutes: (format: Format, input: string) => ParseResults;
7
-
19
+ //#endregion
8
20
  export { parseDegreesDecimalMinutes };
21
+ //# sourceMappingURL=parser.d.ts.map
@@ -1,85 +1,93 @@
1
- import * as Patterning from './../../../patterning.js';
2
- import { PARTIAL_PATTERNS, SYMBOLS, SYMBOL_PATTERNS, BEARINGS, LIMITS } from '../internal/index.js';
3
- import { inRange } from '../internal/in-range.js';
4
- import { createParser } from '../internal/parse-format.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
5
12
 
13
+
14
+ import { fromTemplate } from "../../../patterning.js";
15
+ import { BEARINGS, LIMITS, PARTIAL_PATTERNS, SYMBOLS, SYMBOL_PATTERNS } from "../internal/index.js";
16
+ import { createParser } from "../internal/parse-format.js";
17
+ import { inRange } from "../internal/in-range.js";
18
+
19
+ //#region src/coordinates/latlon/degrees-decimal-minutes/parser.ts
6
20
  const checks = {
7
- deg: (deg, limit) => {
8
- if (Number.parseFloat(deg) > limit) {
9
- return `Degrees value (${deg}) exceeds max value (${limit}).`;
10
- }
11
- if (/\./.test(deg)) {
12
- return `Degrees value (${deg}) must not include decimal value.`;
13
- }
14
- },
15
- min: (min) => inRange("Minutes", min, 59.999999999),
16
- sec: (val) => {
17
- if (val.includes(SYMBOLS.SECONDS)) {
18
- return `Seconds indicator (${SYMBOLS.SECONDS}) not valid in Degree Decimal Minutes.`;
19
- }
20
- }
21
+ deg: (deg, limit) => {
22
+ if (Number.parseFloat(deg) > limit) return `Degrees value (${deg}) exceeds max value (${limit}).`;
23
+ if (/\./.test(deg)) return `Degrees value (${deg}) must not include decimal value.`;
24
+ },
25
+ min: (min) => inRange("Minutes", min, 59.999999999),
26
+ sec: (val) => {
27
+ if (val.includes(SYMBOLS.SECONDS)) return `Seconds indicator (${SYMBOLS.SECONDS}) not valid in Degree Decimal Minutes.`;
28
+ }
21
29
  };
22
30
  const formats = {
23
- LATLON: Patterning.fromTemplate(
24
- PARTIAL_PATTERNS,
25
- `degLat minDec NS ${SYMBOLS.DIVIDER} degLon minDec EW`
26
- ),
27
- LONLAT: Patterning.fromTemplate(
28
- PARTIAL_PATTERNS,
29
- `degLon minDec EW ${SYMBOLS.DIVIDER} degLat minDec NS`
30
- )
31
+ LATLON: fromTemplate(PARTIAL_PATTERNS, `degLat minDec NS ${SYMBOLS.DIVIDER} degLon minDec EW`),
32
+ LONLAT: fromTemplate(PARTIAL_PATTERNS, `degLon minDec EW ${SYMBOLS.DIVIDER} degLat minDec NS`)
31
33
  };
32
34
  function identifyErrors(format) {
33
- return (arg, i) => {
34
- if (!arg) {
35
- return [[], ["Invalid coordinate value."]];
36
- }
37
- let { bear, deg, min } = arg;
38
- deg ??= "0";
39
- min ??= "0";
40
- let isNegative = SYMBOL_PATTERNS.NEGATIVE_SIGN.test(deg) ? 1 : 0;
41
- const bearingOptions = BEARINGS[format][i];
42
- if (!bear || isNegative) {
43
- bear = bearingOptions[isNegative];
44
- deg = Math.abs(Number.parseFloat(deg)).toString();
45
- isNegative = 0;
46
- }
47
- const errors = [
48
- ...[checks.deg(deg, LIMITS[format][i] ?? 0)],
49
- ...[checks.min(min)],
50
- ...[checks.sec([bear, deg, min].join(""))]
51
- ].filter(Boolean);
52
- return errors.length ? [[], errors] : [[deg, min, bear], []];
53
- };
35
+ return (arg, i) => {
36
+ if (!arg) return [[], ["Invalid coordinate value."]];
37
+ let { bear, deg, min } = arg;
38
+ deg ??= "0";
39
+ min ??= "0";
40
+ let isNegative = SYMBOL_PATTERNS.NEGATIVE_SIGN.test(deg) ? 1 : 0;
41
+ const bearingOptions = BEARINGS[format][i];
42
+ if (!bear || isNegative) {
43
+ bear = bearingOptions[isNegative];
44
+ deg = Math.abs(Number.parseFloat(deg)).toString();
45
+ isNegative = 0;
46
+ }
47
+ const errors = [
48
+ ...[checks.deg(deg, LIMITS[format][i] ?? 0)],
49
+ ...[checks.min(min)],
50
+ ...[checks.sec([
51
+ bear,
52
+ deg,
53
+ min
54
+ ].join(""))]
55
+ ].filter(Boolean);
56
+ return errors.length ? [[], errors] : [[
57
+ deg,
58
+ min,
59
+ bear
60
+ ], []];
61
+ };
54
62
  }
55
63
  function identifyPieces(half) {
56
- if (half.length < 1 || half.length > 3) {
57
- return;
58
- }
59
- const asString = half.join(" ");
60
- const places = { bear: "", deg: "", min: "" };
61
- const keys = ["deg", "min"];
62
- const test = (r, b, v) => r.test(v) || r.test(asString) && b;
63
- return half.reduce((acc, token, i, { length }) => {
64
- if (test(SYMBOL_PATTERNS.NSEW, i === length - 1, token)) {
65
- acc.bear ||= token;
66
- } else if (test(SYMBOL_PATTERNS.DEGREES, i === 0, token)) {
67
- acc.deg ||= token;
68
- } else if (test(SYMBOL_PATTERNS.MINUTES, i === 1, token)) {
69
- acc.min ||= token;
70
- } else {
71
- const key = keys.find((k) => !acc[k]);
72
- acc[key] = token;
73
- }
74
- return acc;
75
- }, places);
64
+ if (half.length < 1 || half.length > 3) return;
65
+ const asString = half.join(" ");
66
+ const places = {
67
+ bear: "",
68
+ deg: "",
69
+ min: ""
70
+ };
71
+ const keys = ["deg", "min"];
72
+ const test = (r, b, v) => r.test(v) || r.test(asString) && b;
73
+ return half.reduce((acc, token, i, { length }) => {
74
+ if (test(SYMBOL_PATTERNS.NSEW, i === length - 1, token)) acc.bear ||= token;
75
+ else if (test(SYMBOL_PATTERNS.DEGREES, i === 0, token)) acc.deg ||= token;
76
+ else if (test(SYMBOL_PATTERNS.MINUTES, i === 1, token)) acc.min ||= token;
77
+ else {
78
+ const key = keys.find((k) => !acc[k]);
79
+ acc[key] = token;
80
+ }
81
+ return acc;
82
+ }, places);
76
83
  }
84
+ /** Parse a Degrees Decimal Minutes coordinate. */
77
85
  const parseDegreesDecimalMinutes = createParser({
78
- formats,
79
- identifyErrors,
80
- identifyPieces
86
+ formats,
87
+ identifyErrors,
88
+ identifyPieces
81
89
  });
82
90
 
91
+ //#endregion
83
92
  export { parseDegreesDecimalMinutes };
84
- //# sourceMappingURL=parser.js.map
85
93
  //# sourceMappingURL=parser.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/coordinates/latlon/degrees-decimal-minutes/parser.ts"],"names":[],"mappings":"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","file":"parser.js","sourcesContent":["/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport * as Patterning from '@/patterning';\nimport {\n BEARINGS,\n type Format,\n LIMITS,\n PARTIAL_PATTERNS,\n SYMBOL_PATTERNS,\n SYMBOLS,\n} from '../internal';\nimport { inRange } from '../internal/in-range';\nimport { createParser } from '../internal/parse-format';\nimport type { ParseResults } from '../internal/parse';\n\ntype DegreesDecimalMinutes = {\n bear: string;\n deg: string;\n min: string;\n};\n\nconst checks = {\n deg: (deg: string, limit: number) => {\n if (Number.parseFloat(deg) > limit) {\n return `Degrees value (${deg}) exceeds max value (${limit}).`;\n }\n\n if (/\\./.test(deg)) {\n return `Degrees value (${deg}) must not include decimal value.`;\n }\n },\n min: (min: string) => inRange('Minutes', min, 59.999999999),\n sec: (val: string) => {\n if (val.includes(SYMBOLS.SECONDS)) {\n return `Seconds indicator (${SYMBOLS.SECONDS}) not valid in Degree Decimal Minutes.`;\n }\n },\n};\n\nconst formats = {\n LATLON: Patterning.fromTemplate(\n PARTIAL_PATTERNS,\n `degLat minDec NS ${SYMBOLS.DIVIDER} degLon minDec EW`,\n ),\n LONLAT: Patterning.fromTemplate(\n PARTIAL_PATTERNS,\n `degLon minDec EW ${SYMBOLS.DIVIDER} degLat minDec NS`,\n ),\n};\n\nfunction identifyErrors(format: Format) {\n return (arg: DegreesDecimalMinutes | undefined, i: number) => {\n if (!arg) {\n return [[], ['Invalid coordinate value.']] as ParseResults;\n }\n\n let { bear, deg, min } = arg;\n\n deg ??= '0';\n min ??= '0';\n\n let isNegative: 0 | 1 = SYMBOL_PATTERNS.NEGATIVE_SIGN.test(deg) ? 1 : 0;\n const bearingOptions = BEARINGS[format][i] as [string, string];\n\n if (!bear || isNegative) {\n bear = bearingOptions[isNegative];\n deg = Math.abs(Number.parseFloat(deg)).toString();\n isNegative = 0;\n }\n\n const errors = [\n ...[checks.deg(deg, LIMITS[format][i] ?? 0)],\n ...[checks.min(min)],\n ...[checks.sec([bear, deg, min].join(''))],\n ].filter(Boolean);\n\n return (\n errors.length ? [[], errors] : [[deg, min, bear], []]\n ) as ParseResults;\n };\n}\n\nfunction identifyPieces(half: string[]) {\n if (half.length < 1 || half.length > 3) {\n return;\n }\n\n const asString = half.join(' ');\n const places = { bear: '', deg: '', min: '' };\n const keys = ['deg', 'min'] as (keyof typeof places)[];\n const test = (r: RegExp, b: boolean, v: string) =>\n r.test(v) || (r.test(asString) && b);\n\n return half.reduce((acc, token, i, { length }) => {\n if (test(SYMBOL_PATTERNS.NSEW, i === length - 1, token)) {\n acc.bear ||= token;\n } else if (test(SYMBOL_PATTERNS.DEGREES, i === 0, token)) {\n acc.deg ||= token;\n } else if (test(SYMBOL_PATTERNS.MINUTES, i === 1, token)) {\n acc.min ||= token;\n } else {\n const key = keys.find((k) => !acc[k]);\n\n acc[key as keyof typeof acc] = token;\n }\n\n return acc;\n }, places);\n}\n\n/** Parse a Degrees Decimal Minutes coordinate. */\nexport const parseDegreesDecimalMinutes = createParser<DegreesDecimalMinutes>({\n formats,\n identifyErrors,\n identifyPieces,\n});\n"]}
1
+ {"version":3,"file":"parser.js","names":["Patterning.fromTemplate","isNegative: 0 | 1"],"sources":["../../../../src/coordinates/latlon/degrees-decimal-minutes/parser.ts"],"sourcesContent":["/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport * as Patterning from '@/patterning';\nimport {\n BEARINGS,\n type Format,\n LIMITS,\n PARTIAL_PATTERNS,\n SYMBOL_PATTERNS,\n SYMBOLS,\n} from '../internal';\nimport { inRange } from '../internal/in-range';\nimport { createParser } from '../internal/parse-format';\nimport type { ParseResults } from '../internal/parse';\n\ntype DegreesDecimalMinutes = {\n bear: string;\n deg: string;\n min: string;\n};\n\nconst checks = {\n deg: (deg: string, limit: number) => {\n if (Number.parseFloat(deg) > limit) {\n return `Degrees value (${deg}) exceeds max value (${limit}).`;\n }\n\n if (/\\./.test(deg)) {\n return `Degrees value (${deg}) must not include decimal value.`;\n }\n },\n min: (min: string) => inRange('Minutes', min, 59.999999999),\n sec: (val: string) => {\n if (val.includes(SYMBOLS.SECONDS)) {\n return `Seconds indicator (${SYMBOLS.SECONDS}) not valid in Degree Decimal Minutes.`;\n }\n },\n};\n\nconst formats = {\n LATLON: Patterning.fromTemplate(\n PARTIAL_PATTERNS,\n `degLat minDec NS ${SYMBOLS.DIVIDER} degLon minDec EW`,\n ),\n LONLAT: Patterning.fromTemplate(\n PARTIAL_PATTERNS,\n `degLon minDec EW ${SYMBOLS.DIVIDER} degLat minDec NS`,\n ),\n};\n\nfunction identifyErrors(format: Format) {\n return (arg: DegreesDecimalMinutes | undefined, i: number) => {\n if (!arg) {\n return [[], ['Invalid coordinate value.']] as ParseResults;\n }\n\n let { bear, deg, min } = arg;\n\n deg ??= '0';\n min ??= '0';\n\n let isNegative: 0 | 1 = SYMBOL_PATTERNS.NEGATIVE_SIGN.test(deg) ? 1 : 0;\n const bearingOptions = BEARINGS[format][i] as [string, string];\n\n if (!bear || isNegative) {\n bear = bearingOptions[isNegative];\n deg = Math.abs(Number.parseFloat(deg)).toString();\n isNegative = 0;\n }\n\n const errors = [\n ...[checks.deg(deg, LIMITS[format][i] ?? 0)],\n ...[checks.min(min)],\n ...[checks.sec([bear, deg, min].join(''))],\n ].filter(Boolean);\n\n return (\n errors.length ? [[], errors] : [[deg, min, bear], []]\n ) as ParseResults;\n };\n}\n\nfunction identifyPieces(half: string[]) {\n if (half.length < 1 || half.length > 3) {\n return;\n }\n\n const asString = half.join(' ');\n const places = { bear: '', deg: '', min: '' };\n const keys = ['deg', 'min'] as (keyof typeof places)[];\n const test = (r: RegExp, b: boolean, v: string) =>\n r.test(v) || (r.test(asString) && b);\n\n return half.reduce((acc, token, i, { length }) => {\n if (test(SYMBOL_PATTERNS.NSEW, i === length - 1, token)) {\n acc.bear ||= token;\n } else if (test(SYMBOL_PATTERNS.DEGREES, i === 0, token)) {\n acc.deg ||= token;\n } else if (test(SYMBOL_PATTERNS.MINUTES, i === 1, token)) {\n acc.min ||= token;\n } else {\n const key = keys.find((k) => !acc[k]);\n\n acc[key as keyof typeof acc] = token;\n }\n\n return acc;\n }, places);\n}\n\n/** Parse a Degrees Decimal Minutes coordinate. */\nexport const parseDegreesDecimalMinutes = createParser<DegreesDecimalMinutes>({\n formats,\n identifyErrors,\n identifyPieces,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAS;CACb,MAAM,KAAa,UAAkB;AACnC,MAAI,OAAO,WAAW,IAAI,GAAG,MAC3B,QAAO,kBAAkB,IAAI,uBAAuB,MAAM;AAG5D,MAAI,KAAK,KAAK,IAAI,CAChB,QAAO,kBAAkB,IAAI;;CAGjC,MAAM,QAAgB,QAAQ,WAAW,KAAK,aAAa;CAC3D,MAAM,QAAgB;AACpB,MAAI,IAAI,SAAS,QAAQ,QAAQ,CAC/B,QAAO,sBAAsB,QAAQ,QAAQ;;CAGlD;AAED,MAAM,UAAU;CACd,QAAQA,aACN,kBACA,oBAAoB,QAAQ,QAAQ,mBACrC;CACD,QAAQA,aACN,kBACA,oBAAoB,QAAQ,QAAQ,mBACrC;CACF;AAED,SAAS,eAAe,QAAgB;AACtC,SAAQ,KAAwC,MAAc;AAC5D,MAAI,CAAC,IACH,QAAO,CAAC,EAAE,EAAE,CAAC,4BAA4B,CAAC;EAG5C,IAAI,EAAE,MAAM,KAAK,QAAQ;AAEzB,UAAQ;AACR,UAAQ;EAER,IAAIC,aAAoB,gBAAgB,cAAc,KAAK,IAAI,GAAG,IAAI;EACtE,MAAM,iBAAiB,SAAS,QAAQ;AAExC,MAAI,CAAC,QAAQ,YAAY;AACvB,UAAO,eAAe;AACtB,SAAM,KAAK,IAAI,OAAO,WAAW,IAAI,CAAC,CAAC,UAAU;AACjD,gBAAa;;EAGf,MAAM,SAAS;GACb,GAAG,CAAC,OAAO,IAAI,KAAK,OAAO,QAAQ,MAAM,EAAE,CAAC;GAC5C,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC;GACpB,GAAG,CAAC,OAAO,IAAI;IAAC;IAAM;IAAK;IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;GAC3C,CAAC,OAAO,QAAQ;AAEjB,SACE,OAAO,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,CAAC;GAAC;GAAK;GAAK;GAAK,EAAE,EAAE,CAAC;;;AAK3D,SAAS,eAAe,MAAgB;AACtC,KAAI,KAAK,SAAS,KAAK,KAAK,SAAS,EACnC;CAGF,MAAM,WAAW,KAAK,KAAK,IAAI;CAC/B,MAAM,SAAS;EAAE,MAAM;EAAI,KAAK;EAAI,KAAK;EAAI;CAC7C,MAAM,OAAO,CAAC,OAAO,MAAM;CAC3B,MAAM,QAAQ,GAAW,GAAY,MACnC,EAAE,KAAK,EAAE,IAAK,EAAE,KAAK,SAAS,IAAI;AAEpC,QAAO,KAAK,QAAQ,KAAK,OAAO,GAAG,EAAE,aAAa;AAChD,MAAI,KAAK,gBAAgB,MAAM,MAAM,SAAS,GAAG,MAAM,CACrD,KAAI,SAAS;WACJ,KAAK,gBAAgB,SAAS,MAAM,GAAG,MAAM,CACtD,KAAI,QAAQ;WACH,KAAK,gBAAgB,SAAS,MAAM,GAAG,MAAM,CACtD,KAAI,QAAQ;OACP;GACL,MAAM,MAAM,KAAK,MAAM,MAAM,CAAC,IAAI,GAAG;AAErC,OAAI,OAA2B;;AAGjC,SAAO;IACN,OAAO;;;AAIZ,MAAa,6BAA6B,aAAoC;CAC5E;CACA;CACA;CACD,CAAC"}
@@ -1,8 +1,19 @@
1
- import { CoordinateSystem } from '../internal/coordinate-system.js';
2
- import '../internal/index.js';
3
- import '../internal/parse.js';
4
- import '../internal/lexer.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
5
12
 
6
- declare const systemDegreesDecimalMinutes: CoordinateSystem;
13
+ import { CoordinateSystem } from "../internal/coordinate-system.js";
7
14
 
15
+ //#region src/coordinates/latlon/degrees-decimal-minutes/system.d.ts
16
+ declare const systemDegreesDecimalMinutes: CoordinateSystem;
17
+ //#endregion
8
18
  export { systemDegreesDecimalMinutes };
19
+ //# sourceMappingURL=system.d.ts.map
@@ -1,25 +1,36 @@
1
- import { BEARINGS, SYMBOLS, SYMBOL_PATTERNS } from '../internal/index.js';
2
- import { parseDegreesDecimalMinutes } from './parser.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
3
12
 
13
+
14
+ import { BEARINGS, SYMBOLS, SYMBOL_PATTERNS } from "../internal/index.js";
15
+ import { parseDegreesDecimalMinutes } from "./parser.js";
16
+
17
+ //#region src/coordinates/latlon/degrees-decimal-minutes/system.ts
4
18
  const systemDegreesDecimalMinutes = {
5
- name: "Degrees Decimal Minutes",
6
- parse: parseDegreesDecimalMinutes,
7
- toFloat(arg) {
8
- const [degrees, minutes, bear] = arg;
9
- return Number.parseFloat(
10
- ((Number.parseFloat(degrees) + Number.parseFloat(minutes) / 60) * (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)).toFixed(9)
11
- );
12
- },
13
- toFormat(format, [left, right]) {
14
- return [left, right].map((num, index) => {
15
- const abs = Math.abs(num);
16
- const deg = Math.floor(abs);
17
- const min = Number.parseFloat(((abs - deg) * 60).toFixed(9));
18
- return `${deg} ${min} ${BEARINGS[format][index][+(num < 0)]}`;
19
- }).join(` ${SYMBOLS.DIVIDER} `);
20
- }
19
+ name: "Degrees Decimal Minutes",
20
+ parse: parseDegreesDecimalMinutes,
21
+ toFloat(arg) {
22
+ const [degrees, minutes, bear] = arg;
23
+ return Number.parseFloat(((Number.parseFloat(degrees) + Number.parseFloat(minutes) / 60) * (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)).toFixed(9));
24
+ },
25
+ toFormat(format, [left, right]) {
26
+ return [left, right].map((num, index) => {
27
+ const abs = Math.abs(num);
28
+ const deg = Math.floor(abs);
29
+ return `${deg} ${Number.parseFloat(((abs - deg) * 60).toFixed(9))} ${BEARINGS[format][index][+(num < 0)]}`;
30
+ }).join(` ${SYMBOLS.DIVIDER} `);
31
+ }
21
32
  };
22
33
 
34
+ //#endregion
23
35
  export { systemDegreesDecimalMinutes };
24
- //# sourceMappingURL=system.js.map
25
36
  //# sourceMappingURL=system.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/coordinates/latlon/degrees-decimal-minutes/system.ts"],"names":[],"mappings":";;;AAuBO,MAAM,2BAAA,GAAgD;AAAA,EAC3D,IAAA,EAAM,yBAAA;AAAA,EAEN,KAAA,EAAO,0BAAA;AAAA,EAEP,QAAQ,GAAA,EAAK;AACX,IAAA,MAAM,CAAC,OAAA,EAAS,OAAA,EAAS,IAAI,CAAA,GAAI,GAAA;AAEjC,IAAA,OAAO,MAAA,CAAO,UAAA;AAAA,MAAA,CAAA,CAET,OAAO,UAAA,CAAW,OAAO,CAAA,GAAI,MAAA,CAAO,WAAW,OAAO,CAAA,GAAI,EAAA,KAC1D,eAAA,CAAgB,kBAAkB,IAAA,CAAK,IAAI,IAAI,EAAA,GAAK,CAAA,CAAA,EACrD,QAAQ,CAAC;AAAA,KACb;AAAA,EACF,CAAA;AAAA,EAEA,QAAA,CAAS,MAAA,EAAgB,CAAC,IAAA,EAAM,KAAK,CAAA,EAAqB;AACxD,IAAA,OAAO,CAAC,IAAA,EAAM,KAAK,EAChB,GAAA,CAAI,CAAC,KAAK,KAAA,KAAU;AACnB,MAAA,MAAM,GAAA,GAAM,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA;AACxB,MAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,MAAM,GAAA,GAAM,OAAO,UAAA,CAAA,CAAA,CAAa,GAAA,GAAM,OAAO,EAAA,EAAI,OAAA,CAAQ,CAAC,CAAC,CAAA;AAE3D,MAAA,OAAO,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA,EAAI,QAAA,CAAS,MAAM,CAAA,CAAE,KAAc,CAAA,CAAE,EAAE,GAAA,GAAM,EAAE,CAAC,CAAA,CAAA;AAAA,IACtE,CAAC,CAAA,CACA,IAAA,CAAK,CAAA,CAAA,EAAI,OAAA,CAAQ,OAAO,CAAA,CAAA,CAAG,CAAA;AAAA,EAChC;AACF","file":"system.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n BEARINGS,\n type Compass,\n type Format,\n SYMBOL_PATTERNS,\n SYMBOLS,\n} from '../internal';\nimport { parseDegreesDecimalMinutes } from './parser';\nimport type { CoordinateSystem } from '../internal/coordinate-system';\n\nexport const systemDegreesDecimalMinutes: CoordinateSystem = {\n name: 'Degrees Decimal Minutes',\n\n parse: parseDegreesDecimalMinutes,\n\n toFloat(arg) {\n const [degrees, minutes, bear] = arg as [string, string, Compass];\n\n return Number.parseFloat(\n (\n (Number.parseFloat(degrees) + Number.parseFloat(minutes) / 60) *\n (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)\n ).toFixed(9),\n );\n },\n\n toFormat(format: Format, [left, right]: [number, number]) {\n return [left, right]\n .map((num, index) => {\n const abs = Math.abs(num);\n const deg = Math.floor(abs);\n const min = Number.parseFloat(((abs - deg) * 60).toFixed(9));\n\n return `${deg} ${min} ${BEARINGS[format][index as 0 | 1][+(num < 0)]}`;\n })\n .join(` ${SYMBOLS.DIVIDER} `);\n },\n};\n"]}
1
+ {"version":3,"file":"system.js","names":["systemDegreesDecimalMinutes: CoordinateSystem"],"sources":["../../../../src/coordinates/latlon/degrees-decimal-minutes/system.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n BEARINGS,\n type Compass,\n type Format,\n SYMBOL_PATTERNS,\n SYMBOLS,\n} from '../internal';\nimport { parseDegreesDecimalMinutes } from './parser';\nimport type { CoordinateSystem } from '../internal/coordinate-system';\n\nexport const systemDegreesDecimalMinutes: CoordinateSystem = {\n name: 'Degrees Decimal Minutes',\n\n parse: parseDegreesDecimalMinutes,\n\n toFloat(arg) {\n const [degrees, minutes, bear] = arg as [string, string, Compass];\n\n return Number.parseFloat(\n (\n (Number.parseFloat(degrees) + Number.parseFloat(minutes) / 60) *\n (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)\n ).toFixed(9),\n );\n },\n\n toFormat(format: Format, [left, right]: [number, number]) {\n return [left, right]\n .map((num, index) => {\n const abs = Math.abs(num);\n const deg = Math.floor(abs);\n const min = Number.parseFloat(((abs - deg) * 60).toFixed(9));\n\n return `${deg} ${min} ${BEARINGS[format][index as 0 | 1][+(num < 0)]}`;\n })\n .join(` ${SYMBOLS.DIVIDER} `);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,MAAaA,8BAAgD;CAC3D,MAAM;CAEN,OAAO;CAEP,QAAQ,KAAK;EACX,MAAM,CAAC,SAAS,SAAS,QAAQ;AAEjC,SAAO,OAAO,aAET,OAAO,WAAW,QAAQ,GAAG,OAAO,WAAW,QAAQ,GAAG,OAC1D,gBAAgB,kBAAkB,KAAK,KAAK,GAAG,KAAK,IACrD,QAAQ,EAAE,CACb;;CAGH,SAAS,QAAgB,CAAC,MAAM,QAA0B;AACxD,SAAO,CAAC,MAAM,MAAM,CACjB,KAAK,KAAK,UAAU;GACnB,MAAM,MAAM,KAAK,IAAI,IAAI;GACzB,MAAM,MAAM,KAAK,MAAM,IAAI;AAG3B,UAAO,GAAG,IAAI,GAFF,OAAO,aAAa,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC,CAEvC,GAAG,SAAS,QAAQ,OAAgB,EAAE,MAAM;IACjE,CACD,KAAK,IAAI,QAAQ,QAAQ,GAAG;;CAElC"}
@@ -1,5 +1,19 @@
1
- import { FormatOptions } from '../internal/format.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
2
12
 
3
- declare const formatDegreesMinutesSeconds: (coordinates: [number, number], config?: FormatOptions) => string;
13
+ import { FormatOptions } from "../internal/format.js";
4
14
 
15
+ //#region src/coordinates/latlon/degrees-minutes-seconds/formatter.d.ts
16
+ declare const formatDegreesMinutesSeconds: (coordinates: [number, number], config?: FormatOptions) => string;
17
+ //#endregion
5
18
  export { formatDegreesMinutesSeconds };
19
+ //# sourceMappingURL=formatter.d.ts.map
@@ -1,16 +1,27 @@
1
- import { createFormatter } from '../internal/format.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
2
12
 
13
+
14
+ import { createFormatter } from "../internal/format.js";
15
+
16
+ //#region src/coordinates/latlon/degrees-minutes-seconds/formatter.ts
3
17
  const toDegreesMinutesSeconds = (num) => {
4
- const degrees = Math.floor(Math.abs(num));
5
- const minutesFull = (Math.abs(num) - degrees) * 60;
6
- const minutes = Math.floor(minutesFull);
7
- const seconds = ((minutesFull - minutes) * 60).toFixed(2);
8
- return `${degrees}\xB0 ${minutes}' ${seconds}\u2033`;
18
+ const degrees = Math.floor(Math.abs(num));
19
+ const minutesFull = (Math.abs(num) - degrees) * 60;
20
+ const minutes = Math.floor(minutesFull);
21
+ return `${degrees}° ${minutes}' ${((minutesFull - minutes) * 60).toFixed(2)}″`;
9
22
  };
10
- const formatDegreesMinutesSeconds = createFormatter(
11
- toDegreesMinutesSeconds
12
- );
23
+ const formatDegreesMinutesSeconds = createFormatter(toDegreesMinutesSeconds);
13
24
 
25
+ //#endregion
14
26
  export { formatDegreesMinutesSeconds };
15
- //# sourceMappingURL=formatter.js.map
16
27
  //# sourceMappingURL=formatter.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/coordinates/latlon/degrees-minutes-seconds/formatter.ts"],"names":[],"mappings":";;AAcA,MAAM,uBAAA,GAA0B,CAAC,GAAA,KAAwB;AACvD,EAAA,MAAM,UAAU,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,GAAA,CAAI,GAAG,CAAC,CAAA;AACxC,EAAA,MAAM,WAAA,GAAA,CAAe,IAAA,CAAK,GAAA,CAAI,GAAG,IAAI,OAAA,IAAW,EAAA;AAChD,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,KAAA,CAAM,WAAW,CAAA;AACtC,EAAA,MAAM,OAAA,GAAA,CAAA,CAAY,WAAA,GAAc,OAAA,IAAW,EAAA,EAAI,QAAQ,CAAC,CAAA;AAExD,EAAA,OAAO,CAAA,EAAG,OAAO,CAAA,KAAA,EAAK,OAAO,KAAK,OAAO,CAAA,MAAA,CAAA;AAC3C,CAAA;AAEO,MAAM,2BAAA,GAA8B,eAAA;AAAA,EACzC;AACF","file":"formatter.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { createFormatter } from '../internal/format';\n\nconst toDegreesMinutesSeconds = (num: number): string => {\n const degrees = Math.floor(Math.abs(num));\n const minutesFull = (Math.abs(num) - degrees) * 60;\n const minutes = Math.floor(minutesFull);\n const seconds = ((minutesFull - minutes) * 60).toFixed(2);\n\n return `${degrees}° ${minutes}' ${seconds}″`;\n};\n\nexport const formatDegreesMinutesSeconds = createFormatter(\n toDegreesMinutesSeconds,\n);\n"]}
1
+ {"version":3,"file":"formatter.js","names":[],"sources":["../../../../src/coordinates/latlon/degrees-minutes-seconds/formatter.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { createFormatter } from '../internal/format';\n\nconst toDegreesMinutesSeconds = (num: number): string => {\n const degrees = Math.floor(Math.abs(num));\n const minutesFull = (Math.abs(num) - degrees) * 60;\n const minutes = Math.floor(minutesFull);\n const seconds = ((minutesFull - minutes) * 60).toFixed(2);\n\n return `${degrees}° ${minutes}' ${seconds}″`;\n};\n\nexport const formatDegreesMinutesSeconds = createFormatter(\n toDegreesMinutesSeconds,\n);\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAM,2BAA2B,QAAwB;CACvD,MAAM,UAAU,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC;CACzC,MAAM,eAAe,KAAK,IAAI,IAAI,GAAG,WAAW;CAChD,MAAM,UAAU,KAAK,MAAM,YAAY;AAGvC,QAAO,GAAG,QAAQ,IAAI,QAAQ,MAFZ,cAAc,WAAW,IAAI,QAAQ,EAAE,CAEf;;AAG5C,MAAa,8BAA8B,gBACzC,wBACD"}
@@ -1,8 +1,21 @@
1
- import { Format } from '../internal/index.js';
2
- import { ParseResults } from '../internal/parse.js';
3
- import '../internal/lexer.js';
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
4
12
 
13
+ import { Format } from "../internal/index.js";
14
+ import { ParseResults } from "../internal/parse.js";
15
+
16
+ //#region src/coordinates/latlon/degrees-minutes-seconds/parser.d.ts
5
17
  /** Parse a Degrees Minutes Seconds coordinate. */
6
18
  declare const parseDegreesMinutesSeconds: (format: Format, input: string) => ParseResults;
7
-
19
+ //#endregion
8
20
  export { parseDegreesMinutesSeconds };
21
+ //# sourceMappingURL=parser.d.ts.map