react-native-google-mobile-ads 12.1.1 → 12.2.0
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/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +25 -22
- package/docs/index.mdx +19 -4
- package/lib/commonjs/common/index.js +1 -140
- package/lib/commonjs/common/index.js.map +1 -1
- package/lib/commonjs/common/validate.js +0 -89
- package/lib/commonjs/common/validate.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/common/index.js +1 -78
- package/lib/module/common/index.js.map +1 -1
- package/lib/module/common/validate.js +0 -81
- package/lib/module/common/validate.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/common/index.d.ts +0 -26
- package/lib/typescript/common/index.d.ts.map +1 -1
- package/lib/typescript/common/validate.d.ts +0 -35
- package/lib/typescript/common/validate.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/common/index.ts +1 -81
- package/src/common/validate.ts +0 -98
- package/src/version.ts +1 -1
- package/lib/commonjs/common/Base64.js +0 -102
- package/lib/commonjs/common/Base64.js.map +0 -1
- package/lib/commonjs/common/MutatableParams.js +0 -50
- package/lib/commonjs/common/MutatableParams.js.map +0 -1
- package/lib/commonjs/common/ReferenceBase.js +0 -49
- package/lib/commonjs/common/ReferenceBase.js.map +0 -1
- package/lib/commonjs/common/deeps.js +0 -85
- package/lib/commonjs/common/deeps.js.map +0 -1
- package/lib/commonjs/common/id.js +0 -72
- package/lib/commonjs/common/id.js.map +0 -1
- package/lib/commonjs/common/path.js +0 -125
- package/lib/commonjs/common/path.js.map +0 -1
- package/lib/commonjs/common/promise.js +0 -64
- package/lib/commonjs/common/promise.js.map +0 -1
- package/lib/commonjs/common/serialize.js +0 -48
- package/lib/commonjs/common/serialize.js.map +0 -1
- package/lib/module/common/Base64.js +0 -93
- package/lib/module/common/Base64.js.map +0 -1
- package/lib/module/common/MutatableParams.js +0 -43
- package/lib/module/common/MutatableParams.js.map +0 -1
- package/lib/module/common/ReferenceBase.js +0 -42
- package/lib/module/common/ReferenceBase.js.map +0 -1
- package/lib/module/common/deeps.js +0 -79
- package/lib/module/common/deeps.js.map +0 -1
- package/lib/module/common/id.js +0 -65
- package/lib/module/common/id.js.map +0 -1
- package/lib/module/common/path.js +0 -110
- package/lib/module/common/path.js.map +0 -1
- package/lib/module/common/promise.js +0 -58
- package/lib/module/common/promise.js.map +0 -1
- package/lib/module/common/serialize.js +0 -41
- package/lib/module/common/serialize.js.map +0 -1
- package/lib/typescript/common/Base64.d.ts +0 -15
- package/lib/typescript/common/Base64.d.ts.map +0 -1
- package/lib/typescript/common/MutatableParams.d.ts +0 -10
- package/lib/typescript/common/MutatableParams.d.ts.map +0 -1
- package/lib/typescript/common/ReferenceBase.d.ts +0 -12
- package/lib/typescript/common/ReferenceBase.d.ts.map +0 -1
- package/lib/typescript/common/deeps.d.ts +0 -19
- package/lib/typescript/common/deeps.d.ts.map +0 -1
- package/lib/typescript/common/id.d.ts +0 -12
- package/lib/typescript/common/id.d.ts.map +0 -1
- package/lib/typescript/common/path.d.ts +0 -44
- package/lib/typescript/common/path.d.ts.map +0 -1
- package/lib/typescript/common/promise.d.ts +0 -14
- package/lib/typescript/common/promise.d.ts.map +0 -1
- package/lib/typescript/common/serialize.d.ts +0 -6
- package/lib/typescript/common/serialize.d.ts.map +0 -1
- package/src/common/Base64.ts +0 -114
- package/src/common/MutatableParams.ts +0 -50
- package/src/common/ReferenceBase.ts +0 -45
- package/src/common/deeps.ts +0 -88
- package/src/common/id.ts +0 -74
- package/src/common/path.ts +0 -114
- package/src/common/promise.ts +0 -66
- package/src/common/serialize.ts +0 -43
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ReferenceBase = void 0;
|
|
7
|
-
/*
|
|
8
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
9
|
-
*
|
|
10
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
-
* you may not use this library except in compliance with the License.
|
|
12
|
-
* You may obtain a copy of the License at
|
|
13
|
-
*
|
|
14
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
*
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
* See the License for the specific language governing permissions and
|
|
20
|
-
* limitations under the License.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
class ReferenceBase {
|
|
25
|
-
constructor(_path) {
|
|
26
|
-
let path = _path;
|
|
27
|
-
if (path) {
|
|
28
|
-
path = path.length > 1 && path.endsWith('/') ? path.substring(0, path.length - 1) : path;
|
|
29
|
-
if (path.startsWith('/') && path.length > 1) {
|
|
30
|
-
path = path.substring(1, path.length);
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
path = '/';
|
|
34
|
-
}
|
|
35
|
-
this.path = path;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The last part of a Reference's path (after the last '/')
|
|
40
|
-
* The key of a root Reference is null.
|
|
41
|
-
* @type {String}
|
|
42
|
-
* {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#key}
|
|
43
|
-
*/
|
|
44
|
-
get key() {
|
|
45
|
-
return this.path === '/' ? null : this.path.substring(this.path.lastIndexOf('/') + 1);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.ReferenceBase = ReferenceBase;
|
|
49
|
-
//# sourceMappingURL=ReferenceBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ReferenceBase","constructor","_path","path","length","endsWith","substring","startsWith","key","lastIndexOf","exports"],"sourceRoot":"../../../src","sources":["common/ReferenceBase.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,aAAa,CAAC;EAGzBC,WAAWA,CAACC,KAAa,EAAE;IACzB,IAAIC,IAAI,GAAGD,KAAK;IAEhB,IAAIC,IAAI,EAAE;MACRA,IAAI,GAAGA,IAAI,CAACC,MAAM,GAAG,CAAC,IAAID,IAAI,CAACE,QAAQ,CAAC,GAAG,CAAC,GAAGF,IAAI,CAACG,SAAS,CAAC,CAAC,EAAEH,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC,GAAGD,IAAI;MACxF,IAAIA,IAAI,CAACI,UAAU,CAAC,GAAG,CAAC,IAAIJ,IAAI,CAACC,MAAM,GAAG,CAAC,EAAE;QAC3CD,IAAI,GAAGA,IAAI,CAACG,SAAS,CAAC,CAAC,EAAEH,IAAI,CAACC,MAAM,CAAC;MACvC;IACF,CAAC,MAAM;MACLD,IAAI,GAAG,GAAG;IACZ;IAEA,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAIK,GAAGA,CAAA,EAAG;IACR,OAAO,IAAI,CAACL,IAAI,KAAK,GAAG,GAAG,IAAI,GAAG,IAAI,CAACA,IAAI,CAACG,SAAS,CAAC,IAAI,CAACH,IAAI,CAACM,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;EACvF;AACF;AAACC,OAAA,CAAAV,aAAA,GAAAA,aAAA"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.deepGet = deepGet;
|
|
7
|
-
exports.deepSet = deepSet;
|
|
8
|
-
var _validate = require("./validate");
|
|
9
|
-
/*
|
|
10
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
* you may not use this library except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Deep get a value from an object.
|
|
28
|
-
* @website https://github.com/Salakar/deeps
|
|
29
|
-
* @param object
|
|
30
|
-
* @param path
|
|
31
|
-
* @param joiner
|
|
32
|
-
* @returns {*}
|
|
33
|
-
*/
|
|
34
|
-
function deepGet(object, path) {
|
|
35
|
-
let joiner = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '/';
|
|
36
|
-
if (!(0, _validate.isObject)(object) && !Array.isArray(object)) {
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
const keys = path.split(joiner);
|
|
40
|
-
let i = 0;
|
|
41
|
-
let value;
|
|
42
|
-
const len = keys.length;
|
|
43
|
-
while (i < len) {
|
|
44
|
-
const key = keys[i++];
|
|
45
|
-
if (!object || !Object.hasOwnProperty.call(object, key)) {
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
value = object[key];
|
|
49
|
-
}
|
|
50
|
-
return value;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Deep set a value
|
|
55
|
-
* @param object
|
|
56
|
-
* @param path
|
|
57
|
-
* @param value
|
|
58
|
-
* @param initPaths
|
|
59
|
-
* @param joiner
|
|
60
|
-
*/
|
|
61
|
-
function deepSet(object, path, value) {
|
|
62
|
-
let initPaths = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
63
|
-
let joiner = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '.';
|
|
64
|
-
if (!(0, _validate.isObject)(object)) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
const keys = path.split(joiner);
|
|
68
|
-
let i = 0;
|
|
69
|
-
let _object = object;
|
|
70
|
-
const len = keys.length - 1;
|
|
71
|
-
while (i < len) {
|
|
72
|
-
const key = keys[i++];
|
|
73
|
-
if (initPaths && !Object.hasOwnProperty.call(object, key)) {
|
|
74
|
-
_object[key] = {};
|
|
75
|
-
}
|
|
76
|
-
_object = _object[key];
|
|
77
|
-
}
|
|
78
|
-
if ((0, _validate.isObject)(_object) || (0, _validate.isArray)(_object) && !Number.isNaN(keys[i])) {
|
|
79
|
-
_object[keys[i]] = value;
|
|
80
|
-
} else {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=deeps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_validate","require","deepGet","object","path","joiner","arguments","length","undefined","isObject","Array","isArray","keys","split","i","value","len","key","Object","hasOwnProperty","call","deepSet","initPaths","_object","Number","isNaN"],"sourceRoot":"../../../src","sources":["common/deeps.ts"],"mappings":";;;;;;;AAiBA,IAAAA,SAAA,GAAAC,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAACC,MAA+B,EAAEC,IAAY,EAAgB;EAAA,IAAdC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,G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,CAACE,CAAC,EAAE,CAAC;IACrB,IAAIQ,SAAS,IAAI,CAACJ,MAAM,CAACC,cAAc,CAACC,IAAI,CAACjB,MAAM,EAAEc,GAAG,CAAC,EAAE;MACzDM,OAAO,CAACN,GAAG,CAAC,GAAG,CAAC,CAAC;IACnB;IACAM,OAAO,GAAGA,OAAO,CAACN,GAAG,CAA4B;EACnD;EAEA,IAAI,IAAAR,kBAAQ,EAACc,OAAO,CAAC,IAAK,IAAAZ,iBAAO,EAACY,OAAO,CAAC,IAAI,CAACC,MAAM,CAACC,KAAK,CAACb,IAAI,CAACE,CAAC,CAAC,CAAE,EAAE;IACrES,OAAO,CAACX,IAAI,CAACE,CAAC,CAAC,CAAC,GAAGC,KAAK;EAC1B,CAAC,MAAM;IACL,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.generateDatabaseId = generateDatabaseId;
|
|
7
|
-
exports.generateFirestoreId = generateFirestoreId;
|
|
8
|
-
const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
|
|
9
|
-
const AUTO_ID_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
10
|
-
|
|
11
|
-
// timestamp of last push, used to prevent local collisions if you push twice in one ms.
|
|
12
|
-
let lastPushTime = 0;
|
|
13
|
-
|
|
14
|
-
// we generate 72-bits of randomness which get turned into 12 characters and appended to the
|
|
15
|
-
// timestamp to prevent collisions with other clients. We store the last characters we
|
|
16
|
-
// generated because in the event of a collision, we'll use those same characters except
|
|
17
|
-
// "incremented" by one.
|
|
18
|
-
const lastRandChars = [];
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Generate a firebase id - for use with ref().push(val, cb) - e.g. -KXMr7k2tXUFQqiaZRY4'
|
|
22
|
-
* @param serverTimeOffset - pass in server time offset from native side
|
|
23
|
-
* @returns {string}
|
|
24
|
-
*/
|
|
25
|
-
function generateDatabaseId() {
|
|
26
|
-
let serverTimeOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27
|
-
const timeStampChars = new Array(8);
|
|
28
|
-
let now = new Date().getTime() + serverTimeOffset;
|
|
29
|
-
const duplicateTime = now === lastPushTime;
|
|
30
|
-
lastPushTime = now;
|
|
31
|
-
for (let i = 7; i >= 0; i -= 1) {
|
|
32
|
-
timeStampChars[i] = PUSH_CHARS.charAt(now % 64);
|
|
33
|
-
now = Math.floor(now / 64);
|
|
34
|
-
}
|
|
35
|
-
if (now !== 0) {
|
|
36
|
-
throw new Error('We should have converted the entire timestamp.');
|
|
37
|
-
}
|
|
38
|
-
let id = timeStampChars.join('');
|
|
39
|
-
if (!duplicateTime) {
|
|
40
|
-
for (let i = 0; i < 12; i += 1) {
|
|
41
|
-
lastRandChars[i] = Math.floor(Math.random() * 64);
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
// if the timestamp hasn't changed since last push,
|
|
45
|
-
// use the same random number, but increment it by 1.
|
|
46
|
-
let i;
|
|
47
|
-
for (i = 11; i >= 0 && lastRandChars[i] === 63; i -= 1) {
|
|
48
|
-
lastRandChars[i] = 0;
|
|
49
|
-
}
|
|
50
|
-
lastRandChars[i] += 1;
|
|
51
|
-
}
|
|
52
|
-
for (let i = 0; i < 12; i++) {
|
|
53
|
-
id += PUSH_CHARS.charAt(lastRandChars[i]);
|
|
54
|
-
}
|
|
55
|
-
if (id.length !== 20) {
|
|
56
|
-
throw new Error('Length should be 20.');
|
|
57
|
-
}
|
|
58
|
-
return id;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Generate a firestore auto id for use with collection/document .add()
|
|
63
|
-
* @return {string}
|
|
64
|
-
*/
|
|
65
|
-
function generateFirestoreId() {
|
|
66
|
-
let autoId = '';
|
|
67
|
-
for (let i = 0; i < 20; i++) {
|
|
68
|
-
autoId += AUTO_ID_CHARS.charAt(Math.floor(Math.random() * AUTO_ID_CHARS.length));
|
|
69
|
-
}
|
|
70
|
-
return autoId;
|
|
71
|
-
}
|
|
72
|
-
//# 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;AACO,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,GAAG,GAAGM,IAAI,C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,CAACC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACK,MAAM,CAAC,CAAC,GAAGrB,aAAa,CAACM,MAAM,CAAC,CAAC;EAClF;EACA,OAAOiB,MAAM;AACf"}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.INVALID_PATH_REGEX = void 0;
|
|
7
|
-
exports.isValidPath = isValidPath;
|
|
8
|
-
exports.pathChild = pathChild;
|
|
9
|
-
exports.pathIsEmpty = pathIsEmpty;
|
|
10
|
-
exports.pathLastComponent = pathLastComponent;
|
|
11
|
-
exports.pathParent = pathParent;
|
|
12
|
-
exports.pathPieces = pathPieces;
|
|
13
|
-
exports.pathToUrlEncodedString = pathToUrlEncodedString;
|
|
14
|
-
exports.toFilePath = toFilePath;
|
|
15
|
-
/*
|
|
16
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
17
|
-
*
|
|
18
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
|
-
* you may not use this library except in compliance with the License.
|
|
20
|
-
* You may obtain a copy of the License at
|
|
21
|
-
*
|
|
22
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
-
*
|
|
24
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
25
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
26
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27
|
-
* See the License for the specific language governing permissions and
|
|
28
|
-
* limitations under the License.
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Returns the next parent of the path e.g. /foo/bar/car -> /foo/bar
|
|
34
|
-
*/
|
|
35
|
-
function pathParent(path) {
|
|
36
|
-
if (path.length === 0) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
const index = path.lastIndexOf('/');
|
|
40
|
-
if (index <= 0) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
return path.slice(0, index);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Joins a parent and a child path
|
|
48
|
-
*/
|
|
49
|
-
function pathChild(path, childPath) {
|
|
50
|
-
const canonicalChildPath = pathPieces(childPath).join('/');
|
|
51
|
-
if (path.length === 0) {
|
|
52
|
-
return canonicalChildPath;
|
|
53
|
-
}
|
|
54
|
-
return `${path}/${canonicalChildPath}`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Returns the last component of a path, e.g /foo/bar.jpeg -> bar.jpeg
|
|
59
|
-
*/
|
|
60
|
-
function pathLastComponent(path) {
|
|
61
|
-
const index = path.lastIndexOf('/', path.length - 2);
|
|
62
|
-
if (index === -1) {
|
|
63
|
-
return path;
|
|
64
|
-
}
|
|
65
|
-
return path.slice(index + 1);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Returns all none empty pieces of the path
|
|
70
|
-
* @param path
|
|
71
|
-
* @returns {*}
|
|
72
|
-
*/
|
|
73
|
-
function pathPieces(path) {
|
|
74
|
-
return path.split('/').filter($ => $.length > 0);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Returns whether a given path is empty
|
|
79
|
-
* @param path
|
|
80
|
-
* @returns {boolean}
|
|
81
|
-
*/
|
|
82
|
-
function pathIsEmpty(path) {
|
|
83
|
-
return !pathPieces(path).length;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Converts a given path to a URL encoded string
|
|
88
|
-
* @param path
|
|
89
|
-
* @returns {string|string}
|
|
90
|
-
*/
|
|
91
|
-
function pathToUrlEncodedString(path) {
|
|
92
|
-
const pieces = pathPieces(path);
|
|
93
|
-
let pathString = '';
|
|
94
|
-
for (let i = 0; i < pieces.length; i++) {
|
|
95
|
-
pathString += `/${encodeURIComponent(String(pieces[i]))}`;
|
|
96
|
-
}
|
|
97
|
-
return pathString || '/';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// eslint-disable-next-line no-control-regex
|
|
101
|
-
const INVALID_PATH_REGEX = /[[\].#$\u0000-\u001F\u007F]/;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Ensures a given path is a valid Firebase path
|
|
105
|
-
* @param path
|
|
106
|
-
* @returns {boolean}
|
|
107
|
-
*/
|
|
108
|
-
exports.INVALID_PATH_REGEX = INVALID_PATH_REGEX;
|
|
109
|
-
function isValidPath(path) {
|
|
110
|
-
return typeof path === 'string' && path.length !== 0 && !INVALID_PATH_REGEX.test(path);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Converts a file path to a standardized string path
|
|
115
|
-
* @param path
|
|
116
|
-
* @returns {*}
|
|
117
|
-
*/
|
|
118
|
-
function toFilePath(path) {
|
|
119
|
-
let _filePath = path.replace('file://', '');
|
|
120
|
-
if (_filePath.includes('%')) {
|
|
121
|
-
_filePath = decodeURIComponent(_filePath);
|
|
122
|
-
}
|
|
123
|
-
return _filePath;
|
|
124
|
-
}
|
|
125
|
-
//# 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","exports","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;AACO,SAASA,UAAUA,CAACC,IAAY,EAAE;EACvC,IAAIA,IAAI,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IAAI,CAAC;EAC/B,IAAIiB,UAAU,GAAG,EAAE;EACnB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACf,MAAM,EAAEiB,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;AACO,MAAMI,kBAAkB,GAAG,6BAA6B;;AAE/D;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAD,kBAAA,GAAAA,kBAAA;AAKO,SAASE,WAAWA,CAACvB,IAAa,EAAE;EACzC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,IAAI,CAACoB,kBAAkB,CAACG,IAAI,CAACxB,IAAI,CAAC;AACxF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASyB,UAAUA,CAACzB,IAAY,EAAE;EACvC,IAAI0B,SAAS,GAAG1B,IAAI,CAAC2B,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,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.promiseDefer = promiseDefer;
|
|
7
|
-
exports.promiseWithOptionalCallback = promiseWithOptionalCallback;
|
|
8
|
-
var _validate = require("./validate");
|
|
9
|
-
/*
|
|
10
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
* you may not use this library except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
function promiseDefer() {
|
|
30
|
-
const deferred = {
|
|
31
|
-
promise: null,
|
|
32
|
-
resolve: () => {},
|
|
33
|
-
reject: () => {}
|
|
34
|
-
};
|
|
35
|
-
deferred.promise = new Promise((resolve, reject) => {
|
|
36
|
-
deferred.resolve = resolve;
|
|
37
|
-
deferred.reject = reject;
|
|
38
|
-
});
|
|
39
|
-
return deferred;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @param promise
|
|
44
|
-
* @param callback
|
|
45
|
-
*/
|
|
46
|
-
function promiseWithOptionalCallback(promise, callback) {
|
|
47
|
-
if (!(0, _validate.isFunction)(callback)) {
|
|
48
|
-
return promise;
|
|
49
|
-
}
|
|
50
|
-
return promise.then(result => {
|
|
51
|
-
if (callback && callback.length === 1) {
|
|
52
|
-
callback(null);
|
|
53
|
-
} else if (callback) {
|
|
54
|
-
callback(null, result);
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
}).catch(error => {
|
|
58
|
-
if (callback) {
|
|
59
|
-
callback(error);
|
|
60
|
-
}
|
|
61
|
-
return Promise.reject(error);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=promise.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_validate","require","promiseDefer","deferred","promise","resolve","reject","Promise","promiseWithOptionalCallback","callback","isFunction","then","result","length","catch","error"],"sourceRoot":"../../../src","sources":["common/promise.ts"],"mappings":";;;;;;;AAiBA,IAAAA,SAAA,GAAAC,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACO,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;AACO,SAASK,2BAA2BA,CACzCJ,OAAyB,EACzBK,QAA2C,EAC3C;EACA,IAAI,CAAC,IAAAC,oBAAU,EAACD,QAAQ,CAAC,EAAE;IACzB,OAAOL,OAAO;EAChB;EAEA,OAAOA,OAAO,CACXO,IAAI,CAACC,MAAM,IAAI;IACd,IAAIH,QAAQ,IAAIA,QAAQ,CAACI,MAAM,KAAK,CAAC,EAAE;MACrCJ,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAC,MAAM,IAAIA,QAAQ,EAAE;MACnBA,QAAQ,CAAC,IAAI,EAAEG,MAAM,CAAC;IACxB;IAEA,OAAOA,MAAM;EACf,CAAC,CAAC,CACDE,KAAK,CAACC,KAAK,IAAI;IACd,IAAIN,QAAQ,EAAE;MACZA,QAAQ,CAACM,KAAK,CAAC;IACjB;IACA,OAAOR,OAAO,CAACD,MAAM,CAACS,KAAK,CAAC;EAC9B,CAAC,CAAC;AACN"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.serializeObject = serializeObject;
|
|
7
|
-
exports.serializeType = serializeType;
|
|
8
|
-
var _index = require("./index");
|
|
9
|
-
var _validate = require("./validate");
|
|
10
|
-
/*
|
|
11
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
12
|
-
*
|
|
13
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
* you may not use this library except in compliance with the License.
|
|
15
|
-
* You may obtain a copy of the License at
|
|
16
|
-
*
|
|
17
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
*
|
|
19
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
* See the License for the specific language governing permissions and
|
|
23
|
-
* limitations under the License.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
function serializeType(value) {
|
|
28
|
-
if ((0, _validate.isObject)(value)) {
|
|
29
|
-
return {
|
|
30
|
-
type: 'object',
|
|
31
|
-
value: serializeObject(value)
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
type: typeof value,
|
|
36
|
-
value
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function serializeObject(object) {
|
|
40
|
-
if (!(0, _validate.isObject)(object)) {
|
|
41
|
-
return object;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// json stringify then parse it calls toString on Objects / Classes
|
|
45
|
-
// that support it i.e new Date() becomes a ISO string.
|
|
46
|
-
return (0, _index.tryJSONParse)((0, _index.tryJSONStringify)(object) || '');
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=serialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","_validate","serializeType","value","isObject","type","serializeObject","object","tryJSONParse","tryJSONStringify"],"sourceRoot":"../../../src","sources":["common/serialize.ts"],"mappings":";;;;;;;AAiBA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,SAASE,aAAaA,CAACC,KAAc,EAAE;EAC5C,IAAI,IAAAC,kBAAQ,EAACD,KAAK,CAAC,EAAE;IACnB,OAAO;MACLE,IAAI,EAAE,QAAQ;MACdF,KAAK,EAAEG,eAAe,CAACH,KAAK;IAC9B,CAAC;EACH;EAEA,OAAO;IACLE,IAAI,EAAE,OAAOF,KAAK;IAClBA;EACF,CAAC;AACH;AAEO,SAASG,eAAeA,CAACC,MAAe,EAAE;EAC/C,IAAI,CAAC,IAAAH,kBAAQ,EAACG,MAAM,CAAC,EAAE;IACrB,OAAOA,MAAM;EACf;;EAEA;EACA;EACA,OAAO,IAAAC,mBAAY,EAAC,IAAAC,uBAAgB,EAACF,MAAM,CAAC,IAAI,EAAE,CAAC;AACrD"}
|
|
@@ -1,93 +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
|
-
const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* window.btoa
|
|
26
|
-
*/
|
|
27
|
-
export function btoa(input) {
|
|
28
|
-
let map;
|
|
29
|
-
let i = 0;
|
|
30
|
-
let block = 0;
|
|
31
|
-
let output = '';
|
|
32
|
-
for (block = 0, i = 0, map = CHARS; input.charAt(i | 0) || (map = '=', i % 1); output += map.charAt(63 & block >> 8 - i % 1 * 8)) {
|
|
33
|
-
const charCode = input.charCodeAt(i += 3 / 4);
|
|
34
|
-
if (charCode > 0xff) {
|
|
35
|
-
throw new Error("'RNFirebase.Base64.btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
|
|
36
|
-
}
|
|
37
|
-
block = block << 8 | charCode;
|
|
38
|
-
}
|
|
39
|
-
return output;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* window.atob
|
|
44
|
-
*/
|
|
45
|
-
export function atob(input) {
|
|
46
|
-
let i = 0;
|
|
47
|
-
let bc = 0;
|
|
48
|
-
let bs = 0;
|
|
49
|
-
let buffer;
|
|
50
|
-
let output = '';
|
|
51
|
-
const str = input.replace(/[=]+$/, '');
|
|
52
|
-
if (str.length % 4 === 1) {
|
|
53
|
-
throw new Error("'RNFirebase.Base64.atob' failed: The string to be decoded is not correctly encoded.");
|
|
54
|
-
}
|
|
55
|
-
for (bc = 0, bs = 0, i = 0; buffer = str.charAt(i++); ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0) {
|
|
56
|
-
buffer = CHARS.indexOf(buffer);
|
|
57
|
-
}
|
|
58
|
-
return output;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Converts a Blob, ArrayBuffer or Uint8Array to a base64 string.
|
|
63
|
-
*/
|
|
64
|
-
export function fromData(data) {
|
|
65
|
-
if (data instanceof Blob) {
|
|
66
|
-
const fileReader = new FileReader();
|
|
67
|
-
const {
|
|
68
|
-
resolve,
|
|
69
|
-
reject,
|
|
70
|
-
promise
|
|
71
|
-
} = promiseDefer();
|
|
72
|
-
fileReader.readAsDataURL(data);
|
|
73
|
-
fileReader.onloadend = function onloadend() {
|
|
74
|
-
resolve({
|
|
75
|
-
string: fileReader.result,
|
|
76
|
-
format: 'data_url'
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
fileReader.onerror = function onerror(event) {
|
|
80
|
-
fileReader.abort();
|
|
81
|
-
reject(event);
|
|
82
|
-
};
|
|
83
|
-
return promise;
|
|
84
|
-
}
|
|
85
|
-
if (data instanceof ArrayBuffer || data instanceof Uint8Array) {
|
|
86
|
-
return Promise.resolve({
|
|
87
|
-
string: binaryToBase64(data),
|
|
88
|
-
format: 'base64'
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
throw new Error("'RNFirebase.Base64.fromData' failed: Unknown data type.");
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=Base64.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["binaryToBase64","promiseDefer","CHARS","btoa","input","map","i","block","output","charAt","charCode","charCodeAt","Error","atob","bc","bs","buffer","str","replace","length","String","fromCharCode","indexOf","fromData","data","Blob","fileReader","FileReader","resolve","reject","promise","readAsDataURL","onloadend","string","result","format","onerror","event","abort","ArrayBuffer","Uint8Array","Promise"],"sourceRoot":"../../../src","sources":["common/Base64.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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OAAO,CAAC;MACrBK,MAAM,EAAEjC,cAAc,CAACwB,IAAI,CAAC;MAC5BW,MAAM,EAAE;IACV,CAAC,CAAC;EACJ;EAEA,MAAM,IAAIvB,KAAK,CAAC,yDAAyD,CAAC;AAC5E"}
|
|
@@ -1,43 +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
|
-
export class MutatableParams {
|
|
20
|
-
constructor(parentInstance) {
|
|
21
|
-
if (parentInstance) {
|
|
22
|
-
this._mutatableParams = parentInstance._mutatableParams;
|
|
23
|
-
this._parentInstance = parentInstance;
|
|
24
|
-
} else {
|
|
25
|
-
this._mutatableParams = {};
|
|
26
|
-
this._parentInstance = this;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
set(param, value) {
|
|
30
|
-
deepSet(this._mutatableParams, param, value);
|
|
31
|
-
return this._parentInstance;
|
|
32
|
-
}
|
|
33
|
-
get(param) {
|
|
34
|
-
return deepGet(this._mutatableParams, param, '.');
|
|
35
|
-
}
|
|
36
|
-
toJSON() {
|
|
37
|
-
return Object.assign({}, this._mutatableParams);
|
|
38
|
-
}
|
|
39
|
-
validate() {
|
|
40
|
-
// do nothing
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=MutatableParams.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["deepGet","deepSet","MutatableParams","constructor","parentInstance","_mutatableParams","_parentInstance","set","param","value","get","toJSON","Object","assign","validate"],"sourceRoot":"../../../src","sources":["common/MutatableParams.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,EAAEC,OAAO,QAAQ,SAAS;AAE1C,OAAO,MAAMC,eAAe,CAAC;EAI3BC,WAAWA,CAACC,cAA+B,EAAE;IAC3C,IAAIA,cAAc,EAAE;MAClB,IAAI,CAACC,gBAAgB,GAAGD,cAAc,CAACC,gBAAgB;MACvD,IAAI,CAACC,eAAe,GAAGF,cAAc;IACvC,CAAC,MAAM;MACL,IAAI,CAACC,gBAAgB,GAAG,CAAC,CAAC;MAC1B,IAAI,CAACC,eAAe,GAAG,IAAI;IAC7B;EACF;EAEAC,GAAGA,CAACC,KAAa,EAAEC,KAAc,EAAE;IACjCR,OAAO,CAAC,IAAI,CAACI,gBAAgB,EAAEG,KAAK,EAAEC,KAAK,CAAC;IAC5C,OAAO,IAAI,CAACH,eAAe;EAC7B;EAEAI,GAAGA,CAACF,KAAa,EAAE;IACjB,OAAOR,OAAO,CAAC,IAAI,CAACK,gBAAgB,EAAEG,KAAK,EAAE,GAAG,CAAC;EACnD;EAEAG,MAAMA,CAAA,EAAG;IACP,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAACR,gBAAgB,CAAC;EACjD;EAEAS,QAAQA,CAAA,EAAG;IACT;EAAA;AAEJ"}
|
|
@@ -1,42 +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
|
-
export class ReferenceBase {
|
|
19
|
-
constructor(_path) {
|
|
20
|
-
let path = _path;
|
|
21
|
-
if (path) {
|
|
22
|
-
path = path.length > 1 && path.endsWith('/') ? path.substring(0, path.length - 1) : path;
|
|
23
|
-
if (path.startsWith('/') && path.length > 1) {
|
|
24
|
-
path = path.substring(1, path.length);
|
|
25
|
-
}
|
|
26
|
-
} else {
|
|
27
|
-
path = '/';
|
|
28
|
-
}
|
|
29
|
-
this.path = path;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* The last part of a Reference's path (after the last '/')
|
|
34
|
-
* The key of a root Reference is null.
|
|
35
|
-
* @type {String}
|
|
36
|
-
* {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#key}
|
|
37
|
-
*/
|
|
38
|
-
get key() {
|
|
39
|
-
return this.path === '/' ? null : this.path.substring(this.path.lastIndexOf('/') + 1);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=ReferenceBase.js.map
|