contentful-sdk-core
Advanced tools
Comparing version 7.0.4 to 7.0.5
@@ -7,2 +7,29 @@ import copy from 'fast-copy'; | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; | ||
if (null != _i) { | ||
var _s, | ||
_e, | ||
_x, | ||
_r, | ||
_arr = [], | ||
_n = !0, | ||
_d = !1; | ||
try { | ||
if (_x = (_i = _i.call(arr)).next, 0 === i) { | ||
if (Object(_i) !== _i) return; | ||
_n = !1; | ||
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); | ||
} catch (err) { | ||
_d = !0, _e = err; | ||
} finally { | ||
try { | ||
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
@@ -61,3 +88,8 @@ var keys = Object.keys(object); | ||
var result = _super.exec.call(this, str); | ||
return result && (result.groups = buildGroups(result, this)), result; | ||
if (result) { | ||
result.groups = buildGroups(result, this); | ||
var indices = result.indices; | ||
indices && (indices.groups = buildGroups(indices, this)); | ||
} | ||
return result; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { | ||
@@ -67,3 +99,4 @@ if ("string" == typeof substitution) { | ||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { | ||
return "$" + groups[name]; | ||
var group = groups[name]; | ||
return "$" + (Array.isArray(group) ? group.join("$") : group); | ||
})); | ||
@@ -82,2 +115,3 @@ } | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
@@ -124,26 +158,2 @@ Object.defineProperty(obj, key, { | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | ||
if (_i == null) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _s, _e; | ||
try { | ||
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
if (i && _arr.length === i) break; | ||
} | ||
} catch (err) { | ||
_d = true; | ||
_e = err; | ||
} finally { | ||
try { | ||
if (!_n && _i["return"] != null) _i["return"](); | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
@@ -216,12 +226,24 @@ if (!o) return; | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
} | ||
function isNode() { | ||
/** | ||
* Polyfills of 'process' might set process.browser === true | ||
* | ||
* See: | ||
* https://github.com/webpack/node-libs-browser/blob/master/mock/process.js#L8 | ||
* https://github.com/defunctzombie/node-process/blob/master/browser.js#L156 | ||
**/ | ||
return typeof process !== 'undefined' && !process.browser; | ||
* Save way to check for the global scope which should confirm if an environment is node | ||
* For reference: https://stackoverflow.com/a/31090240 | ||
*/ | ||
var isNodeFunc = new Function('try {return this===global;}catch(e){return false;}'); | ||
return isNodeFunc(); | ||
} | ||
@@ -471,10 +493,2 @@ function isReactNative() { | ||
} | ||
// Set these headers only for node because browsers don't like it when you | ||
// override user-agent or accept-encoding. | ||
// The SDKs should set their own X-Contentful-User-Agent. | ||
if (isNode()) { | ||
config.headers['user-agent'] = 'node.js/' + getNodeVersion(); | ||
config.headers['Accept-Encoding'] = 'gzip'; | ||
} | ||
var axiosOptions = { | ||
@@ -481,0 +495,0 @@ // Axios |
@@ -19,2 +19,29 @@ 'use strict'; | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; | ||
if (null != _i) { | ||
var _s, | ||
_e, | ||
_x, | ||
_r, | ||
_arr = [], | ||
_n = !0, | ||
_d = !1; | ||
try { | ||
if (_x = (_i = _i.call(arr)).next, 0 === i) { | ||
if (Object(_i) !== _i) return; | ||
_n = !1; | ||
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); | ||
} catch (err) { | ||
_d = !0, _e = err; | ||
} finally { | ||
try { | ||
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
@@ -73,3 +100,8 @@ var keys = Object.keys(object); | ||
var result = _super.exec.call(this, str); | ||
return result && (result.groups = buildGroups(result, this)), result; | ||
if (result) { | ||
result.groups = buildGroups(result, this); | ||
var indices = result.indices; | ||
indices && (indices.groups = buildGroups(indices, this)); | ||
} | ||
return result; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { | ||
@@ -79,3 +111,4 @@ if ("string" == typeof substitution) { | ||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { | ||
return "$" + groups[name]; | ||
var group = groups[name]; | ||
return "$" + (Array.isArray(group) ? group.join("$") : group); | ||
})); | ||
@@ -94,2 +127,3 @@ } | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
@@ -136,26 +170,2 @@ Object.defineProperty(obj, key, { | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | ||
if (_i == null) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _s, _e; | ||
try { | ||
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
if (i && _arr.length === i) break; | ||
} | ||
} catch (err) { | ||
_d = true; | ||
_e = err; | ||
} finally { | ||
try { | ||
if (!_n && _i["return"] != null) _i["return"](); | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
@@ -228,12 +238,24 @@ if (!o) return; | ||
} | ||
function _toPrimitive(input, hint) { | ||
if (typeof input !== "object" || input === null) return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== undefined) { | ||
var res = prim.call(input, hint || "default"); | ||
if (typeof res !== "object") return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return typeof key === "symbol" ? key : String(key); | ||
} | ||
function isNode() { | ||
/** | ||
* Polyfills of 'process' might set process.browser === true | ||
* | ||
* See: | ||
* https://github.com/webpack/node-libs-browser/blob/master/mock/process.js#L8 | ||
* https://github.com/defunctzombie/node-process/blob/master/browser.js#L156 | ||
**/ | ||
return typeof process !== 'undefined' && !process.browser; | ||
* Save way to check for the global scope which should confirm if an environment is node | ||
* For reference: https://stackoverflow.com/a/31090240 | ||
*/ | ||
var isNodeFunc = new Function('try {return this===global;}catch(e){return false;}'); | ||
return isNodeFunc(); | ||
} | ||
@@ -483,10 +505,2 @@ function isReactNative() { | ||
} | ||
// Set these headers only for node because browsers don't like it when you | ||
// override user-agent or accept-encoding. | ||
// The SDKs should set their own X-Contentful-User-Agent. | ||
if (isNode()) { | ||
config.headers['user-agent'] = 'node.js/' + getNodeVersion(); | ||
config.headers['Accept-Encoding'] = 'gzip'; | ||
} | ||
var axiosOptions = { | ||
@@ -493,0 +507,0 @@ // Axios |
@@ -1,2 +0,2 @@ | ||
declare type Config = { | ||
type Config = { | ||
params?: Record<string, any>; | ||
@@ -3,0 +3,0 @@ }; |
@@ -1,3 +0,3 @@ | ||
declare type FreezeObject = Record<string, any>; | ||
type FreezeObject = Record<string, any>; | ||
export default function freezeSys<T extends FreezeObject>(obj: T): T; | ||
export {}; |
import { AxiosInstance } from './types'; | ||
declare type ThrottleType = 'auto' | string; | ||
type ThrottleType = 'auto' | string; | ||
declare const _default: (axiosInstance: AxiosInstance, type?: ThrottleType | number) => () => void; | ||
export default _default; |
import { AxiosRequestHeaders } from 'axios'; | ||
import type { AxiosInstance as OriginalAxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
declare type DefaultOptions = AxiosRequestConfig & { | ||
type DefaultOptions = AxiosRequestConfig & { | ||
logHandler: (level: string, data?: Error | string) => void; | ||
@@ -9,3 +9,3 @@ responseLogger?: (response: AxiosResponse<any> | Error) => unknown; | ||
}; | ||
export declare type AxiosInstance = OriginalAxiosInstance & { | ||
export type AxiosInstance = OriginalAxiosInstance & { | ||
httpClientParams: CreateHttpClientParams; | ||
@@ -15,3 +15,3 @@ cloneWithNewParams: (params: Partial<CreateHttpClientParams>) => AxiosInstance; | ||
}; | ||
export declare type CreateHttpClientParams = { | ||
export type CreateHttpClientParams = { | ||
/** Access Token or an async function that returns Access Token */ | ||
@@ -18,0 +18,0 @@ accessToken: string | (() => Promise<string>); |
{ | ||
"name": "contentful-sdk-core", | ||
"version": "7.0.4", | ||
"version": "7.0.5", | ||
"description": "Core modules for the Contentful JS SDKs", | ||
@@ -36,4 +36,3 @@ "homepage": "https://www.contentful.com/developers/docs/javascript/", | ||
"tsc": "tsc --noEmit", | ||
"prepush": "npm run test:unit", | ||
"postbuild": "bundlesize" | ||
"prepush": "npm run test:unit && bundlesize" | ||
}, | ||
@@ -68,3 +67,3 @@ "files": [ | ||
"@types/chai": "^4.2.21", | ||
"@types/jest": "^27.4.0", | ||
"@types/jest": "^29.2.2", | ||
"@types/lodash.isplainobject": "^4.0.6", | ||
@@ -92,3 +91,3 @@ "@types/lodash.isstring": "^4.0.6", | ||
"in-publish": "^2.0.0", | ||
"jest": "^27.5.1", | ||
"jest": "^29.3.1", | ||
"lint-staged": "^13.0.0", | ||
@@ -105,3 +104,3 @@ "mkdirp": "^1.0.4", | ||
"semantic-release": "^17.0.7", | ||
"ts-jest": "^27.1.3", | ||
"ts-jest": "^29.0.3", | ||
"tslib": "^2.0.3", | ||
@@ -108,0 +107,0 @@ "typescript": "^4.5.5" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67260
1632
2