@zukhruf/python 0.8.246 → 0.8.247
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/README.md +31 -16
- package/dist/dumps-json.d.ts +10 -0
- package/dist/dumps-json.d.ts.map +1 -0
- package/dist/dumps-json.js +104 -0
- package/dist/dumps-json.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @zukhruf/python
|
|
2
2
|
|
|
3
|
-
The results of CPython 3.12 in JavaScript, to the last bit: the `sum()` of floats, the `repr()` of a float, the order of two strings, `json.loads`, the white space of `str.isspace()`, and the word characters of `\w`. Use it when a TypeScript port must give the same numbers and text as a Python program, such as a benchmark's scorer.
|
|
3
|
+
The results of CPython 3.12 in JavaScript, to the last bit: the `sum()` of floats, the `repr()` of a float, the order of two strings, `json.loads`, `json.dumps`, the white space of `str.isspace()`, and the word characters of `\w`. Use it when a TypeScript port must give the same numbers and text as a Python program, such as a benchmark's scorer.
|
|
4
4
|
|
|
5
5
|
The package is public on npm. Until 2026-11-07 it was private and reached through a workspace path (ADR 0001); it became public with `@zukhruf/evals`, which depends on it (backlog #3888).
|
|
6
6
|
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
PYTHON_SPACE,
|
|
20
20
|
PYTHON_WORD,
|
|
21
21
|
compareStrings,
|
|
22
|
+
dumpsJson,
|
|
22
23
|
floatRepr,
|
|
23
24
|
loadsJson,
|
|
24
25
|
toJsonParseValue,
|
|
@@ -31,28 +32,31 @@ floatRepr(1e16); // '1e+16', as repr(1e16)
|
|
|
31
32
|
const value: JsonData = loadsJson('{"b": 1, "10": 2.0, "a": NaN}');
|
|
32
33
|
// Map { 'b' => 1n, '10' => 2, 'a' => NaN }
|
|
33
34
|
toJsonParseValue(value); // { '10': 2, b: 1, a: NaN }, for a validator
|
|
35
|
+
dumpsJson(value, { sortKeys: true }); // '{"10": 2.0, "a": NaN, "b": 1}', as json.dumps(value, sort_keys=True)
|
|
34
36
|
new RegExp(`[${PYTHON_SPACE}]+`, 'u'); // Python's \s
|
|
35
37
|
new RegExp(`[${PYTHON_WORD}]+`, 'u'); // Python's \w
|
|
36
38
|
```
|
|
37
39
|
|
|
38
|
-
| Export | CPython | What it keeps
|
|
39
|
-
| ------------------ | ---------------------------------------- |
|
|
40
|
-
| `NeumaierSum` | `sum()` of floats (Python/bltinmodule.c) | Neumaier's compensated sum. It starts at 0 and adds the compensation only when that is not 0 and is finite, so `[1e308, 1e308, -1e308]` gives `Infinity` and `[-0.0]` gives `0`. `add` and `value` give a running sum; `NeumaierSum.of(values)` sums an iterable. `NeumaierSum.mean(values)` is `sum(values) / len(values)`, and no value throws a `RangeError` (Python's `ZeroDivisionError`, ADR 0003).
|
|
41
|
-
| `compareStrings` | the order of two `str` | The order of the Unicode code points, as `sorted()` gives. JavaScript's `<` compares UTF-16 code units, so a character above U+FFFF sorts before U+E000 to U+FFFF there and after them in Python.
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
40
|
+
| Export | CPython | What it keeps |
|
|
41
|
+
| ------------------ | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `NeumaierSum` | `sum()` of floats (Python/bltinmodule.c) | Neumaier's compensated sum. It starts at 0 and adds the compensation only when that is not 0 and is finite, so `[1e308, 1e308, -1e308]` gives `Infinity` and `[-0.0]` gives `0`. `add` and `value` give a running sum; `NeumaierSum.of(values)` sums an iterable. `NeumaierSum.mean(values)` is `sum(values) / len(values)`, and no value throws a `RangeError` (Python's `ZeroDivisionError`, ADR 0003). |
|
|
43
|
+
| `compareStrings` | the order of two `str` | The order of the Unicode code points, as `sorted()` gives. JavaScript's `<` compares UTF-16 code units, so a character above U+FFFF sorts before U+E000 to U+FFFF there and after them in Python. |
|
|
44
|
+
| `dumpsJson` | `json.dumps` | The text of `json.dumps`. Each keyword argument is an option: `indent` is `indent`, `separators` is `separators`, `sort_keys` is `sortKeys`, `ensure_ascii` is `ensureAscii` and `allow_nan` is `allowNan`, with CPython's defaults. A dict keeps the order of its `Map`, or `sortKeys` sorts its keys by code point. A float is its `repr()`, and an int its digits. A NaN or an infinity with `allowNan: false`, or an int of more than 4300 digits, throws a `RangeError` (Python's `ValueError`). A fractional `indent`, or a list or dict that holds itself, throws a `TypeError` (ADR 0004). |
|
|
45
|
+
| `floatRepr` | `repr()` of a float | The shortest digits, fixed notation for exponents from -4 to 15, and always a fraction: `1.0`, `1e+16`, `1e-05`, `-0.0`, `nan`, `inf`. |
|
|
46
|
+
| `loadsJson` | `json.loads` | A dict is a `Map` in the order of its keys, and a repeated key keeps its first place and its last value. An int is a `bigint` and a float a `number`, so `1` and `1.0` stay apart. `NaN`, `Infinity` and `-Infinity` are numbers. Text that is not JSON throws a `SyntaxError` (Python's `JSONDecodeError`). An int of more than 4300 digits throws a `RangeError` (Python's `ValueError`). |
|
|
47
|
+
| `JsonData` | the values of `json.loads` | `null`, `boolean`, `bigint`, `number`, `string`, arrays and `Map`s of them. They are mutable, as in Python, so `Array.isArray` and `instanceof Map` narrow a value. |
|
|
48
|
+
| `PYTHON_SPACE` | `str.isspace()`, `\s`, `str.split()` | The body of a RegExp class. It has U+001C to U+001F, which JavaScript's `\s` lacks, and lacks U+FEFF, which JavaScript's `\s` has. |
|
|
49
|
+
| `PYTHON_WORD` | `\w` of a `str` pattern | The body of a RegExp class: letters, numbers and `_`. It equals CPython 3.12's `\w` for each character of Unicode 15.0. Node knows characters of later Unicode versions, which it reads as `\w` and Python 3.12 does not. |
|
|
50
|
+
| `toJsonParseValue` | none: the way out of `JsonData` | The value that `JSON.parse` gives for the same text, for code that reads only plain JavaScript, such as a JSON Schema validator. A dict becomes an object, so its integer-like keys move first. An int becomes the nearest `number`, so an int beyond 2^53 loses digits. The int `-0` gives `0`. Keep the `JsonData`, and convert only where such code reads it (ADR 0002). |
|
|
51
|
+
| `JsonParseValue` | none | The type of a value of `toJsonParseValue`: `null`, `boolean`, `number`, `string`, arrays and plain objects of them. |
|
|
49
52
|
|
|
50
53
|
## Errors
|
|
51
54
|
|
|
52
|
-
| Error | When
|
|
53
|
-
| ------------- |
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
55
|
+
| Error | When |
|
|
56
|
+
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
57
|
+
| `TypeError` | `dumpsJson` gets an `indent` that is not an integer, as `' ' * 2.5` raises a `TypeError`, or a list or a dict that holds itself (Python raises a `ValueError`; `JSON.stringify` throws a `TypeError`). |
|
|
58
|
+
| `SyntaxError` | `loadsJson` reads a text that is not JSON, as Python raises a `JSONDecodeError`. Comments and trailing commas are not JSON, and a `NaN`, `Infinity` or `-Infinity` key is not either. |
|
|
59
|
+
| `RangeError` | `loadsJson` reads or `dumpsJson` writes an int of more than 4300 digits, as Python raises a `ValueError` (`sys.int_info.default_max_str_digits`). `dumpsJson` gets a NaN or an infinity with `allowNan: false`, as Python raises a `ValueError`. `NeumaierSum.mean` gets no value, as Python raises a `ZeroDivisionError`. |
|
|
56
60
|
|
|
57
61
|
The golden test `src/cpython.golden.test.ts` proves each error against CPython 3.12.
|
|
58
62
|
|
|
@@ -61,6 +65,16 @@ The golden test `src/cpython.golden.test.ts` proves each error against CPython 3
|
|
|
61
65
|
```ts
|
|
62
66
|
function compareStrings(left: string, right: string): number;
|
|
63
67
|
|
|
68
|
+
interface DumpsOptions {
|
|
69
|
+
readonly indent?: number | string;
|
|
70
|
+
readonly separators?: readonly [item: string, key: string];
|
|
71
|
+
readonly sortKeys?: boolean;
|
|
72
|
+
readonly ensureAscii?: boolean;
|
|
73
|
+
readonly allowNan?: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function dumpsJson(value: JsonData, options?: DumpsOptions): string; // throws RangeError, TypeError
|
|
77
|
+
|
|
64
78
|
function floatRepr(value: number): string;
|
|
65
79
|
|
|
66
80
|
type JsonData =
|
|
@@ -106,3 +120,4 @@ function toJsonParseValue(value: JsonData): JsonParseValue;
|
|
|
106
120
|
- [ADR 0001: one home for the CPython rules that three places copied, reached through a workspace path](docs/adr/0001-one-home-for-the-cpython-rules-that-three-places-copied.md)
|
|
107
121
|
- [ADR 0002: JsonData has one way out, and code takes it only at an edge](docs/adr/0002-json-data-has-one-way-out-at-an-edge.md)
|
|
108
122
|
- [ADR 0003: the mean that a Python program writes as sum(values) / len(values) is NeumaierSum.mean](docs/adr/0003-the-mean-of-a-python-program-is-neumaier-sum-mean.md)
|
|
123
|
+
- [ADR 0004: json.dumps moves here at its fifth place, and its options are the keyword arguments of the caller](docs/adr/0004-json-dumps-moves-here-at-its-fifth-place.md)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JsonData } from './json-data.ts';
|
|
2
|
+
export interface DumpsOptions {
|
|
3
|
+
readonly indent?: number | string;
|
|
4
|
+
readonly separators?: readonly [item: string, key: string];
|
|
5
|
+
readonly sortKeys?: boolean;
|
|
6
|
+
readonly ensureAscii?: boolean;
|
|
7
|
+
readonly allowNan?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function dumpsJson(value: JsonData, options?: DumpsOptions): string;
|
|
10
|
+
//# sourceMappingURL=dumps-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dumps-json.d.ts","sourceRoot":"","sources":["../src/dumps-json.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AA8BD,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAgE7E"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { compareStrings } from './compare-strings.js';
|
|
2
|
+
import { floatRepr } from './float-repr.js';
|
|
3
|
+
// The escapes that json.dumps writes in short form (encoder.py:21-29); it
|
|
4
|
+
// writes any other escaped character as \u and four lowercase hex digits.
|
|
5
|
+
const SHORT = {
|
|
6
|
+
'\\': '\\\\',
|
|
7
|
+
'"': '\\"',
|
|
8
|
+
'\b': '\\b',
|
|
9
|
+
'\f': '\\f',
|
|
10
|
+
'\n': '\\n',
|
|
11
|
+
'\r': '\\r',
|
|
12
|
+
'\t': '\\t',
|
|
13
|
+
};
|
|
14
|
+
// With ensure_ascii, each UTF-16 code unit outside ' ' to '~' is escaped, so a
|
|
15
|
+
// character above U+FFFF is a surrogate pair and U+007F is escaped too
|
|
16
|
+
// (encoder.py:19, 49-68). Without it, only the control characters, the quote
|
|
17
|
+
// and the backslash are, and a lone surrogate stays as it is (encoder.py:18).
|
|
18
|
+
// A code unit below ' ' is one that is not from ' ' to U+FFFF.
|
|
19
|
+
const ASCII = /[^\x20-\x7e]|[\\"]/g;
|
|
20
|
+
const RAW = /[^\x20-\uffff]|[\\"]/g;
|
|
21
|
+
// json.dumps of CPython 3.12 (Lib/json/encoder.py and _json.c). A dict keeps
|
|
22
|
+
// the order of its Map, or sorts its keys by code point with sortKeys
|
|
23
|
+
// (encoder.py:353-354). A float is its repr(), and NaN, Infinity and -Infinity
|
|
24
|
+
// are tokens, or a RangeError without allowNan, as Python raises a ValueError
|
|
25
|
+
// (encoder.py:224-242). An int of more than 4300 digits throws a RangeError. A
|
|
26
|
+
// list or a dict that holds itself throws a TypeError; one that two places
|
|
27
|
+
// hold is written in each place, as Python removes its marker on the way out
|
|
28
|
+
// (encoder.py:282-286, 331-332).
|
|
29
|
+
export function dumpsJson(value, options = {}) {
|
|
30
|
+
const quote = (text) => `"${text.replaceAll(options.ensureAscii === false ? RAW : ASCII, escape)}"`;
|
|
31
|
+
const indent = indentOf(options.indent);
|
|
32
|
+
// Under indent the item separator is ',', so no line ends in a space
|
|
33
|
+
// (encoder.py:154-157).
|
|
34
|
+
const [itemSeparator, keySeparator] = options.separators ?? (indent === undefined ? [', ', ': '] : [',', ': ']);
|
|
35
|
+
// An empty list or dict is [] or {}; under indent each item is on its own
|
|
36
|
+
// line, one indent deeper than its container (encoder.py:288-292, 327-329).
|
|
37
|
+
const container = (open, parts, close, level) => {
|
|
38
|
+
if (parts.length === 0)
|
|
39
|
+
return open + close;
|
|
40
|
+
if (indent === undefined)
|
|
41
|
+
return open + parts.join(itemSeparator) + close;
|
|
42
|
+
const inner = `\n${indent.repeat(level + 1)}`;
|
|
43
|
+
return `${open}${inner}${parts.join(itemSeparator + inner)}\n${indent.repeat(level)}${close}`;
|
|
44
|
+
};
|
|
45
|
+
const float = (number) => {
|
|
46
|
+
if (Number.isFinite(number))
|
|
47
|
+
return floatRepr(number);
|
|
48
|
+
if (options.allowNan === false)
|
|
49
|
+
throw new RangeError(`Out of range float values are not JSON compliant: ${floatRepr(number)}`);
|
|
50
|
+
if (Number.isNaN(number))
|
|
51
|
+
return 'NaN';
|
|
52
|
+
return number > 0 ? 'Infinity' : '-Infinity';
|
|
53
|
+
};
|
|
54
|
+
const markers = new Set();
|
|
55
|
+
const write = (item, level) => {
|
|
56
|
+
if (item === null)
|
|
57
|
+
return 'null';
|
|
58
|
+
if (typeof item === 'boolean')
|
|
59
|
+
return String(item);
|
|
60
|
+
if (typeof item === 'bigint')
|
|
61
|
+
return int(item);
|
|
62
|
+
if (typeof item === 'number')
|
|
63
|
+
return float(item);
|
|
64
|
+
if (typeof item === 'string')
|
|
65
|
+
return quote(item);
|
|
66
|
+
if (markers.has(item))
|
|
67
|
+
throw new TypeError('Circular reference detected');
|
|
68
|
+
markers.add(item);
|
|
69
|
+
const text = Array.isArray(item) ? list(item, level) : dict(item, level);
|
|
70
|
+
markers.delete(item);
|
|
71
|
+
return text;
|
|
72
|
+
};
|
|
73
|
+
const list = (item, level) => container('[', item.map((member) => write(member, level + 1)), ']', level);
|
|
74
|
+
const dict = (item, level) => {
|
|
75
|
+
const members = options.sortKeys
|
|
76
|
+
? [...item].toSorted(([left], [right]) => compareStrings(left, right))
|
|
77
|
+
: [...item];
|
|
78
|
+
return container('{', members.map(([key, member]) => quote(key) + keySeparator + write(member, level + 1)), '}', level);
|
|
79
|
+
};
|
|
80
|
+
return write(value, 0);
|
|
81
|
+
}
|
|
82
|
+
function escape(char) {
|
|
83
|
+
return (SHORT[char] ?? `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
84
|
+
}
|
|
85
|
+
// Python indents with ' ' * indent (encoder.py:275-276): a negative int gives
|
|
86
|
+
// '', which still puts each item on its own line, and a float raises.
|
|
87
|
+
function indentOf(indent) {
|
|
88
|
+
if (typeof indent !== 'number')
|
|
89
|
+
return indent;
|
|
90
|
+
if (!Number.isInteger(indent))
|
|
91
|
+
throw new TypeError("can't multiply sequence by non-int of type 'float'");
|
|
92
|
+
return ' '.repeat(Math.max(indent, 0));
|
|
93
|
+
}
|
|
94
|
+
// Python 3.11 and later refuse to write an int of more than this many digits
|
|
95
|
+
// (sys.int_info.default_max_str_digits); the sign is not a digit.
|
|
96
|
+
const maxIntDigits = 4300;
|
|
97
|
+
// repr() of an int, as int.__repr__ that encoder.py calls (encoder.py:272).
|
|
98
|
+
function int(value) {
|
|
99
|
+
const digits = String(value);
|
|
100
|
+
if (digits.replace('-', '').length > maxIntDigits)
|
|
101
|
+
throw new RangeError(`Exceeds the limit (${maxIntDigits} digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit`);
|
|
102
|
+
return digits;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=dumps-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dumps-json.js","sourceRoot":"","sources":["../src/dumps-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAc5C,0EAA0E;AAC1E,0EAA0E;AAC1E,MAAM,KAAK,GAAqC;IAC9C,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;CACZ,CAAC;AAEF,+EAA+E;AAC/E,uEAAuE;AACvE,6EAA6E;AAC7E,8EAA8E;AAC9E,+DAA+D;AAC/D,MAAM,KAAK,GAAG,qBAAqB,CAAC;AACpC,MAAM,GAAG,GAAG,uBAAuB,CAAC;AAEpC,6EAA6E;AAC7E,sEAAsE;AACtE,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,2EAA2E;AAC3E,6EAA6E;AAC7E,iCAAiC;AACjC,MAAM,UAAU,SAAS,CAAC,KAAe,EAAE,OAAO,GAAiB,EAAE;IACnE,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAC7B,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC;IAC9E,MAAM,MAAM,GAAG,QA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AC5E,SAAS,GAAG,CAAC,KAAa;IACxB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,YAAY;QAC/C,MAAM,IAAI,UAAU,CAClB,sBAAsB,YAAY,gGAAgG,CACnI,CAAC;IACJ,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,KAAK,cAAc,EACnB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,KAAK,cAAc,EACnB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAEL,gBAAgB,GACjB,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAqB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAEL,gBAAgB,GACjB,MAAM,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/python",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "The results of CPython 3.12 in JavaScript: the compensated `sum()` of floats, the `repr()` of a float, `json.loads` with the order of keys and ints apart from floats, and the white space of `str.isspace()`.",
|
|
3
|
+
"version": "0.8.247",
|
|
4
|
+
"description": "The results of CPython 3.12 in JavaScript: the compensated `sum()` of floats, the `repr()` of a float, `json.loads` with the order of keys and ints apart from floats, `json.dumps` with its keyword arguments, and the white space of `str.isspace()`.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"jsonc-parser": "^3.3.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@zukhruf/parameterized-test": "^0.8.
|
|
43
|
+
"@zukhruf/parameterized-test": "^0.8.247"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|