mythix-orm-sql-base 1.0.4 → 1.1.1
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.
|
@@ -743,9 +743,9 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
743
743
|
if (_options && !Nife.instanceOf(_options, 'object'))
|
|
744
744
|
throw new TypeError(`${this.constructor.name}::pluck: "options" isn't an object. Did you pass a field by accident?`);
|
|
745
745
|
|
|
746
|
-
let options
|
|
747
|
-
let
|
|
748
|
-
let fields
|
|
746
|
+
let options = _options || {};
|
|
747
|
+
let moreThanOneFieldRequested = (Array.isArray(_fields) && _fields.length > 1);
|
|
748
|
+
let fields = Nife.arrayFlatten(Nife.toArray(_fields)).filter(Boolean);
|
|
749
749
|
|
|
750
750
|
if (Nife.isEmpty(fields))
|
|
751
751
|
throw new Error(`${this.constructor.name}::pluck: You must supply "fields" to pluck.`);
|
|
@@ -816,7 +816,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
816
816
|
});
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
-
if (!
|
|
819
|
+
if (!moreThanOneFieldRequested)
|
|
820
820
|
finalResults = finalResults.map((row) => row[0]);
|
|
821
821
|
|
|
822
822
|
return finalResults;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mythix-orm-sql-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "SQL base support for Mythix ORM",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/th317erd/mythix-orm-sql-base#readme",
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"mythix-orm": "^1.0
|
|
36
|
+
"mythix-orm": "^1.3.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"nife": "^1.11.3",
|