README
cf-pony
CloudFlare ponyfills
We are wrapping other modules so that we can deprecate them in the future with
console.warn
warnings. We can also swap out implementations easily.
Installation
$ npm install cf-pony
Usage
Array.isArray
Use the native method.
Array.isArray(arr);
Array.prototype.every
Use the native method.
arr.every(function() {
// ...
});
Array.prototype.filter
Use the native method.
arr.filter(function() {
// ...
});
Array.prototype.find
Use the native method.
arr.find(function() {
// ...
});
Array.prototype.forEach
Use the native method.
arr.forEach(function() {
// ...
});
=> Array.prototype.includescf.arrayIncludes
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.arrayIncludes(arr, 'item');
Array.prototype.map
Use the native method.
arr.map(function() {
// ...
});
Array.prototype.reduce
Use the native method.
arr.reduce(function() {
// ...
});
Array.prototype.some
Use the native method.
arr.some(function() {
// ...
});
=> Object.assigncf.objectAssign
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.objectAssign(obj, obj2);
Object.create
Use the native method.
Object.create(obj);
=> Object.iscf.objectIs
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.objectIs(obj, val);
Object.keys
Use the native method.
Object.keys(obj);
Object.prototype.hasOwnProperty
Use the native method.
obj.hasOwnProperty('prop');
=> String.prototype.endsWithcf.stringEndsWith
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.stringEndsWith(str, 'string');
=> String.prototype.includescf.stringIncludes
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.stringIncludes(str, 'string');
=> String.prototype.startsWithcf.stringStartsWith
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.stringStartsWith(str, 'string');
=> String.prototype.trimcf.stringTrim
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.stringTrim(str);
=> String.prototype.trimLeftcf.stringTrimLeft
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.stringTrimLeft(str);
=> String.prototype.trimRightcf.stringTrimRight
Use the ponyfill from this module.
var cf = require('cf-pony');
cf.stringTrimRight(str);