Skip to content

Commit 605fea7

Browse files
committed
Add conversion document for strings.ts
1 parent e80a5d9 commit 605fea7

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Conversion for `common-web/strings.ts`
2+
3+
## `export const utf8Len = (str: string): number`
4+
5+
This is redundant and will not be converted. Use `.utf8.count` on the `String` object instead.
6+
7+
```swift
8+
let string = "I am feeling great today!"
9+
string.utf8.count
10+
```
11+
12+
## `export const graphemeLen = (str: string): number`
13+
14+
This is redundant and will not be converted. Use `.count` on the `String` object instead.
15+
16+
```swift
17+
let string = "I am feeling great today!"
18+
string.count
19+
```
20+
21+
## `export const utf8ToB64Url = (utf8: string): string`
22+
23+
This is redundant and will not be converted. MultiformatKit and ATCryptography both contain methods that will convert from a `String` to Base64URL. Use one of those instead.
24+
25+
## `export const b64UrlToUtf8 = (b64: string): string`
26+
27+
This is redundant and will not be converted. MultiformatKit and ATCryptography both contain methods that will convert from Base64URL to a `String` object. Use one of those instead.
28+
29+
## `export const parseLanguage = (langTag: string): LanguageTag | null`
30+
31+
This is unneeded and will not be converted. Use `Locale` instead.
32+
33+
## `export const validateLanguage = (langTag: string): boolean`
34+
35+
This is unneeded and will not be converted.
36+
37+
## `export type LanguageTag`
38+
39+
This is unneeded and will not be converted.
40+
41+
## `const bcp47Regexp`
42+
43+
This is unneeded and will not be converted.

0 commit comments

Comments
 (0)