0.0.9 • Published 9 years ago

esbases v0.0.9

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
9 years ago

Build Status NPM

esbases

Collection of base classes for use with Babel projects. esbases provides base classes for common native types such as Error and Number. These native types, which, when extended directly, will lead to unwanted side effects and even dysfunctional subclasses such as

  • subclasses of error cannot have properties or methods, or,
  • Number#getValueOf is not generic.

So, if you ever ran into these problems, then esbases is definitely for you.

Releases

See the changelog for more information.

Project Site

The project site, see (2) under resources below, provides more insight into the project, including test coverage reports and API documentation.

Contributing

You are very welcome to propose changes and report bugs, or even provide pull requests on github.

See the contributing guidelines for more information.

Contributors

See contributors for more information.

Building

See build process and the available build targets for more information on how to build this.

See also development dependencies and on how to deal with them.

Installation

npm --save esbases

Runtime Dependencies

The dependencies denoted in italics must be provided by the using project.

Usage

class EsError

import EsError from 'esbases/error';


class MyError extends EsError
{
    constructor(message, cause, data)
    {
        super(message, cause);

        this._data = data;
    }

    get data()
    {
        return this._data;
    }
}

class EsNumber

import EsNumber from 'esbases/number';

const num1 = ESNumber.parseFloat('0.005');
// -> EsNumber('0.005')

const num2 = ESNumber.parseInt('5');
// -> EsNumber('5')

Similar Projects

babel-plugin-transform-builtin-extend

This new plugin allows you to extend arbitrary native types. While there is nothing wrong with such an approach, I strongly believe that some native types should be left as they are, such as Array, String, or RegExp and so on.

See https://github.com/loganfsmyth/babel-plugin-transform-builtin-extend.

Resources

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago