@atproto/common-web 0.4.6 → 0.4.7

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atproto/common-web
2
2
 
3
+ ## 0.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ - Updated dependencies [[`693784c`](https://github.com/bluesky-social/atproto/commit/693784c3a0dee4b6a29aa1e018fce682dcae148f)]:
10
+ - @atproto/lex-data@0.0.3
11
+ - @atproto/lex-json@0.0.3
12
+
3
13
  ## 0.4.6
4
14
 
5
15
  ### Patch Changes
package/dist/strings.d.ts CHANGED
@@ -23,4 +23,12 @@ export { parseLanguageLegacy as parseLanguage };
23
23
  * @deprecated Use {@link isLanguage} from `@atproto/lex-data` instead.
24
24
  */
25
25
  export declare const validateLanguage: typeof isLanguage;
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
@@ -1 +1 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,UAAU,EACV,aAAa,EAEd,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,sBAAgB,CAAA;AAChD,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB,mBAAa,CAAA"}
1
+ {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,UAAU,EACV,aAAa,EAGd,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,sBAAgB,CAAA;AAChD,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB,mBAAa,CAAA;AAE1C;;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.
@@ -21,4 +21,18 @@ exports.parseLanguage = exports.parseLanguageLegacy;
21
21
  * @deprecated Use {@link isLanguage} from `@atproto/lex-data` instead.
22
22
  */
23
23
  exports.validateLanguage = lex_data_1.isLanguage;
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
@@ -1 +1 @@
1
- {"version":3,"file":"strings.js","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":";;;AAAA,gDAM0B;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,wBAAa,CAAA;AAChB,wBADnB,2BAAmB,CACa;AAE7C;;GAEG;AACU,QAAA,gBAAgB,GAAG,qBAAU,CAAA","sourcesContent":["import {\n LanguageTag,\n graphemeLen,\n isLanguage,\n parseLanguage,\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 parseLanguage} from `@atproto/lex-data` instead.\n */\nexport const parseLanguageLegacy = parseLanguage\nexport { parseLanguageLegacy as parseLanguage }\n\n/**\n * @deprecated Use {@link isLanguage} from `@atproto/lex-data` instead.\n */\nexport const validateLanguage = isLanguage\n"]}
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,wBAAa,CAAA;AAChB,wBADnB,2BAAmB,CACa;AAE7C;;GAEG;AACU,QAAA,gBAAgB,GAAG,qBAAU,CAAA;AAE1C;;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 isLanguage,\n parseLanguage,\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 parseLanguage} from `@atproto/lex-data` instead.\n */\nexport const parseLanguageLegacy = parseLanguage\nexport { parseLanguageLegacy as parseLanguage }\n\n/**\n * @deprecated Use {@link isLanguage} from `@atproto/lex-data` instead.\n */\nexport const validateLanguage = isLanguage\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.6",
3
+ "version": "0.4.7",
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.2",
20
- "@atproto/lex-json": "0.0.2"
19
+ "@atproto/lex-data": "0.0.3",
20
+ "@atproto/lex-json": "0.0.3"
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
  isLanguage,
5
6
  parseLanguage,
7
+ toBase64,
6
8
  utf8Len,
7
9
  } from '@atproto/lex-data'
8
10
 
@@ -34,3 +36,17 @@ export { parseLanguageLegacy as parseLanguage }
34
36
  * @deprecated Use {@link isLanguage} from `@atproto/lex-data` instead.
35
37
  */
36
38
  export const validateLanguage = isLanguage
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
+ }