Skip to content

Commit

Permalink
space
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Nov 15, 2024
1 parent 154bab0 commit d318f9e
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/catch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function __getProperty(objectOrArray, key, nullish) {
}
}
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/catch2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function __getProperty(objectOrArray, key, nullish) {
}
}
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
6 changes: 3 additions & 3 deletions hogvm/__tests__/__snapshots__/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ function toUnixTimestamp (input, zone) { return __toUnixTimestamp(input, zone) }
function toTimeZone (input, zone) { return __toTimeZone(input, zone) }
function toString (value) { return __STLToString(value) }
function toInt(value) {
if (__isHogDateTime(value)) { return Math.floor(value.dt); }
if (__isHogDateTime(value)) { return Math.floor(value.dt); }
else if (__isHogDate(value)) { const date = new Date(Date.UTC(value.year, value.month - 1, value.day)); const epoch = new Date(Date.UTC(1970, 0, 1)); const diffInDays = Math.floor((date - epoch) / (1000 * 60 * 60 * 24)); return diffInDays; }
return !isNaN(parseInt(value)) ? parseInt(value) : null; }
function toFloat(value) {
if (__isHogDateTime(value)) { return value.dt; }
if (__isHogDateTime(value)) { return value.dt; }
else if (__isHogDate(value)) { const date = new Date(Date.UTC(value.year, value.month - 1, value.day)); const epoch = new Date(Date.UTC(1970, 0, 1)); const diffInDays = (date - epoch) / (1000 * 60 * 60 * 24); return diffInDays; }
return !isNaN(parseFloat(value)) ? parseFloat(value) : null; }
function toDateTime (input, zone) { return __toDateTime(input, zone) }
Expand Down Expand Up @@ -41,7 +41,7 @@ function __toHogDateTime(timestamp, zone) {
}
return { __hogDateTime__: true, dt: timestamp, zone: zone || 'UTC' }; }
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/dateFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function __formatDateTime(input, format, zone) {
return result;
}
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/exceptions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function print (...args) { console.log(...args.map(__printHogStringOutput)) }
function concat (...args) { return args.map((arg) => (arg === null ? '' : __STLToString(arg))).join('') }
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function jsonStringify (value, spacing) {
}
function jsonParse (str) {
function convert(x) {
if (Array.isArray(x)) { return x.map(convert) }
if (Array.isArray(x)) { return x.map(convert) }
else if (typeof x === 'object' && x !== null) {
if (x.__hogDateTime__) { return __toHogDateTime(x.dt, x.zone)
} else if (x.__hogDate__) { return __toHogDate(x.year, x.month, x.day)
Expand Down
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/lambdas.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function jsonStringify (value, spacing) {
}
function jsonParse (str) {
function convert(x) {
if (Array.isArray(x)) { return x.map(convert) }
if (Array.isArray(x)) { return x.map(convert) }
else if (typeof x === 'object' && x !== null) {
if (x.__hogDateTime__) { return __toHogDateTime(x.dt, x.zone)
} else if (x.__hogDate__) { return __toHogDate(x.year, x.month, x.day)
Expand Down
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/mandelbrot.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function print (...args) { console.log(...args.map(__printHogStringOutput)) }
function concat (...args) { return args.map((arg) => (arg === null ? '' : __STLToString(arg))).join('') }
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
6 changes: 3 additions & 3 deletions hogvm/__tests__/__snapshots__/operations.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function toUUID (value) { return __STLToString(value) }
function toString (value) { return __STLToString(value) }
function toInt(value) {
if (__isHogDateTime(value)) { return Math.floor(value.dt); }
if (__isHogDateTime(value)) { return Math.floor(value.dt); }
else if (__isHogDate(value)) { const date = new Date(Date.UTC(value.year, value.month - 1, value.day)); const epoch = new Date(Date.UTC(1970, 0, 1)); const diffInDays = Math.floor((date - epoch) / (1000 * 60 * 60 * 24)); return diffInDays; }
return !isNaN(parseInt(value)) ? parseInt(value) : null; }
function toFloat(value) {
if (__isHogDateTime(value)) { return value.dt; }
if (__isHogDateTime(value)) { return value.dt; }
else if (__isHogDate(value)) { const date = new Date(Date.UTC(value.year, value.month - 1, value.day)); const epoch = new Date(Date.UTC(1970, 0, 1)); const diffInDays = (date - epoch) / (1000 * 60 * 60 * 24); return diffInDays; }
return !isNaN(parseFloat(value)) ? parseFloat(value) : null; }
function print (...args) { console.log(...args.map(__printHogStringOutput)) }
Expand Down Expand Up @@ -53,7 +53,7 @@ function __like(str, pattern, caseInsensitive = false) {
return new RegExp(pattern).test(str)
}
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
4 changes: 2 additions & 2 deletions hogvm/__tests__/__snapshots__/printLoops.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function jsonStringify (value, spacing) {
}
function jsonParse (str) {
function convert(x) {
if (Array.isArray(x)) { return x.map(convert) }
if (Array.isArray(x)) { return x.map(convert) }
else if (typeof x === 'object' && x !== null) {
if (x.__hogDateTime__) { return __toHogDateTime(x.dt, x.zone)
} else if (x.__hogDate__) { return __toHogDate(x.year, x.month, x.day)
Expand Down Expand Up @@ -66,7 +66,7 @@ function __newHogError(type, message, payload) {
return error
}
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down
4 changes: 2 additions & 2 deletions hogvm/__tests__/__snapshots__/printLoops2.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function jsonStringify (value, spacing) {
}
function jsonParse (str) {
function convert(x) {
if (Array.isArray(x)) { return x.map(convert) }
if (Array.isArray(x)) { return x.map(convert) }
else if (typeof x === 'object' && x !== null) {
if (x.__hogDateTime__) { return __toHogDateTime(x.dt, x.zone)
} else if (x.__hogDate__) { return __toHogDate(x.year, x.month, x.day)
Expand Down Expand Up @@ -66,7 +66,7 @@ function __newHogError(type, message, payload) {
return error
}
function __STLToString(arg) {
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
if (arg && __isHogDate(arg)) { return `${arg.year}-${arg.month.toString().padStart(2, '0')}-${arg.day.toString().padStart(2, '0')}`; }
else if (arg && __isHogDateTime(arg)) { return __DateTimeToString(arg); }
return __printHogStringOutput(arg); }
function __printHogStringOutput(obj) { if (typeof obj === 'string') { return obj } return __printHogValue(obj) }
Expand Down

0 comments on commit d318f9e

Please sign in to comment.