@atproto/common-web 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/strings.d.ts +13 -5
- package/dist/strings.d.ts.map +1 -1
- package/dist/strings.js +19 -5
- package/dist/strings.js.map +1 -1
- package/package.json +3 -3
- package/src/strings.ts +22 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atproto/common-web
|
|
2
2
|
|
|
3
|
+
## 0.4.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`e6b6107`](https://github.com/bluesky-social/atproto/commit/e6b6107e028fee964972274b71f5da1329a7bece), [`e6b6107`](https://github.com/bluesky-social/atproto/commit/e6b6107e028fee964972274b71f5da1329a7bece), [`e6b6107`](https://github.com/bluesky-social/atproto/commit/e6b6107e028fee964972274b71f5da1329a7bece), [`e6b6107`](https://github.com/bluesky-social/atproto/commit/e6b6107e028fee964972274b71f5da1329a7bece), [`e6b6107`](https://github.com/bluesky-social/atproto/commit/e6b6107e028fee964972274b71f5da1329a7bece)]:
|
|
8
|
+
- @atproto/lex-data@0.0.4
|
|
9
|
+
- @atproto/lex-json@0.0.4
|
|
10
|
+
|
|
11
|
+
## 0.4.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#4422](https://github.com/bluesky-social/atproto/pull/4422) [`693784c`](https://github.com/bluesky-social/atproto/commit/693784c3a0dee4b6a29aa1e018fce682dcae148f) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Restore `utf8ToB64Url` and `b64UrlToUtf8` utilities
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`693784c`](https://github.com/bluesky-social/atproto/commit/693784c3a0dee4b6a29aa1e018fce682dcae148f)]:
|
|
18
|
+
- @atproto/lex-data@0.0.3
|
|
19
|
+
- @atproto/lex-json@0.0.3
|
|
20
|
+
|
|
3
21
|
## 0.4.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/strings.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LanguageTag,
|
|
1
|
+
import { LanguageTag, isLanguageString, parseLanguageString } from '@atproto/lex-data';
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Use {@link graphemeLen} from `@atproto/lex-data` instead.
|
|
4
4
|
*/
|
|
@@ -15,12 +15,20 @@ export { utf8LenLegacy as utf8Len };
|
|
|
15
15
|
type LanguageTagLegacy = LanguageTag;
|
|
16
16
|
export type { LanguageTagLegacy as LanguageTag };
|
|
17
17
|
/**
|
|
18
|
-
* @deprecated Use {@link
|
|
18
|
+
* @deprecated Use {@link parseLanguageString} from `@atproto/lex-data` instead.
|
|
19
19
|
*/
|
|
20
|
-
export declare const parseLanguageLegacy: typeof
|
|
20
|
+
export declare const parseLanguageLegacy: typeof parseLanguageString;
|
|
21
21
|
export { parseLanguageLegacy as parseLanguage };
|
|
22
22
|
/**
|
|
23
|
-
* @deprecated Use {@link
|
|
23
|
+
* @deprecated Use {@link isLanguageString} from `@atproto/lex-data` instead.
|
|
24
24
|
*/
|
|
25
|
-
export declare const validateLanguage: typeof
|
|
25
|
+
export declare const validateLanguage: typeof isLanguageString;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use {@link toBase64} from `@atproto/lex-data` instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare const utf8ToB64Url: (utf8: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use {@link fromBase64} from `@atproto/lex-data` instead.
|
|
32
|
+
*/
|
|
33
|
+
export declare const b64UrlToUtf8: (b64: string) => string;
|
|
26
34
|
//# sourceMappingURL=strings.d.ts.map
|
package/dist/strings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,gBAAgB,EAChB,mBAAmB,EAGpB,MAAM,mBAAmB,CAAA;AAE1B;;GAEG;AACH,QAAA,MAAM,iBAAiB,yBAAc,CAAA;AACrC,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,CAAA;AAE3C;;GAEG;AACH,QAAA,MAAM,aAAa,4BAAU,CAAA;AAC7B,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,CAAA;AAEnC;;GAEG;AACH,KAAK,iBAAiB,GAAG,WAAW,CAAA;AACpC,YAAY,EAAE,iBAAiB,IAAI,WAAW,EAAE,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,mBAAmB,4BAAsB,CAAA;AACtD,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB,yBAAmB,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,MAE3C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAE1C,CAAA"}
|
package/dist/strings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateLanguage = exports.parseLanguage = exports.parseLanguageLegacy = exports.utf8Len = exports.graphemeLen = void 0;
|
|
3
|
+
exports.b64UrlToUtf8 = exports.utf8ToB64Url = exports.validateLanguage = exports.parseLanguage = exports.parseLanguageLegacy = exports.utf8Len = exports.graphemeLen = void 0;
|
|
4
4
|
const lex_data_1 = require("@atproto/lex-data");
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Use {@link graphemeLen} from `@atproto/lex-data` instead.
|
|
@@ -13,12 +13,26 @@ exports.graphemeLen = graphemeLenLegacy;
|
|
|
13
13
|
const utf8LenLegacy = lex_data_1.utf8Len;
|
|
14
14
|
exports.utf8Len = utf8LenLegacy;
|
|
15
15
|
/**
|
|
16
|
-
* @deprecated Use {@link
|
|
16
|
+
* @deprecated Use {@link parseLanguageString} from `@atproto/lex-data` instead.
|
|
17
17
|
*/
|
|
18
|
-
exports.parseLanguageLegacy = lex_data_1.
|
|
18
|
+
exports.parseLanguageLegacy = lex_data_1.parseLanguageString;
|
|
19
19
|
exports.parseLanguage = exports.parseLanguageLegacy;
|
|
20
20
|
/**
|
|
21
|
-
* @deprecated Use {@link
|
|
21
|
+
* @deprecated Use {@link isLanguageString} from `@atproto/lex-data` instead.
|
|
22
22
|
*/
|
|
23
|
-
exports.validateLanguage = lex_data_1.
|
|
23
|
+
exports.validateLanguage = lex_data_1.isLanguageString;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use {@link toBase64} from `@atproto/lex-data` instead.
|
|
26
|
+
*/
|
|
27
|
+
const utf8ToB64Url = (utf8) => {
|
|
28
|
+
return (0, lex_data_1.toBase64)(new TextEncoder().encode(utf8), 'base64url');
|
|
29
|
+
};
|
|
30
|
+
exports.utf8ToB64Url = utf8ToB64Url;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use {@link fromBase64} from `@atproto/lex-data` instead.
|
|
33
|
+
*/
|
|
34
|
+
const b64UrlToUtf8 = (b64) => {
|
|
35
|
+
return new TextDecoder().decode((0, lex_data_1.fromBase64)(b64, 'base64url'));
|
|
36
|
+
};
|
|
37
|
+
exports.b64UrlToUtf8 = b64UrlToUtf8;
|
|
24
38
|
//# sourceMappingURL=strings.js.map
|
package/dist/strings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.js","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"strings.js","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":";;;AAAA,gDAQ0B;AAE1B;;GAEG;AACH,MAAM,iBAAiB,GAAG,sBAAW,CAAA;AACP,wCAAW;AAEzC;;GAEG;AACH,MAAM,aAAa,GAAG,kBAAO,CAAA;AACH,gCAAO;AAQjC;;GAEG;AACU,QAAA,mBAAmB,GAAG,8BAAmB,CAAA;AACtB,wBADnB,2BAAmB,CACa;AAE7C;;GAEG;AACU,QAAA,gBAAgB,GAAG,2BAAgB,CAAA;AAEhD;;GAEG;AACI,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE;IACnD,OAAO,IAAA,mBAAQ,EAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAA;AAC9D,CAAC,CAAA;AAFY,QAAA,YAAY,gBAExB;AAED;;GAEG;AACI,MAAM,YAAY,GAAG,CAAC,GAAW,EAAU,EAAE;IAClD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAA,qBAAU,EAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAA;AAC/D,CAAC,CAAA;AAFY,QAAA,YAAY,gBAExB","sourcesContent":["import {\n LanguageTag,\n fromBase64,\n graphemeLen,\n isLanguageString,\n parseLanguageString,\n toBase64,\n utf8Len,\n} from '@atproto/lex-data'\n\n/**\n * @deprecated Use {@link graphemeLen} from `@atproto/lex-data` instead.\n */\nconst graphemeLenLegacy = graphemeLen\nexport { graphemeLenLegacy as graphemeLen }\n\n/**\n * @deprecated Use {@link utf8Len} from `@atproto/lex-data` instead.\n */\nconst utf8LenLegacy = utf8Len\nexport { utf8LenLegacy as utf8Len }\n\n/**\n * @deprecated Use {@link LanguageTag} from `@atproto/lex-data` instead.\n */\ntype LanguageTagLegacy = LanguageTag\nexport type { LanguageTagLegacy as LanguageTag }\n\n/**\n * @deprecated Use {@link parseLanguageString} from `@atproto/lex-data` instead.\n */\nexport const parseLanguageLegacy = parseLanguageString\nexport { parseLanguageLegacy as parseLanguage }\n\n/**\n * @deprecated Use {@link isLanguageString} from `@atproto/lex-data` instead.\n */\nexport const validateLanguage = isLanguageString\n\n/**\n * @deprecated Use {@link toBase64} from `@atproto/lex-data` instead.\n */\nexport const utf8ToB64Url = (utf8: string): string => {\n return toBase64(new TextEncoder().encode(utf8), 'base64url')\n}\n\n/**\n * @deprecated Use {@link fromBase64} from `@atproto/lex-data` instead.\n */\nexport const b64UrlToUtf8 = (b64: string): string => {\n return new TextDecoder().decode(fromBase64(b64, 'base64url'))\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/common-web",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared web-platform-friendly code for atproto libraries",
|
|
6
6
|
"keywords": [
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"zod": "^3.23.8",
|
|
19
|
-
"@atproto/lex-data": "0.0.
|
|
20
|
-
"@atproto/lex-json": "0.0.
|
|
19
|
+
"@atproto/lex-data": "0.0.4",
|
|
20
|
+
"@atproto/lex-json": "0.0.4"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"jest": "^28.1.2",
|
package/src/strings.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LanguageTag,
|
|
3
|
+
fromBase64,
|
|
3
4
|
graphemeLen,
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
isLanguageString,
|
|
6
|
+
parseLanguageString,
|
|
7
|
+
toBase64,
|
|
6
8
|
utf8Len,
|
|
7
9
|
} from '@atproto/lex-data'
|
|
8
10
|
|
|
@@ -25,12 +27,26 @@ type LanguageTagLegacy = LanguageTag
|
|
|
25
27
|
export type { LanguageTagLegacy as LanguageTag }
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
|
-
* @deprecated Use {@link
|
|
30
|
+
* @deprecated Use {@link parseLanguageString} from `@atproto/lex-data` instead.
|
|
29
31
|
*/
|
|
30
|
-
export const parseLanguageLegacy =
|
|
32
|
+
export const parseLanguageLegacy = parseLanguageString
|
|
31
33
|
export { parseLanguageLegacy as parseLanguage }
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
|
-
* @deprecated Use {@link
|
|
36
|
+
* @deprecated Use {@link isLanguageString} from `@atproto/lex-data` instead.
|
|
35
37
|
*/
|
|
36
|
-
export const validateLanguage =
|
|
38
|
+
export const validateLanguage = isLanguageString
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use {@link toBase64} from `@atproto/lex-data` instead.
|
|
42
|
+
*/
|
|
43
|
+
export const utf8ToB64Url = (utf8: string): string => {
|
|
44
|
+
return toBase64(new TextEncoder().encode(utf8), 'base64url')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use {@link fromBase64} from `@atproto/lex-data` instead.
|
|
49
|
+
*/
|
|
50
|
+
export const b64UrlToUtf8 = (b64: string): string => {
|
|
51
|
+
return new TextDecoder().decode(fromBase64(b64, 'base64url'))
|
|
52
|
+
}
|