Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed webpack 4 builds breaking due to nullish coalescing operator #3679

Merged
merged 2 commits into from Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/alpinejs/src/directives/x-model.js
Expand Up @@ -134,7 +134,7 @@ function getInputValue(el, modifiers, event, currentValue) {
// Safari autofill triggers event as CustomEvent and assigns value to target
// so we return event.target.value instead of event.detail
if (event instanceof CustomEvent && event.detail !== undefined)
return event.detail ?? event.target.value
return event.detail !== null && event.detail !== undefined ? event.detail : event.target.value
else if (el.type === 'checkbox') {
// If the data we are binding to is an array, toggle its value inside the array.
if (Array.isArray(currentValue)) {
Expand Down
4 changes: 3 additions & 1 deletion packages/mask/src/index.js
Expand Up @@ -174,7 +174,9 @@ export function formatMoney(input, delimiter = '.', thousands, precision = 2) {
if (input === '-') return '-'
if (/^\D+$/.test(input)) return '9'

thousands = thousands ?? (delimiter === "," ? "." : ",")
if (thousands === null || thousands === undefined) {
thousands = delimiter === "," ? "." : ","
}

let addThousands = (input, thousands) => {
let output = ''
Expand Down