@x-oasis/inherit 0.1.11

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/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @x-oasis/inherit
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ $ npm i @x-oasis/inherit
7
+ ```
8
+
9
+ ## How to use
10
+
11
+ ```typescript
12
+ import inherit from '@x-oasis/inherit'
13
+ ```
14
+
15
+ ## How to run test
16
+
17
+ ```bash
18
+ $ pnpm test
19
+ ```
@@ -0,0 +1,6 @@
1
+ declare const _default: (subClass: {
2
+ prototype: any;
3
+ }, superClass: {
4
+ prototype: any;
5
+ }) => void;
6
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./inherit.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./inherit.cjs.development.js')
8
+ }
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index = (function (subClass, superClass) {
6
+ subClass.prototype = Object.create(superClass.prototype);
7
+ subClass.prototype.constructor = subClass;
8
+ });
9
+
10
+ exports.default = index;
11
+ //# sourceMappingURL=inherit.cjs.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inherit.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["export default (\n subClass: {\n prototype: any;\n // __proto__: any;\n },\n superClass: {\n prototype: any;\n }\n) => {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n // subClass.__proto__ = superClass // eslint-disable-line\n};\n"],"names":["subClass","superClass","prototype","Object","create","constructor"],"mappings":";;;;AAAA,aAAe,UACbA,QAGC,EACDC,UAEC;EAEDD,QAAQ,CAACE,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACH,UAAU,CAACC,SAAS,CAAC;EACxDF,QAAQ,CAACE,SAAS,CAACG,WAAW,GAAGL,QAAQ;AAE3C,CAAC;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t};
2
+ //# sourceMappingURL=inherit.cjs.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inherit.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["export default (\n subClass: {\n prototype: any;\n // __proto__: any;\n },\n superClass: {\n prototype: any;\n }\n) => {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n // subClass.__proto__ = superClass // eslint-disable-line\n};\n"],"names":["subClass","superClass","prototype","Object","create","constructor"],"mappings":"6FACEA,EAIAC,GAIAD,EAASE,UAAYC,OAAOC,OAAOH,EAAWC,WAC9CF,EAASE,UAAUG,YAAcL"}
@@ -0,0 +1,7 @@
1
+ var index = (function (subClass, superClass) {
2
+ subClass.prototype = Object.create(superClass.prototype);
3
+ subClass.prototype.constructor = subClass;
4
+ });
5
+
6
+ export default index;
7
+ //# sourceMappingURL=inherit.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inherit.esm.js","sources":["../src/index.ts"],"sourcesContent":["export default (\n subClass: {\n prototype: any;\n // __proto__: any;\n },\n superClass: {\n prototype: any;\n }\n) => {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n // subClass.__proto__ = superClass // eslint-disable-line\n};\n"],"names":["subClass","superClass","prototype","Object","create","constructor"],"mappings":"AAAA,aAAe,UACbA,QAGC,EACDC,UAEC;EAEDD,QAAQ,CAACE,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACH,UAAU,CAACC,SAAS,CAAC;EACxDF,QAAQ,CAACE,SAAS,CAACG,WAAW,GAAGL,QAAQ;AAE3C,CAAC;;;;"}
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@x-oasis/inherit",
3
+ "version": "0.1.11",
4
+ "description": "inherit function",
5
+ "main": "dist/index.js",
6
+ "typings": "dist/index.d.ts",
7
+ "module": "dist/inherit.esm.js",
8
+ "files": [
9
+ "dist",
10
+ "index.ts",
11
+ "src"
12
+ ],
13
+ "author": "",
14
+ "license": "ISC",
15
+ "devDependencies": {
16
+ "tsdx": "^0.14.1"
17
+ },
18
+ "scripts": {
19
+ "build": "tsdx build --tsconfig tsconfig.build.json",
20
+ "clean": "rimraf ./dist",
21
+ "test": "vitest",
22
+ "compile": "tsc -p tsconfig.build.json"
23
+ }
24
+ }
package/src/index.ts ADDED
@@ -0,0 +1,13 @@
1
+ export default (
2
+ subClass: {
3
+ prototype: any;
4
+ // __proto__: any;
5
+ },
6
+ superClass: {
7
+ prototype: any;
8
+ }
9
+ ) => {
10
+ subClass.prototype = Object.create(superClass.prototype);
11
+ subClass.prototype.constructor = subClass;
12
+ // subClass.__proto__ = superClass // eslint-disable-line
13
+ };