{"id":16515637,"url":"https://github.com/insin/concur","last_synced_at":"2025-09-21T00:31:22.907Z","repository":{"id":2047934,"uuid":"2985464","full_name":"insin/concur","owner":"insin","description":"Sugar for infectious JavaScript inheritance, metaprogramming \u0026 mixins","archived":false,"fork":false,"pushed_at":"2015-02-13T09:31:06.000Z","size":222,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-31T22:09:03.474Z","etag":null,"topics":["inheritance","javascript","metaprogramming","mixins","utility"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-15T04:54:22.000Z","updated_at":"2020-01-16T20:42:38.000Z","dependencies_parsed_at":"2022-08-27T13:11:37.062Z","dependency_job_id":null,"html_url":"https://github.com/insin/concur","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/insin/concur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fconcur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fconcur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fconcur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fconcur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insin","download_url":"https://codeload.github.com/insin/concur/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fconcur/sbom","scorecard":{"id":489701,"data":{"date":"2025-08-11","repo":{"name":"github.com/insin/concur","commit":"86e816f1a0cb90ec227371bee065cc76e7234b7c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T18:45:06.961Z","repository_id":2047934,"created_at":"2025-08-19T18:45:06.961Z","updated_at":"2025-08-19T18:45:06.961Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276179281,"owners_count":25598565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inheritance","javascript","metaprogramming","mixins","utility"],"created_at":"2024-10-11T16:17:47.571Z","updated_at":"2025-09-21T00:31:22.672Z","avatar_url":"https://github.com/insin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Concur [![build status](https://secure.travis-ci.org/insin/concur.png)](http://travis-ci.org/insin/concur)\n\nSyntactic sugar for JavaScript inheritance, which takes two of the JavaScript\nFunctions Of The Ages (`extend()` and `inherits()`), combines their power in\na [Backbone](https://github.com/documentcloud/backbone)-style infectious\ninheritance function and allows for inheritance-time metaprogramming and mixins\nfor those who need them.\n\nRuns in browsers and [Node.js](http://nodejs.org).\n\n## Install\n\nBrowser bundles export a global `Concur` variable.\n\n* [concur.js](https://raw.github.com/insin/concur/master/concur.js)\n* [concur.min.js](https://raw.github.com/insin/concur/master/concur.min.js)\n\nNode.js:\n\n```\nnpm install Concur\n```\n```javascript\nvar Concur = require('Concur')\n```\n\n## Usage\n\nConcur is [sugar](http://en.wikipedia.org/wiki/Syntactic_sugar) for JavaScript\ninheritance.\n\nIt deals with constructor functions, prototypes and prototype chains.\nIt does not break ``instanceof`` and constructors created with Concur will\nnot be ``instanceof Concur`` - it does not attempt to transplant paradigms\nfrom other languages into JavaScript, but it *does* try to provide a\nconvenient means of manipulating prototypes while setting up inheritance.\n\nAssuming the standard `inherits(child, parent)` function - which (\\*deep\nbreath\\*) puts one constructor's prototype in another constructor's prototype\nchain, so objects created with the latter will have access to the former's\nprototype properties when property access walks the prototype chain - you\nmight have an inheritance hierarchy set up something like this:\n\n```javascript\nfunction inherits(child, parent) {\n  function F() {}\n  F.prototype = parent.prototype\n  child.prototype = new F()\n  child.prototype.constructor = child\n}\n\nfunction Widget(attrs) {\n  this.attrs = attrs || {}\n}\n\nWidget.prototype.isHidden = false\n\nfunction Input(attrs) {\n  Widget.call(this, attrs)\n}\ninherits(Input, Widget)\n\nInput.prototype.inputType = null\n\nInput.prototype.render = function(name, value) {\n  return React.createElement('input', {\n    type: this.inputType\n  , name: name\n  , value: value\n  })\n}\n\nfunction TextInput(attrs) {\n  Input.call(this, attrs)\n}\ninherits(TextInput, Input)\n\nTextInput.prototype.inputType = 'text'\n```\n\nYou could start sugaring this by having Concur take care of setting up\nprototype inheritance and generating default constructors.\n\nThe `Concur.extend()` function returns a constructor function - either\none you provide or a default which calls the \"parent\" constructor in the\ncontext of the object being created, passing along all given arguments -\nwhich you can continue to work with as above. The `extend()` function is\nattached to the resulting constructor before it is returned, so it can be\nfurther extended from using the same API.\n\nSetting up a prototype by augmenting a constructor's prototype\nproperty-by-property is preferred by some as it doesn't introduce any extra\nlevels of nesting, and gives each property plenty of room for scanning and\ndocumentation:\n\n```javascript\nvar Widget = Concur.extend({\n  constructor: function(attrs) {\n    this.attrs = attrs || {}\n  }\n})\n\nWidget.prototype.isHidden = false\n\nvar Input = Widget.extend()\n\nInput.prototype.inputType = null\n\nInput.prototype.render = function(name, value) {\n  return React.createElement('input', {\n    type: this.inputType\n  , name: name\n  , value: value\n  })\n}\n\nvar TextInput = Input.extend()\n\nTextInput.prototype.inputType = 'text'\n```\n\nTo further sugar this, you could pass additional properties to the\n`extend()` function, which will augment the prototype for you.\n\nYou might prefer to do this only with data, rather than functions, or you\nmight prefer the compactness of having the entire prototype definition as\npart of one statement (particularly for constructors with small\nprototypes) - for demonstration purposes, this example shows the latter:\n\n```javascript\nvar Widget = Concur.extend({\n  isHidden: false,\n\n  constructor: function(attrs) {\n    this.attrs = attrs || {}\n  }\n})\n\nvar Input = Widget.extend({\n  inputType: null,\n\n  render: function(name, value) {\n    return React.createElement('input', {\n      type: this.inputType\n    , name: name\n    , value: value\n    })\n  }\n})\n\nvar TextInput = Input.extend({\n  inputType: 'text'\n)}\n```\n\n### Manipulating Prototypes\n\nThe following \"special\" properties, or \"dunder-properties\" owing to the double\nunderscores, can be used to manipulate prototypes at inheritance time. The\nmanipulations they enable are performed in the order they are listed below.\n\n#### `__meta__(prototypeProps, constructorProps)`\n\nIf a constructor's prototype properties include a dunder-meta property,\nthen when `extend()` is used on that constructor, dunder-meta will be\ncalled with all property-defining objects which were passed in.\n\nThis enables you to declare constructors which can modify the prototypes of\nconstructors inheriting from them, at inheritance time.\n\nContrived example:\n\n```javascript\nfunction NutAllergyProtectionMeta(prototypeProps) {\n   var nutIndex = prototypeProps.ingredients.indexOf('nuts')\n   if (nutIndex != -1) {\n      prototypeProps.ingredients.splice(nutIndex, 1)\n   }\n}\n\nvar Bar = Concur.extend({\n  __meta__: NutAllergyProtectionMeta,\n\n  eat: function() {\n    if (this.ingredients.indexOf('nuts') != -1) {\n      console.log('You eat nuts. You die.')\n    }\n    else {\n      console.log('You feel a bit dunder-meta.')\n    }\n  }\n})\n\nvar NougatBar = Bar.extend({\n   ingredients: ['sugar', 'egg whites', 'nuts']\n})\n```\n```\n\u003e\u003e\u003e var snack = new NougatBar()\n\u003e\u003e\u003e snack.eat()\nYou feel a bit dunder-meta.\n```\n\nActual examples:\n\n* Implementing basic Django-style declarative models:\n  [`examples/models.js`](https://github.com/insin/concur/blob/master/examples/models.js).\n* Implementing inheritance of fields from ancestor constructors and mixing in\n  fields from other constructors at the same time:\n  [newforms' `DeclarativeFieldsMeta.js`](https://github.com/insin/newforms/blob/react/src/forms/DeclarativeFieldsMeta.js)\n\n#### `__mixins__`\n\nIf any properties object passed to `extend()` includes a dunder-mixins\nArray, each of its contents will be mixed into that properties object in the\ngiven order.\n\n## API\n\n### `Concur.extend([prototypeProps[, constructorProps]])`\n\nCreates a child constructor which inherits from the call context object\n(`this`), adding the given prototype and constructor properties and\nadding `extend()` as a property of the new constructor for further\nextension:\n\n* Calling `Concur.extend()` creates a \"base\" constructor, which inherits\n  from `Object` just like any other Function.\n\n* Calling `extend()` in the context of any other constructor creates a\n  new constructor which inherits from it.\n\nWhen required, constructor logic should be provided as a function -\n`prototypeProps.constructor()` - otherwise, a default constructor which\ncalls the parent constructor with all given arguments will be created for you.\n\nChild constructors will have a `__super__` property added to them referencing\nthe prototype they extend, as a convenience for accessing it when required.\n\nChild constructors will also have an `__mro__` property added to them, which\nis a list of the constructors in their inheritance chain, with the new child\nconstructor itself at the head of the list.\n\n#### Special arguments\n\n##### `prototypeProps.constructor([...])`\n\nIf provided, this function will be used as the child constructor, otherwise a\nnew child constructor function will be created for you.\n\n##### `prototypeProps.__meta__(prototypeProps, constructorProps)`\n\nIf provided, this function will not be used immediately, but will be called\nwhen further extension is done based on the constructor returned by this call\nto `extend()`.\n\nAt that point, `__meta__` will be called with the property arguments passed\nto `extend()` so it can customise them before they're used to set up the\ninheriting constructor's prototype.\n\n##### `prototypeProps.__mixins__` and `constructorProps.__mixins__`\n\nIf provided, the contents of this Array will be mixed in to the properties\nobject it's set on, in the given order.\n\n## MIT Licensed","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsin%2Fconcur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsin%2Fconcur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsin%2Fconcur/lists"}