react-native-google-mobile-ads 12.1.1 → 12.1.2

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.
Files changed (77) hide show
  1. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +25 -22
  2. package/lib/commonjs/common/index.js +1 -140
  3. package/lib/commonjs/common/index.js.map +1 -1
  4. package/lib/commonjs/common/validate.js +0 -89
  5. package/lib/commonjs/common/validate.js.map +1 -1
  6. package/lib/commonjs/version.js +1 -1
  7. package/lib/module/common/index.js +1 -78
  8. package/lib/module/common/index.js.map +1 -1
  9. package/lib/module/common/validate.js +0 -81
  10. package/lib/module/common/validate.js.map +1 -1
  11. package/lib/module/version.js +1 -1
  12. package/lib/typescript/common/index.d.ts +0 -26
  13. package/lib/typescript/common/index.d.ts.map +1 -1
  14. package/lib/typescript/common/validate.d.ts +0 -35
  15. package/lib/typescript/common/validate.d.ts.map +1 -1
  16. package/lib/typescript/index.d.ts +1 -1
  17. package/lib/typescript/version.d.ts +1 -1
  18. package/package.json +1 -1
  19. package/src/common/index.ts +1 -81
  20. package/src/common/validate.ts +0 -98
  21. package/src/version.ts +1 -1
  22. package/lib/commonjs/common/Base64.js +0 -102
  23. package/lib/commonjs/common/Base64.js.map +0 -1
  24. package/lib/commonjs/common/MutatableParams.js +0 -50
  25. package/lib/commonjs/common/MutatableParams.js.map +0 -1
  26. package/lib/commonjs/common/ReferenceBase.js +0 -49
  27. package/lib/commonjs/common/ReferenceBase.js.map +0 -1
  28. package/lib/commonjs/common/deeps.js +0 -85
  29. package/lib/commonjs/common/deeps.js.map +0 -1
  30. package/lib/commonjs/common/id.js +0 -72
  31. package/lib/commonjs/common/id.js.map +0 -1
  32. package/lib/commonjs/common/path.js +0 -125
  33. package/lib/commonjs/common/path.js.map +0 -1
  34. package/lib/commonjs/common/promise.js +0 -64
  35. package/lib/commonjs/common/promise.js.map +0 -1
  36. package/lib/commonjs/common/serialize.js +0 -48
  37. package/lib/commonjs/common/serialize.js.map +0 -1
  38. package/lib/module/common/Base64.js +0 -93
  39. package/lib/module/common/Base64.js.map +0 -1
  40. package/lib/module/common/MutatableParams.js +0 -43
  41. package/lib/module/common/MutatableParams.js.map +0 -1
  42. package/lib/module/common/ReferenceBase.js +0 -42
  43. package/lib/module/common/ReferenceBase.js.map +0 -1
  44. package/lib/module/common/deeps.js +0 -79
  45. package/lib/module/common/deeps.js.map +0 -1
  46. package/lib/module/common/id.js +0 -65
  47. package/lib/module/common/id.js.map +0 -1
  48. package/lib/module/common/path.js +0 -110
  49. package/lib/module/common/path.js.map +0 -1
  50. package/lib/module/common/promise.js +0 -58
  51. package/lib/module/common/promise.js.map +0 -1
  52. package/lib/module/common/serialize.js +0 -41
  53. package/lib/module/common/serialize.js.map +0 -1
  54. package/lib/typescript/common/Base64.d.ts +0 -15
  55. package/lib/typescript/common/Base64.d.ts.map +0 -1
  56. package/lib/typescript/common/MutatableParams.d.ts +0 -10
  57. package/lib/typescript/common/MutatableParams.d.ts.map +0 -1
  58. package/lib/typescript/common/ReferenceBase.d.ts +0 -12
  59. package/lib/typescript/common/ReferenceBase.d.ts.map +0 -1
  60. package/lib/typescript/common/deeps.d.ts +0 -19
  61. package/lib/typescript/common/deeps.d.ts.map +0 -1
  62. package/lib/typescript/common/id.d.ts +0 -12
  63. package/lib/typescript/common/id.d.ts.map +0 -1
  64. package/lib/typescript/common/path.d.ts +0 -44
  65. package/lib/typescript/common/path.d.ts.map +0 -1
  66. package/lib/typescript/common/promise.d.ts +0 -14
  67. package/lib/typescript/common/promise.d.ts.map +0 -1
  68. package/lib/typescript/common/serialize.d.ts +0 -6
  69. package/lib/typescript/common/serialize.d.ts.map +0 -1
  70. package/src/common/Base64.ts +0 -114
  71. package/src/common/MutatableParams.ts +0 -50
  72. package/src/common/ReferenceBase.ts +0 -45
  73. package/src/common/deeps.ts +0 -88
  74. package/src/common/id.ts +0 -74
  75. package/src/common/path.ts +0 -114
  76. package/src/common/promise.ts +0 -66
  77. package/src/common/serialize.ts +0 -43
@@ -1,65 +0,0 @@
1
- const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
2
- const AUTO_ID_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
3
-
4
- // timestamp of last push, used to prevent local collisions if you push twice in one ms.
5
- let lastPushTime = 0;
6
-
7
- // we generate 72-bits of randomness which get turned into 12 characters and appended to the
8
- // timestamp to prevent collisions with other clients. We store the last characters we
9
- // generated because in the event of a collision, we'll use those same characters except
10
- // "incremented" by one.
11
- const lastRandChars = [];
12
-
13
- /**
14
- * Generate a firebase id - for use with ref().push(val, cb) - e.g. -KXMr7k2tXUFQqiaZRY4'
15
- * @param serverTimeOffset - pass in server time offset from native side
16
- * @returns {string}
17
- */
18
- export function generateDatabaseId() {
19
- let serverTimeOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
20
- const timeStampChars = new Array(8);
21
- let now = new Date().getTime() + serverTimeOffset;
22
- const duplicateTime = now === lastPushTime;
23
- lastPushTime = now;
24
- for (let i = 7; i >= 0; i -= 1) {
25
- timeStampChars[i] = PUSH_CHARS.charAt(now % 64);
26
- now = Math.floor(now / 64);
27
- }
28
- if (now !== 0) {
29
- throw new Error('We should have converted the entire timestamp.');
30
- }
31
- let id = timeStampChars.join('');
32
- if (!duplicateTime) {
33
- for (let i = 0; i < 12; i += 1) {
34
- lastRandChars[i] = Math.floor(Math.random() * 64);
35
- }
36
- } else {
37
- // if the timestamp hasn't changed since last push,
38
- // use the same random number, but increment it by 1.
39
- let i;
40
- for (i = 11; i >= 0 && lastRandChars[i] === 63; i -= 1) {
41
- lastRandChars[i] = 0;
42
- }
43
- lastRandChars[i] += 1;
44
- }
45
- for (let i = 0; i < 12; i++) {
46
- id += PUSH_CHARS.charAt(lastRandChars[i]);
47
- }
48
- if (id.length !== 20) {
49
- throw new Error('Length should be 20.');
50
- }
51
- return id;
52
- }
53
-
54
- /**
55
- * Generate a firestore auto id for use with collection/document .add()
56
- * @return {string}
57
- */
58
- export function generateFirestoreId() {
59
- let autoId = '';
60
- for (let i = 0; i < 20; i++) {
61
- autoId += AUTO_ID_CHARS.charAt(Math.floor(Math.random() * AUTO_ID_CHARS.length));
62
- }
63
- return autoId;
64
- }
65
- //# sourceMappingURL=id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PUSH_CHARS","AUTO_ID_CHARS","lastPushTime","lastRandChars","generateDatabaseId","serverTimeOffset","arguments","length","undefined","timeStampChars","Array","now","Date","getTime","duplicateTime","i","charAt","Math","floor","Error","id","join","random","generateFirestoreId","autoId"],"sourceRoot":"../../../src","sources":["common/id.ts"],"mappings":"AAAA,MAAMA,UAAU,GAAG,kEAAkE;AAErF,MAAMC,aAAa,GAAG,gEAAgE;;AAEtF;AACA,IAAIC,YAAY,GAAG,CAAC;;AAEpB;AACA;AACA;AACA;AACA,MAAMC,aAAuB,GAAG,EAAE;;AAElC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAA,EAAuB;EAAA,IAAtBC,gBAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EACrD,MAAMG,cAAc,GAAG,IAAIC,KAAK,CAAC,CAAC,CAAC;EACnC,IAAIC,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,GAAGR,gBAAgB;EACjD,MAAMS,aAAa,GAAGH,GAAG,KAAKT,YAAY;EAE1CA,YAAY,GAAGS,GAAG;EAElB,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAI,CAAC,EAAEA,CAAC,IAAI,CAAC,EAAE;IAC9BN,cAAc,CAACM,CAAC,CAAC,GAAGf,UAAU,CAACgB,MAAM,CAACL,GAAG,GAAG,EAAE,CAAC;IAC/CA,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,IAAIvB,aAAa,CAACe,MAAM,CAACC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACK,MAAM,CAAC,CAAC,GAAGrB,aAAa,CAACM,MAAM,CAAC,CAAC;EAClF;EACA,OAAOiB,MAAM;AACf"}
@@ -1,110 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-present Invertase Limited & Contributors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this library except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- /**
19
- * Returns the next parent of the path e.g. /foo/bar/car -> /foo/bar
20
- */
21
- export function pathParent(path) {
22
- if (path.length === 0) {
23
- return null;
24
- }
25
- const index = path.lastIndexOf('/');
26
- if (index <= 0) {
27
- return null;
28
- }
29
- return path.slice(0, index);
30
- }
31
-
32
- /**
33
- * Joins a parent and a child path
34
- */
35
- export function pathChild(path, childPath) {
36
- const canonicalChildPath = pathPieces(childPath).join('/');
37
- if (path.length === 0) {
38
- return canonicalChildPath;
39
- }
40
- return `${path}/${canonicalChildPath}`;
41
- }
42
-
43
- /**
44
- * Returns the last component of a path, e.g /foo/bar.jpeg -> bar.jpeg
45
- */
46
- export function pathLastComponent(path) {
47
- const index = path.lastIndexOf('/', path.length - 2);
48
- if (index === -1) {
49
- return path;
50
- }
51
- return path.slice(index + 1);
52
- }
53
-
54
- /**
55
- * Returns all none empty pieces of the path
56
- * @param path
57
- * @returns {*}
58
- */
59
- export function pathPieces(path) {
60
- return path.split('/').filter($ => $.length > 0);
61
- }
62
-
63
- /**
64
- * Returns whether a given path is empty
65
- * @param path
66
- * @returns {boolean}
67
- */
68
- export function pathIsEmpty(path) {
69
- return !pathPieces(path).length;
70
- }
71
-
72
- /**
73
- * Converts a given path to a URL encoded string
74
- * @param path
75
- * @returns {string|string}
76
- */
77
- export function pathToUrlEncodedString(path) {
78
- const pieces = pathPieces(path);
79
- let pathString = '';
80
- for (let i = 0; i < pieces.length; i++) {
81
- pathString += `/${encodeURIComponent(String(pieces[i]))}`;
82
- }
83
- return pathString || '/';
84
- }
85
-
86
- // eslint-disable-next-line no-control-regex
87
- export const INVALID_PATH_REGEX = /[[\].#$\u0000-\u001F\u007F]/;
88
-
89
- /**
90
- * Ensures a given path is a valid Firebase path
91
- * @param path
92
- * @returns {boolean}
93
- */
94
- export function isValidPath(path) {
95
- return typeof path === 'string' && path.length !== 0 && !INVALID_PATH_REGEX.test(path);
96
- }
97
-
98
- /**
99
- * Converts a file path to a standardized string path
100
- * @param path
101
- * @returns {*}
102
- */
103
- export function toFilePath(path) {
104
- let _filePath = path.replace('file://', '');
105
- if (_filePath.includes('%')) {
106
- _filePath = decodeURIComponent(_filePath);
107
- }
108
- return _filePath;
109
- }
110
- //# sourceMappingURL=path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["pathParent","path","length","index","lastIndexOf","slice","pathChild","childPath","canonicalChildPath","pathPieces","join","pathLastComponent","split","filter","$","pathIsEmpty","pathToUrlEncodedString","pieces","pathString","i","encodeURIComponent","String","INVALID_PATH_REGEX","isValidPath","test","toFilePath","_filePath","replace","includes","decodeURIComponent"],"sourceRoot":"../../../src","sources":["common/path.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,SAASA,UAAUA,CAACC,IAAY,EAAE;EACvC,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;IACrB,OAAO,IAAI;EACb;EAEA,MAAMC,KAAK,GAAGF,IAAI,CAACG,WAAW,CAAC,GAAG,CAAC;EACnC,IAAID,KAAK,IAAI,CAAC,EAAE;I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AAEiB,CAAC,EAAE,EAAE;IACtCD,UAAU,IAAK,IAAGE,kBAAkB,CAACC,MAAM,CAACJ,MAAM,CAACE,CAAC,CAAC,CAAC,CAAE,EAAC;EAC3D;EACA,OAAOD,UAAU,IAAI,GAAG;AAC1B;;AAEA;AACA,OAAO,MAAMI,kBAAkB,GAAG,6BAA6B;;AAE/D;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACtB,IAAa,EAAE;EACzC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,IAAI,CAACoB,kBAAkB,CAACE,IAAI,CAACvB,IAAI,CAAC;AACxF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASwB,UAAUA,CAACxB,IAAY,EAAE;EACvC,IAAIyB,SAAS,GAAGzB,IAAI,CAAC0B,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;EAC3C,IAAID,SAAS,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;IAC3BF,SAAS,GAAGG,kBAAkB,CAACH,SAAS,CAAC;EAC3C;EACA,OAAOA,SAAS;AAClB"}
@@ -1,58 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-present Invertase Limited & Contributors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this library except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- import { isFunction } from './validate';
19
-
20
- /**
21
- *
22
- */
23
- export function promiseDefer() {
24
- const deferred = {
25
- promise: null,
26
- resolve: () => {},
27
- reject: () => {}
28
- };
29
- deferred.promise = new Promise((resolve, reject) => {
30
- deferred.resolve = resolve;
31
- deferred.reject = reject;
32
- });
33
- return deferred;
34
- }
35
-
36
- /**
37
- * @param promise
38
- * @param callback
39
- */
40
- export function promiseWithOptionalCallback(promise, callback) {
41
- if (!isFunction(callback)) {
42
- return promise;
43
- }
44
- return promise.then(result => {
45
- if (callback && callback.length === 1) {
46
- callback(null);
47
- } else if (callback) {
48
- callback(null, result);
49
- }
50
- return result;
51
- }).catch(error => {
52
- if (callback) {
53
- callback(error);
54
- }
55
- return Promise.reject(error);
56
- });
57
- }
58
- //# sourceMappingURL=promise.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["isFunction","promiseDefer","deferred","promise","resolve","reject","Promise","promiseWithOptionalCallback","callback","then","result","length","catch","error"],"sourceRoot":"../../../src","sources":["common/promise.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,YAAY;;AAEvC;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAG;EAC7B,MAAMC,QAIL,GAAG;IAAEC,OAAO,EAAE,IAAI;IAAEC,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IAAEC,MAAM,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAC;EAE1DH,QAAQ,CAACC,OAAO,GAAG,IAAIG,OAAO,CAAC,CAACF,OAAO,EAAEC,MAAM,KAAK;IAClDH,QAAQ,CAACE,OAAO,GAAGA,OAAO;IAC1BF,QAAQ,CAACG,MAAM,GAAGA,MAAM;EAC1B,CAAC,CAAC;EAEF,OAAOH,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,2BAA2BA,CACzCJ,OAAyB,EACzBK,QAA2C,EAC3C;EACA,IAAI,CAACR,UAAU,CAACQ,QAAQ,CAAC,EAAE;IACzB,OAAOL,OAAO;EAChB;EAEA,OAAOA,OAAO,CACXM,IAAI,CAACC,MAAM,IAAI;IACd,IAAIF,QAAQ,IAAIA,QAAQ,CAACG,MAAM,KAAK,CAAC,EAAE;MACrCH,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAC,MAAM,IAAIA,QAAQ,EAAE;MACnBA,QAAQ,CAAC,IAAI,EAAEE,MAAM,CAAC;IACxB;IAEA,OAAOA,MAAM;EACf,CAAC,CAAC,CACDE,KAAK,CAACC,KAAK,IAAI;IACd,IAAIL,QAAQ,EAAE;MACZA,QAAQ,CAACK,KAAK,CAAC;IACjB;IACA,OAAOP,OAAO,CAACD,MAAM,CAACQ,KAAK,CAAC;EAC9B,CAAC,CAAC;AACN"}
@@ -1,41 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-present Invertase Limited & Contributors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this library except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- import { tryJSONParse, tryJSONStringify } from './index';
19
- import { isObject } from './validate';
20
- export function serializeType(value) {
21
- if (isObject(value)) {
22
- return {
23
- type: 'object',
24
- value: serializeObject(value)
25
- };
26
- }
27
- return {
28
- type: typeof value,
29
- value
30
- };
31
- }
32
- export function serializeObject(object) {
33
- if (!isObject(object)) {
34
- return object;
35
- }
36
-
37
- // json stringify then parse it calls toString on Objects / Classes
38
- // that support it i.e new Date() becomes a ISO string.
39
- return tryJSONParse(tryJSONStringify(object) || '');
40
- }
41
- //# sourceMappingURL=serialize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["tryJSONParse","tryJSONStringify","isObject","serializeType","value","type","serializeObject","object"],"sourceRoot":"../../../src","sources":["common/serialize.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,EAAEC,gBAAgB,QAAQ,SAAS;AACxD,SAASC,QAAQ,QAAQ,YAAY;AAErC,OAAO,SAASC,aAAaA,CAACC,KAAc,EAAE;EAC5C,IAAIF,QAAQ,CAACE,KAAK,CAAC,EAAE;IACnB,OAAO;MACLC,IAAI,EAAE,QAAQ;MACdD,KAAK,EAAEE,eAAe,CAACF,KAAK;IAC9B,CAAC;EACH;EAEA,OAAO;IACLC,IAAI,EAAE,OAAOD,KAAK;IAClBA;EACF,CAAC;AACH;AAEA,OAAO,SAASE,eAAeA,CAACC,MAAe,EAAE;EAC/C,IAAI,CAACL,QAAQ,CAACK,MAAM,CAAC,EAAE;IACrB,OAAOA,MAAM;EACf;;EAEA;EACA;EACA,OAAOP,YAAY,CAACC,gBAAgB,CAACM,MAAM,CAAC,IAAI,EAAE,CAAC;AACrD"}
@@ -1,15 +0,0 @@
1
- /// <reference types="react-native" />
2
- /// <reference types="node" />
3
- /**
4
- * window.btoa
5
- */
6
- export declare function btoa(input: string): string;
7
- /**
8
- * window.atob
9
- */
10
- export declare function atob(input: string): string;
11
- /**
12
- * Converts a Blob, ArrayBuffer or Uint8Array to a base64 string.
13
- */
14
- export declare function fromData(data: Blob | ArrayBuffer | Uint8Array): Promise<unknown> | null;
15
- //# sourceMappingURL=Base64.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Base64.d.ts","sourceRoot":"","sources":["../../../src/common/Base64.ts"],"names":[],"mappings":";;AAwBA;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,UAuBjC;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,UA0BjC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,UAAU,2BA2B7D"}
@@ -1,10 +0,0 @@
1
- export declare class MutatableParams {
2
- _mutatableParams: Record<string, unknown>;
3
- _parentInstance: MutatableParams;
4
- constructor(parentInstance: MutatableParams);
5
- set(param: string, value: unknown): MutatableParams;
6
- get(param: string): unknown;
7
- toJSON(): Record<string, unknown>;
8
- validate(): void;
9
- }
10
- //# sourceMappingURL=MutatableParams.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MutatableParams.d.ts","sourceRoot":"","sources":["../../../src/common/MutatableParams.ts"],"names":[],"mappings":"AAmBA,qBAAa,eAAe;IAC1B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,eAAe,EAAE,eAAe,CAAC;gBAErB,cAAc,EAAE,eAAe;IAU3C,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAKjC,GAAG,CAAC,KAAK,EAAE,MAAM;IAIjB,MAAM;IAIN,QAAQ;CAGT"}
@@ -1,12 +0,0 @@
1
- export declare class ReferenceBase {
2
- path: string;
3
- constructor(_path: string);
4
- /**
5
- * The last part of a Reference's path (after the last '/')
6
- * The key of a root Reference is null.
7
- * @type {String}
8
- * {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#key}
9
- */
10
- get key(): string | null;
11
- }
12
- //# sourceMappingURL=ReferenceBase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferenceBase.d.ts","sourceRoot":"","sources":["../../../src/common/ReferenceBase.ts"],"names":[],"mappings":"AAiBA,qBAAa,aAAa;IACxB,IAAI,EAAE,MAAM,CAAC;gBAED,KAAK,EAAE,MAAM;IAezB;;;;;OAKG;IACH,IAAI,GAAG,kBAEN;CACF"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Deep get a value from an object.
3
- * @website https://github.com/Salakar/deeps
4
- * @param object
5
- * @param path
6
- * @param joiner
7
- * @returns {*}
8
- */
9
- export declare function deepGet(object: Record<string, unknown>, path: string, joiner?: string): unknown;
10
- /**
11
- * Deep set a value
12
- * @param object
13
- * @param path
14
- * @param value
15
- * @param initPaths
16
- * @param joiner
17
- */
18
- export declare function deepSet(object: Record<string, unknown>, path: string, value: unknown, initPaths?: boolean, joiner?: string): boolean;
19
- //# sourceMappingURL=deeps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deeps.d.ts","sourceRoot":"","sources":["../../../src/common/deeps.ts"],"names":[],"mappings":"AAmBA;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAM,WAmBlF;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,SAAS,UAAO,EAChB,MAAM,SAAM,WA0Bb"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Generate a firebase id - for use with ref().push(val, cb) - e.g. -KXMr7k2tXUFQqiaZRY4'
3
- * @param serverTimeOffset - pass in server time offset from native side
4
- * @returns {string}
5
- */
6
- export declare function generateDatabaseId(serverTimeOffset?: number): string;
7
- /**
8
- * Generate a firestore auto id for use with collection/document .add()
9
- * @return {string}
10
- */
11
- export declare function generateFirestoreId(): string;
12
- //# sourceMappingURL=id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/common/id.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,gBAAgB,SAAI,UA0CtD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,WAOlC"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Returns the next parent of the path e.g. /foo/bar/car -> /foo/bar
3
- */
4
- export declare function pathParent(path: string): string | null;
5
- /**
6
- * Joins a parent and a child path
7
- */
8
- export declare function pathChild(path: string, childPath: string): string;
9
- /**
10
- * Returns the last component of a path, e.g /foo/bar.jpeg -> bar.jpeg
11
- */
12
- export declare function pathLastComponent(path: string): string;
13
- /**
14
- * Returns all none empty pieces of the path
15
- * @param path
16
- * @returns {*}
17
- */
18
- export declare function pathPieces(path: string): string[];
19
- /**
20
- * Returns whether a given path is empty
21
- * @param path
22
- * @returns {boolean}
23
- */
24
- export declare function pathIsEmpty(path: string): boolean;
25
- /**
26
- * Converts a given path to a URL encoded string
27
- * @param path
28
- * @returns {string|string}
29
- */
30
- export declare function pathToUrlEncodedString(path: string): string;
31
- export declare const INVALID_PATH_REGEX: RegExp;
32
- /**
33
- * Ensures a given path is a valid Firebase path
34
- * @param path
35
- * @returns {boolean}
36
- */
37
- export declare function isValidPath(path: unknown): boolean;
38
- /**
39
- * Converts a file path to a standardized string path
40
- * @param path
41
- * @returns {*}
42
- */
43
- export declare function toFilePath(path: string): string;
44
- //# sourceMappingURL=path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/common/path.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,iBAWtC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAQxD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAO7C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,YAEtC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,WAEvC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,UAOlD;AAGD,eAAO,MAAM,kBAAkB,QAAgC,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,WAExC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAMtC"}
@@ -1,14 +0,0 @@
1
- /**
2
- *
3
- */
4
- export declare function promiseDefer(): {
5
- promise: Promise<unknown> | null;
6
- resolve: (value: unknown) => void;
7
- reject: (value: unknown) => void;
8
- };
9
- /**
10
- * @param promise
11
- * @param callback
12
- */
13
- export declare function promiseWithOptionalCallback(promise: Promise<unknown>, callback: (a: unknown, b?: unknown) => void): Promise<unknown>;
14
- //# sourceMappingURL=promise.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../../src/common/promise.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,wBAAgB,YAAY;aAEf,QAAQ,OAAO,CAAC,GAAG,IAAI;qBACf,OAAO,KAAK,IAAI;oBACjB,OAAO,KAAK,IAAI;EASnC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,oBAsB5C"}
@@ -1,6 +0,0 @@
1
- export declare function serializeType(value: unknown): {
2
- type: string;
3
- value: any;
4
- };
5
- export declare function serializeObject(object: unknown): any;
6
- //# sourceMappingURL=serialize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/common/serialize.ts"],"names":[],"mappings":"AAoBA,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO;;;EAY3C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,OAQ9C"}
@@ -1,114 +0,0 @@
1
- /* eslint-disable no-bitwise */
2
- /* global Blob, FileReader */
3
- /*
4
- * Copyright (c) 2016-present Invertase Limited & Contributors
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this library except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- */
19
-
20
- import binaryToBase64 from 'react-native/Libraries/Utilities/binaryToBase64';
21
- import { promiseDefer } from './promise';
22
-
23
- const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
24
-
25
- /**
26
- * window.btoa
27
- */
28
- export function btoa(input: string) {
29
- let map;
30
- let i = 0;
31
- let block = 0;
32
- let output = '';
33
-
34
- for (
35
- block = 0, i = 0, map = CHARS;
36
- input.charAt(i | 0) || ((map = '='), i % 1);
37
- output += map.charAt(63 & (block >> (8 - (i % 1) * 8)))
38
- ) {
39
- const charCode = input.charCodeAt((i += 3 / 4));
40
-
41
- if (charCode > 0xff) {
42
- throw new Error(
43
- "'RNFirebase.Base64.btoa' failed: The string to be encoded contains characters outside of the Latin1 range.",
44
- );
45
- }
46
-
47
- block = (block << 8) | charCode;
48
- }
49
-
50
- return output;
51
- }
52
-
53
- /**
54
- * window.atob
55
- */
56
- export function atob(input: string) {
57
- let i = 0;
58
- let bc = 0;
59
- let bs = 0;
60
- let buffer;
61
- let output = '';
62
-
63
- const str = input.replace(/[=]+$/, '');
64
-
65
- if (str.length % 4 === 1) {
66
- throw new Error(
67
- "'RNFirebase.Base64.atob' failed: The string to be decoded is not correctly encoded.",
68
- );
69
- }
70
-
71
- for (
72
- bc = 0, bs = 0, i = 0;
73
- (buffer = str.charAt(i++));
74
- ~buffer && ((bs = bc % 4 ? bs * 64 + buffer : buffer), bc++ % 4)
75
- ? (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6))))
76
- : 0
77
- ) {
78
- buffer = CHARS.indexOf(buffer);
79
- }
80
-
81
- return output;
82
- }
83
-
84
- /**
85
- * Converts a Blob, ArrayBuffer or Uint8Array to a base64 string.
86
- */
87
- export function fromData(data: Blob | ArrayBuffer | Uint8Array) {
88
- if (data instanceof Blob) {
89
- const fileReader = new FileReader();
90
- const { resolve, reject, promise } = promiseDefer();
91
-
92
- fileReader.readAsDataURL(data);
93
-
94
- fileReader.onloadend = function onloadend() {
95
- resolve({ string: fileReader.result, format: 'data_url' });
96
- };
97
-
98
- fileReader.onerror = function onerror(event) {
99
- fileReader.abort();
100
- reject(event);
101
- };
102
-
103
- return promise;
104
- }
105
-
106
- if (data instanceof ArrayBuffer || data instanceof Uint8Array) {
107
- return Promise.resolve({
108
- string: binaryToBase64(data),
109
- format: 'base64',
110
- });
111
- }
112
-
113
- throw new Error("'RNFirebase.Base64.fromData' failed: Unknown data type.");
114
- }
@@ -1,50 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-present Invertase Limited & Contributors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this library except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- import { deepGet, deepSet } from './deeps';
19
-
20
- export class MutatableParams {
21
- _mutatableParams: Record<string, unknown>;
22
- _parentInstance: MutatableParams;
23
-
24
- constructor(parentInstance: MutatableParams) {
25
- if (parentInstance) {
26
- this._mutatableParams = parentInstance._mutatableParams;
27
- this._parentInstance = parentInstance;
28
- } else {
29
- this._mutatableParams = {};
30
- this._parentInstance = this;
31
- }
32
- }
33
-
34
- set(param: string, value: unknown) {
35
- deepSet(this._mutatableParams, param, value);
36
- return this._parentInstance;
37
- }
38
-
39
- get(param: string) {
40
- return deepGet(this._mutatableParams, param, '.');
41
- }
42
-
43
- toJSON() {
44
- return Object.assign({}, this._mutatableParams);
45
- }
46
-
47
- validate() {
48
- // do nothing
49
- }
50
- }