@qp-mongosh/service-provider-core 0.0.0-dev.5 → 0.0.0-dev.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/.eslintignore +2 -2
- package/.eslintrc.js +1 -1
- package/AUTHORS +11 -11
- package/LICENSE +200 -200
- package/lib/admin.d.ts +28 -28
- package/lib/admin.js +2 -2
- package/lib/all-fle-types.d.ts +2 -2
- package/lib/all-fle-types.js +2 -2
- package/lib/all-transport-types.d.ts +1 -1
- package/lib/all-transport-types.js +2 -2
- package/lib/bulk-write-result.d.ts +16 -0
- package/lib/bulk-write-result.js +3 -0
- package/lib/bulk-write-result.js.map +1 -0
- package/lib/cli-options.d.ts +43 -43
- package/lib/cli-options.js +2 -2
- package/lib/closable.d.ts +4 -4
- package/lib/closable.js +2 -2
- package/lib/command-options.d.ts +4 -0
- package/lib/command-options.js +3 -0
- package/lib/command-options.js.map +1 -0
- package/lib/connect-info.d.ts +19 -19
- package/lib/connect-info.js +34 -34
- package/lib/cursor.d.ts +34 -0
- package/lib/cursor.js +3 -0
- package/lib/cursor.js.map +1 -0
- package/lib/database-options.d.ts +8 -0
- package/lib/database-options.js +3 -0
- package/lib/database-options.js.map +1 -0
- package/lib/document.d.ts +3 -0
- package/lib/document.js +3 -0
- package/lib/document.js.map +1 -0
- package/lib/fast-failure-connect.d.ts +1 -0
- package/lib/fast-failure-connect.js +15 -0
- package/lib/fast-failure-connect.js.map +1 -0
- package/lib/index.d.ts +31 -31
- package/lib/index.js +55 -55
- package/lib/platform.d.ts +6 -6
- package/lib/platform.js +10 -10
- package/lib/printable-bson.d.ts +3 -3
- package/lib/printable-bson.js +81 -81
- package/lib/read-concern.d.ts +3 -0
- package/lib/read-concern.js +3 -0
- package/lib/read-concern.js.map +1 -0
- package/lib/read-preference.d.ts +4 -0
- package/lib/read-preference.js +3 -0
- package/lib/read-preference.js.map +1 -0
- package/lib/readable.d.ts +18 -18
- package/lib/readable.js +2 -2
- package/lib/result.d.ts +2 -0
- package/lib/result.js +3 -0
- package/lib/result.js.map +1 -0
- package/lib/service-provider.d.ts +11 -11
- package/lib/service-provider.js +18 -18
- package/lib/shell-auth-options.d.ts +7 -7
- package/lib/shell-auth-options.js +2 -2
- package/lib/textencoder-polyfill.d.ts +2 -2
- package/lib/textencoder-polyfill.js +21 -21
- package/lib/uri-generator.d.ts +8 -8
- package/lib/uri-generator.js +175 -175
- package/lib/writable.d.ts +22 -22
- package/lib/writable.js +2 -2
- package/lib/write-concern.d.ts +5 -0
- package/lib/write-concern.js +3 -0
- package/lib/write-concern.js.map +1 -0
- package/package.json +54 -54
- package/src/admin.ts +119 -119
- package/src/all-fle-types.ts +17 -17
- package/src/all-transport-types.ts +80 -80
- package/src/cli-options.ts +49 -49
- package/src/closable.ts +14 -14
- package/src/connect-info.spec.ts +192 -192
- package/src/connect-info.ts +57 -57
- package/src/index.ts +62 -62
- package/src/platform.ts +6 -6
- package/src/printable-bson.spec.ts +75 -75
- package/src/printable-bson.ts +103 -103
- package/src/readable.ts +242 -242
- package/src/service-provider.ts +23 -23
- package/src/shell-auth-options.ts +7 -7
- package/src/textencoder-polyfill.spec.ts +11 -11
- package/src/textencoder-polyfill.ts +30 -30
- package/src/uri-generator.spec.ts +481 -481
- package/src/uri-generator.ts +265 -265
- package/src/writable.ts +367 -367
- package/tsconfig.json +12 -12
- package/tsconfig.lint.json +8 -8
package/lib/printable-bson.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bsonStringifiers = void 0;
|
|
4
|
-
const index_1 = require("./index");
|
|
5
|
-
const util_1 = require("util");
|
|
6
|
-
const inspectCustom = Symbol.for('nodejs.util.inspect.custom');
|
|
7
|
-
exports.bsonStringifiers = {
|
|
8
|
-
ObjectId: function () {
|
|
9
|
-
return `ObjectId("${this.toHexString()}")`;
|
|
10
|
-
},
|
|
11
|
-
DBRef: function (depth, options) {
|
|
12
|
-
return `DBRef("${this.namespace}", ` +
|
|
13
|
-
(0, util_1.inspect)(this.oid, options) +
|
|
14
|
-
(this.db ? `, "${this.db}"` : '') +
|
|
15
|
-
')';
|
|
16
|
-
},
|
|
17
|
-
MaxKey: function () {
|
|
18
|
-
return 'MaxKey()';
|
|
19
|
-
},
|
|
20
|
-
MinKey: function () {
|
|
21
|
-
return 'MinKey()';
|
|
22
|
-
},
|
|
23
|
-
Timestamp: function () {
|
|
24
|
-
return `Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`;
|
|
25
|
-
},
|
|
26
|
-
BSONSymbol: function () {
|
|
27
|
-
return `BSONSymbol("${this.valueOf()}")`;
|
|
28
|
-
},
|
|
29
|
-
Code: function () {
|
|
30
|
-
const j = this.toJSON();
|
|
31
|
-
return `Code("${j.code}"${j.scope ? `, ${JSON.stringify(j.scope)}` : ''})`;
|
|
32
|
-
},
|
|
33
|
-
Decimal128: function () {
|
|
34
|
-
return `Decimal128("${this.toString()}")`;
|
|
35
|
-
},
|
|
36
|
-
Int32: function () {
|
|
37
|
-
return `Int32(${this.valueOf()})`;
|
|
38
|
-
},
|
|
39
|
-
Long: function () {
|
|
40
|
-
return `Long("${this.toString()}"${this.unsigned ? ', true' : ''})`;
|
|
41
|
-
},
|
|
42
|
-
BSONRegExp: function () {
|
|
43
|
-
return `BSONRegExp(${JSON.stringify(this.pattern)}, ${JSON.stringify(this.options)})`;
|
|
44
|
-
},
|
|
45
|
-
Binary: function () {
|
|
46
|
-
const asBuffer = this.value(true);
|
|
47
|
-
switch (this.sub_type) {
|
|
48
|
-
case index_1.bson.Binary.SUBTYPE_MD5:
|
|
49
|
-
return `MD5("${asBuffer.toString('hex')}")`;
|
|
50
|
-
case index_1.bson.Binary.SUBTYPE_UUID:
|
|
51
|
-
if (asBuffer.length === 16) {
|
|
52
|
-
const hex = asBuffer.toString('hex');
|
|
53
|
-
const asUUID = hex.match(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/)
|
|
54
|
-
.slice(1, 6).join('-');
|
|
55
|
-
return `UUID("${asUUID}")`;
|
|
56
|
-
}
|
|
57
|
-
default:
|
|
58
|
-
return `Binary(Buffer.from("${asBuffer.toString('hex')}", "hex"), ${this.sub_type})`;
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
exports.bsonStringifiers.ObjectID = exports.bsonStringifiers.ObjectId;
|
|
63
|
-
function default_1(bson) {
|
|
64
|
-
if (!bson) {
|
|
65
|
-
bson = index_1.bson;
|
|
66
|
-
}
|
|
67
|
-
for (const [key, stringifier] of Object.entries(exports.bsonStringifiers)) {
|
|
68
|
-
if (!(key in bson)) {
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
const cls = bson[key];
|
|
72
|
-
for (const key of [inspectCustom, 'inspect']) {
|
|
73
|
-
try {
|
|
74
|
-
cls.prototype[key] = stringifier;
|
|
75
|
-
}
|
|
76
|
-
catch (_a) {
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.default = default_1;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bsonStringifiers = void 0;
|
|
4
|
+
const index_1 = require("./index");
|
|
5
|
+
const util_1 = require("util");
|
|
6
|
+
const inspectCustom = Symbol.for('nodejs.util.inspect.custom');
|
|
7
|
+
exports.bsonStringifiers = {
|
|
8
|
+
ObjectId: function () {
|
|
9
|
+
return `ObjectId("${this.toHexString()}")`;
|
|
10
|
+
},
|
|
11
|
+
DBRef: function (depth, options) {
|
|
12
|
+
return `DBRef("${this.namespace}", ` +
|
|
13
|
+
(0, util_1.inspect)(this.oid, options) +
|
|
14
|
+
(this.db ? `, "${this.db}"` : '') +
|
|
15
|
+
')';
|
|
16
|
+
},
|
|
17
|
+
MaxKey: function () {
|
|
18
|
+
return 'MaxKey()';
|
|
19
|
+
},
|
|
20
|
+
MinKey: function () {
|
|
21
|
+
return 'MinKey()';
|
|
22
|
+
},
|
|
23
|
+
Timestamp: function () {
|
|
24
|
+
return `Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`;
|
|
25
|
+
},
|
|
26
|
+
BSONSymbol: function () {
|
|
27
|
+
return `BSONSymbol("${this.valueOf()}")`;
|
|
28
|
+
},
|
|
29
|
+
Code: function () {
|
|
30
|
+
const j = this.toJSON();
|
|
31
|
+
return `Code("${j.code}"${j.scope ? `, ${JSON.stringify(j.scope)}` : ''})`;
|
|
32
|
+
},
|
|
33
|
+
Decimal128: function () {
|
|
34
|
+
return `Decimal128("${this.toString()}")`;
|
|
35
|
+
},
|
|
36
|
+
Int32: function () {
|
|
37
|
+
return `Int32(${this.valueOf()})`;
|
|
38
|
+
},
|
|
39
|
+
Long: function () {
|
|
40
|
+
return `Long("${this.toString()}"${this.unsigned ? ', true' : ''})`;
|
|
41
|
+
},
|
|
42
|
+
BSONRegExp: function () {
|
|
43
|
+
return `BSONRegExp(${JSON.stringify(this.pattern)}, ${JSON.stringify(this.options)})`;
|
|
44
|
+
},
|
|
45
|
+
Binary: function () {
|
|
46
|
+
const asBuffer = this.value(true);
|
|
47
|
+
switch (this.sub_type) {
|
|
48
|
+
case index_1.bson.Binary.SUBTYPE_MD5:
|
|
49
|
+
return `MD5("${asBuffer.toString('hex')}")`;
|
|
50
|
+
case index_1.bson.Binary.SUBTYPE_UUID:
|
|
51
|
+
if (asBuffer.length === 16) {
|
|
52
|
+
const hex = asBuffer.toString('hex');
|
|
53
|
+
const asUUID = hex.match(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/)
|
|
54
|
+
.slice(1, 6).join('-');
|
|
55
|
+
return `UUID("${asUUID}")`;
|
|
56
|
+
}
|
|
57
|
+
default:
|
|
58
|
+
return `Binary(Buffer.from("${asBuffer.toString('hex')}", "hex"), ${this.sub_type})`;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
exports.bsonStringifiers.ObjectID = exports.bsonStringifiers.ObjectId;
|
|
63
|
+
function default_1(bson) {
|
|
64
|
+
if (!bson) {
|
|
65
|
+
bson = index_1.bson;
|
|
66
|
+
}
|
|
67
|
+
for (const [key, stringifier] of Object.entries(exports.bsonStringifiers)) {
|
|
68
|
+
if (!(key in bson)) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const cls = bson[key];
|
|
72
|
+
for (const key of [inspectCustom, 'inspect']) {
|
|
73
|
+
try {
|
|
74
|
+
cls.prototype[key] = stringifier;
|
|
75
|
+
}
|
|
76
|
+
catch (_a) {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.default = default_1;
|
|
82
82
|
//# sourceMappingURL=printable-bson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-concern.js","sourceRoot":"","sources":["../src/read-concern.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-preference.js","sourceRoot":"","sources":["../src/read-preference.ts"],"names":[],"mappings":""}
|
package/lib/readable.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { Document, AggregateOptions, CountOptions, CountDocumentsOptions, DistinctOptions, EstimatedDocumentCountOptions, FindOptions, ListCollectionsOptions, CollStatsOptions, ListIndexesOptions, AggregationCursor, FindCursor, DbOptions, ReadPreferenceFromOptions, ReadPreferenceLike } from './all-transport-types';
|
|
2
|
-
import { ChangeStream, ChangeStreamOptions } from './all-transport-types';
|
|
3
|
-
export default interface Readable {
|
|
4
|
-
aggregate(database: string, collection: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
|
|
5
|
-
aggregateDb(database: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
|
|
6
|
-
count(db: string, coll: string, query?: Document, options?: CountOptions, dbOptions?: DbOptions): Promise<number>;
|
|
7
|
-
countDocuments(database: string, collection: string, filter?: Document, options?: CountDocumentsOptions, dbOptions?: DbOptions): Promise<number>;
|
|
8
|
-
distinct(database: string, collection: string, fieldName: string, filter?: Document, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document>;
|
|
9
|
-
estimatedDocumentCount(database: string, collection: string, options?: EstimatedDocumentCountOptions, dbOptions?: DbOptions): Promise<number>;
|
|
10
|
-
find(database: string, collection: string, filter?: Document, options?: FindOptions, dbOptions?: DbOptions): FindCursor;
|
|
11
|
-
getTopology(): any;
|
|
12
|
-
isCapped(database: string, collection: string, dbOptions?: DbOptions): Promise<boolean>;
|
|
13
|
-
getIndexes(database: string, collection: string, options: ListIndexesOptions, dbOptions?: DbOptions): Promise<Document[]>;
|
|
14
|
-
listCollections(database: string, filter?: Document, options?: ListCollectionsOptions, dbOptions?: DbOptions): Promise<Document[]>;
|
|
15
|
-
readPreferenceFromOptions(options?: Omit<ReadPreferenceFromOptions, 'session'>): ReadPreferenceLike | undefined;
|
|
16
|
-
stats(database: string, collection: string, options?: CollStatsOptions, dbOptions?: DbOptions): Promise<Document>;
|
|
17
|
-
watch(pipeline: Document[], options: ChangeStreamOptions, dbOptions?: DbOptions, db?: string, coll?: string): ChangeStream<Document>;
|
|
18
|
-
}
|
|
1
|
+
import type { Document, AggregateOptions, CountOptions, CountDocumentsOptions, DistinctOptions, EstimatedDocumentCountOptions, FindOptions, ListCollectionsOptions, CollStatsOptions, ListIndexesOptions, AggregationCursor, FindCursor, DbOptions, ReadPreferenceFromOptions, ReadPreferenceLike } from './all-transport-types';
|
|
2
|
+
import { ChangeStream, ChangeStreamOptions } from './all-transport-types';
|
|
3
|
+
export default interface Readable {
|
|
4
|
+
aggregate(database: string, collection: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
|
|
5
|
+
aggregateDb(database: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
|
|
6
|
+
count(db: string, coll: string, query?: Document, options?: CountOptions, dbOptions?: DbOptions): Promise<number>;
|
|
7
|
+
countDocuments(database: string, collection: string, filter?: Document, options?: CountDocumentsOptions, dbOptions?: DbOptions): Promise<number>;
|
|
8
|
+
distinct(database: string, collection: string, fieldName: string, filter?: Document, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document>;
|
|
9
|
+
estimatedDocumentCount(database: string, collection: string, options?: EstimatedDocumentCountOptions, dbOptions?: DbOptions): Promise<number>;
|
|
10
|
+
find(database: string, collection: string, filter?: Document, options?: FindOptions, dbOptions?: DbOptions): FindCursor;
|
|
11
|
+
getTopology(): any;
|
|
12
|
+
isCapped(database: string, collection: string, dbOptions?: DbOptions): Promise<boolean>;
|
|
13
|
+
getIndexes(database: string, collection: string, options: ListIndexesOptions, dbOptions?: DbOptions): Promise<Document[]>;
|
|
14
|
+
listCollections(database: string, filter?: Document, options?: ListCollectionsOptions, dbOptions?: DbOptions): Promise<Document[]>;
|
|
15
|
+
readPreferenceFromOptions(options?: Omit<ReadPreferenceFromOptions, 'session'>): ReadPreferenceLike | undefined;
|
|
16
|
+
stats(database: string, collection: string, options?: CollStatsOptions, dbOptions?: DbOptions): Promise<Document>;
|
|
17
|
+
watch(pipeline: Document[], options: ChangeStreamOptions, dbOptions?: DbOptions, db?: string, coll?: string): ChangeStream<Document>;
|
|
18
|
+
}
|
package/lib/readable.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=readable.js.map
|
package/lib/result.d.ts
ADDED
package/lib/result.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Admin from './admin';
|
|
2
|
-
import Closable from './closable';
|
|
3
|
-
import Readable from './readable';
|
|
4
|
-
import Writable from './writable';
|
|
5
|
-
import type { bson as BSON } from './index';
|
|
6
|
-
export default interface ServiceProvider extends Readable, Writable, Closable, Admin {
|
|
7
|
-
}
|
|
8
|
-
export declare class ServiceProviderCore {
|
|
9
|
-
bsonLibrary: typeof BSON;
|
|
10
|
-
constructor(bsonLibrary?: typeof BSON);
|
|
11
|
-
}
|
|
1
|
+
import Admin from './admin';
|
|
2
|
+
import Closable from './closable';
|
|
3
|
+
import Readable from './readable';
|
|
4
|
+
import Writable from './writable';
|
|
5
|
+
import type { bson as BSON } from './index';
|
|
6
|
+
export default interface ServiceProvider extends Readable, Writable, Closable, Admin {
|
|
7
|
+
}
|
|
8
|
+
export declare class ServiceProviderCore {
|
|
9
|
+
bsonLibrary: typeof BSON;
|
|
10
|
+
constructor(bsonLibrary?: typeof BSON);
|
|
11
|
+
}
|
package/lib/service-provider.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ServiceProviderCore = void 0;
|
|
7
|
-
const errors_1 = require("@qp-mongosh/errors");
|
|
8
|
-
const printable_bson_1 = __importDefault(require("./printable-bson"));
|
|
9
|
-
class ServiceProviderCore {
|
|
10
|
-
constructor(bsonLibrary) {
|
|
11
|
-
if (bsonLibrary === undefined) {
|
|
12
|
-
throw new errors_1.MongoshInternalError('BSON Library is undefined.');
|
|
13
|
-
}
|
|
14
|
-
(0, printable_bson_1.default)(bsonLibrary);
|
|
15
|
-
this.bsonLibrary = bsonLibrary;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.ServiceProviderCore = ServiceProviderCore;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ServiceProviderCore = void 0;
|
|
7
|
+
const errors_1 = require("@qp-mongosh/errors");
|
|
8
|
+
const printable_bson_1 = __importDefault(require("./printable-bson"));
|
|
9
|
+
class ServiceProviderCore {
|
|
10
|
+
constructor(bsonLibrary) {
|
|
11
|
+
if (bsonLibrary === undefined) {
|
|
12
|
+
throw new errors_1.MongoshInternalError('BSON Library is undefined.');
|
|
13
|
+
}
|
|
14
|
+
(0, printable_bson_1.default)(bsonLibrary);
|
|
15
|
+
this.bsonLibrary = bsonLibrary;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ServiceProviderCore = ServiceProviderCore;
|
|
19
19
|
//# sourceMappingURL=service-provider.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default interface ShellAuthOptions {
|
|
2
|
-
user: string;
|
|
3
|
-
pwd: string;
|
|
4
|
-
mechanism?: string;
|
|
5
|
-
digestPassword?: boolean;
|
|
6
|
-
authDb?: string;
|
|
7
|
-
}
|
|
1
|
+
export default interface ShellAuthOptions {
|
|
2
|
+
user: string;
|
|
3
|
+
pwd: string;
|
|
4
|
+
mechanism?: string;
|
|
5
|
+
digestPassword?: boolean;
|
|
6
|
+
authDb?: string;
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=shell-auth-options.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function textEncodingPolyfill(): any;
|
|
2
|
-
export { textEncodingPolyfill };
|
|
1
|
+
declare function textEncodingPolyfill(): any;
|
|
2
|
+
export { textEncodingPolyfill };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.textEncodingPolyfill = void 0;
|
|
4
|
-
if (typeof TextDecoder !== 'function' || typeof TextEncoder !== 'function') {
|
|
5
|
-
Object.assign(Function('return this')(), textEncodingPolyfill());
|
|
6
|
-
}
|
|
7
|
-
function textEncodingPolyfill() {
|
|
8
|
-
class TextEncoder {
|
|
9
|
-
encode(string) {
|
|
10
|
-
return Buffer.from(string, 'utf8');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
class TextDecoder {
|
|
14
|
-
decode(bytes) {
|
|
15
|
-
const str = Buffer.from(bytes).toString('utf8');
|
|
16
|
-
return str.slice(+str.startsWith('\ufeff'));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return { TextDecoder, TextEncoder };
|
|
20
|
-
}
|
|
21
|
-
exports.textEncodingPolyfill = textEncodingPolyfill;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textEncodingPolyfill = void 0;
|
|
4
|
+
if (typeof TextDecoder !== 'function' || typeof TextEncoder !== 'function') {
|
|
5
|
+
Object.assign(Function('return this')(), textEncodingPolyfill());
|
|
6
|
+
}
|
|
7
|
+
function textEncodingPolyfill() {
|
|
8
|
+
class TextEncoder {
|
|
9
|
+
encode(string) {
|
|
10
|
+
return Buffer.from(string, 'utf8');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class TextDecoder {
|
|
14
|
+
decode(bytes) {
|
|
15
|
+
const str = Buffer.from(bytes).toString('utf8');
|
|
16
|
+
return str.slice(+str.startsWith('\ufeff'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return { TextDecoder, TextEncoder };
|
|
20
|
+
}
|
|
21
|
+
exports.textEncodingPolyfill = textEncodingPolyfill;
|
|
22
22
|
//# sourceMappingURL=textencoder-polyfill.js.map
|
package/lib/uri-generator.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import CliOptions from './cli-options';
|
|
2
|
-
declare enum Scheme {
|
|
3
|
-
Mongo = "mongodb://",
|
|
4
|
-
MongoSrv = "mongodb+srv://"
|
|
5
|
-
}
|
|
6
|
-
declare function generateUri(options: CliOptions): string;
|
|
7
|
-
export default generateUri;
|
|
8
|
-
export { Scheme };
|
|
1
|
+
import CliOptions from './cli-options';
|
|
2
|
+
declare enum Scheme {
|
|
3
|
+
Mongo = "mongodb://",
|
|
4
|
+
MongoSrv = "mongodb+srv://"
|
|
5
|
+
}
|
|
6
|
+
declare function generateUri(options: CliOptions): string;
|
|
7
|
+
export default generateUri;
|
|
8
|
+
export { Scheme };
|