This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PropTypes from 'prop-types' | |
/** | |
* Require at least one of provided props | |
* | |
* @example | |
* | |
* const requireOneOfProps = requireOneOf({ | |
* entity: PropTypes.string, | |
* entities: PropTypes.arrayOf(PropTypes.string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const capitalize = text => text.replace(/^\w/, c => c.toUpperCase()) | |
/** | |
* Convert delimiter based string like hyphen-case to | |
* pascalCase string | |
* | |
* @param {*} text | |
* @param {string} [delimiter='-'] delimiter regex, for / you need to pass \/ | |
* @returns {string} pascal cased string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const clearHtml = (data) => { | |
let html = data | |
html = html.replace(/<style([\s\S]*?)<\/style>/gi, ''); | |
html = html.replace(/<script([\s\S]*?)<\/script>/gi, ''); | |
html = html.replace(/<\/div>/ig, '\n'); | |
html = html.replace(/<\/li>/ig, '\n'); | |
html = html.replace(/<li>/ig, ' * '); | |
html = html.replace(/<\/ul>/ig, '\n'); | |
html = html.replace(/<\/p>/ig, '\n'); | |
html = html.replace(/<br\s*[\/]?>/gi, "\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('isomorphic-unfetch') | |
const { performance } = require('perf_hooks') | |
//Replace char function | |
function setCharAt(str,index,chr) { | |
if(index > str.length-1) return str; | |
return str.substr(0,index) + chr + str.substr(index+1); | |
} | |
//Check if they are the same |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple polyfill to support retry of fetch requests | |
*/ | |
;(() => { | |
global.fetchOriginal = global.fetch | |
/** | |
* Create retry fetch with last request arguments | |
* | |
* @param {string} resource request URL or resource to fetch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const randomString = (length = 16) => { | |
let string = '' | |
for (let i = 0; i < length; i += 1) { | |
const random = (Math.random() * 16) | 0 // eslint-disable-line | |
string += random.toString(16) | |
} | |
return string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Logger } from 'core/helpers' | |
class DeepLinkService { | |
init(navigation) { | |
this.navigation = navigation | |
} | |
handleUrl = (event, navigation) => { | |
try { | |
if (!event?.url) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
dependencies: dependenciesNew, | |
devDependencies: devDependenciesNew | |
} = require('../cazmatrans.hr-native-0.59/package.json') | |
const { dependencies, devDependencies } = require('./package.json') | |
// const newDeps = Object.keys(devDependenciesNew) | |
// console.log(newDeps.filter(dep => !devDependencies[dep]).join(' ')) | |
const newDeps = Object.keys(dependenciesNew) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from 'react' | |
const noop = () => {} | |
export default ( | |
url, | |
options = {}, | |
complete = noop, | |
error = noop, | |
final = noop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import firebase from 'react-native-firebase' | |
const withRemoteConfig = (configValues = []) => Component => ( | |
class EnhancedComponent extends React.Component { | |
state = { | |
config: {} | |
} | |
componentDidMount = async () => { |
NewerOlder