validno 0.1.9 → 0.1.10

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/dev.js ADDED
@@ -0,0 +1,63 @@
1
+ import { Schema } from "./Schema.js";
2
+ const schema = new Schema({
3
+ wrongType: {
4
+ type: Number,
5
+ required: true,
6
+ title: 'Не по типу',
7
+ customMessage: (input) => {
8
+ return 'wrong type 1 msg ' + input.keyword;
9
+ }
10
+ },
11
+ missingKey: {
12
+ type: Date,
13
+ required: true,
14
+ title: 'Отсутствующий',
15
+ customMessage: (input) => {
16
+ return 'missing msg ' + input.keyword;
17
+ }
18
+ },
19
+ wrongRule1: {
20
+ type: String,
21
+ required: true,
22
+ title: 'Wrong Rule #1',
23
+ rules: {
24
+ is: 'xxx'
25
+ },
26
+ customMessage: (input) => {
27
+ return 'wrong rule #1 msg ' + input.keyword;
28
+ }
29
+ },
30
+ wrongRule2: {
31
+ type: String,
32
+ required: true,
33
+ title: 'Wrong Rule #2',
34
+ rules: {
35
+ lengthMin: 999
36
+ },
37
+ customMessage: (input) => {
38
+ return 'wrong rule #2 msg ' + input.keyword;
39
+ }
40
+ },
41
+ wrongRule3: {
42
+ type: String,
43
+ required: true,
44
+ title: 'Wrong Rule #3',
45
+ rules: {
46
+ lengthMax: 1
47
+ },
48
+ customMessage: (input) => {
49
+ const { keyword, value, key, title, reqs, schema, rules } = input;
50
+ if (keyword === 'lengthMax') {
51
+ return `Значение ${value} недопустимо для поля ${title}. Минимальная длина ${rules.lengthMax} символов`;
52
+ }
53
+ return 'Проверьте значение, кажется, что-то не в порядке';
54
+ }
55
+ },
56
+ });
57
+ const obj = {
58
+ wrongType: 'String',
59
+ wrongRule1: 'qwertyuiop',
60
+ wrongRule2: 'asdfghjkl',
61
+ wrongRule3: 'zxcvbnmasd'
62
+ };
63
+ console.log('finalResult', schema.validate(obj));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "validno",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/Schema.ts DELETED
@@ -1,46 +0,0 @@
1
- import validate from "./validate.js"
2
-
3
- export type TSchemaItem = {
4
- required: boolean,
5
- type: any,
6
- eachType?: any,
7
- rules?: {},
8
- title?: string,
9
- customMessage?: Function
10
- }
11
-
12
- export type TSchemaInput = {
13
- [key: string]: TSchemaItem | TSchemaInput
14
- }
15
-
16
- export const enum ESchemaFields {
17
- Required = 'required',
18
- Type = 'type',
19
- EachType = 'eachType',
20
- Rules = 'rules',
21
- Title = 'title',
22
- CustomMessage = 'customMessage'
23
- }
24
-
25
- export const defaultSchemaKeys = [
26
- ESchemaFields.Required,
27
- ESchemaFields.Type,
28
- ESchemaFields.EachType,
29
- ESchemaFields.Rules,
30
- ESchemaFields.Title,
31
- ESchemaFields.CustomMessage
32
- ]
33
-
34
- export type TSchema = TSchemaInput
35
-
36
- export class Schema {
37
- schema: TSchema
38
-
39
- constructor(inputSchema: TSchema) {
40
- this.schema = inputSchema
41
- }
42
-
43
- validate(data: any, keys?: string | string[]) {
44
- return validate.call(this, this, data, keys)
45
- }
46
- }
package/src/checkRules.ts DELETED
@@ -1,196 +0,0 @@
1
- import { ErrorKeywords } from "./constants/details.js";
2
- import { TSchema, TSchemaItem } from "./Schema.js";
3
- import _validations from "./utils/validations.js"
4
-
5
- export type TRule = {[key: string]: any}
6
-
7
- type TLengths = string | Array<any>
8
-
9
- export const rulesParams = {
10
- lengthMin: {
11
- allowedTypes: [String]
12
- }
13
- }
14
-
15
- const ensureRuleHasCorrectType = (value: any, allowedTypes: any[]) => {
16
- const isInAllowedList = allowedTypes.some(TYPE => {
17
- const getType = (el: any) => Object.prototype.toString.call(el)
18
- return getType(new TYPE()) == getType(value)
19
- })
20
-
21
- return isInAllowedList
22
- }
23
-
24
- const rulesFunctions: any = {
25
- custom: (key: string, val: any, func: Function, extra: {schema: TSchema, input: {[key: string]: any}}) => {
26
- return func(val, extra)
27
- },
28
- isEmail: (key: string, val: any) => {
29
- return {
30
- result: _validations.isEmail(val),
31
- details: `Значение должно соответствовать формату name@email.ru`
32
- }
33
- },
34
- is: (key: string, val: any, equalTo: any) => {
35
- return {
36
- result: _validations.is(val, equalTo),
37
- details: `Значение должно быть "${equalTo}"`
38
- }
39
- },
40
- isNot: (key: string, val: any, notEqualTo: any) => {
41
- return {
42
- result: _validations.isNot(val, notEqualTo),
43
- details: `Значение "${notEqualTo}" недопустимо`
44
- }
45
- },
46
- min: (key: string, val: number, min: number) => {
47
- return {
48
- result: _validations.isNumberGte(val, min),
49
- details: "Значение не может быть меньше " + min
50
- }
51
- },
52
- max: (key: string, val: number, max: number) => {
53
- return {
54
- result: _validations.isNumberLte(val, max),
55
- details: "Значение не может быть больше " + max
56
- }
57
- },
58
- minMax: (key: string, val: number, minMax: [min: number, max: number]) => {
59
- const [min, max] = minMax
60
- return {
61
- result: _validations.isNumberGte(val, min) && _validations.isNumberLte(val, max),
62
- details: `Значение должно быть в пределах ${min}-${max}`
63
- }
64
- },
65
- length: (key: string, val: TLengths, length: number) => {
66
- return {
67
- result: _validations.lengthIs(val, length),
68
- details: "Количество символов должно быть равным " + length
69
- }
70
- },
71
- lengthNot: (key: string, val: TLengths, lengthNot: number) => {
72
- return {
73
- result: _validations.lengthNot(val, lengthNot),
74
- details: "Количество символов не должно быть равным " + lengthNot
75
- }
76
- },
77
- lengthMinMax: (key: string, val: TLengths, minMax: [min: number, max: number]) => {
78
- const [min, max] = minMax
79
-
80
- return {
81
- result: _validations.lengthMin(val, min) && _validations.lengthMax(val, max),
82
- details: `Длина должна быть от ${min} до ${max} символов`
83
- }
84
- },
85
- lengthMin: (key: string, val: TLengths, min: number) => {
86
- ensureRuleHasCorrectType(val, rulesParams['lengthMin'].allowedTypes)
87
-
88
- return {
89
- result: _validations.lengthMin(val, min),
90
- details: `Длина не может быть меньше ${min} символов`
91
- }
92
- },
93
- lengthMax: (key: string, val: TLengths, max: number) => {
94
- return {
95
- result: _validations.lengthMax(val, max),
96
- details: `Длина не может быть больше ${max} символов`
97
- }
98
- },
99
- regex: (key: string, val: any, regex: RegExp) => {
100
- return {
101
- result: _validations.regexTested(val, regex),
102
- details: "Значение не соответствует допустимому формату"
103
- }
104
- },
105
- enum: (key: string, value: any, allowedList: any[]) => {
106
- const output = {
107
- result: true,
108
- details: ''
109
- }
110
-
111
- if (!Array.isArray(value)) {
112
- const isCorrect = allowedList.includes(value)
113
- output.result = isCorrect,
114
- output.details = isCorrect ? '' : `Значение "${value}" недопустимо`
115
- } else {
116
- const incorrectValues: any[] = []
117
- value.forEach((v: any) => !allowedList.includes(v) ? incorrectValues.push(v): {})
118
- const isCorrect = incorrectValues.length === 0
119
-
120
- output.result = isCorrect,
121
- output.details = isCorrect ? '' : `Значения недопустимы: "${incorrectValues.join(', ')}"`
122
- }
123
-
124
- return output
125
- }
126
- };
127
-
128
- type TRulesResult = {
129
- ok: boolean,
130
- details: string[]
131
- }
132
-
133
- function checkRules (this: any, key: string, value: any, requirements: TSchemaItem, inputObj: any) {
134
- const result: TRulesResult = {
135
- ok: true,
136
- details: []
137
- };
138
-
139
- // Значение отсутствует, но НЕ является обязательным
140
- if (requirements.required !== true && value === undefined) return result
141
-
142
- // Для этого ключа нет правил
143
- if (!requirements || !requirements.rules || !Object.keys(requirements.rules).length) {
144
- return result
145
- }
146
-
147
- const rules: TRule = requirements.rules
148
- const title = requirements.title || key
149
-
150
- const allResults = []
151
- const allRulesKeys = Object.keys(rules)
152
-
153
- let i = 0;
154
- while (i < allRulesKeys.length) {
155
- const ruleName = allRulesKeys[i]
156
-
157
- // Если правило, указанное для ключа, отсутствует в списке доступных
158
- if (ruleName in rulesFunctions === false) {
159
- i++
160
- continue
161
- }
162
-
163
- const func = rulesFunctions[ruleName]
164
- const args = rules[ruleName]
165
-
166
- const result = func(key, value, args, {schema: this.schema, input: inputObj})
167
-
168
- if (requirements.customMessage && typeof requirements.customMessage === 'function') {
169
- result.details = requirements.customMessage({
170
- keyword: ruleName,
171
- value: value,
172
- key: key,
173
- title: title,
174
- reqs: requirements,
175
- schema: this.schema,
176
- rules: rules,
177
- })
178
- }
179
-
180
- allResults.push(result)
181
-
182
- i++;
183
- }
184
-
185
- // If key has failed rules checks
186
- const failedResults = allResults.filter(el => el.result === false)
187
-
188
- if (failedResults.length) {
189
- result.ok = false
190
- result.details = failedResults.map(el => el.details)
191
- }
192
-
193
- return result;
194
- };
195
-
196
- export default checkRules
package/src/checkType.ts DELETED
@@ -1,213 +0,0 @@
1
- import { ErrorKeywords } from "./constants/details.js";
2
- import { TSchemaInput, TSchemaItem } from "./Schema.js";
3
- import _validations from "./utils/validations.js";
4
-
5
- const getErrorDetails = (key: string, expectedType: any, receivedValue: any) => {
6
- let receivedType = ''
7
-
8
- if (typeof receivedValue === 'string') receivedType = 'String'
9
- else if (typeof receivedValue === 'number') receivedType = 'Number'
10
- else if (typeof receivedValue === 'boolean') receivedType = 'Noolean'
11
- else if (receivedValue === null) receivedType = 'null'
12
- else if (Array.isArray(receivedValue)) receivedType = 'Array'
13
- else if (_validations.isDate(receivedValue)) receivedType = 'Date'
14
- else if (_validations.isObject(receivedValue)) receivedType = 'Object'
15
- else if (receivedValue === undefined) receivedType = 'undefined'
16
-
17
- return `Проверьте тип "${key}": ожидался ${expectedType?.name || expectedType}, получен ${receivedType || 'unknown'}`;
18
- };
19
-
20
- const checkTypeMultiple = (key: string, value: any, requirements: TSchemaItem | TSchemaInput, keyName = key) => {
21
- const constructorNames = requirements.type.map((el:any) => String(el?.name || el))
22
-
23
- const result = {
24
- key: keyName,
25
- passed: false,
26
- details: getErrorDetails(keyName, constructorNames.join('/'), value)
27
- };
28
-
29
- let i = 0;
30
- while (i < requirements.type.length) {
31
- const requirementsRe = { ...requirements, type: requirements.type[i]}
32
- const check = checkType(key, value, requirementsRe)
33
-
34
- if (check[0].passed === true) {
35
- result.passed = true
36
- result.details = 'OK'
37
- return result
38
- }
39
-
40
- i++
41
- }
42
-
43
- return result
44
- }
45
-
46
- type TCheckTypeResult = {key: string, passed: boolean, details: string}
47
-
48
- const checkType = (key: string, value: any, requirements: TSchemaItem | TSchemaInput, keyName = key): TCheckTypeResult[] => {
49
- const isNotNull = value !== null
50
- const keyTitle = 'title' in requirements ? requirements.title : keyName
51
- const hasCustomMessage = requirements.customMessage && typeof requirements.customMessage === 'function'
52
-
53
- if (value === undefined && requirements.required) {
54
- return [{key: keyName, passed: false, details: `Значение "${keyName}" отсутствует`}]
55
- }
56
-
57
- let result: TCheckTypeResult[] = []
58
-
59
- if (Array.isArray(requirements.type)) {
60
- return [checkTypeMultiple(key, value, requirements)]
61
- }
62
-
63
- if (value === undefined && requirements.required !== true) {
64
- result.push({
65
- key: keyName,
66
- passed: true,
67
- details: 'OK'
68
- })
69
- return result
70
- }
71
-
72
-
73
- const customErrDetails = hasCustomMessage ?
74
- //@ts-ignore
75
- requirements.customMessage({
76
- keyword: ErrorKeywords.Type,
77
- value: value,
78
- key: keyName,
79
- title: keyTitle,
80
- reqs: requirements,
81
- schema: null
82
- }) :
83
- null;
84
-
85
- const baseErrDetails = getErrorDetails(keyName, requirements.type, value)
86
-
87
- const getDetails = (isOK: boolean) => isOK ? 'OK' : customErrDetails || baseErrDetails
88
-
89
- switch (requirements.type) {
90
- case 'any':
91
- result.push({
92
- key: keyName,
93
- passed: true,
94
- details: 'OK'
95
- })
96
- break;
97
- case Number:
98
- const isNumber = isNotNull && value.constructor === Number
99
-
100
- result.push({
101
- key: keyName,
102
- passed: isNumber,
103
- details: getDetails(isNumber)
104
- })
105
-
106
- break;
107
- case String:
108
- const isString = isNotNull && value.constructor === String
109
-
110
- result.push({
111
- key: keyName,
112
- passed: isString,
113
- details: getDetails(isString)
114
- })
115
- break;
116
- case Date:
117
- const isDate = isNotNull && value.constructor === Date
118
- const isValid = isDate && !isNaN(value.getTime())
119
- const errorMsg = isValid ? getDetails(isDate) : 'Дата невалидна'
120
-
121
- result.push({
122
- key: keyName,
123
- passed: isDate && isValid,
124
- details: isDate && isValid ? 'OK' : errorMsg
125
- })
126
- break;
127
- case Boolean:
128
- const isBoolean = isNotNull && value.constructor === Boolean
129
-
130
- result.push({
131
- key: keyName,
132
- passed: isBoolean,
133
- details: isBoolean ? 'OK' : getDetails(isBoolean)
134
- })
135
- break;
136
- case Array:
137
- const isArray = isNotNull && value.constructor === Array
138
-
139
- if (!isArray) {
140
- result.push({
141
- key: keyName,
142
- passed: false,
143
- details: getDetails(isArray)
144
- });
145
-
146
- break;
147
- }
148
-
149
- let isEachChecked = { passed: true, details: ""}
150
-
151
- if ('eachType' in requirements) {
152
- isEachChecked.passed = value.every((el: any) => {
153
- const checkResult = checkType('each of ' + key, el, {type: requirements.eachType, required: true})
154
-
155
- if (!checkResult[0].passed) {
156
- isEachChecked.details = checkResult[0].details
157
- isEachChecked.passed = false
158
- }
159
-
160
- return true
161
- })
162
- }
163
-
164
- const isOk = isArray && isEachChecked.passed
165
-
166
- result.push({
167
- key: keyName,
168
- passed: isOk,
169
- details: isOk ? 'OK' : !isEachChecked.passed ? isEachChecked.details : getDetails(isOk)
170
- })
171
-
172
- break;
173
- case Object:
174
- const isObject = _validations.isObject(value) && value.constructor === Object
175
-
176
- result.push({
177
- key: keyName,
178
- passed: isObject,
179
- details: isObject ? 'OK' : getDetails(isObject)
180
- })
181
-
182
- break;
183
- case RegExp:
184
- const isRegex = _validations.isRegex(value)
185
- result.push({
186
- key: keyName,
187
- passed: isRegex,
188
- details: isRegex ? 'OK' : getDetails(isRegex)
189
- })
190
-
191
- break;
192
- case null:
193
- const isNull = value === null
194
-
195
- result.push({
196
- key: keyName,
197
- passed: isNull,
198
- details: isNull ? 'OK' : getDetails(isNull)
199
- })
200
-
201
- break;
202
- default:
203
- result.push({
204
- key: keyName,
205
- passed: false,
206
- details: `Тип '${keyName}' не определен`
207
- })
208
- }
209
-
210
- return result;
211
- };
212
-
213
- export default checkType
@@ -1,5 +0,0 @@
1
- export enum ErrorKeywords {
2
- Missing = 'missing',
3
- Type = 'type',
4
- Rule = 'rule'
5
- }
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- import { Schema } from "./Schema.js";
2
-
3
- export default Schema
package/src/tsconfig.json DELETED
@@ -1,103 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "ES2017", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
- // "jsx": "preserve", /* Specify what JSX code is generated. */
17
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "ES2022", /* Specify what module code is generated. */
29
- // "rootDir": "./", /* Specify the root folder within your source files. */
30
- "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- // "resolveJsonModule": true, /* Enable importing .json files. */
39
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
-
41
- /* JavaScript Support */
42
- "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
-
46
- /* Emit */
47
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50
- "sourceMap": false, /* Create source map files for emitted JavaScript files. */
51
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52
- "outDir": "../dist/", /* Specify an output folder for all emitted files. */
53
- "removeComments": true, /* Disable emitting comments. */
54
- // "noEmit": true, /* Disable emitting files from a compilation. */
55
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63
- // "newLine": "crlf", /* Set the newline character for emitting files. */
64
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
69
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70
-
71
- /* Interop Constraints */
72
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77
-
78
- /* Type Checking */
79
- "strict": true, /* Enable all strict type-checking options. */
80
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98
-
99
- /* Completeness */
100
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
- }
103
- }
@@ -1,6 +0,0 @@
1
- const _errors: {[key: string]: Function} = {}
2
-
3
- _errors.getMissingError = (key: string) => `Ключ '${key}' отсутствует`
4
-
5
- export default _errors
6
-