@visactor/vrender-animate 1.0.45 → 1.0.46-alpha.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.
@@ -14,7 +14,6 @@ function getCustomType(custom) {
14
14
  if (custom.prototype.constructor === custom) {
15
15
  const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
16
16
  if (descriptor && !descriptor.writable) return 1;
17
- if (Object.getOwnPropertyNames(custom.prototype).length > 1) return 1;
18
17
  }
19
18
  return 2;
20
19
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAO9C,SAAgB,aAAa,CAAC,MAAW;IACvC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAA,mBAAU,EAAC,MAAM,CAAC,EAAE;QAClC,OAAO,CAAC,CAAC;KACV;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAChC,OAAO,CAAC,CAAC;KACV;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,CAAC,CAAC;KACV;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,KAAK,MAAM,EAAE;QAE3C,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtC,OAAO,CAAC,CAAC;SACV;QAGD,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AA5BD,sCA4BC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\n/**\n * 获取自定义类型\n * @param custom 自定义动画对象\n * @returns 0: 不是函数/类, 1: 是类, 2: 是函数\n */\nexport function getCustomType(custom: any): number {\n if (!custom || !isFunction(custom)) {\n return 0;\n }\n // 正则表达式检查是最快的,优先使用\n const functionStr = Function.prototype.toString.call(custom);\n if (/^class\\s/.test(functionStr)) {\n return 1;\n }\n // 检查箭头函数(没有prototype)\n if (!custom.prototype) {\n return 2;\n }\n // 检查构造函数是否是它自己\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,原生class的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n // Babel/TypeScript 转译后的类,prototype 可写但仍有方法在 prototype 上\n // 通过检查 prototype 上是否有除 constructor 之外的自有属性来判断\n const protoKeys = Object.getOwnPropertyNames(custom.prototype);\n if (protoKeys.length > 1) {\n return 1;\n }\n }\n return 2;\n}\n"]}
1
+ {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAO9C,SAAgB,aAAa,CAAC,MAAW;IACvC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAA,mBAAU,EAAC,MAAM,CAAC,EAAE;QAClC,OAAO,CAAC,CAAC;KACV;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAChC,OAAO,CAAC,CAAC;KACV;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,CAAC,CAAC;KACV;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,KAAK,MAAM,EAAE;QAE3C,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtC,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAtBD,sCAsBC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\n/**\n * 获取自定义类型\n * @param custom 自定义动画对象\n * @returns 0: 不是函数/类, 1: 是类, 2: 是函数\n */\nexport function getCustomType(custom: any): number {\n if (!custom || !isFunction(custom)) {\n return 0;\n }\n // 正则表达式检查是最快的,优先使用\n const functionStr = Function.prototype.toString.call(custom);\n if (/^class\\s/.test(functionStr)) {\n return 1;\n }\n // 检查箭头函数(没有prototype)\n if (!custom.prototype) {\n return 2;\n }\n // 检查构造函数是否是它自己(ES5类)\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,类的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n }\n return 2;\n}\n"]}
package/dist/index.es.js CHANGED
@@ -1578,10 +1578,6 @@ function getCustomType(custom) {
1578
1578
  if (descriptor && !descriptor.writable) {
1579
1579
  return 1;
1580
1580
  }
1581
- const protoKeys = Object.getOwnPropertyNames(custom.prototype);
1582
- if (protoKeys.length > 1) {
1583
- return 1;
1584
- }
1585
1581
  }
1586
1582
  return 2;
1587
1583
  }
@@ -8,7 +8,6 @@ export function getCustomType(custom) {
8
8
  if (custom.prototype.constructor === custom) {
9
9
  const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
10
10
  if (descriptor && !descriptor.writable) return 1;
11
- if (Object.getOwnPropertyNames(custom.prototype).length > 1) return 1;
12
11
  }
13
12
  return 2;
14
13
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAClC,OAAO,CAAC,CAAC;KACV;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAChC,OAAO,CAAC,CAAC;KACV;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,CAAC,CAAC;KACV;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,KAAK,MAAM,EAAE;QAE3C,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtC,OAAO,CAAC,CAAC;SACV;QAGD,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\n/**\n * 获取自定义类型\n * @param custom 自定义动画对象\n * @returns 0: 不是函数/类, 1: 是类, 2: 是函数\n */\nexport function getCustomType(custom: any): number {\n if (!custom || !isFunction(custom)) {\n return 0;\n }\n // 正则表达式检查是最快的,优先使用\n const functionStr = Function.prototype.toString.call(custom);\n if (/^class\\s/.test(functionStr)) {\n return 1;\n }\n // 检查箭头函数(没有prototype)\n if (!custom.prototype) {\n return 2;\n }\n // 检查构造函数是否是它自己\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,原生class的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n // Babel/TypeScript 转译后的类,prototype 可写但仍有方法在 prototype 上\n // 通过检查 prototype 上是否有除 constructor 之外的自有属性来判断\n const protoKeys = Object.getOwnPropertyNames(custom.prototype);\n if (protoKeys.length > 1) {\n return 1;\n }\n }\n return 2;\n}\n"]}
1
+ {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAClC,OAAO,CAAC,CAAC;KACV;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAChC,OAAO,CAAC,CAAC;KACV;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,CAAC,CAAC;KACV;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,KAAK,MAAM,EAAE;QAE3C,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtC,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\n/**\n * 获取自定义类型\n * @param custom 自定义动画对象\n * @returns 0: 不是函数/类, 1: 是类, 2: 是函数\n */\nexport function getCustomType(custom: any): number {\n if (!custom || !isFunction(custom)) {\n return 0;\n }\n // 正则表达式检查是最快的,优先使用\n const functionStr = Function.prototype.toString.call(custom);\n if (/^class\\s/.test(functionStr)) {\n return 1;\n }\n // 检查箭头函数(没有prototype)\n if (!custom.prototype) {\n return 2;\n }\n // 检查构造函数是否是它自己(ES5类)\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,类的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n }\n return 2;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-animate",
3
- "version": "1.0.45",
3
+ "version": "1.0.46-alpha.0",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "dependencies": {
15
15
  "@visactor/vutils": "~1.0.12",
16
- "@visactor/vrender-core": "1.0.45"
16
+ "@visactor/vrender-core": "1.0.46-alpha.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@rushstack/eslint-patch": "~1.1.4",
@@ -29,9 +29,9 @@
29
29
  "vite": "3.2.6",
30
30
  "typescript": "4.9.5",
31
31
  "cross-env": "^7.0.3",
32
- "@internal/eslint-config": "0.0.1",
32
+ "@internal/bundler": "0.0.1",
33
33
  "@internal/ts-config": "0.0.1",
34
- "@internal/bundler": "0.0.1"
34
+ "@internal/eslint-config": "0.0.1"
35
35
  },
36
36
  "keywords": [
37
37
  "VisActor",