\s
Any whitespace character\v
Vertical whitespace\h
Horizontal whitespacex
Ignore whitespace (end line)
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
declare module "react-native-radial-gradient" { | |
import * as ReactNative from "react-native"; | |
import * as React from "react"; | |
type Props = ReactNative.ViewPropTypes & { | |
style?: ReactNative.StyleProp<ReactNative.ViewStyle>; | |
colors: string[]; | |
stops: number[]; | |
center: number[]; | |
radius: number; |
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 { ObjectId } from "mongoose"; | |
export type AttributesWithObjectId<Attr> = { | |
_id: ObjectId | |
} & Attr |
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
String.prototype.valueIsBool = function() { | |
return /^\s*(true|1)\s*$/i.test(this); | |
}; |
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
function generate_number(){ | |
return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); | |
} |
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
module.exports = async function sleep(time){ | |
return new Promise(function (resolve) { | |
setTimeout(resolve, time); | |
}) | |
} |
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
export default function preg_match(regex: RegExp, str: string) { | |
return regex.test(str); | |
} |
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 array = ["Lenivene", "World", "Bezerra", "Hello", "Lenivene"]; | |
array.reduce((unique, item) => { | |
return unique.includes(item) ? unique : [...unique, item] | |
}, []); |
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
if (location.protocol != "https:") { | |
location.href = "https:" +=window.location.href.substring(window.location.protocol.length); | |
} |
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
console.log("Hello World"): |