UNPKG

es6-class-prototype

Version:
1 lines 1.8 kB
{"version":3,"file":"index.cjs.production.min.cjs","sources":["../src/index.ts","../src/index.cts"],"sourcesContent":["/**\n * Created by user on 2018/3/16/016.\n */\n\nimport { IClassProxyStatic } from 'class-proxy';\nexport { IClassProxyStatic } from 'class-proxy';\n\nexport function classPrototype<T>(target: IClassProxyStatic<T>, all?: boolean): T\n{\n\t// @ts-ignore\n\tlet desc = Object.getOwnPropertyDescriptors(target.prototype);\n\n\tlet prototype = Object.keys(desc).reduce(function (a, b)\n\t{\n\t\tif (all || !desc[b].get && !desc[b].set)\n\t\t{\n\t\t\t// @ts-ignore\n\t\t\ta[b] = target.prototype[b];\n\t\t}\n\n\t\treturn a;\n\t}, {});\n\n\t// @ts-ignore\n\treturn Object.assign({}, target.prototype, prototype);\n}\n\nexport default classPrototype\n\n// @ts-ignore\nif (process.env.TSDX_FORMAT !== 'esm')\n{\n\tObject.defineProperty(classPrototype, \"__esModule\", { value: true });\n\n\tObject.defineProperty(classPrototype, 'classPrototype', { value: classPrototype });\n\tObject.defineProperty(classPrototype, 'default', { value: classPrototype });\n}\n","/**\n * Created by user on 2018/2/11/011.\n */\n\nimport _ from './index';\n\n// @ts-ignore\nexport = _;\n"],"names":["classPrototype","target","all","desc","Object","getOwnPropertyDescriptors","prototype","keys","reduce","a","b","get","set","assign","defineProperty","value","module","exports","_"],"mappings":";;AAOgB,SAAAA,eAAkBC,GAA8BC;EAG/D,IAAIC,IAAOC,OAAOC,0BAA0BJ,EAAOK,YAE/CA,IAAYF,OAAOG,KAAKJ,GAAMK,QAAO,SAAUC,GAAGC;IAQrD,QANIR,MAAQC,EAAKO,GAAGC,QAAQR,EAAKO,GAAGE,SAGnCH,EAAEC,KAAKT,EAAOK,UAAUI,KAGlBD;AACP,MAAE,CAAE;EAGL,OAAOL,OAAOS,OAAO,CAAA,GAAIZ,EAAOK,WAAWA;AAC5C;;AAOCF,OAAOU,eAAed,gBAAgB,cAAc;EAAEe,QAAO;IAE7DX,OAAOU,eAAed,gBAAgB,kBAAkB;EAAEe,OAAOf;IACjEI,OAAOU,eAAed,gBAAgB,WAAW;EAAEe,OAAOf;IC7B3DgB,OAAAC,UACSC"}