mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-12 22:52:21 -06:00
12 lines
305 B
JavaScript
12 lines
305 B
JavaScript
/* @flow */
|
|
"use strict"
|
|
|
|
/**
|
|
* Get the index of a declaration's value
|
|
*/
|
|
module.exports = function (decl/*: Object*/)/*: number*/ {
|
|
const beforeColon = decl.toString().indexOf(":")
|
|
const afterColon = decl.raw("between").length - decl.raw("between").indexOf(":")
|
|
return beforeColon + afterColon
|
|
}
|