This is a fork of the UAParser Javascript library uap-ref-impl converted to TypeScript.
This fork handles replacement values of empty strings (''
) differently to the uap-ref-impl
as the specification is ambigious about empty strings.
This fork aligns with the C# implementation which carries a replacement value of empty strings (''
) to the output, rather than treating it as a falsey value and falling back to the default value (usually 'Other'
or null
).
For example a regex of
device_parsers:
- regex: '(radiocomandroid)'
brand_replacement: ''
device_replacement: ''
model_replacement: ''
will output
uap-ref-impl | uap-ref-impl-typescript (this library) | |
---|---|---|
Device family | "radiocomandroid" |
"" |
Device brand | null |
"" |
Device model | "radiocomandroid" |
"" |
$ npm install github:121cast/uap-ref-impl-typescript