Giter VIP home page Giter VIP logo

toolkit's People

Contributors

archaeron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

toolkit's Issues

String.prototype Methods

From Ruby:
center, chars, chomp, concat, count, delete, dump, insert, reverse

From PHP:
ucfirst

From Me:
soundex, distance

Throw error if method already exists.

The difficultly with extending native methods is that other libraries can do the same thing. There should be a mechanism that warns the user if an existing method is being overwritten and then freeze the object if in a strict mode setting?

Debugging such conflicts is incredibly difficult for developers so I consider this relatively import.

Name functions

Just a little bit of sugar to make them fit in with the rest of the native functions.

Number.prototype methods

With inspiration from Ruby:

ceil() / floor()
round(precision)
lcm(_int) / gcd(_int)
isOdd() / isEven()
times() / upto() / downto()
chr()
next() / prev()

Toolkit 1.4.0 Doesnot work in Node

Here's the Node REPL Output

> require('toolkit')
{ version: '1.4.0' }
> Array.intersect([[2,3,4], [3,4,5]])
TypeError: Object function Array() { [native code] } has no method 'intersect'
    at [object Context]:1:7
    at Interface.<anonymous> (repl.js:171:22)
    at Interface.emit (events.js:64:17)
    at Interface._onLine (readline.js:153:10)
    at Interface._line (readline.js:408:8)
    at Interface._ttyWrite (readline.js:585:14)
    at ReadStream.<anonymous> (readline.js:73:12)
    at ReadStream.emit (events.js:81:20)
    at ReadStream._emitKey (tty_posix.js:307:10)
    at ReadStream.onData (tty_posix.js:70:12)
> 

Func.apply shortcut for utility methods

Often one will have an array of arrays they want to find an intersection with (for instance). At the moment they would have to take the first item out of the array and apply the function to the rest of the elements like:

arr.splice(1).intersect.apply(arr);

Which is difficult to read and if you don't want to mess up the original array you spill into two lines:

var first = arr[0];
first.intersect.apply(arr.slice(1));

I'm not happy with this so I propose adding some helper methods. Something like:

Array.intersect(arr);

Rename a few functions

Array.intersect => Array#intersect (if arguments.length == 0)
Array.diff => Array#diff (if arguments.length == 0)
Array.union => Array#union (if arguments.length == 0)

Object.walk

Like map - except applies the user function to the object instance without cloning.

i18n support.

Fairly important as I start delving into the depths of the Date.

Function.prototype Methods

From underscore.js:
bind, bindAll, memoize, delay, defer, throttle, debounce, once, after, wrap, compose

From Ruby:
new, equal

From Me:
tap

Question

Hi, I know this is a bold question, but figured it wouldn't hurt to try.

I have an idea for a library and toolkit is the perfect name for it, and I was wondering if you would consider adding me as an owner to the toolkit package on NPM.

Since NPM does not allow existing published versions of a package to be deleted or modified, anything that currently depends on toolkit will not be effected at all by any changes.

Thanks in advance for considering my request!

If you do decide to add me, you simply need to enter the following in the command line:

$ npm owner add jonschlinkert toolkit

Thanks!

Object.clone doesn't clone

Using Object.create() simply uses the parent object as the clone's prototype which is exactly the opposite of a clone.

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.