Add class MCF_File. Update packages
This commit is contained in:
parent
d1de47e9f9
commit
424e3e4df0
6 changed files with 4607 additions and 1565 deletions
52
.eslintrc.js
Normal file
52
.eslintrc.js
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
module.exports = {
|
||||||
|
'plugins': ['jest'],
|
||||||
|
'env': {
|
||||||
|
'commonjs': true,
|
||||||
|
'es6': true,
|
||||||
|
'node': true,
|
||||||
|
'jest/globals': true,
|
||||||
|
},
|
||||||
|
'extends': 'eslint:recommended',
|
||||||
|
'globals': {
|
||||||
|
'Atomics': 'readonly',
|
||||||
|
'SharedArrayBuffer': 'readonly',
|
||||||
|
},
|
||||||
|
'parserOptions': {
|
||||||
|
'ecmaVersion': 2018,
|
||||||
|
'sourceType': 'module',
|
||||||
|
},
|
||||||
|
'rules': {
|
||||||
|
'indent': [
|
||||||
|
'error',
|
||||||
|
2,
|
||||||
|
],
|
||||||
|
'linebreak-style': [
|
||||||
|
'error',
|
||||||
|
'unix',
|
||||||
|
],
|
||||||
|
'quotes': [
|
||||||
|
'error',
|
||||||
|
'single',
|
||||||
|
{ 'avoidEscape': true },
|
||||||
|
],
|
||||||
|
'semi': [
|
||||||
|
'error',
|
||||||
|
'never',
|
||||||
|
],
|
||||||
|
'comma-dangle': [
|
||||||
|
'error',
|
||||||
|
'always-multiline',
|
||||||
|
],
|
||||||
|
'arrow-parens': [
|
||||||
|
'error',
|
||||||
|
'as-needed',
|
||||||
|
],
|
||||||
|
'no-var': [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
'prefer-const': ['error', {
|
||||||
|
'destructuring': 'all',
|
||||||
|
'ignoreReadBeforeAssign': true,
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
};
|
2
dist/mcf-objects.js
vendored
2
dist/mcf-objects.js
vendored
File diff suppressed because one or more lines are too long
2
dist/mcf-objects.js.map
vendored
2
dist/mcf-objects.js.map
vendored
File diff suppressed because one or more lines are too long
6122
package-lock.json
generated
6122
package-lock.json
generated
File diff suppressed because it is too large
Load diff
19
package.json
19
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mcf-objects",
|
"name": "mcf-objects",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"description": "Library to create custom typed objects with custom types",
|
"description": "Library to create custom typed objects with custom types",
|
||||||
"main": "dist/mcf-objects.js",
|
"main": "dist/mcf-objects.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -10,15 +10,16 @@
|
||||||
"test:watch": "jest --watch"
|
"test:watch": "jest --watch"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.7.5",
|
"@babel/core": "^7.11.6",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
||||||
"@babel/preset-env": "^7.7.6",
|
"@babel/preset-env": "^7.11.5",
|
||||||
"@babel/preset-react": "^7.7.4",
|
"@babel/preset-react": "^7.10.4",
|
||||||
"babel-loader": "^8.0.6",
|
"babel-loader": "^8.1.0",
|
||||||
|
"eslint": "^7.8.1",
|
||||||
"jest": "^24.9.0",
|
"jest": "^24.9.0",
|
||||||
"webpack": "^4.41.3",
|
"webpack": "^4.44.2",
|
||||||
"webpack-cli": "^3.3.10",
|
"webpack-cli": "^3.3.12",
|
||||||
"webpack-dev-server": "^3.9.0",
|
"webpack-dev-server": "^3.11.0",
|
||||||
"webpack-merge": "^4.2.2"
|
"webpack-merge": "^4.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
|
|
21
src/index.js
21
src/index.js
|
@ -232,4 +232,23 @@ class MCF_DefinedObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {MCF_DefinedObject as definedObject};
|
const fileDefinition = {
|
||||||
|
name: {TYPE: 'string', required: true},
|
||||||
|
extension: {TYPE: 'string', required: true},
|
||||||
|
path: {TYPE: 'string', required: true},
|
||||||
|
content: {TYPE: 'string'},
|
||||||
|
}
|
||||||
|
|
||||||
|
class MCF_File extends MCF_DefinedObject {
|
||||||
|
constructor(params) {
|
||||||
|
super({
|
||||||
|
fields: fileDefinition,
|
||||||
|
value: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
MCF_DefinedObject as definedObject,
|
||||||
|
MCF_File,
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue