{"id":17766648,"url":"https://github.com/floatdrop/deps-normalize","last_synced_at":"2025-03-15T13:30:52.981Z","repository":{"id":19913511,"uuid":"23179232","full_name":"floatdrop/deps-normalize","owner":"floatdrop","description":"Dependencies normalization for gulp-bem","archived":false,"fork":false,"pushed_at":"2015-11-17T08:47:25.000Z","size":29,"stargazers_count":4,"open_issues_count":2,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-14T01:31:43.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floatdrop.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-21T08:09:41.000Z","updated_at":"2016-11-18T09:39:31.000Z","dependencies_parsed_at":"2022-08-20T17:20:26.587Z","dependency_job_id":null,"html_url":"https://github.com/floatdrop/deps-normalize","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fdeps-normalize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fdeps-normalize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fdeps-normalize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fdeps-normalize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatdrop","download_url":"https://codeload.github.com/floatdrop/deps-normalize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735797,"owners_count":20339530,"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","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":[],"created_at":"2024-10-26T20:33:43.504Z","updated_at":"2025-03-15T13:30:52.966Z","avatar_url":"https://github.com/floatdrop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deps-normalize\n\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]\n\nThis module used to normalize `require` and `expect` properties in BEM object.\n\n## Usage\n\n```js\n\nvar normalize = require('deps-normalize');\n\nnormalize(undefined);               // []\nnormalize({ block: 'block' });      // [ { block: 'block' } ]\nnormalize({ elem: 'elem' });        // [ { elem: 'elem' } ]\n\n// See more examples in tests\n```\n\n## API\n\n### normalize(dependencies, [options])\n\nRuns normalization of dependencies. Returns array of normalized dependencies.\n\n#### dependencies\nType: `Object` / `String`\n\n#### options\nType: `Object`\n\n * `parseString` - contains `Function`, that will parse `dependencies` if they passed as string.\n\n## Normalization\n\nDependencies should contain [deps objects](http://bem.info/tools/bem/bem-tools/depsjs/) (or `String`). We do not support full specification. Those objects are equivalents of BEM objects, but with additional properties, that reduces boilerplate code. After they are normalized, they can be converted to BEM objects.\n\n * `elems` - contains `Array` of `String` (if it contains `String` it will be wrapped in array).\n * `mods` - contains `Object` with keys as modificators names and values as modificators values. Values can be `Number`, `Boolean`, `String` or `Array` of `String`.\n\nIf deps object contain `elems` or `mods` it will be splitted in multiple BEM objects. It will not take multiplication of `elems` and `mods`, if both are present in deps object. Instead it will be interpretated as two deps objects: one with `elems` and other with `mods`.\n\n```js\nnormalize({ elems: ['e1', 'e2'], mods: {m1: 1, m2: [2, 3]} });\n\n// [\n//     { block: 'b', elem: 'e1' },\n//     { block: 'b', elem: 'e2' },\n//     { block: 'b', modName: 'm1', modVal: 1 },\n//     { block: 'b', modName: 'm2', modVal: 2 },\n//     { block: 'b', modName: 'm2', modVal: 3 }\n// ]\n```\n\n`level`, `block`, `elem`, `mod` and `value` properties will be taken from current processing object.\n\n__Note:__ you can not have `elem` with `elems` in one deps object (same applies to `mod` and `mods`).\n\n## License\n\nMIT (c) 2014 Vsevolod Strukchinsky\n\n[npm-url]: https://npmjs.org/package/deps-normalize\n[npm-image]: http://img.shields.io/npm/v/deps-normalize.svg?style=flat\n\n[travis-url]: http://travis-ci.org/floatdrop/deps-normalize\n[travis-image]: http://img.shields.io/travis/floatdrop/deps-normalize.svg?branch=master\u0026style=flat\n\n[depstat-url]: https://david-dm.org/floatdrop/deps-normalize\n[depstat-image]: http://img.shields.io/david/floatdrop/deps-normalize.svg?style=flat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fdeps-normalize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatdrop%2Fdeps-normalize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fdeps-normalize/lists"}