{"_id":"rocambole-indent","_rev":"14-c2314b789b8c2f1a661464fa0810bcec","name":"rocambole-indent","description":"helpers for rocambole AST indentation","dist-tags":{"latest":"2.0.4"},"versions":{"0.1.0":{"name":"rocambole-indent","version":"0.1.0","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"gitHead":"aeb39004c627158e5c35c63a73884425aa0a1169","_id":"rocambole-indent@0.1.0","_shasum":"fd2abd19fa9e1ede274e8a59191ca465e63bda64","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"fd2abd19fa9e1ede274e8a59191ca465e63bda64","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-0.1.0.tgz","integrity":"sha512-3jm8g+vGcO6IUliG0/QSWsMXeVIJWmstItgFMj6j7h9+TTjpuspAY4T/RI3wx7a56A/5CKF2EqJnlnFtyJGh5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGCsmS87n2hDmcpjfwx/luyNmccwyV2+cZhYahpvKxYHAiEA2OuQZtQUE5YNgNKpjizymUPeMB+JWmze581foQq5f+Q="}]}},"0.2.0":{"name":"rocambole-indent","version":"0.2.0","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"gitHead":"7e129aeb154dfae4fdb38f6d42d4e315b5f3b8ab","_id":"rocambole-indent@0.2.0","_shasum":"a4a48407fad0754b8d37323f08cc380f793488c3","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"a4a48407fad0754b8d37323f08cc380f793488c3","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-0.2.0.tgz","integrity":"sha512-G5T+jFqOoMMuNy40i7IZD6QH4AuL609ikUJLhlsoX7GZyXqlskRwiJrZzf2bh5MRiYkU3U1wLH80Rl2cnoJduw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgGAkvmvpCPAu18tOs2hRrr2t4/CwUzvwagQpt5M/fOAiB3QfCZ1xXOfPOVoEIupwqSHToT86QpiYPUo4Yi/ySyQA=="}]}},"1.0.0":{"name":"rocambole-indent","version":"1.0.0","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"gitHead":"98637be402a3df7bc462448a68ff53d354388573","_id":"rocambole-indent@1.0.0","_shasum":"1cb8b22c8e0e25d630fbbb0497ad5da1cc57310d","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"1cb8b22c8e0e25d630fbbb0497ad5da1cc57310d","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-1.0.0.tgz","integrity":"sha512-SoRwLhUqAOdZUkavXZg/EgLDckj+reiHpahScKoM14n9z6Fuo72KGBQ+6S//1b5FHwVPyi4loEyQ7PYWCue5xw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID4qlqsEkGV+2U8MVN4NTfJJbZad3sDRAx1viHVJA+EKAiAWkCSlzRPC3xrm349i477Fs8V+nF+b0BybkGX0s/th3A=="}]}},"1.1.0":{"name":"rocambole-indent","version":"1.1.0","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"node test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"devDependencies":{"diff":"^1.3.1","rocambole":"^0.5.1"},"gitHead":"53a0240d5b782bb06c564e7ca7cebde8f680273e","_id":"rocambole-indent@1.1.0","_shasum":"4674ed3e43bcecf22be5a82a95ceae67cf3c6c05","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"4674ed3e43bcecf22be5a82a95ceae67cf3c6c05","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-1.1.0.tgz","integrity":"sha512-5wbdB6yDxokFbTX48l31AW2DwsZ4HsAjKblGMXQmsuvpN6It3fQuEgwmGHc24FR/TTORY4e8meLgKb9RhtR5XA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBklG1H/U0xo9oPzc7SwKp6m0cIySbEoARBQODD/JjfsAiBpnLMCfXk2NTqZkAi4aV1kJ0+cF2zx2VQZM80sjFJb0g=="}]}},"1.1.1":{"name":"rocambole-indent","version":"1.1.1","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"node test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"devDependencies":{"diff":"^1.3.1","rocambole":"^0.5.1"},"gitHead":"df80825c61af62017c42525eaf860c546a948d97","_id":"rocambole-indent@1.1.1","_shasum":"279c949165e4f23cbfc2d9795d4836a8afece7d9","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"279c949165e4f23cbfc2d9795d4836a8afece7d9","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-1.1.1.tgz","integrity":"sha512-nlpinUAaRECtd4NyiKm2r5Iox9MGonOYbgGP7YxfU4SsbP7lnyCEJB4LyIn7zpg27vDhvkW8G7b6I4ult8f3UA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQv+LEHkHSws63ZL9uMuoJg+ocqTfv+gO8mkzXNZRjQAiEAsGxhvZk/G7FqbbWDoMhXkLch1OiS2VUTCPdPhqohLDc="}]}},"2.0.0":{"name":"rocambole-indent","version":"2.0.0","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"node test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"devDependencies":{"diff":"^1.3.1","rocambole":"^0.5.1"},"gitHead":"7912d3962d1745b2af4fb3e2a2a13b6f275c7fab","_id":"rocambole-indent@2.0.0","_shasum":"ff3096ee0d67f8517913c7612c4886a3c08926f6","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"ff3096ee0d67f8517913c7612c4886a3c08926f6","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-2.0.0.tgz","integrity":"sha512-ILjf2F7Tz5lNy+BTYo6wrV9RREoxfI3GtG0WrFoDbB7JRwS2jwxIrX+QNbWww7XWmgFUT0QUfIAjczsRajIw/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3jQQPMctvuEZMXqubqPK7tD+e3OBeVXUWrNUwAeaBGwIhALyXdmZI2PcS+7eB/ysroLlPf03PY+1HsSyO2xhaMuKk"}]}},"2.0.1":{"name":"rocambole-indent","version":"2.0.1","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"node test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"devDependencies":{"diff":"^1.3.1","rocambole":"^0.5.1"},"gitHead":"dd49ba6533e484c51da6526d51b5fd7fd67af4b2","_id":"rocambole-indent@2.0.1","_shasum":"e56420c9d174ca2041340a9c82fff0239963e5d3","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"e56420c9d174ca2041340a9c82fff0239963e5d3","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-2.0.1.tgz","integrity":"sha512-VR0Gtw0UlMXxvsSSWpnXOC0iI/h0V70EY9E4LAB/4Fne/2Eajl5WJ9fyqxsoOBHysPiVeWRExzkgOgReWD/MCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPHQ6ijMdHoUTB7GNdL7nkwN4ei+5QyGrS6aSlwmFtUAiBKQhQ54IbKHYgHW4Gt63Y+HwcYzmp36irA0wz0yegxvg=="}]}},"2.0.2":{"name":"rocambole-indent","version":"2.0.2","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"node test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"devDependencies":{"diff":"^1.3.1","rocambole":"^0.5.1"},"gitHead":"971bf578f8c3b0660bb372abd3912848e39703b5","_id":"rocambole-indent@2.0.2","_shasum":"c0c0292f74c3d94861cdf3ebe55e04a4b1cf24d4","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"c0c0292f74c3d94861cdf3ebe55e04a4b1cf24d4","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-2.0.2.tgz","integrity":"sha512-P9iCaZOCOtu3CZhZ3HgJIqb3bfRTFPAYwmmNAGf4KGPG6SUNDN0kooC40OKbOCGXZBajbnCNNP1ujJF5t/0dKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFfLcBNO3/gB2AkAt7kyVaPn/FcLinV6mqf3w+eGzH/jAiEAoe0r7hJGB8k9BabOWEK8PsYYNvpQedbbM2XRTNgZxBI="}]}},"2.0.3":{"name":"rocambole-indent","version":"2.0.3","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"node test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"devDependencies":{"diff":"^1.3.1","rocambole":"^0.5.1"},"gitHead":"ec57530ab421e34ab976ebc4631d4b7167adb370","_id":"rocambole-indent@2.0.3","_shasum":"fb2d257d01a0f6ebd045eb0fd3e42c4f7cac54ce","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"fb2d257d01a0f6ebd045eb0fd3e42c4f7cac54ce","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-2.0.3.tgz","integrity":"sha512-sdoJ8BSxlAGSLJJWesbhscCzw1gUv3wYqv4frx1JsaCkpUS8YEzPb3VH1xlzsASXxDnbZyxVe9bhianWkMVfXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLRdBt6On8A6EMHQmpCymJ6m94FXUFx7M6jQAcXpvYdwIgHx2iwl3KAMtd81LHDieziRhUF5p2YCRcvPB1QJkZ9wg="}]}},"2.0.4":{"name":"rocambole-indent","version":"2.0.4","description":"helpers for rocambole AST indentation","main":"rocambole-indent.js","scripts":{"test":"node test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"keywords":["rocambole","ast","esformatter","indent"],"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"license":"MIT","bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"homepage":"https://github.com/millermedeiros/rocambole-indent","jshintConfig":{"node":true,"eqnull":true},"dependencies":{"debug":"^2.1.3","mout":"^0.11.0","rocambole-token":"^1.2.1"},"devDependencies":{"disparity":"^2.0.0","rocambole":"^0.5.1"},"gitHead":"c3e41b175da3b964814b0214df96d507e0bd4128","_id":"rocambole-indent@2.0.4","_shasum":"a18a24977ca0400b861daa4631e861dcb52d085c","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dist":{"shasum":"a18a24977ca0400b861daa4631e861dcb52d085c","tarball":"https://registry.npmjs.org/rocambole-indent/-/rocambole-indent-2.0.4.tgz","integrity":"sha512-/N3lT+gjpWkHjMkFEBCQnLs1jZK4/QcGk6PFpwUO4Syk+wjM1N3jRY5p0N1MbH5A7oTiCxOAtDARbXdRtUGk9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZNZndiiqiwSBENCseE3RbEiG+RzHIDgOQ1gUzNCsb4AiEAi/1PaVL8+1Y67babxcPK2AZOHBZMx/FDP7wwEUp8K+M="}]}}},"readme":"# rocambole-indent\n\nHelpers to manipulate [rocambole](https://github.com/millermedeiros/rocambole)\n`Indent` tokens.\n\nUsed mainly by [esformatter](https://github.com/millermedeiros/esformatter/) and its plugins.\n\n\n## API\n\n```js\nvar indent = require('rocambole-indent');\n```\n\n### setOptions(opts)\n\n`setOptions` used to set the indent value.\n\n```js\nsetOptions({\n  // sets \"value\" used by `Indent` tokens (defaults to two spaces)\n  value: '  ',\n  // amount of indents added on `alignComments` if comment is inside an empty\n  // block (surrounded by `{}`, `[]` or `()`) - defaults to `1`\n  CommentInsideEmptyBlock: 1\n});\n```\n\n### inBetween(startToken, endToken, level)\n\nIncrease/Decrease the indent level in between the `startToken` and `endToken`.\n\nIt will not include the start and end tokens on the indentation range, only the\ntokens in between them.\n\n```js\n// increase the indent level by 1\ninBetween(node.startToken, node.endToken, 1);\n// decrease the indent level by 1\ninBetween(node.startToken, node.endToken, -1);\n// zero does nothing\ninBetween(node.endToken, 0);\n```\n\n**Important:** negative values only work if original `Indent` token contains\na `level` property since there is no reliable way to infer this value (probably\nwill only work if indent was added by this lib).\n\n### addLevel(token, level)\n\nIncreases/decreases the indent level at the beginning of the line that includes\nthe given `token`.\n\n```js\n// adds 2 indents\naddLevel(node.startToken, 2);\n// decrease indent level in 1 step\naddLevel(node.endToken, -1);\n// zero does nothing\naddLevel(node.endToken, 0);\n```\n\n**Important:** negative values only work if original `Indent` token contains\na `level` property since there is no reliable way to infer this value (probably\nwill only work if indent was added by this lib).\n\n### sanitize(astOrNode)\n\nRemoves any `Indent` tokens that don't have a `level` property (this is\nusually the original indentation of the program parsed by rocambole) or that\nare not at the beginning of the line. Also removing `WhiteSpace` tokens that\nare at the beginning of the line to avoid mistakes.\n\n```js\n// sanitize a single node\nsanitize(node);\n// sanitize whole AST\nsanitize(ast);\n```\n\n### updateBlockComment(token)\n\nUpdates `BlockComment` `raw` value to make sure all the lines have the same\n`Indent` level.\n\nThis is called internally by the `addLevel` and `indentInBetween` methods (if\nfirst token of line is a `BlockComment`), so as long as you only use those\nmethods to edit the indent level you shouldn't need to call this.\n\n### alignComments(astOrNode)\n\nAlign all the comments based on the next/previous lines inside a given `ast` or\n`node`.\n\nIt will align the comments with the next line unless the comment block is\nfollowed by an empty line, in that case it will use the previous non-empty line\nas a reference.\n\nExample output:\n\n```js\n// aligned with next line\nswitch (foo) {\n  // aligned with next non-empty line\n\n  case bar:\n    // aligned with next line\n    baz();\n    // this should be aligned with previous line since comment block is\n    // followed by an empty line\n\n  // aligned with next line\n  case biz:\n    // aligned with next line\n    what();\n// aligned with next line\n}\n\nfunction noop() {\n  // indented since it's inside an empty block\n}\n\n// aligned with previous line since it's at the end of program\n```\n\n### whiteSpaceToIndent(token, [indentValue])\n\nConvert `WhiteSpace` token into `Indent` if it's the first token of the line.\n\nYou can pass a custom `indentValue` or it will use the value set by\n`setOptions()` to calculate the indent `level` (basically count how many times\nthis string repeats inside the `token.value`).\n\n```js\nvar token = {\n  type: 'WhiteSpace',\n  value: '\\t\\t\\t',\n  prev: { type: 'LineBreak', value: '\\n' }\n};\nwhiteSpaceToIndent(token, '\\t');\n// edits properties in place\nconsole.log(token.type);  // > \"Indent\"\nconsole.log(token.level); // > 3\n```\n\nThis is useful in case you want to make sure `sanitize` won't remove the\noriginal indents.\n\n## Debug\n\nThis module uses [debug](https://www.npmjs.com/package/debug) internally. To\nmake it easier to identify what is wrong we sometimes run the esformatter tests\nwith a `DEBUG` flag, like:\n\n```sh\nDEBUG=rocambole:indent npm test\n```\n\n## License\n\nReleased under the MIT License\n\n","maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"time":{"modified":"2022-06-26T13:48:47.919Z","created":"2015-03-20T05:52:21.073Z","0.1.0":"2015-03-20T05:52:21.073Z","0.2.0":"2015-03-20T19:27:05.966Z","1.0.0":"2015-03-24T15:36:49.634Z","1.1.0":"2015-03-25T19:34:29.482Z","1.1.1":"2015-03-25T20:03:26.468Z","2.0.0":"2015-03-25T20:09:05.067Z","2.0.1":"2015-03-25T20:18:09.960Z","2.0.2":"2015-03-25T22:29:10.719Z","2.0.3":"2015-03-27T19:32:56.292Z","2.0.4":"2015-05-02T20:23:24.359Z"},"homepage":"https://github.com/millermedeiros/rocambole-indent","keywords":["rocambole","ast","esformatter","indent"],"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole-indent.git"},"author":{"name":"Miller Medeiros","email":"http://millermedeiros.com","url":"contact@millermedeiros.com"},"bugs":{"url":"https://github.com/millermedeiros/rocambole-indent/issues"},"license":"MIT","readmeFilename":"README.md"}