@tryghost/content-api 1.6.3 → 1.7.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.
- package/cjs/content-api.js +80 -50
- package/es/content-api.js +297 -261
- package/es/content-api.js.map +1 -1
- package/lib/index.js +80 -50
- package/package.json +4 -4
- package/umd/content-api.min.js +1 -1
- package/umd/content-api.min.js.map +1 -1
package/es/content-api.js
CHANGED
|
@@ -819,6 +819,50 @@ _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1
|
|
|
819
819
|
}
|
|
820
820
|
});
|
|
821
821
|
|
|
822
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
823
|
+
var test = {};
|
|
824
|
+
|
|
825
|
+
test[TO_STRING_TAG$2] = 'z';
|
|
826
|
+
|
|
827
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
828
|
+
|
|
829
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
830
|
+
var Object$1 = global_1.Object;
|
|
831
|
+
|
|
832
|
+
// ES3 wrong here
|
|
833
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
834
|
+
|
|
835
|
+
// fallback for IE11 Script Access Denied error
|
|
836
|
+
var tryGet = function (it, key) {
|
|
837
|
+
try {
|
|
838
|
+
return it[key];
|
|
839
|
+
} catch (error) { /* empty */ }
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
843
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
844
|
+
var O, tag, result;
|
|
845
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
846
|
+
// @@toStringTag case
|
|
847
|
+
: typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
848
|
+
// builtinTag case
|
|
849
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
850
|
+
// ES3 arguments fallback
|
|
851
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
// `Object.prototype.toString` method implementation
|
|
855
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
856
|
+
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
857
|
+
return '[object ' + classof(this) + ']';
|
|
858
|
+
};
|
|
859
|
+
|
|
860
|
+
// `Object.prototype.toString` method
|
|
861
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
862
|
+
if (!toStringTagSupport) {
|
|
863
|
+
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
864
|
+
}
|
|
865
|
+
|
|
822
866
|
// `Object.keys` method
|
|
823
867
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
824
868
|
// eslint-disable-next-line es/no-object-keys -- safe
|
|
@@ -826,6 +870,165 @@ var objectKeys = Object.keys || function keys(O) {
|
|
|
826
870
|
return objectKeysInternal(O, enumBugKeys);
|
|
827
871
|
};
|
|
828
872
|
|
|
873
|
+
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
|
874
|
+
|
|
875
|
+
// `Object.keys` method
|
|
876
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
877
|
+
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
|
878
|
+
keys: function keys(it) {
|
|
879
|
+
return objectKeys(toObject(it));
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
|
|
883
|
+
// `IsArray` abstract operation
|
|
884
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
885
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
886
|
+
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
887
|
+
return classofRaw(argument) == 'Array';
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
var createProperty = function (object, key, value) {
|
|
891
|
+
var propertyKey = toPropertyKey(key);
|
|
892
|
+
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
|
893
|
+
else object[propertyKey] = value;
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
var noop = function () { /* empty */ };
|
|
897
|
+
var empty = [];
|
|
898
|
+
var construct = getBuiltIn('Reflect', 'construct');
|
|
899
|
+
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
900
|
+
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
901
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
902
|
+
|
|
903
|
+
var isConstructorModern = function isConstructor(argument) {
|
|
904
|
+
if (!isCallable(argument)) return false;
|
|
905
|
+
try {
|
|
906
|
+
construct(noop, empty, argument);
|
|
907
|
+
return true;
|
|
908
|
+
} catch (error) {
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
var isConstructorLegacy = function isConstructor(argument) {
|
|
914
|
+
if (!isCallable(argument)) return false;
|
|
915
|
+
switch (classof(argument)) {
|
|
916
|
+
case 'AsyncFunction':
|
|
917
|
+
case 'GeneratorFunction':
|
|
918
|
+
case 'AsyncGeneratorFunction': return false;
|
|
919
|
+
}
|
|
920
|
+
try {
|
|
921
|
+
// we can't check .prototype since constructors produced by .bind haven't it
|
|
922
|
+
// `Function#toString` throws on some built-it function in some legacy engines
|
|
923
|
+
// (for example, `DOMQuad` and similar in FF41-)
|
|
924
|
+
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
925
|
+
} catch (error) {
|
|
926
|
+
return true;
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
isConstructorLegacy.sham = true;
|
|
931
|
+
|
|
932
|
+
// `IsConstructor` abstract operation
|
|
933
|
+
// https://tc39.es/ecma262/#sec-isconstructor
|
|
934
|
+
var isConstructor = !construct || fails(function () {
|
|
935
|
+
var called;
|
|
936
|
+
return isConstructorModern(isConstructorModern.call)
|
|
937
|
+
|| !isConstructorModern(Object)
|
|
938
|
+
|| !isConstructorModern(function () { called = true; })
|
|
939
|
+
|| called;
|
|
940
|
+
}) ? isConstructorLegacy : isConstructorModern;
|
|
941
|
+
|
|
942
|
+
var SPECIES$4 = wellKnownSymbol('species');
|
|
943
|
+
var Array$1 = global_1.Array;
|
|
944
|
+
|
|
945
|
+
// a part of `ArraySpeciesCreate` abstract operation
|
|
946
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
947
|
+
var arraySpeciesConstructor = function (originalArray) {
|
|
948
|
+
var C;
|
|
949
|
+
if (isArray$1(originalArray)) {
|
|
950
|
+
C = originalArray.constructor;
|
|
951
|
+
// cross-realm fallback
|
|
952
|
+
if (isConstructor(C) && (C === Array$1 || isArray$1(C.prototype))) C = undefined;
|
|
953
|
+
else if (isObject$1(C)) {
|
|
954
|
+
C = C[SPECIES$4];
|
|
955
|
+
if (C === null) C = undefined;
|
|
956
|
+
}
|
|
957
|
+
} return C === undefined ? Array$1 : C;
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
// `ArraySpeciesCreate` abstract operation
|
|
961
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
962
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
|
963
|
+
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
var SPECIES$3 = wellKnownSymbol('species');
|
|
967
|
+
|
|
968
|
+
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
|
969
|
+
// We can't use this feature detection in V8 since it causes
|
|
970
|
+
// deoptimization and serious performance degradation
|
|
971
|
+
// https://github.com/zloirock/core-js/issues/677
|
|
972
|
+
return engineV8Version >= 51 || !fails(function () {
|
|
973
|
+
var array = [];
|
|
974
|
+
var constructor = array.constructor = {};
|
|
975
|
+
constructor[SPECIES$3] = function () {
|
|
976
|
+
return { foo: 1 };
|
|
977
|
+
};
|
|
978
|
+
return array[METHOD_NAME](Boolean).foo !== 1;
|
|
979
|
+
});
|
|
980
|
+
};
|
|
981
|
+
|
|
982
|
+
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
|
983
|
+
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
|
984
|
+
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
|
985
|
+
var TypeError$9 = global_1.TypeError;
|
|
986
|
+
|
|
987
|
+
// We can't use this feature detection in V8 since it causes
|
|
988
|
+
// deoptimization and serious performance degradation
|
|
989
|
+
// https://github.com/zloirock/core-js/issues/679
|
|
990
|
+
var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
|
|
991
|
+
var array = [];
|
|
992
|
+
array[IS_CONCAT_SPREADABLE] = false;
|
|
993
|
+
return array.concat()[0] !== array;
|
|
994
|
+
});
|
|
995
|
+
|
|
996
|
+
var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
|
997
|
+
|
|
998
|
+
var isConcatSpreadable = function (O) {
|
|
999
|
+
if (!isObject$1(O)) return false;
|
|
1000
|
+
var spreadable = O[IS_CONCAT_SPREADABLE];
|
|
1001
|
+
return spreadable !== undefined ? !!spreadable : isArray$1(O);
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
1005
|
+
|
|
1006
|
+
// `Array.prototype.concat` method
|
|
1007
|
+
// https://tc39.es/ecma262/#sec-array.prototype.concat
|
|
1008
|
+
// with adding support of @@isConcatSpreadable and @@species
|
|
1009
|
+
_export({ target: 'Array', proto: true, forced: FORCED$1 }, {
|
|
1010
|
+
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
1011
|
+
concat: function concat(arg) {
|
|
1012
|
+
var O = toObject(this);
|
|
1013
|
+
var A = arraySpeciesCreate(O, 0);
|
|
1014
|
+
var n = 0;
|
|
1015
|
+
var i, k, length, len, E;
|
|
1016
|
+
for (i = -1, length = arguments.length; i < length; i++) {
|
|
1017
|
+
E = i === -1 ? O : arguments[i];
|
|
1018
|
+
if (isConcatSpreadable(E)) {
|
|
1019
|
+
len = lengthOfArrayLike(E);
|
|
1020
|
+
if (n + len > MAX_SAFE_INTEGER) throw TypeError$9(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
1021
|
+
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
|
1022
|
+
} else {
|
|
1023
|
+
if (n >= MAX_SAFE_INTEGER) throw TypeError$9(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
1024
|
+
createProperty(A, n++, E);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
A.length = n;
|
|
1028
|
+
return A;
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
|
|
829
1032
|
// `Object.defineProperties` method
|
|
830
1033
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
831
1034
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
@@ -960,38 +1163,6 @@ _export({ target: 'Array', proto: true }, {
|
|
|
960
1163
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
961
1164
|
addToUnscopables('includes');
|
|
962
1165
|
|
|
963
|
-
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
964
|
-
var test = {};
|
|
965
|
-
|
|
966
|
-
test[TO_STRING_TAG$2] = 'z';
|
|
967
|
-
|
|
968
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
969
|
-
|
|
970
|
-
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
971
|
-
var Object$1 = global_1.Object;
|
|
972
|
-
|
|
973
|
-
// ES3 wrong here
|
|
974
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
975
|
-
|
|
976
|
-
// fallback for IE11 Script Access Denied error
|
|
977
|
-
var tryGet = function (it, key) {
|
|
978
|
-
try {
|
|
979
|
-
return it[key];
|
|
980
|
-
} catch (error) { /* empty */ }
|
|
981
|
-
};
|
|
982
|
-
|
|
983
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
984
|
-
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
985
|
-
var O, tag, result;
|
|
986
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
987
|
-
// @@toStringTag case
|
|
988
|
-
: typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
989
|
-
// builtinTag case
|
|
990
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
991
|
-
// ES3 arguments fallback
|
|
992
|
-
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
993
|
-
};
|
|
994
|
-
|
|
995
1166
|
var String$3 = global_1.String;
|
|
996
1167
|
|
|
997
1168
|
var toString_1 = function (argument) {
|
|
@@ -1190,11 +1361,11 @@ var isRegexp = function (it) {
|
|
|
1190
1361
|
return isObject$1(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
|
1191
1362
|
};
|
|
1192
1363
|
|
|
1193
|
-
var TypeError$
|
|
1364
|
+
var TypeError$8 = global_1.TypeError;
|
|
1194
1365
|
|
|
1195
1366
|
var notARegexp = function (it) {
|
|
1196
1367
|
if (isRegexp(it)) {
|
|
1197
|
-
throw TypeError$
|
|
1368
|
+
throw TypeError$8("The method doesn't accept regular expressions");
|
|
1198
1369
|
} return it;
|
|
1199
1370
|
};
|
|
1200
1371
|
|
|
@@ -1282,18 +1453,6 @@ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_I
|
|
|
1282
1453
|
}
|
|
1283
1454
|
});
|
|
1284
1455
|
|
|
1285
|
-
// `Object.prototype.toString` method implementation
|
|
1286
|
-
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1287
|
-
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
1288
|
-
return '[object ' + classof(this) + ']';
|
|
1289
|
-
};
|
|
1290
|
-
|
|
1291
|
-
// `Object.prototype.toString` method
|
|
1292
|
-
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1293
|
-
if (!toStringTagSupport) {
|
|
1294
|
-
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
1456
|
var nativePromiseConstructor = global_1.Promise;
|
|
1298
1457
|
|
|
1299
1458
|
var redefineAll = function (target, src, options) {
|
|
@@ -1302,11 +1461,11 @@ var redefineAll = function (target, src, options) {
|
|
|
1302
1461
|
};
|
|
1303
1462
|
|
|
1304
1463
|
var String$2 = global_1.String;
|
|
1305
|
-
var TypeError$
|
|
1464
|
+
var TypeError$7 = global_1.TypeError;
|
|
1306
1465
|
|
|
1307
1466
|
var aPossiblePrototype = function (argument) {
|
|
1308
1467
|
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
1309
|
-
throw TypeError$
|
|
1468
|
+
throw TypeError$7("Can't set " + String$2(argument) + ' as a prototype');
|
|
1310
1469
|
};
|
|
1311
1470
|
|
|
1312
1471
|
/* eslint-disable no-proto -- safe */
|
|
@@ -1350,25 +1509,25 @@ var setToStringTag = function (target, TAG, STATIC) {
|
|
|
1350
1509
|
}
|
|
1351
1510
|
};
|
|
1352
1511
|
|
|
1353
|
-
var SPECIES$
|
|
1512
|
+
var SPECIES$2 = wellKnownSymbol('species');
|
|
1354
1513
|
|
|
1355
1514
|
var setSpecies = function (CONSTRUCTOR_NAME) {
|
|
1356
1515
|
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
|
1357
1516
|
var defineProperty = objectDefineProperty.f;
|
|
1358
1517
|
|
|
1359
|
-
if (descriptors && Constructor && !Constructor[SPECIES$
|
|
1360
|
-
defineProperty(Constructor, SPECIES$
|
|
1518
|
+
if (descriptors && Constructor && !Constructor[SPECIES$2]) {
|
|
1519
|
+
defineProperty(Constructor, SPECIES$2, {
|
|
1361
1520
|
configurable: true,
|
|
1362
1521
|
get: function () { return this; }
|
|
1363
1522
|
});
|
|
1364
1523
|
}
|
|
1365
1524
|
};
|
|
1366
1525
|
|
|
1367
|
-
var TypeError$
|
|
1526
|
+
var TypeError$6 = global_1.TypeError;
|
|
1368
1527
|
|
|
1369
1528
|
var anInstance = function (it, Prototype) {
|
|
1370
1529
|
if (objectIsPrototypeOf(Prototype, it)) return it;
|
|
1371
|
-
throw TypeError$
|
|
1530
|
+
throw TypeError$6('Incorrect invocation');
|
|
1372
1531
|
};
|
|
1373
1532
|
|
|
1374
1533
|
var bind$2 = functionUncurryThis(functionUncurryThis.bind);
|
|
@@ -1399,12 +1558,12 @@ var getIteratorMethod = function (it) {
|
|
|
1399
1558
|
|| iterators[classof(it)];
|
|
1400
1559
|
};
|
|
1401
1560
|
|
|
1402
|
-
var TypeError$
|
|
1561
|
+
var TypeError$5 = global_1.TypeError;
|
|
1403
1562
|
|
|
1404
1563
|
var getIterator = function (argument, usingIterator) {
|
|
1405
1564
|
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
1406
1565
|
if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
|
|
1407
|
-
throw TypeError$
|
|
1566
|
+
throw TypeError$5(tryToString(argument) + ' is not iterable');
|
|
1408
1567
|
};
|
|
1409
1568
|
|
|
1410
1569
|
var iteratorClose = function (iterator, kind, value) {
|
|
@@ -1427,7 +1586,7 @@ var iteratorClose = function (iterator, kind, value) {
|
|
|
1427
1586
|
return value;
|
|
1428
1587
|
};
|
|
1429
1588
|
|
|
1430
|
-
var TypeError$
|
|
1589
|
+
var TypeError$4 = global_1.TypeError;
|
|
1431
1590
|
|
|
1432
1591
|
var Result = function (stopped, result) {
|
|
1433
1592
|
this.stopped = stopped;
|
|
@@ -1460,7 +1619,7 @@ var iterate = function (iterable, unboundFunction, options) {
|
|
|
1460
1619
|
iterator = iterable;
|
|
1461
1620
|
} else {
|
|
1462
1621
|
iterFn = getIteratorMethod(iterable);
|
|
1463
|
-
if (!iterFn) throw TypeError$
|
|
1622
|
+
if (!iterFn) throw TypeError$4(tryToString(iterable) + ' is not iterable');
|
|
1464
1623
|
// optimisation for array iterators
|
|
1465
1624
|
if (isArrayIteratorMethod(iterFn)) {
|
|
1466
1625
|
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
@@ -1519,68 +1678,22 @@ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
|
|
1519
1678
|
return ITERATION_SUPPORT;
|
|
1520
1679
|
};
|
|
1521
1680
|
|
|
1522
|
-
var
|
|
1523
|
-
var empty = [];
|
|
1524
|
-
var construct = getBuiltIn('Reflect', 'construct');
|
|
1525
|
-
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
1526
|
-
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
1527
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
1528
|
-
|
|
1529
|
-
var isConstructorModern = function isConstructor(argument) {
|
|
1530
|
-
if (!isCallable(argument)) return false;
|
|
1531
|
-
try {
|
|
1532
|
-
construct(noop, empty, argument);
|
|
1533
|
-
return true;
|
|
1534
|
-
} catch (error) {
|
|
1535
|
-
return false;
|
|
1536
|
-
}
|
|
1537
|
-
};
|
|
1538
|
-
|
|
1539
|
-
var isConstructorLegacy = function isConstructor(argument) {
|
|
1540
|
-
if (!isCallable(argument)) return false;
|
|
1541
|
-
switch (classof(argument)) {
|
|
1542
|
-
case 'AsyncFunction':
|
|
1543
|
-
case 'GeneratorFunction':
|
|
1544
|
-
case 'AsyncGeneratorFunction': return false;
|
|
1545
|
-
}
|
|
1546
|
-
try {
|
|
1547
|
-
// we can't check .prototype since constructors produced by .bind haven't it
|
|
1548
|
-
// `Function#toString` throws on some built-it function in some legacy engines
|
|
1549
|
-
// (for example, `DOMQuad` and similar in FF41-)
|
|
1550
|
-
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
1551
|
-
} catch (error) {
|
|
1552
|
-
return true;
|
|
1553
|
-
}
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
|
-
isConstructorLegacy.sham = true;
|
|
1557
|
-
|
|
1558
|
-
// `IsConstructor` abstract operation
|
|
1559
|
-
// https://tc39.es/ecma262/#sec-isconstructor
|
|
1560
|
-
var isConstructor = !construct || fails(function () {
|
|
1561
|
-
var called;
|
|
1562
|
-
return isConstructorModern(isConstructorModern.call)
|
|
1563
|
-
|| !isConstructorModern(Object)
|
|
1564
|
-
|| !isConstructorModern(function () { called = true; })
|
|
1565
|
-
|| called;
|
|
1566
|
-
}) ? isConstructorLegacy : isConstructorModern;
|
|
1567
|
-
|
|
1568
|
-
var TypeError$4 = global_1.TypeError;
|
|
1681
|
+
var TypeError$3 = global_1.TypeError;
|
|
1569
1682
|
|
|
1570
1683
|
// `Assert: IsConstructor(argument) is true`
|
|
1571
1684
|
var aConstructor = function (argument) {
|
|
1572
1685
|
if (isConstructor(argument)) return argument;
|
|
1573
|
-
throw TypeError$
|
|
1686
|
+
throw TypeError$3(tryToString(argument) + ' is not a constructor');
|
|
1574
1687
|
};
|
|
1575
1688
|
|
|
1576
|
-
var SPECIES$
|
|
1689
|
+
var SPECIES$1 = wellKnownSymbol('species');
|
|
1577
1690
|
|
|
1578
1691
|
// `SpeciesConstructor` abstract operation
|
|
1579
1692
|
// https://tc39.es/ecma262/#sec-speciesconstructor
|
|
1580
1693
|
var speciesConstructor = function (O, defaultConstructor) {
|
|
1581
1694
|
var C = anObject(O).constructor;
|
|
1582
1695
|
var S;
|
|
1583
|
-
return C === undefined || (S = anObject(C)[SPECIES$
|
|
1696
|
+
return C === undefined || (S = anObject(C)[SPECIES$1]) == undefined ? defaultConstructor : aConstructor(S);
|
|
1584
1697
|
};
|
|
1585
1698
|
|
|
1586
1699
|
var FunctionPrototype$1 = Function.prototype;
|
|
@@ -1594,10 +1707,10 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBind
|
|
|
1594
1707
|
|
|
1595
1708
|
var arraySlice = functionUncurryThis([].slice);
|
|
1596
1709
|
|
|
1597
|
-
var TypeError$
|
|
1710
|
+
var TypeError$2 = global_1.TypeError;
|
|
1598
1711
|
|
|
1599
1712
|
var validateArgumentsLength = function (passed, required) {
|
|
1600
|
-
if (passed < required) throw TypeError$
|
|
1713
|
+
if (passed < required) throw TypeError$2('Not enough arguments');
|
|
1601
1714
|
return passed;
|
|
1602
1715
|
};
|
|
1603
1716
|
|
|
@@ -1882,7 +1995,7 @@ var task = task$1.set;
|
|
|
1882
1995
|
|
|
1883
1996
|
|
|
1884
1997
|
|
|
1885
|
-
var SPECIES
|
|
1998
|
+
var SPECIES = wellKnownSymbol('species');
|
|
1886
1999
|
var PROMISE = 'Promise';
|
|
1887
2000
|
|
|
1888
2001
|
var getInternalState = internalState.getterFor(PROMISE);
|
|
@@ -1891,7 +2004,7 @@ var getInternalPromiseState = internalState.getterFor(PROMISE);
|
|
|
1891
2004
|
var NativePromisePrototype = nativePromiseConstructor && nativePromiseConstructor.prototype;
|
|
1892
2005
|
var PromiseConstructor = nativePromiseConstructor;
|
|
1893
2006
|
var PromisePrototype = NativePromisePrototype;
|
|
1894
|
-
var TypeError$
|
|
2007
|
+
var TypeError$1 = global_1.TypeError;
|
|
1895
2008
|
var document$1 = global_1.document;
|
|
1896
2009
|
var process$1 = global_1.process;
|
|
1897
2010
|
var newPromiseCapability = newPromiseCapability$1.f;
|
|
@@ -1910,7 +2023,7 @@ var SUBCLASSING = false;
|
|
|
1910
2023
|
|
|
1911
2024
|
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
1912
2025
|
|
|
1913
|
-
var FORCED
|
|
2026
|
+
var FORCED = isForced_1(PROMISE, function () {
|
|
1914
2027
|
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
|
|
1915
2028
|
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
|
|
1916
2029
|
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
@@ -1927,14 +2040,14 @@ var FORCED$1 = isForced_1(PROMISE, function () {
|
|
|
1927
2040
|
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
1928
2041
|
};
|
|
1929
2042
|
var constructor = promise.constructor = {};
|
|
1930
|
-
constructor[SPECIES
|
|
2043
|
+
constructor[SPECIES] = FakePromise;
|
|
1931
2044
|
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
1932
2045
|
if (!SUBCLASSING) return true;
|
|
1933
2046
|
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
1934
2047
|
return !GLOBAL_CORE_JS_PROMISE && engineIsBrowser && !NATIVE_REJECTION_EVENT;
|
|
1935
2048
|
});
|
|
1936
2049
|
|
|
1937
|
-
var INCORRECT_ITERATION = FORCED
|
|
2050
|
+
var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
|
1938
2051
|
PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
|
|
1939
2052
|
});
|
|
1940
2053
|
|
|
@@ -1968,7 +2081,7 @@ var callReaction = function (reaction, state) {
|
|
|
1968
2081
|
}
|
|
1969
2082
|
}
|
|
1970
2083
|
if (result === reaction.promise) {
|
|
1971
|
-
reject(TypeError$
|
|
2084
|
+
reject(TypeError$1('Promise-chain cycle'));
|
|
1972
2085
|
} else if (then = isThenable(result)) {
|
|
1973
2086
|
functionCall(then, result, resolve, reject);
|
|
1974
2087
|
} else resolve(result);
|
|
@@ -2058,7 +2171,7 @@ var internalResolve = function (state, value, unwrap) {
|
|
|
2058
2171
|
state.done = true;
|
|
2059
2172
|
if (unwrap) state = unwrap;
|
|
2060
2173
|
try {
|
|
2061
|
-
if (state.facade === value) throw TypeError$
|
|
2174
|
+
if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
|
|
2062
2175
|
var then = isThenable(value);
|
|
2063
2176
|
if (then) {
|
|
2064
2177
|
microtask(function () {
|
|
@@ -2083,7 +2196,7 @@ var internalResolve = function (state, value, unwrap) {
|
|
|
2083
2196
|
};
|
|
2084
2197
|
|
|
2085
2198
|
// constructor polyfill
|
|
2086
|
-
if (FORCED
|
|
2199
|
+
if (FORCED) {
|
|
2087
2200
|
// 25.4.3.1 Promise(executor)
|
|
2088
2201
|
PromiseConstructor = function Promise(executor) {
|
|
2089
2202
|
anInstance(this, PromisePrototype);
|
|
@@ -2175,7 +2288,7 @@ if (FORCED$1) {
|
|
|
2175
2288
|
}
|
|
2176
2289
|
}
|
|
2177
2290
|
|
|
2178
|
-
_export({ global: true, wrap: true, forced: FORCED
|
|
2291
|
+
_export({ global: true, wrap: true, forced: FORCED }, {
|
|
2179
2292
|
Promise: PromiseConstructor
|
|
2180
2293
|
});
|
|
2181
2294
|
|
|
@@ -2185,7 +2298,7 @@ setSpecies(PROMISE);
|
|
|
2185
2298
|
PromiseWrapper = getBuiltIn(PROMISE);
|
|
2186
2299
|
|
|
2187
2300
|
// statics
|
|
2188
|
-
_export({ target: PROMISE, stat: true, forced: FORCED
|
|
2301
|
+
_export({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
2189
2302
|
// `Promise.reject` method
|
|
2190
2303
|
// https://tc39.es/ecma262/#sec-promise.reject
|
|
2191
2304
|
reject: function reject(r) {
|
|
@@ -2195,7 +2308,7 @@ _export({ target: PROMISE, stat: true, forced: FORCED$1 }, {
|
|
|
2195
2308
|
}
|
|
2196
2309
|
});
|
|
2197
2310
|
|
|
2198
|
-
_export({ target: PROMISE, stat: true, forced: FORCED
|
|
2311
|
+
_export({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
2199
2312
|
// `Promise.resolve` method
|
|
2200
2313
|
// https://tc39.es/ecma262/#sec-promise.resolve
|
|
2201
2314
|
resolve: function resolve(x) {
|
|
@@ -2303,119 +2416,6 @@ _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }
|
|
|
2303
2416
|
assign: objectAssign
|
|
2304
2417
|
});
|
|
2305
2418
|
|
|
2306
|
-
// `IsArray` abstract operation
|
|
2307
|
-
// https://tc39.es/ecma262/#sec-isarray
|
|
2308
|
-
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
2309
|
-
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
2310
|
-
return classofRaw(argument) == 'Array';
|
|
2311
|
-
};
|
|
2312
|
-
|
|
2313
|
-
var createProperty = function (object, key, value) {
|
|
2314
|
-
var propertyKey = toPropertyKey(key);
|
|
2315
|
-
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
|
2316
|
-
else object[propertyKey] = value;
|
|
2317
|
-
};
|
|
2318
|
-
|
|
2319
|
-
var SPECIES$1 = wellKnownSymbol('species');
|
|
2320
|
-
var Array$1 = global_1.Array;
|
|
2321
|
-
|
|
2322
|
-
// a part of `ArraySpeciesCreate` abstract operation
|
|
2323
|
-
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
2324
|
-
var arraySpeciesConstructor = function (originalArray) {
|
|
2325
|
-
var C;
|
|
2326
|
-
if (isArray$1(originalArray)) {
|
|
2327
|
-
C = originalArray.constructor;
|
|
2328
|
-
// cross-realm fallback
|
|
2329
|
-
if (isConstructor(C) && (C === Array$1 || isArray$1(C.prototype))) C = undefined;
|
|
2330
|
-
else if (isObject$1(C)) {
|
|
2331
|
-
C = C[SPECIES$1];
|
|
2332
|
-
if (C === null) C = undefined;
|
|
2333
|
-
}
|
|
2334
|
-
} return C === undefined ? Array$1 : C;
|
|
2335
|
-
};
|
|
2336
|
-
|
|
2337
|
-
// `ArraySpeciesCreate` abstract operation
|
|
2338
|
-
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
2339
|
-
var arraySpeciesCreate = function (originalArray, length) {
|
|
2340
|
-
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
2341
|
-
};
|
|
2342
|
-
|
|
2343
|
-
var SPECIES = wellKnownSymbol('species');
|
|
2344
|
-
|
|
2345
|
-
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
|
2346
|
-
// We can't use this feature detection in V8 since it causes
|
|
2347
|
-
// deoptimization and serious performance degradation
|
|
2348
|
-
// https://github.com/zloirock/core-js/issues/677
|
|
2349
|
-
return engineV8Version >= 51 || !fails(function () {
|
|
2350
|
-
var array = [];
|
|
2351
|
-
var constructor = array.constructor = {};
|
|
2352
|
-
constructor[SPECIES] = function () {
|
|
2353
|
-
return { foo: 1 };
|
|
2354
|
-
};
|
|
2355
|
-
return array[METHOD_NAME](Boolean).foo !== 1;
|
|
2356
|
-
});
|
|
2357
|
-
};
|
|
2358
|
-
|
|
2359
|
-
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
|
2360
|
-
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
|
2361
|
-
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
|
2362
|
-
var TypeError$1 = global_1.TypeError;
|
|
2363
|
-
|
|
2364
|
-
// We can't use this feature detection in V8 since it causes
|
|
2365
|
-
// deoptimization and serious performance degradation
|
|
2366
|
-
// https://github.com/zloirock/core-js/issues/679
|
|
2367
|
-
var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
|
|
2368
|
-
var array = [];
|
|
2369
|
-
array[IS_CONCAT_SPREADABLE] = false;
|
|
2370
|
-
return array.concat()[0] !== array;
|
|
2371
|
-
});
|
|
2372
|
-
|
|
2373
|
-
var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
|
2374
|
-
|
|
2375
|
-
var isConcatSpreadable = function (O) {
|
|
2376
|
-
if (!isObject$1(O)) return false;
|
|
2377
|
-
var spreadable = O[IS_CONCAT_SPREADABLE];
|
|
2378
|
-
return spreadable !== undefined ? !!spreadable : isArray$1(O);
|
|
2379
|
-
};
|
|
2380
|
-
|
|
2381
|
-
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
2382
|
-
|
|
2383
|
-
// `Array.prototype.concat` method
|
|
2384
|
-
// https://tc39.es/ecma262/#sec-array.prototype.concat
|
|
2385
|
-
// with adding support of @@isConcatSpreadable and @@species
|
|
2386
|
-
_export({ target: 'Array', proto: true, forced: FORCED }, {
|
|
2387
|
-
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
2388
|
-
concat: function concat(arg) {
|
|
2389
|
-
var O = toObject(this);
|
|
2390
|
-
var A = arraySpeciesCreate(O, 0);
|
|
2391
|
-
var n = 0;
|
|
2392
|
-
var i, k, length, len, E;
|
|
2393
|
-
for (i = -1, length = arguments.length; i < length; i++) {
|
|
2394
|
-
E = i === -1 ? O : arguments[i];
|
|
2395
|
-
if (isConcatSpreadable(E)) {
|
|
2396
|
-
len = lengthOfArrayLike(E);
|
|
2397
|
-
if (n + len > MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
2398
|
-
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
|
2399
|
-
} else {
|
|
2400
|
-
if (n >= MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
2401
|
-
createProperty(A, n++, E);
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
A.length = n;
|
|
2405
|
-
return A;
|
|
2406
|
-
}
|
|
2407
|
-
});
|
|
2408
|
-
|
|
2409
|
-
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
|
2410
|
-
|
|
2411
|
-
// `Object.keys` method
|
|
2412
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
2413
|
-
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
|
2414
|
-
keys: function keys(it) {
|
|
2415
|
-
return objectKeys(toObject(it));
|
|
2416
|
-
}
|
|
2417
|
-
});
|
|
2418
|
-
|
|
2419
2419
|
var FUNCTION_NAME_EXISTS = functionName.EXISTS;
|
|
2420
2420
|
|
|
2421
2421
|
var defineProperty = objectDefineProperty.f;
|
|
@@ -4038,17 +4038,52 @@ axios_1.default = default_1;
|
|
|
4038
4038
|
|
|
4039
4039
|
var axios = axios_1;
|
|
4040
4040
|
|
|
4041
|
-
var supportedVersions = ['v2', 'v3', 'v4', 'canary'];
|
|
4041
|
+
var supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
|
|
4042
4042
|
var name = '@tryghost/content-api';
|
|
4043
|
-
|
|
4043
|
+
|
|
4044
|
+
var defaultMakeRequest = function defaultMakeRequest(_ref) {
|
|
4044
4045
|
var url = _ref.url,
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4046
|
+
method = _ref.method,
|
|
4047
|
+
params = _ref.params,
|
|
4048
|
+
headers = _ref.headers;
|
|
4049
|
+
return axios[method](url, {
|
|
4050
|
+
params: params,
|
|
4051
|
+
paramsSerializer: function paramsSerializer(parameters) {
|
|
4052
|
+
return Object.keys(parameters).reduce(function (parts, k) {
|
|
4053
|
+
var val = encodeURIComponent([].concat(parameters[k]).join(','));
|
|
4054
|
+
return parts.concat("".concat(k, "=").concat(val));
|
|
4055
|
+
}, []).join('&');
|
|
4056
|
+
},
|
|
4057
|
+
headers: headers
|
|
4058
|
+
});
|
|
4059
|
+
};
|
|
4060
|
+
/**
|
|
4061
|
+
*
|
|
4062
|
+
* @param {Object} options
|
|
4063
|
+
* @param {String} options.url
|
|
4064
|
+
* @param {String} options.key
|
|
4065
|
+
* @param {String} [options.ghostPath]
|
|
4066
|
+
* @param {String} [options.version]
|
|
4067
|
+
* @param {Function} [options.makeRequest]
|
|
4068
|
+
* @param {String} [options.host] Deprecated
|
|
4069
|
+
* @returns
|
|
4070
|
+
*/
|
|
4071
|
+
|
|
4072
|
+
|
|
4073
|
+
function GhostContentAPI(_ref2) {
|
|
4074
|
+
var url = _ref2.url,
|
|
4075
|
+
key = _ref2.key,
|
|
4076
|
+
host = _ref2.host,
|
|
4077
|
+
version = _ref2.version,
|
|
4078
|
+
_ref2$ghostPath = _ref2.ghostPath,
|
|
4079
|
+
ghostPath = _ref2$ghostPath === void 0 ? 'ghost' : _ref2$ghostPath,
|
|
4080
|
+
_ref2$makeRequest = _ref2.makeRequest,
|
|
4081
|
+
makeRequest = _ref2$makeRequest === void 0 ? defaultMakeRequest : _ref2$makeRequest;
|
|
4050
4082
|
|
|
4051
|
-
|
|
4083
|
+
/**
|
|
4084
|
+
* host parameter is deprecated
|
|
4085
|
+
* @deprecated use "url" instead
|
|
4086
|
+
*/
|
|
4052
4087
|
if (host) {
|
|
4053
4088
|
// eslint-disable-next-line
|
|
4054
4089
|
console.warn("".concat(name, ": The 'host' parameter is deprecated, please use 'url' instead"));
|
|
@@ -4061,16 +4096,14 @@ function GhostContentAPI(_ref) {
|
|
|
4061
4096
|
if (this instanceof GhostContentAPI) {
|
|
4062
4097
|
return GhostContentAPI({
|
|
4063
4098
|
url: url,
|
|
4099
|
+
key: key,
|
|
4064
4100
|
version: version,
|
|
4065
|
-
|
|
4101
|
+
ghostPath: ghostPath,
|
|
4102
|
+
makeRequest: makeRequest
|
|
4066
4103
|
});
|
|
4067
4104
|
}
|
|
4068
4105
|
|
|
4069
|
-
if (!version) {
|
|
4070
|
-
throw new Error("".concat(name, " Config Missing: 'version' is required. E.g. ").concat(supportedVersions.join(',')));
|
|
4071
|
-
}
|
|
4072
|
-
|
|
4073
|
-
if (!supportedVersions.includes(version)) {
|
|
4106
|
+
if (version && !supportedVersions.includes(version)) {
|
|
4074
4107
|
throw new Error("".concat(name, " Config Invalid: 'version' ").concat(version, " is not supported"));
|
|
4075
4108
|
}
|
|
4076
4109
|
|
|
@@ -4098,7 +4131,7 @@ function GhostContentAPI(_ref) {
|
|
|
4098
4131
|
function browse() {
|
|
4099
4132
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4100
4133
|
var memberToken = arguments.length > 1 ? arguments[1] : undefined;
|
|
4101
|
-
return
|
|
4134
|
+
return makeApiRequest(resourceType, options, null, memberToken);
|
|
4102
4135
|
}
|
|
4103
4136
|
|
|
4104
4137
|
function read(data) {
|
|
@@ -4110,7 +4143,7 @@ function GhostContentAPI(_ref) {
|
|
|
4110
4143
|
}
|
|
4111
4144
|
|
|
4112
4145
|
var params = Object.assign({}, data, options);
|
|
4113
|
-
return
|
|
4146
|
+
return makeApiRequest(resourceType, params, data.id || "slug/".concat(data.slug), memberToken);
|
|
4114
4147
|
}
|
|
4115
4148
|
|
|
4116
4149
|
return Object.assign(apiObject, _defineProperty({}, resourceType, {
|
|
@@ -4121,7 +4154,7 @@ function GhostContentAPI(_ref) {
|
|
|
4121
4154
|
delete api.settings.read;
|
|
4122
4155
|
return api;
|
|
4123
4156
|
|
|
4124
|
-
function
|
|
4157
|
+
function makeApiRequest(resourceType, params, id) {
|
|
4125
4158
|
var membersToken = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
4126
4159
|
|
|
4127
4160
|
if (!membersToken && !key) {
|
|
@@ -4131,17 +4164,20 @@ function GhostContentAPI(_ref) {
|
|
|
4131
4164
|
delete params.id;
|
|
4132
4165
|
var headers = membersToken ? {
|
|
4133
4166
|
Authorization: "GhostMembers ".concat(membersToken)
|
|
4134
|
-
} :
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4167
|
+
} : {};
|
|
4168
|
+
|
|
4169
|
+
if (!version || ['v4', 'v5', 'canary'].includes(version)) {
|
|
4170
|
+
headers['Accept-Version'] = version || 'v5';
|
|
4171
|
+
}
|
|
4172
|
+
|
|
4173
|
+
params = Object.assign({
|
|
4174
|
+
key: key
|
|
4175
|
+
}, params);
|
|
4176
|
+
var apiUrl = version ? "".concat(url, "/").concat(ghostPath, "/api/").concat(version, "/content/").concat(resourceType, "/").concat(id ? id + '/' : '') : "".concat(url, "/").concat(ghostPath, "/api/content/").concat(resourceType, "/").concat(id ? id + '/' : '');
|
|
4177
|
+
return makeRequest({
|
|
4178
|
+
url: apiUrl,
|
|
4179
|
+
method: 'get',
|
|
4180
|
+
params: params,
|
|
4145
4181
|
headers: headers
|
|
4146
4182
|
}).then(function (res) {
|
|
4147
4183
|
if (!Array.isArray(res.data[resourceType])) {
|