Skip to content

Instantly share code, notes, and snippets.

View baptisteArno's full-sized avatar

Baptiste Arnaud baptisteArno

View GitHub Profile
function cloneProps(props) {
const propKeys = Object.keys(props);
return propKeys.reduce((memo, k) => {
const prop = props[k];
memo[k] = Object.assign({}, prop);
if (isObject$4(prop.value) && !isFunction$3(prop.value) && !Array.isArray(prop.value)) memo[k].value = Object.assign({}, prop.value);
if (Array.isArray(prop.value)) memo[k].value = prop.value.slice(0);
return memo;
}, {});
}
@baptisteArno
baptisteArno / taxIdTypes.ts
Last active March 7, 2023 06:39
Tax ID types list
export const taxIdTypes = [
{
type: 'ae_trn',
code: 'AE TRN',
name: 'United Arab Emirates',
emoji: '🇦🇪',
placeholder: '123456789012345',
},
{
type: 'au_abn',
@baptisteArno
baptisteArno / stripe.ts
Created June 2, 2022 08:11
Function to check if currency is "zero-decimal" - Stripe
// https://stripe.com/docs/currencies#zero-decimal
const isZeroDecimalCurrency = (currency: string) =>
[
'BIF',
'CLP',
'DJF',
'GNF',
'JPY',
'KMF',
'KRW',