<commit_before>{
    "name": "superb-class",
    "description": "A superb way of creating classes. Focues on OOP stability.",
    "author": [{
        "name" : "<NAME>",
        "email" : "<EMAIL>"
    }],
    "version": "0.2.1",
    "dependencies": {
    },
    "devDependencies" : {
        "grunt" : "0.4.5",
        "grunt-mocha-test" : "0.12.7",
        "grunt-contrib-clean" : "0.6.0",
        "assert" : "1.3.0",
        "better-assert" : "1.0.2",
        "chai" : "2.1.1"
    },
    "keywords": [],
    "main": "./lib/superb-class.js",
    "bugs": {
        "url": "https://github.com/bmustiata/superb-class/issues"
    },
    "licenses": [
        {
            "type": "BSD",
            "url": "https://github.com/bmustiata/superb-class/blob/master/LICENSE"
        }
    ],
    "repository": {
        "type": "git",
        "url": "https://github.com/bmustiata/superb-class.git"
    },
    "readme": "# superb-class\nA superb way of doing JS classes.\n## About\nSuperb Class is a simple API that allows creating JS classes with ease\ndesigned for ES3/5 usage.\nIt's heavily tested, simple to use, and validates your\nclasses against simple programming errors.\n## Install\nIn order to install it you can just do:\n```sh\nnpm install superb-class\n```\n## Usage\nIn it's simplest form you can just:\n```\nvar createClass = require('superb-class').createClass;\nvar Dialog = createClass({\n    _title : null, \n    constructor : function(title) {\n        this._title = title;\n    },\n    show : function() {\n        console.log('Dialog.show(): ', this._title);\n    }\n});\nvar dialog = new Dialog('Dialog Title');\n```\nThe created class propagates the arguments to the constructor function\nas you might expect. The `this` variable is the variable that will be\nreturned and has already the instance updated to have the base class,\nmixins, and current prototypical items already written.\nA more advanced usage is:\n```javascript\nvar createClass = require('superb-class').createClass;\nvar Dialog = createClass({\n    _title : null, // declaring members adds them to checking\n    constructor : function(title) {\n        this._title = title;\n    },\n    show : function() {\n        console.log('Dialog.show(): ', this._title);\n    }\n});\nvar ModalDialog = createClass(Dialog, {\n    _modal : false,\n    constructor : function(modal, title) {\n        this._super.constructor.call(this, title);\n        this._modal = false;\n    },\n    show : function() {\n        console.log('ModalDialog.show(): ', this._modal, this._title);\n        this._super.show.apply(this, arguments);\n    }\n}, { // static functions\n    create : function(title) {\n        console.log('Static factory create()');\n        return new ModalDialog(true, title);\n    }\n});\nvar dialog = ModalDialog.create('dialog_title');\n// equivalent to: new ModalDialog(true, 'dialog_title');\nconsole.log('Is dialog instanceof ModalDialog: ', dialog instanceof ModalDialog);\nconsole.log('Is dialog instanceof Dialog: ', dialog instanceof Dialog);\ndialog.show();\n```\nThis will output:\n```text\nStatic factory create()\nIs dialog instanceof ModalDialog:  true\nIs dialog instanceof Dialog:  true\nModalDialog.show():  false dialog_title\nDialog.show():  dialog_title\n```\n## Full API\nStraight from the sources:\n```javascript\n/**\n * Create a class.\n * @param {string} name The string name of the class.\n * @param {function} superClass The superclass to inherit from. It will be\n *                          available as $super in the this instance, for\n *                          calls on the super class.\n * @param {Array<function>} mixins mixins definitions.\n * @param {Object} instanceProperties Instance properties that should be\n *          created. Properties that are prefixed with _ denode private\n *          properties, and creation of the class will fail if another\n *          property with the same name exists in the parent prototype.\n *          Properties prefixed with $ are protected properties.\n *          Shadowing is allowed only for public and protected members.\n *          The constructor() will be called if present with the arguments\n *          from the function itself.\n * @param {Object} staticProperties Static properties that will be defined\n *          on the returned class itself.\n * @type {function}\n */\nfunction createClass() { /* ... */ }\n```\n## Superb\n### \\_super Access\nThe \\_super private member is available on the this instance that points to\nthe prototype of the parent class. Thus calls to the base implementation\nof a specific method becomes easier, without holding manual references to\nthe base implementation.\n```javascript\nthis._super.show.apply(this, arguments);\n```\n### Private Members\nPrivate members are prefied with \\_.\nPrivate members can not be overwritten by mixins, nor by extending classes.\nIn case this is attempted createClass will throw an error. This is especially\ngood in large APIs where it becomes impossible to check if a private member\nwith a given name is already defined.\nSuperb Class will do that for you. Due to the prototypical nature of JavaScript\nprivate members are available in extending classes. Even if this is possible,\nit's strongly discouraged.\n```javascript\nvar createClass = require('superb-class').createClass;\nvar Base = createClass({\n    _show : function() {\n        console.log('Base.show()');\n    }\n});\nvar Extend = createClass(Base, {\n    // Fails with:\n    // Error: Private member _show is already defined.\n    _show : function() {\n        console.log('Extend.show()');\n    }\n});\n```\n### Protected Members\nProtected members are prefixed with $.\nProtected members can be overwritten by extending classes, but not by mixins.\nThe reason is most likely having abstract classes does make sense to be implemented\nin the extedning class, but the implementation in a mixin is most likely a bug.\nNote that mixins can still add both private _and_ protected members to the instance,\nthey just can't override items from the base class, nor can they conflict with the\nones from the existing prototype instance.\n",
    "readmeFilename": "README.md",
    "homepage": "http://blog.ciplogic.com"
}<commit_msg>Updated readme.<commit_after>{
    "name": "superb-class",
    "description": "A superb way of creating classes. Focues on OOP stability.",
    "author": [{
        "name" : "<NAME>",
        "email" : "<EMAIL>"
    }],
    "version": "0.2.2",
    "dependencies": {
    },
    "devDependencies" : {
        "grunt" : "0.4.5",
        "grunt-mocha-test" : "0.12.7",
        "grunt-contrib-clean" : "0.6.0",
        "assert" : "1.3.0",
        "better-assert" : "1.0.2",
        "chai" : "2.1.1"
    },
    "keywords": [],
    "main": "./lib/superb-class.js",
    "bugs": {
        "url": "https://github.com/bmustiata/superb-class/issues"
    },
    "licenses": [
        {
            "type": "BSD",
            "url": "https://github.com/bmustiata/superb-class/blob/master/LICENSE"
        }
    ],
    "repository": {
        "type": "git",
        "url": "https://github.com/bmustiata/superb-class.git"
    },
    "readme": "# superb-class\nA superb way of doing JS classes.\n## About\nSuperb Class is a simple API that allows creating JS classes with ease\ndesigned for ES3/5 usage.\nIt's heavily tested, simple to use, and validates your\nclasses against simple programming errors.\n## Install\nIn order to install it you can just do:\n```sh\nnpm install superb-class\n```\n## Usage\nIn it's simplest form you can just:\n```javascript\nvar createClass = require('superb-class').createClass;\nvar Dialog = createClass({\n    _title : null,\n    constructor : function(title) {\n        this._title = title;\n    },\n    show : function() {\n        console.log('Dialog.show(): ', this._title);\n    }\n});\nvar dialog = new Dialog('Dialog Title');\n```\nThe created class propagates the arguments to the constructor function\nas you might expect. The `this` variable is the variable that will be\nreturned and has already the instance updated to have the base class,\nmixins, and current prototypical items already written.\nA more advanced usage is:\n```javascript\nvar createClass = require('superb-class').createClass;\n// ==========================================================================\n// Dialog Class\n// ==========================================================================\nvar Dialog = createClass({\n    _title : null, // declaring members adds them to checking\n    constructor : function(title) {\n        this._title = title;\n    },\n    show : function() {\n        console.log('Dialog.show(): ', this._title);\n    }\n});\n// ==========================================================================\n// ModalDialog Class\n// ==========================================================================\nvar ModalDialog = createClass(Dialog, {\n    _modal : false,\n    constructor : function(modal, title) {\n        this._super.constructor.call(this, title);\n        this._modal = false;\n    },\n    show : function() {\n        console.log('ModalDialog.show(): ', this._modal, this._title);\n        this._super.show.apply(this, arguments);\n    }\n}, { // static functions\n    create : function(title) {\n        console.log('Static factory create()');\n        return new ModalDialog(true, title);\n    }\n});\n// ==========================================================================\n// Usage\n// ==========================================================================\nvar dialog = ModalDialog.create('dialog_title');\n// equivalent to: new ModalDialog(true, 'dialog_title');\nconsole.log('Is dialog instanceof ModalDialog: ', dialog instanceof ModalDialog);\nconsole.log('Is dialog instanceof Dialog: ', dialog instanceof Dialog);\ndialog.show();\n```\nThis will output:\n```text\nStatic factory create()\nIs dialog instanceof ModalDialog:  true\nIs dialog instanceof Dialog:  true\nModalDialog.show():  false dialog_title\nDialog.show():  dialog_title\n```\n## Full API\nStraight from the sources:\n```javascript\n/**\n * Create a class.\n * @param {string} name The string name of the class.\n * @param {function} superClass The superclass to inherit from. It will be\n *                          available as $super in the this instance, for\n *                          calls on the super class.\n * @param {Array<function>} mixins mixins definitions.\n * @param {Object} instanceProperties Instance properties that should be\n *          created. Properties that are prefixed with _ denode private\n *          properties, and creation of the class will fail if another\n *          property with the same name exists in the parent prototype.\n *          Properties prefixed with $ are protected properties.\n *          Shadowing is allowed only for public and protected members.\n *          The constructor() will be called if present with the arguments\n *          from the function itself.\n * @param {Object} staticProperties Static properties that will be defined\n *          on the returned class itself.\n * @type {function}\n */\nfunction createClass() { /* ... */ }\n```\n## Superb\n### \\_super Access\nThe \\_super private member is available on the this instance that points to\nthe prototype of the parent class. Thus calls to the base implementation\nof a specific method becomes easier, without holding manual references to\nthe base implementation.\n```javascript\nthis._super.show.apply(this, arguments);\n```\n### Private Members\nPrivate members are prefied with \\_.\nPrivate members can not be overwritten by mixins, nor by extending classes.\nIn case this is attempted createClass will throw an error. This is especially\ngood in large APIs where it becomes impossible to check if a private member\nwith a given name is already defined.\nSuperb Class will do that for you. Due to the prototypical nature of JavaScript\nprivate members are available in extending classes. Even if this is possible,\nit's strongly discouraged.\n```javascript\nvar createClass = require('superb-class').createClass;\nvar Base = createClass({\n    _show : function() {\n        console.log('Base.show()');\n    }\n});\nvar Extend = createClass(Base, {\n    // Fails with:\n    // Error: Private member _show is already defined.\n    _show : function() {\n        console.log('Extend.show()');\n    }\n});\n```\n### Protected Members\nProtected members are prefixed with $.\nProtected members can be overwritten by extending classes, but not by mixins.\nThe reason is most likely having abstract classes does make sense to be implemented\nin the extedning class, but the implementation in a mixin is most likely a bug.\nNote that mixins can still add both private _and_ protected members to the instance,\nthey just can't override items from the base class, nor can they conflict with the\nones from the existing prototype instance.\n",
    "readmeFilename": "README.md",
    "homepage": "http://blog.ciplogic.com"
}
{'fraction_non_alphanumeric': 0.16290495931214494, 'fraction_numerical': 0.0036849378166743437, 'mean_word_length': 3.3626925653047555, 'pattern_counts': {'":': 36, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '562547', 'n_tokens_mistral': 3586, 'n_tokens_neox': 3459, 'n_words': 1241}