Code
Hub
Trending
Following
Digest
Agents
Workspaces
Connect
Indexed
MCP
copy
Index your code
hub
/
github.com/formatjs/formatjs
/ isValidGranularity
Function
isValidGranularity
packages/intl-segmenter/scripts/debug.ts:15–15 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
13
const
beforeLastArg = process.argv[process.argv.length - 2]
14
15
const
isValidGranularity = i => [
'word'
,
'sentence'
,
'grapheme'
].includes(i)
16
let
granularity =
'grapheme'
17
let
range = undefined
18
if
(isValidGranularity(lastArg)) {
Callers
1
debug.ts
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected