1.0.9 • Published 9 years ago

ultimate-prototype v1.0.9

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

UltimatePrototype

Provides werful tools to work with prototypes

Usage:

const Prototype = require( 'ultimate-prototype' );

/* ------------ Tools ------------- */

// Executes handler on each obj prototype
// Prototype.each( {obj:Object}, {handler:Function} )

// Goes through all object and its prototypes properties and replaces needed descriptors defined by name in propDescriptors
// Prototype.setup( {obj:Object}, {defaultDescriptor:Object|undefined}, {propDescriptors:Object} ) => {Object}

// Adds all prototypes to object
// Prototype.add( {obj:Object}, {prototypes:Object|Array} ) => {Object}

// Returns last non null prototype in obj ( using filter if defined )
// Prototype.last( {obj:Object}, {filter:Function|undefined} ) => {Object}

// Clones obj without prototypes defined in prototypes
// Prototype.diff( {obj:Object}, {prototypes:Object|Array}, {setLastToNull:Boolean} ) => {Object|null}

// Extends target with all object's properties and prototypes
// Prototype.extend( {asProxy:Boolean|undefined}, {target:Object}[, {obj1:Object}, ...] ) => {Object}

// Extends target only with object's own properties
// Prototype.extendLite( {asProxy:Boolean|undefined}, {target:Object}[, {obj1:Object}, ...] ) => {Object}

// Tells if object is prototype of at least one of objects
// Prototype.isPrototypeOf( {proto:Object}, {objects:Object|Array} ) => {Boolean}
1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago