mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-22 14:01:42 +03:00
fix: read yaml with intAsBigInt
This commit is contained in:
1 parent
e5d842571b
commit
0d4267e356
2 files changed
+2
-2
No files matched your search
@@ -30,7 +30,7 @@ function fromProperties(value: string) {
|
|||||||
}
|
}
|
||||||
function toProperties(value: string) {
|
function toProperties(value: string) {
|
||||||
try {
|
try {
|
||||||
return properties.stringify(flatten(yaml.parse(value)));
|
return properties.stringify(flatten(yaml.parse(value, { intAsBigInt: true })));
|
||||||
}
|
}
|
||||||
catch (e: any) {
|
catch (e: any) {
|
||||||
return e.toString();
|
return e.toString();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const nestify = ref(false);
|
|||||||
|
|
||||||
function transformer(value: string) {
|
function transformer(value: string) {
|
||||||
return withDefaultOnError(() => {
|
return withDefaultOnError(() => {
|
||||||
let obj = parseYaml(value, { merge: true });
|
let obj = parseYaml(value, { merge: true, intAsBigInt: true });
|
||||||
if (nestify.value) {
|
if (nestify.value) {
|
||||||
if (obj && Array.isArray(obj)) {
|
if (obj && Array.isArray(obj)) {
|
||||||
obj = (obj as any[]).map(o => nestifyObject(o));
|
obj = (obj as any[]).map(o => nestifyObject(o));
|
||||||
|
|||||||
Reference in new issue
Block a user