decap-cms-lib-util 3.3.1 → 3.5.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/dist/esm/API.js CHANGED
@@ -1,28 +1,7 @@
1
- function _extendableBuiltin(cls) {
2
- function ExtendableBuiltin() {
3
- var instance = Reflect.construct(cls, Array.from(arguments));
4
- Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
5
- return instance;
6
- }
7
- ExtendableBuiltin.prototype = Object.create(cls.prototype, {
8
- constructor: {
9
- value: cls,
10
- enumerable: false,
11
- writable: true,
12
- configurable: true
13
- }
14
- });
15
- if (Object.setPrototypeOf) {
16
- Object.setPrototypeOf(ExtendableBuiltin, cls);
17
- } else {
18
- ExtendableBuiltin.__proto__ = cls;
19
- }
20
- return ExtendableBuiltin;
21
- }
22
1
  import { asyncLock } from './asyncLock';
23
2
  import unsentRequest from './unsentRequest';
24
3
  import APIError from './APIError';
25
- class RateLimitError extends _extendableBuiltin(Error) {
4
+ class RateLimitError extends Error {
26
5
  constructor(message, resetSeconds) {
27
6
  super(message);
28
7
  if (resetSeconds < 0) {
@@ -1,26 +1,5 @@
1
- function _extendableBuiltin(cls) {
2
- function ExtendableBuiltin() {
3
- var instance = Reflect.construct(cls, Array.from(arguments));
4
- Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
5
- return instance;
6
- }
7
- ExtendableBuiltin.prototype = Object.create(cls.prototype, {
8
- constructor: {
9
- value: cls,
10
- enumerable: false,
11
- writable: true,
12
- configurable: true
13
- }
14
- });
15
- if (Object.setPrototypeOf) {
16
- Object.setPrototypeOf(ExtendableBuiltin, cls);
17
- } else {
18
- ExtendableBuiltin.__proto__ = cls;
19
- }
20
- return ExtendableBuiltin;
21
- }
22
1
  export const API_ERROR = 'API_ERROR';
23
- export default class APIError extends _extendableBuiltin(Error) {
2
+ export default class APIError extends Error {
24
3
  constructor(message, status, api, meta = {}) {
25
4
  super(message);
26
5
  this.message = message;
@@ -1,26 +1,5 @@
1
- function _extendableBuiltin(cls) {
2
- function ExtendableBuiltin() {
3
- var instance = Reflect.construct(cls, Array.from(arguments));
4
- Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
5
- return instance;
6
- }
7
- ExtendableBuiltin.prototype = Object.create(cls.prototype, {
8
- constructor: {
9
- value: cls,
10
- enumerable: false,
11
- writable: true,
12
- configurable: true
13
- }
14
- });
15
- if (Object.setPrototypeOf) {
16
- Object.setPrototypeOf(ExtendableBuiltin, cls);
17
- } else {
18
- ExtendableBuiltin.__proto__ = cls;
19
- }
20
- return ExtendableBuiltin;
21
- }
22
1
  export const ACCESS_TOKEN_ERROR = 'ACCESS_TOKEN_ERROR';
23
- export default class AccessTokenError extends _extendableBuiltin(Error) {
2
+ export default class AccessTokenError extends Error {
24
3
  constructor(message) {
25
4
  super(message);
26
5
  this.message = message;
@@ -1,26 +1,5 @@
1
- function _extendableBuiltin(cls) {
2
- function ExtendableBuiltin() {
3
- var instance = Reflect.construct(cls, Array.from(arguments));
4
- Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
5
- return instance;
6
- }
7
- ExtendableBuiltin.prototype = Object.create(cls.prototype, {
8
- constructor: {
9
- value: cls,
10
- enumerable: false,
11
- writable: true,
12
- configurable: true
13
- }
14
- });
15
- if (Object.setPrototypeOf) {
16
- Object.setPrototypeOf(ExtendableBuiltin, cls);
17
- } else {
18
- ExtendableBuiltin.__proto__ = cls;
19
- }
20
- return ExtendableBuiltin;
21
- }
22
1
  export const EDITORIAL_WORKFLOW_ERROR = 'EDITORIAL_WORKFLOW_ERROR';
23
- export default class EditorialWorkflowError extends _extendableBuiltin(Error) {
2
+ export default class EditorialWorkflowError extends Error {
24
3
  constructor(message, notUnderEditorialWorkflow) {
25
4
  super(message);
26
5
  this.message = message;
package/dist/esm/path.js CHANGED
@@ -1,9 +1,10 @@
1
- const absolutePath = new RegExp('^(?:[a-z]+:)?//', 'i');
1
+ const absolutePath = new RegExp('^(?:[a-z]+:)?//|^/', 'i');
2
2
  function normalizePath(path) {
3
3
  return path.replace(/[\\/]+/g, '/');
4
4
  }
5
5
  export function isAbsolutePath(path) {
6
- return absolutePath.test(path);
6
+ const result = absolutePath.test(path);
7
+ return result;
7
8
  }
8
9
 
9
10
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "decap-cms-lib-util",
3
3
  "description": "Shared utilities for Decap CMS.",
4
- "version": "3.3.1",
4
+ "version": "3.5.0",
5
5
  "repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-lib-util",
6
6
  "bugs": "https://github.com/decaporg/decap-cms/issues",
7
7
  "module": "dist/esm/index.js",
@@ -28,5 +28,5 @@
28
28
  "immutable": "^3.7.6",
29
29
  "lodash": "^4.17.11"
30
30
  },
31
- "gitHead": "899dba82d1f396260e0f84c6977c1d2aee809b59"
31
+ "gitHead": "45c9f5b9a1a12f74321ce4658b71ec88d6365ec1"
32
32
  }