Code Monkey home page Code Monkey logo

proto's Introduction

proto

ES5-compatible object manipulation library for node and modern browsers

Build Status npm version Code Climate Test Coverage

Documentation: http://milojs.github.io/proto/

Why not use underscore or lo-dash

  1. They do NOT use properties that are non-enumerable when they extend/clone/etc.
  2. They DO use enumerable properties from prototypes when they extend/clone/etc.
  3. When they clone, they create instances of Object rather than of the same class as cloned object.
  4. They implement many methods that are already implemented natively.
  5. They don't implement methods for inheritance and extention of prototypes.
  6. They create confusion when you read code as you can't clearly differentiate between arrays and objects (maps), e.g. when each function is used.
  7. Underscore has clumbersome chaining syntax, chaining in proto is more succinct.

Install

npm install mol-proto --save

To use and develop:

git clone [email protected]:milojs/proto.git
cd proto
npm link
cd ../<your project>
npm link mol-proto

Use

Node/browserify:

var _ = require('mol-proto');

Browser:

All functions are exported as properties of a global _ object when used with milo, there is no separate proto bundle yet (will be added shortly).

Functions

proto's People

Contributors

jasoniangreen avatar epoberezkin avatar richard-walton avatar greenkeeperio-bot avatar webreflection avatar sithmel avatar

Stargazers

 avatar oyjing avatar Łukasz Marek Sielski avatar Nikos avatar timelyportfolio avatar  avatar howzus avatar Felipe Klein Zigmundo avatar  avatar  avatar

Watchers

Craig Coffman avatar Peter Galiba avatar sbharti avatar timelyportfolio avatar James Cloos avatar Diego Manilla Suárez avatar Janice Taylor avatar  avatar Julia Hayward avatar Carlos Serrano avatar  avatar Dalibor Novak avatar Kevin Chetty avatar Garazi avatar  avatar Neil Finlayson avatar  avatar Gabor Raski avatar Leonard Wu avatar Paulo Bravo avatar  avatar  avatar Felipe Klein Zigmundo avatar Mail Online Teamcity avatar  avatar amit.patel avatar  avatar Samuel Spettigue avatar  avatar manju avatar Thomas Gurung avatar John Ballantyne avatar  avatar  avatar  avatar Noah Szubski avatar Oleg Vishnepolsky avatar

proto's Issues

[DepShield] (CVSS 8.8) Vulnerability due to usage of growl:1.9.2

Vulnerabilities

DepShield reports that this application's usage of growl:1.9.2 results in the following vulnerability(s):


Occurrences

growl:1.9.2 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ growl:1.9.2

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

Unsafe use of eval

In lib/proto_function.js (as compiled in the published npm module), the following use of eval is dangerous:

function makeFunction(arg1, arg2, funcBody) {
    var name = this, count = arguments.length - 1, funcBody = arguments[count], func, code = '';
    for (var i = 0; i < count; i++)
        code += ', ' + arguments[i];
    code = [
        'func = function ',
        name,
        '(',
        code.slice(2),
        ') {\n',
        funcBody,
        '\n}'
    ].join('');
    eval(code);
    return func;
}

As opposed to new Function(), your code do not validate the arguments. Please validate the argument names and the function name by using some regular expression or some more heavy-weighted sanitization like:
https://www.npmjs.com/package/eval-sanitizer

A similar case is createSubclass method in lib/proto_prototype.js.

[DepShield] (CVSS 7.5) Vulnerability due to usage of acorn:5.7.4

Vulnerabilities

DepShield reports that this application's usage of acorn:5.7.4 results in the following vulnerability(s):


Occurrences

acorn:5.7.4 is a transitive dependency introduced by the following direct dependency(s):

browserify:14.5.0
        └─ module-deps:4.1.1
              └─ detective:4.7.1
                    └─ acorn:5.7.4

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.5) Vulnerability due to usage of debug:2.6.8

Vulnerabilities

DepShield reports that this application's usage of debug:2.6.8 results in the following vulnerability(s):


Occurrences

debug:2.6.8 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ debug:2.6.8

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.isarray:3.0.4

Vulnerabilities

DepShield reports that this application's usage of lodash.isarray:3.0.4 results in the following vulnerability(s):


Occurrences

lodash.isarray:3.0.4 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2
                          └─ lodash.isarray:3.0.4

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._baseassign:3.2.0

Vulnerabilities

DepShield reports that this application's usage of lodash._baseassign:3.2.0 results in the following vulnerability(s):


Occurrences

lodash._baseassign:3.2.0 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.isarguments:3.1.0

Vulnerabilities

DepShield reports that this application's usage of lodash.isarguments:3.1.0 results in the following vulnerability(s):


Occurrences

lodash.isarguments:3.1.0 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2
                          └─ lodash.isarguments:3.1.0

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.5) Vulnerability due to usage of debug:2.6.9

Vulnerabilities

DepShield reports that this application's usage of debug:2.6.9 results in the following vulnerability(s):


Occurrences

debug:2.6.9 is a transitive dependency introduced by the following direct dependency(s):

grunt-browserify:5.3.0
        └─ watchify:3.11.1
              └─ anymatch:2.0.0
                    └─ micromatch:3.1.10
                          └─ extglob:2.0.4
                                └─ expand-brackets:2.1.4
                                      └─ debug:2.6.9
                          └─ snapdragon:0.8.2
                                └─ debug:2.6.9

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._basecreate:3.0.3

Vulnerabilities

DepShield reports that this application's usage of lodash._basecreate:3.0.3 results in the following vulnerability(s):


Occurrences

lodash._basecreate:3.0.3 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._basecreate:3.0.3

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.create:3.1.1

Vulnerabilities

DepShield reports that this application's usage of lodash.create:3.1.1 results in the following vulnerability(s):


Occurrences

lodash.create:3.1.1 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.keys:3.1.2

Vulnerabilities

DepShield reports that this application's usage of lodash.keys:3.1.2 results in the following vulnerability(s):


Occurrences

lodash.keys:3.1.2 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._getnative:3.9.1

Vulnerabilities

DepShield reports that this application's usage of lodash._getnative:3.9.1 results in the following vulnerability(s):


Occurrences

lodash._getnative:3.9.1 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2
                          └─ lodash._getnative:3.9.1

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 5.3) Vulnerability due to usage of kind-of:4.0.0

Vulnerabilities

DepShield reports that this application's usage of kind-of:4.0.0 results in the following vulnerability(s):


Occurrences

kind-of:4.0.0 is a transitive dependency introduced by the following direct dependency(s):

grunt-browserify:5.3.0
        └─ watchify:3.11.1
              └─ anymatch:2.0.0
                    └─ micromatch:3.1.10
                          └─ snapdragon:0.8.2
                                └─ base:0.11.2
                                      └─ cache-base:1.0.1
                                            └─ has-value:1.0.0
                                                  └─ has-values:1.0.0
                                                        └─ kind-of:4.0.0

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._basecopy:3.0.1

Vulnerabilities

DepShield reports that this application's usage of lodash._basecopy:3.0.1 results in the following vulnerability(s):


Occurrences

lodash._basecopy:3.0.1 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash._basecopy:3.0.1

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._isiterateecall:3.0.9

Vulnerabilities

DepShield reports that this application's usage of lodash._isiterateecall:3.0.9 results in the following vulnerability(s):


Occurrences

lodash._isiterateecall:3.0.9 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._isiterateecall:3.0.9

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.memoize:3.0.4

Vulnerabilities

DepShield reports that this application's usage of lodash.memoize:3.0.4 results in the following vulnerability(s):


Occurrences

lodash.memoize:3.0.4 is a transitive dependency introduced by the following direct dependency(s):

browserify:14.5.0
        └─ browser-pack:6.1.0
              └─ combine-source-map:0.8.0
                    └─ lodash.memoize:3.0.4

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 5.3) Vulnerability due to usage of kind-of:3.2.2

Vulnerabilities

DepShield reports that this application's usage of kind-of:3.2.2 results in the following vulnerability(s):


Occurrences

kind-of:3.2.2 is a transitive dependency introduced by the following direct dependency(s):

grunt-browserify:5.3.0
        └─ watchify:3.11.1
              └─ anymatch:2.0.0
                    └─ micromatch:3.1.10
                          └─ snapdragon:0.8.2
                                └─ base:0.11.2
                                      └─ cache-base:1.0.1
                                            └─ to-object-path:0.3.0
                                                  └─ kind-of:3.2.2
                                      └─ class-utils:0.3.6
                                            └─ static-extend:0.1.2
                                                  └─ object-copy:0.1.0
                                                        └─ kind-of:3.2.2
                                └─ define-property:0.2.5
                                      └─ is-descriptor:0.1.6
                                            └─ is-accessor-descriptor:0.1.6
                                                  └─ kind-of:3.2.2
                                            └─ is-data-descriptor:0.1.4
                                                  └─ kind-of:3.2.2
              └─ chokidar:2.1.8
                    └─ braces:2.3.2
                          └─ fill-range:4.0.0
                                └─ is-number:3.0.0
                                      └─ kind-of:3.2.2
                          └─ snapdragon-node:2.1.1
                                └─ snapdragon-util:3.0.1
                                      └─ kind-of:3.2.2

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.5) Vulnerability due to usage of mocha:3.5.3

Vulnerabilities

DepShield reports that this application's usage of mocha:3.5.3 results in the following vulnerability(s):

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 5.3) Vulnerability due to usage of kind-of:5.1.0

Vulnerabilities

DepShield reports that this application's usage of kind-of:5.1.0 results in the following vulnerability(s):


Occurrences

kind-of:5.1.0 is a transitive dependency introduced by the following direct dependency(s):

grunt-browserify:5.3.0
        └─ watchify:3.11.1
              └─ anymatch:2.0.0
                    └─ micromatch:3.1.10
                          └─ snapdragon:0.8.2
                                └─ define-property:0.2.5
                                      └─ is-descriptor:0.1.6
                                            └─ kind-of:5.1.0

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 8.8) Vulnerability due to usage of minimist:0.0.8

Vulnerabilities

DepShield reports that this application's usage of minimist:0.0.8 results in the following vulnerability(s):


Occurrences

minimist:0.0.8 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ mkdirp:0.5.1
              └─ minimist:0.0.8

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.