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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
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
var Benchmark = require('benchmark'); | |
var request = require('request'); | |
var suite = new Benchmark.Suite; | |
// add tests | |
suite.add('Calling cow api', { | |
defer: true, | |
fn: function(deferred) { | |
request({ |
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
var typeOf = (function(Object, RegExp){ | |
// WTFPL License - http://en.wikipedia.org/wiki/WTFPL | |
// thanks to @jdalton and @ljharb | |
var toString = Object.prototype.toString, | |
cache = (Object.create || Object)(null); | |
return function typeOf(Unknown) { | |
var asString = typeof Unknown; | |
return asString == 'object' ? ( | |
Unknown === null ? 'null' : ( | |
cache[asString = toString.call(Unknown)] || ( |