{"id":21934240,"url":"https://github.com/marcellomontemagno/cursorify","last_synced_at":"2026-05-06T05:44:33.941Z","repository":{"id":101882644,"uuid":"106340907","full_name":"marcellomontemagno/cursorify","owner":"marcellomontemagno","description":"It helps to manipulate, complex and deeply nested objects trees.","archived":false,"fork":false,"pushed_at":"2017-10-31T11:15:40.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T04:14:07.171Z","etag":null,"topics":["configuration","cursor","javascript","utility","webpack"],"latest_commit_sha":null,"homepage":null,"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/marcellomontemagno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-09T22:16:19.000Z","updated_at":"2019-02-25T00:02:07.000Z","dependencies_parsed_at":"2023-04-25T11:02:41.026Z","dependency_job_id":null,"html_url":"https://github.com/marcellomontemagno/cursorify","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/marcellomontemagno/cursorify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellomontemagno%2Fcursorify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellomontemagno%2Fcursorify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellomontemagno%2Fcursorify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellomontemagno%2Fcursorify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcellomontemagno","download_url":"https://codeload.github.com/marcellomontemagno/cursorify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellomontemagno%2Fcursorify/sbom","scorecard":{"id":617516,"data":{"date":"2025-08-11","repo":{"name":"github.com/marcellomontemagno/cursorify","commit":"f9fc4e1c95c3ecb6ee30879e53c55928b7650b20"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/11 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":"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":"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":"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":"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":"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":"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":"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:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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-21T04:21:17.687Z","repository_id":101882644,"created_at":"2025-08-21T04:21:17.687Z","updated_at":"2025-08-21T04:21:17.687Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32680890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["configuration","cursor","javascript","utility","webpack"],"created_at":"2024-11-29T00:14:59.152Z","updated_at":"2026-05-06T05:44:33.913Z","avatar_url":"https://github.com/marcellomontemagno.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/marcellomontemagno/cursorify.svg?style=shield)](https://circleci.com/gh/marcellomontemagno/cursorify)\n\n## What is it about?\n\nIt helps to manipulate, complex and deeply nested objects trees.\n\n## How does it work?\n\nAssume you need to create an object tree like the following:\n\n```javascript\nconst obj = {\n  a: {\n    b: {\n      c: [\n        {d: 1},\n        {\n          e: {\n            f: {g: 2},\n            h: {i: 3}\n          },\n        },\n        {l: 4}\n      ]\n    }\n  }\n}\n```\n\nNow assume you have to delete the object `{l: 4}`, delete the key `h` and override `{g: 2}` with `{k: 2}`.\n\nWith cursorify you can create cursors to the parts of the object you will need to modify later:\n\n```javascript\nimport {createCursors} from 'cursorify';\n\nconst cursors = createCursors();\n\nconst obj = {\n  a: {\n    b: {\n      c: [\n        {d: 1},\n        {\n          e: {\n            f: cursors.push('cursor1',\n              {g: 2}\n            ),\n            h: cursors.push('cursor2',\n              {i: 3}\n            )\n          },\n        },\n        cursors.push('cursor3',\n          {l: 4}\n        )\n      ]\n    }\n  }\n}\n```\n\nAnd then use the cursors to easily mutate the object as you intended to:\n\n```javascript\nimport {setByCursor, deleteByCursor} from 'cursorify';\n\ndeleteByCursor(obj, cursors['cursor3']);\n\ndeleteByCursor(obj, cursors['cursor2']);\n\nsetByCursors(obj, cursors['cursor1'], {k:2});\n\n/*\n\n  Now obj value is:\n\n  const obj = {\n    a: {\n      b: {\n        c: [\n          {d: 1},\n          {\n            e: {\n              f: {k: 2}\n            },\n          }\n        ]\n      }\n    }\n  }\n\n*/\n```\n\n## API\n\n```javascript\nimport {createCursors, getByCursor, setByCursor, deleteByCursor} from 'cursorify';\n```\n\n- createCursors() initializes a new empty list of cursors\n- cursors.push(name, value) pushes a new cursor to the list\n- getByCursor(obj, cursor) retrieve a value from `obj` using the cursor `cursor`\n- setByCursor(obj, cursor, newValue) overrides a value in `obj` using the cursor `cursor`\n- deleteByCursor(obj, cursor) deletes a value in `obj` using the cursor `cursor`\n    - if the cursor points to an entry into an array deleteByCursor removes that entry from the array\n    - if the cursor points to a value into an object deleteByCursor removes the related key from the object\n\n## When is this library useful? (A real use case)\n\nSometimes object trees are structure in a way that is very difficult to modify or get values form them later on.\n\nA real life example is the webpack configuration object tree, modify, or delete a loader from the configuration after its initialization can be very messy and unreliable.\n\nIn general overriding a pre existing webpack configuration can be very painful.\n\nHere an example of how a webpack configuration object looks like:\n\n```javascript\nlet config = {\n  output: {\n    path: BUILD,\n    filename: 'bundle.js',\n    publicPath: '/'\n  },\n  plugins: [\n    new DefinePlugin(ENV),\n    new ProgressBarPlugin({clear: false})\n  ],\n  resolve: {\n    modules: [NODE_MODULES, CWD_NODE_MODULES],\n    extensions: ['.js', '.jsx', '.json']\n  },\n  resolveLoader: {\n    modules: [NODE_MODULES, CWD_NODE_MODULES]\n  },\n  module: {\n    rules: [\n      {\n          test: /\\.jsx?$/,\n          enforce: \"pre\",\n          use: [\n            {loader: 'source-map-loader'}\n          ]\n      },\n      {\n        test: /\\.html$/,\n        loader: 'file-loader',\n        options: {\n          name: '[name].[ext]'\n        }\n      },\n      {\n        test: /\\.s?css$/, // alternative *** : ^(?:(?:[^\\.\\s]+\\.)(?!module))+s?css$\n        use: [\n          {loader: 'style-loader'},\n          {loader: 'css-loader'},\n          {loader: 'sass-loader'},\n        ]\n      },\n      {\n        test: /\\.jsx?$/,\n        include: [SRC, TESTS],\n        exclude: /(node_modules|bower_components)/,\n        use: [\n          {\n            loader: 'babel-loader',\n            options: {\n              babelrc: false,\n              presets: [\n                ['babel-preset-es2015',{ \"modules\": false }], //{ \"modules\": false } is needed to make react-hot-loader work\n                'babel-preset-flow',\n                'babel-preset-stage-0',\n                'babel-preset-react'\n              ],\n              plugins: [\n                'react-hot-loader/babel'\n              ]\n            }\n          },\n        ],\n      },\n      {\n        test: /\\.svg(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n        loader: 'url-loader',\n        options: {\n          limit: '10000',\n          mimetype: 'image/svg+xml'\n        }\n      },\n      {\n        test: /\\.eot(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n        loader: 'file-loader'\n      }\n    ]\n  }\n};\n```\n\nWhat if you only need to modify the loader for the svg files after the config object has been created? There is no reliable and easy way for you to mutate only that part of the config object.\n\nWith cursorify you can name parts of this configuration object so that it will be very easy for you to modify them later on:\n\n```javascript\nimport {createCursors} from 'cursorify';\n\nconst cursors = createCursors();\n\nlet config = {\n   output: {\n     path: BUILD,\n     filename: 'bundle.js',\n     publicPath: '/'\n   },\n   plugins: [\n     new DefinePlugin(ENV),\n     new ProgressBarPlugin({clear: false})\n   ],\n   resolve: {\n     modules: [NODE_MODULES, CWD_NODE_MODULES],\n     extensions: ['.js', '.jsx', '.json']\n   },\n   resolveLoader: {\n     modules: [NODE_MODULES, CWD_NODE_MODULES]\n   },\n   module: {\n     rules: [\n       cursors.push('source-map-loader',{\n           test: /\\.jsx?$/,\n           enforce: \"pre\",\n           use: [\n             {loader: 'source-map-loader'}\n           ]\n       }),\n       cursors.push('html-loader',{\n         test: /\\.html$/,\n         loader: 'file-loader',\n         options: {\n           name: '[name].[ext]'\n         }\n       }),\n       cursors.push('style-loader',{\n         test: /\\.s?css$/, // alternative *** : ^(?:(?:[^\\.\\s]+\\.)(?!module))+s?css$\n         use: [\n           {loader: 'style-loader'},\n           {loader: 'css-loader'},\n           {loader: 'sass-loader'},\n         ]\n       }),\n       cursors.push('javascript-loader',{\n         test: /\\.jsx?$/,\n         include: [SRC, TESTS],\n         exclude: /(node_modules|bower_components)/,\n         use: [\n           {\n             loader: 'babel-loader',\n             options: {\n               babelrc: false,\n               presets: [\n                 ['babel-preset-es2015',{ \"modules\": false }], //{ \"modules\": false } is needed to make react-hot-loader work\n                 'babel-preset-flow',\n                 'babel-preset-stage-0',\n                 'babel-preset-react'\n               ],\n               plugins: [\n                 'react-hot-loader/babel'\n               ]\n             }\n           },\n         ],\n       }),\n       cursors.push('svg-loader',{\n         test: /\\.svg(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n         loader: 'url-loader',\n         options: {\n           limit: '10000',\n           mimetype: 'image/svg+xml'\n         }\n       }),\n       cursors.push('eot-loader',{\n         test: /\\.eot(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n         loader: 'file-loader'\n       })\n     ]\n   }\n };\n ```\n\ncreating cursors doesn't mutate the original object so that you can keep on using it as usual, the advantage is that changing the loaders now is very simple e.g:\n\n```javascript\n//the following code replaces the existing loader for the svg files completely:\n\nimport {setByCursor} from 'cursorify';\n\nsetByCursor(config, cursors['svg-loader'], {\n  test: /\\.svg(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n  loaders: [\n    'svg-inline-loader', {\n      loader: 'image-webpack-loader',\n      options: {\n        svgo: {\n          plugins: [\n            {\n              removeStyleElement: true\n            },\n            {\n              removeXMLNS: true\n            },\n            {\n              removeDimensions: true\n            }\n          ]\n        }\n      }\n    }\n  ]\n});\n```\n\nconsider providing references to part of your configuration object using cursorify if you are building a tool exposing a complex and deeply nested configuration object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellomontemagno%2Fcursorify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcellomontemagno%2Fcursorify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellomontemagno%2Fcursorify/lists"}