fix: avoid newer JS syntax to support old Safari (#380)
This commit is contained in:
parent
497681f211
commit
77e6e35bd5
|
@ -78,7 +78,18 @@ const baseConfig = {
|
|||
const entryPoints = [
|
||||
{
|
||||
input: './src/picker/PickerElement.js',
|
||||
output: './picker.js'
|
||||
output: './picker.js',
|
||||
plugins: [
|
||||
// Replace newer syntax in Svelte v4 to avoid breaking iOS <13.4
|
||||
// https://github.com/nolanlawson/emoji-picker-element/pull/379
|
||||
replace({
|
||||
'array_like_or_iterator?.length': 'array_like_or_iterator && array_like_or_iterator.length',
|
||||
'$$ = undefined;': '', // not necessary to initialize class prop to undefined
|
||||
'$$set = undefined;': '', // not necessary to initialize class prop to undefined
|
||||
delimiters: ['', ''],
|
||||
preventAssignment: true
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
input: './src/database/Database.js',
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// this code is copied from svelte v4
|
||||
/* eslint-disable camelcase */
|
||||
export function ensure_array_like_shim (array_like_or_iterator) {
|
||||
return array_like_or_iterator?.length !== undefined
|
||||
return (array_like_or_iterator && array_like_or_iterator.length !== undefined)
|
||||
? array_like_or_iterator
|
||||
: Array.from(array_like_or_iterator)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue