checkly 3.1.1 → 4.0.1
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 +42 -110
- package/bin/dev +17 -0
- package/bin/run +5 -0
- package/bin/run.cmd +3 -0
- package/constructs.d.ts +1 -0
- package/constructs.js +1 -0
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.js +228 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/commands/authCommand.d.ts +5 -0
- package/dist/commands/authCommand.js +14 -0
- package/dist/commands/authCommand.js.map +1 -0
- package/dist/commands/baseCommand.d.ts +9 -0
- package/dist/commands/baseCommand.js +21 -0
- package/dist/commands/baseCommand.js.map +1 -0
- package/dist/commands/deploy.d.ts +13 -0
- package/dist/commands/deploy.js +171 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/destroy.d.ts +10 -0
- package/dist/commands/destroy.js +47 -0
- package/dist/commands/destroy.js.map +1 -0
- package/dist/commands/env/add.d.ts +13 -0
- package/dist/commands/env/add.js +54 -0
- package/dist/commands/env/add.js.map +1 -0
- package/dist/commands/env/ls.d.ts +6 -0
- package/dist/commands/env/ls.js +21 -0
- package/dist/commands/env/ls.js.map +1 -0
- package/dist/commands/env/pull.d.ts +12 -0
- package/dist/commands/env/pull.js +63 -0
- package/dist/commands/env/pull.js.map +1 -0
- package/dist/commands/env/rm.d.ts +12 -0
- package/dist/commands/env/rm.js +56 -0
- package/dist/commands/env/rm.js.map +1 -0
- package/dist/commands/env/update.d.ts +13 -0
- package/dist/commands/env/update.js +54 -0
- package/dist/commands/env/update.js.map +1 -0
- package/dist/commands/login.d.ts +13 -0
- package/dist/commands/login.js +129 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +9 -0
- package/dist/commands/logout.js +40 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/runtimes.d.ts +6 -0
- package/dist/commands/runtimes.js +26 -0
- package/dist/commands/runtimes.js.map +1 -0
- package/dist/commands/switch.d.ts +9 -0
- package/dist/commands/switch.js +59 -0
- package/dist/commands/switch.js.map +1 -0
- package/dist/commands/test.d.ts +36 -0
- package/dist/commands/test.js +237 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/trigger.d.ts +32 -0
- package/dist/commands/trigger.js +173 -0
- package/dist/commands/trigger.js.map +1 -0
- package/dist/commands/whoami.d.ts +6 -0
- package/dist/commands/whoami.js +16 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -0
- package/dist/constructs/alert-channel-subscription.d.ts +44 -0
- package/dist/constructs/alert-channel-subscription.js +39 -0
- package/dist/constructs/alert-channel-subscription.js.map +1 -0
- package/dist/constructs/alert-channel.d.ts +53 -0
- package/dist/constructs/alert-channel.js +55 -0
- package/dist/constructs/alert-channel.js.map +1 -0
- package/dist/constructs/api-check.d.ts +179 -0
- package/dist/constructs/api-check.js +248 -0
- package/dist/constructs/api-check.js.map +1 -0
- package/dist/constructs/browser-check.d.ts +59 -0
- package/dist/constructs/browser-check.js +102 -0
- package/dist/constructs/browser-check.js.map +1 -0
- package/dist/constructs/check-group.d.ts +116 -0
- package/dist/constructs/check-group.js +113 -0
- package/dist/constructs/check-group.js.map +1 -0
- package/dist/constructs/check.d.ts +111 -0
- package/dist/constructs/check.js +88 -0
- package/dist/constructs/check.js.map +1 -0
- package/dist/constructs/construct.d.ts +17 -0
- package/dist/constructs/construct.js +22 -0
- package/dist/constructs/construct.js.map +1 -0
- package/dist/constructs/email-alert-channel.d.ts +26 -0
- package/dist/constructs/email-alert-channel.js +37 -0
- package/dist/constructs/email-alert-channel.js.map +1 -0
- package/dist/constructs/environment-variable.d.ts +2 -0
- package/dist/constructs/environment-variable.js +3 -0
- package/dist/constructs/environment-variable.js.map +1 -0
- package/dist/constructs/frequency.d.ts +20 -0
- package/dist/constructs/frequency.js +26 -0
- package/dist/constructs/frequency.js.map +1 -0
- package/dist/constructs/http-header.d.ts +2 -0
- package/dist/constructs/http-header.js +3 -0
- package/dist/constructs/http-header.js.map +1 -0
- package/dist/constructs/index.d.ts +15 -0
- package/dist/constructs/index.js +32 -0
- package/dist/constructs/index.js.map +1 -0
- package/dist/constructs/key-value-pair.d.ts +5 -0
- package/dist/constructs/key-value-pair.js +3 -0
- package/dist/constructs/key-value-pair.js.map +1 -0
- package/dist/constructs/opsgenie-alert-channel.d.ts +45 -0
- package/dist/constructs/opsgenie-alert-channel.js +44 -0
- package/dist/constructs/opsgenie-alert-channel.js.map +1 -0
- package/dist/constructs/pagerduty-alert-channel.d.ts +39 -0
- package/dist/constructs/pagerduty-alert-channel.js +42 -0
- package/dist/constructs/pagerduty-alert-channel.js.map +1 -0
- package/dist/constructs/project.d.ts +57 -0
- package/dist/constructs/project.js +100 -0
- package/dist/constructs/project.js.map +1 -0
- package/dist/constructs/query-param.d.ts +2 -0
- package/dist/constructs/query-param.js +3 -0
- package/dist/constructs/query-param.js.map +1 -0
- package/dist/constructs/ref.d.ts +5 -0
- package/dist/constructs/ref.js +13 -0
- package/dist/constructs/ref.js.map +1 -0
- package/dist/constructs/slack-alert-channel.d.ts +26 -0
- package/dist/constructs/slack-alert-channel.js +40 -0
- package/dist/constructs/slack-alert-channel.js.map +1 -0
- package/dist/constructs/sms-alert-channel.d.ts +27 -0
- package/dist/constructs/sms-alert-channel.js +38 -0
- package/dist/constructs/sms-alert-channel.js.map +1 -0
- package/dist/constructs/validator-error.d.ts +2 -0
- package/dist/constructs/validator-error.js +7 -0
- package/dist/constructs/validator-error.js.map +1 -0
- package/dist/constructs/webhook-alert-channel.d.ts +59 -0
- package/dist/constructs/webhook-alert-channel.js +50 -0
- package/dist/constructs/webhook-alert-channel.js.map +1 -0
- package/dist/help/examples.d.ts +6 -0
- package/dist/help/examples.js +22 -0
- package/dist/help/examples.js.map +1 -0
- package/dist/help/help-extension.d.ts +4 -0
- package/dist/help/help-extension.js +41 -0
- package/dist/help/help-extension.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/messages/common-messages.d.ts +5 -0
- package/dist/messages/common-messages.js +9 -0
- package/dist/messages/common-messages.js.map +1 -0
- package/dist/reporters/abstract-list.d.ts +34 -0
- package/dist/reporters/abstract-list.js +128 -0
- package/dist/reporters/abstract-list.js.map +1 -0
- package/dist/reporters/ci.d.ts +12 -0
- package/dist/reporters/ci.js +29 -0
- package/dist/reporters/ci.js.map +1 -0
- package/dist/reporters/dot.d.ts +12 -0
- package/dist/reporters/dot.js +28 -0
- package/dist/reporters/dot.js.map +1 -0
- package/dist/reporters/github.d.ts +34 -0
- package/dist/reporters/github.js +103 -0
- package/dist/reporters/github.js.map +1 -0
- package/dist/reporters/list.d.ts +13 -0
- package/dist/reporters/list.js +57 -0
- package/dist/reporters/list.js.map +1 -0
- package/dist/reporters/reporter.d.ts +14 -0
- package/dist/reporters/reporter.js +23 -0
- package/dist/reporters/reporter.js.map +1 -0
- package/dist/reporters/util.d.ts +15 -0
- package/dist/reporters/util.js +283 -0
- package/dist/reporters/util.js.map +1 -0
- package/dist/rest/accounts.d.ts +12 -0
- package/dist/rest/accounts.js +15 -0
- package/dist/rest/accounts.js.map +1 -0
- package/dist/rest/api.d.ts +27 -0
- package/dist/rest/api.js +90 -0
- package/dist/rest/api.js.map +1 -0
- package/dist/rest/assets.d.ts +13 -0
- package/dist/rest/assets.js +30 -0
- package/dist/rest/assets.js.map +1 -0
- package/dist/rest/environment-variables.d.ts +16 -0
- package/dist/rest/environment-variables.js +25 -0
- package/dist/rest/environment-variables.js.map +1 -0
- package/dist/rest/locations.d.ts +11 -0
- package/dist/rest/locations.js +12 -0
- package/dist/rest/locations.js.map +1 -0
- package/dist/rest/private-locations.d.ts +11 -0
- package/dist/rest/private-locations.js +12 -0
- package/dist/rest/private-locations.js.map +1 -0
- package/dist/rest/projects.d.ts +43 -0
- package/dist/rest/projects.js +24 -0
- package/dist/rest/projects.js.map +1 -0
- package/dist/rest/runtimes.d.ts +15 -0
- package/dist/rest/runtimes.js +15 -0
- package/dist/rest/runtimes.js.map +1 -0
- package/dist/rest/test-sessions.d.ts +47 -0
- package/dist/rest/test-sessions.js +15 -0
- package/dist/rest/test-sessions.js.map +1 -0
- package/dist/rest/users.d.ts +12 -0
- package/dist/rest/users.js +12 -0
- package/dist/rest/users.js.map +1 -0
- package/dist/services/abstract-check-runner.d.ts +50 -0
- package/dist/services/abstract-check-runner.js +151 -0
- package/dist/services/abstract-check-runner.js.map +1 -0
- package/dist/services/check-parser/collector.d.ts +33 -0
- package/dist/services/check-parser/collector.js +48 -0
- package/dist/services/check-parser/collector.js.map +1 -0
- package/dist/services/check-parser/errors.d.ts +8 -0
- package/dist/services/check-parser/errors.js +45 -0
- package/dist/services/check-parser/errors.js.map +1 -0
- package/dist/services/check-parser/parser.d.ts +39 -0
- package/dist/services/check-parser/parser.js +296 -0
- package/dist/services/check-parser/parser.js.map +1 -0
- package/dist/services/checkly-config-loader.d.ts +54 -0
- package/dist/services/checkly-config-loader.js +55 -0
- package/dist/services/checkly-config-loader.js.map +1 -0
- package/dist/services/config.d.ts +24 -0
- package/dist/services/config.js +75 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/project-parser.d.ts +19 -0
- package/dist/services/project-parser.js +87 -0
- package/dist/services/project-parser.js.map +1 -0
- package/dist/services/socket-client.d.ts +4 -0
- package/dist/services/socket-client.js +20 -0
- package/dist/services/socket-client.js.map +1 -0
- package/dist/services/test-filters.d.ts +2 -0
- package/dist/services/test-filters.js +16 -0
- package/dist/services/test-filters.js.map +1 -0
- package/dist/services/test-runner.d.ts +21 -0
- package/dist/services/test-runner.js +50 -0
- package/dist/services/test-runner.js.map +1 -0
- package/dist/services/trigger-runner.d.ts +26 -0
- package/dist/services/trigger-runner.js +47 -0
- package/dist/services/trigger-runner.js.map +1 -0
- package/dist/services/util.d.ts +30 -0
- package/dist/services/util.js +157 -0
- package/dist/services/util.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/oclif.manifest.json +527 -0
- package/package.json +163 -18
- package/LICENSE +0 -121
- package/dist/checkly.min.js +0 -1
- package/index.js +0 -285
- package/logo.png +0 -0
- package/test.js +0 -183
package/package.json
CHANGED
|
@@ -1,27 +1,172 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "checkly",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "index.js",
|
|
3
|
+
"version": "4.0.1",
|
|
4
|
+
"description": "Checkly CLI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=16.0.0"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
|
-
"
|
|
11
|
+
"clean": "rimraf ./dist",
|
|
12
|
+
"test": "jest --selectProjects unit",
|
|
13
|
+
"version": "node -e \"console.log(require('./package.json').version)\"",
|
|
14
|
+
"test:e2e": "npm run prepare && cross-env NODE_CONFIG_DIR=./e2e/config jest --selectProjects E2E",
|
|
15
|
+
"watch": "tsc --watch",
|
|
16
|
+
"prepare": "npm run clean && tsc --build",
|
|
17
|
+
"prepack": "npx oclif manifest",
|
|
18
|
+
"lint": "eslint src"
|
|
8
19
|
},
|
|
9
20
|
"repository": {
|
|
10
21
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
12
|
-
},
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"truthy",
|
|
16
|
-
"falsey",
|
|
17
|
-
"falsy",
|
|
18
|
-
"equality",
|
|
19
|
-
"checks"
|
|
20
|
-
],
|
|
21
|
-
"author": "xemasiv <xemasiv@gmail.com>",
|
|
22
|
-
"license": "CC0-1.0",
|
|
22
|
+
"url": "git+https://github.com/checkly/checkly-cli.git"
|
|
23
|
+
},
|
|
24
|
+
"author": "Checkly Engineering <support@checklyhq.com>",
|
|
25
|
+
"license": "Apache-2.0",
|
|
23
26
|
"bugs": {
|
|
24
|
-
"url": "https://github.com/
|
|
27
|
+
"url": "https://github.com/checkly/checkly-cli/issues"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"/bin",
|
|
31
|
+
"/dist",
|
|
32
|
+
"/constructs.js",
|
|
33
|
+
"/constructs.d.ts",
|
|
34
|
+
"/oclif.manifest.json"
|
|
35
|
+
],
|
|
36
|
+
"oclif": {
|
|
37
|
+
"bin": "checkly",
|
|
38
|
+
"commands": "./dist/commands",
|
|
39
|
+
"topicSeparator": " ",
|
|
40
|
+
"additionalHelpFlags": [
|
|
41
|
+
"-h"
|
|
42
|
+
],
|
|
43
|
+
"additionalVersionFlags": [
|
|
44
|
+
"-v",
|
|
45
|
+
"version"
|
|
46
|
+
],
|
|
47
|
+
"plugins": [
|
|
48
|
+
"@oclif/plugin-help",
|
|
49
|
+
"@oclif/plugin-warn-if-update-available",
|
|
50
|
+
"@oclif/plugin-not-found",
|
|
51
|
+
"@oclif/plugin-autocomplete"
|
|
52
|
+
],
|
|
53
|
+
"warn-if-update-available": {
|
|
54
|
+
"timeoutInDays": 30,
|
|
55
|
+
"message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>."
|
|
56
|
+
},
|
|
57
|
+
"topics": {
|
|
58
|
+
"env": { "description": "Manage Checkly environment variables" }
|
|
59
|
+
},
|
|
60
|
+
"helpClass": "./dist/help/help-extension"
|
|
61
|
+
},
|
|
62
|
+
"bin": {
|
|
63
|
+
"checkly": "./bin/run"
|
|
64
|
+
},
|
|
65
|
+
"homepage": "https://github.com/checkly/checkly-cli#readme",
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@oclif/core": "2.0.7",
|
|
68
|
+
"@oclif/plugin-autocomplete": "2.1.8",
|
|
69
|
+
"@oclif/plugin-help": "5.1.20",
|
|
70
|
+
"@oclif/plugin-not-found": "2.3.23",
|
|
71
|
+
"@oclif/plugin-plugins": "2.3.0",
|
|
72
|
+
"@oclif/plugin-warn-if-update-available": "2.0.24",
|
|
73
|
+
"@typescript-eslint/typescript-estree": "5.46.1",
|
|
74
|
+
"acorn": "8.8.1",
|
|
75
|
+
"acorn-walk": "8.2.0",
|
|
76
|
+
"async-mqtt": "2.6.3",
|
|
77
|
+
"axios": "1.2.1",
|
|
78
|
+
"chalk": "4.1.2",
|
|
79
|
+
"ci-info": "3.7.1",
|
|
80
|
+
"conf": "10.2.0",
|
|
81
|
+
"dotenv": "16.0.3",
|
|
82
|
+
"git-repo-info": "2.1.1",
|
|
83
|
+
"glob": "8.0.3",
|
|
84
|
+
"indent-string": "4.0.0",
|
|
85
|
+
"inquirer": "8.2.3",
|
|
86
|
+
"jwt-decode": "3.1.2",
|
|
87
|
+
"log-symbols": "4.1.0",
|
|
88
|
+
"luxon": "3.2.1",
|
|
89
|
+
"open": "8.4.0",
|
|
90
|
+
"p-queue": "6.6.2",
|
|
91
|
+
"uuid": "9.0.0"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@checkly/eslint-config": "0.14.1",
|
|
95
|
+
"@types/config": "3.3.0",
|
|
96
|
+
"@types/glob": "8.0.0",
|
|
97
|
+
"@types/inquirer": "8.2.3",
|
|
98
|
+
"@types/jest": "29.2.4",
|
|
99
|
+
"@types/luxon": "3.2.0",
|
|
100
|
+
"@types/node": "18.11.18",
|
|
101
|
+
"@types/uuid": "9.0.1",
|
|
102
|
+
"@types/ws": "8.5.3",
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "5.46.1",
|
|
104
|
+
"@typescript-eslint/parser": "5.46.1",
|
|
105
|
+
"config": "3.3.8",
|
|
106
|
+
"cross-env": "7.0.3",
|
|
107
|
+
"eslint": "8.30.0",
|
|
108
|
+
"jest": "29.3.1",
|
|
109
|
+
"oclif": "3.7.3",
|
|
110
|
+
"ts-jest": "29.0.3",
|
|
111
|
+
"ts-node": "10.9.1",
|
|
112
|
+
"typescript": "4.9.4"
|
|
113
|
+
},
|
|
114
|
+
"eslintConfig": {
|
|
115
|
+
"rules": {
|
|
116
|
+
"@typescript-eslint/type-annotation-spacing": 2,
|
|
117
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
118
|
+
"@typescript-eslint/ban-ts-comment": 0,
|
|
119
|
+
"no-console": 2,
|
|
120
|
+
"no-restricted-syntax": [
|
|
121
|
+
"error",
|
|
122
|
+
{
|
|
123
|
+
"selector": "TSEnumDeclaration",
|
|
124
|
+
"message": "Don't declare enums, use union types instead"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"extends": [
|
|
129
|
+
"@checkly/eslint-config",
|
|
130
|
+
"plugin:@typescript-eslint/recommended"
|
|
131
|
+
],
|
|
132
|
+
"parser": "@typescript-eslint/parser",
|
|
133
|
+
"plugins": [
|
|
134
|
+
"@typescript-eslint"
|
|
135
|
+
],
|
|
136
|
+
"overrides": [
|
|
137
|
+
{
|
|
138
|
+
"files": [
|
|
139
|
+
"src/commands/*",
|
|
140
|
+
"src/reporters/*"
|
|
141
|
+
],
|
|
142
|
+
"rules": {
|
|
143
|
+
"no-console": 0
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
]
|
|
25
147
|
},
|
|
26
|
-
"
|
|
148
|
+
"jest": {
|
|
149
|
+
"projects": [
|
|
150
|
+
{
|
|
151
|
+
"displayName": "unit",
|
|
152
|
+
"testMatch": [
|
|
153
|
+
"<rootDir>/src/**/*.spec.ts"
|
|
154
|
+
],
|
|
155
|
+
"preset": "ts-jest",
|
|
156
|
+
"testEnvironment": "node"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"displayName": "E2E",
|
|
160
|
+
"testMatch": [
|
|
161
|
+
"<rootDir>/e2e/__tests__/**/*.spec.ts"
|
|
162
|
+
],
|
|
163
|
+
"preset": "ts-jest",
|
|
164
|
+
"testEnvironment": "node"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"reporters": [
|
|
168
|
+
"default",
|
|
169
|
+
"github-actions"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
27
172
|
}
|
package/LICENSE
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
Creative Commons Legal Code
|
|
2
|
-
|
|
3
|
-
CC0 1.0 Universal
|
|
4
|
-
|
|
5
|
-
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
|
6
|
-
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
|
7
|
-
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
|
8
|
-
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
|
9
|
-
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
|
10
|
-
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
|
11
|
-
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
|
12
|
-
HEREUNDER.
|
|
13
|
-
|
|
14
|
-
Statement of Purpose
|
|
15
|
-
|
|
16
|
-
The laws of most jurisdictions throughout the world automatically confer
|
|
17
|
-
exclusive Copyright and Related Rights (defined below) upon the creator
|
|
18
|
-
and subsequent owner(s) (each and all, an "owner") of an original work of
|
|
19
|
-
authorship and/or a database (each, a "Work").
|
|
20
|
-
|
|
21
|
-
Certain owners wish to permanently relinquish those rights to a Work for
|
|
22
|
-
the purpose of contributing to a commons of creative, cultural and
|
|
23
|
-
scientific works ("Commons") that the public can reliably and without fear
|
|
24
|
-
of later claims of infringement build upon, modify, incorporate in other
|
|
25
|
-
works, reuse and redistribute as freely as possible in any form whatsoever
|
|
26
|
-
and for any purposes, including without limitation commercial purposes.
|
|
27
|
-
These owners may contribute to the Commons to promote the ideal of a free
|
|
28
|
-
culture and the further production of creative, cultural and scientific
|
|
29
|
-
works, or to gain reputation or greater distribution for their Work in
|
|
30
|
-
part through the use and efforts of others.
|
|
31
|
-
|
|
32
|
-
For these and/or other purposes and motivations, and without any
|
|
33
|
-
expectation of additional consideration or compensation, the person
|
|
34
|
-
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
|
35
|
-
is an owner of Copyright and Related Rights in the Work, voluntarily
|
|
36
|
-
elects to apply CC0 to the Work and publicly distribute the Work under its
|
|
37
|
-
terms, with knowledge of his or her Copyright and Related Rights in the
|
|
38
|
-
Work and the meaning and intended legal effect of CC0 on those rights.
|
|
39
|
-
|
|
40
|
-
1. Copyright and Related Rights. A Work made available under CC0 may be
|
|
41
|
-
protected by copyright and related or neighboring rights ("Copyright and
|
|
42
|
-
Related Rights"). Copyright and Related Rights include, but are not
|
|
43
|
-
limited to, the following:
|
|
44
|
-
|
|
45
|
-
i. the right to reproduce, adapt, distribute, perform, display,
|
|
46
|
-
communicate, and translate a Work;
|
|
47
|
-
ii. moral rights retained by the original author(s) and/or performer(s);
|
|
48
|
-
iii. publicity and privacy rights pertaining to a person's image or
|
|
49
|
-
likeness depicted in a Work;
|
|
50
|
-
iv. rights protecting against unfair competition in regards to a Work,
|
|
51
|
-
subject to the limitations in paragraph 4(a), below;
|
|
52
|
-
v. rights protecting the extraction, dissemination, use and reuse of data
|
|
53
|
-
in a Work;
|
|
54
|
-
vi. database rights (such as those arising under Directive 96/9/EC of the
|
|
55
|
-
European Parliament and of the Council of 11 March 1996 on the legal
|
|
56
|
-
protection of databases, and under any national implementation
|
|
57
|
-
thereof, including any amended or successor version of such
|
|
58
|
-
directive); and
|
|
59
|
-
vii. other similar, equivalent or corresponding rights throughout the
|
|
60
|
-
world based on applicable law or treaty, and any national
|
|
61
|
-
implementations thereof.
|
|
62
|
-
|
|
63
|
-
2. Waiver. To the greatest extent permitted by, but not in contravention
|
|
64
|
-
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
|
65
|
-
irrevocably and unconditionally waives, abandons, and surrenders all of
|
|
66
|
-
Affirmer's Copyright and Related Rights and associated claims and causes
|
|
67
|
-
of action, whether now known or unknown (including existing as well as
|
|
68
|
-
future claims and causes of action), in the Work (i) in all territories
|
|
69
|
-
worldwide, (ii) for the maximum duration provided by applicable law or
|
|
70
|
-
treaty (including future time extensions), (iii) in any current or future
|
|
71
|
-
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
|
72
|
-
including without limitation commercial, advertising or promotional
|
|
73
|
-
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
|
74
|
-
member of the public at large and to the detriment of Affirmer's heirs and
|
|
75
|
-
successors, fully intending that such Waiver shall not be subject to
|
|
76
|
-
revocation, rescission, cancellation, termination, or any other legal or
|
|
77
|
-
equitable action to disrupt the quiet enjoyment of the Work by the public
|
|
78
|
-
as contemplated by Affirmer's express Statement of Purpose.
|
|
79
|
-
|
|
80
|
-
3. Public License Fallback. Should any part of the Waiver for any reason
|
|
81
|
-
be judged legally invalid or ineffective under applicable law, then the
|
|
82
|
-
Waiver shall be preserved to the maximum extent permitted taking into
|
|
83
|
-
account Affirmer's express Statement of Purpose. In addition, to the
|
|
84
|
-
extent the Waiver is so judged Affirmer hereby grants to each affected
|
|
85
|
-
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
|
86
|
-
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
|
87
|
-
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
|
88
|
-
maximum duration provided by applicable law or treaty (including future
|
|
89
|
-
time extensions), (iii) in any current or future medium and for any number
|
|
90
|
-
of copies, and (iv) for any purpose whatsoever, including without
|
|
91
|
-
limitation commercial, advertising or promotional purposes (the
|
|
92
|
-
"License"). The License shall be deemed effective as of the date CC0 was
|
|
93
|
-
applied by Affirmer to the Work. Should any part of the License for any
|
|
94
|
-
reason be judged legally invalid or ineffective under applicable law, such
|
|
95
|
-
partial invalidity or ineffectiveness shall not invalidate the remainder
|
|
96
|
-
of the License, and in such case Affirmer hereby affirms that he or she
|
|
97
|
-
will not (i) exercise any of his or her remaining Copyright and Related
|
|
98
|
-
Rights in the Work or (ii) assert any associated claims and causes of
|
|
99
|
-
action with respect to the Work, in either case contrary to Affirmer's
|
|
100
|
-
express Statement of Purpose.
|
|
101
|
-
|
|
102
|
-
4. Limitations and Disclaimers.
|
|
103
|
-
|
|
104
|
-
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
|
105
|
-
surrendered, licensed or otherwise affected by this document.
|
|
106
|
-
b. Affirmer offers the Work as-is and makes no representations or
|
|
107
|
-
warranties of any kind concerning the Work, express, implied,
|
|
108
|
-
statutory or otherwise, including without limitation warranties of
|
|
109
|
-
title, merchantability, fitness for a particular purpose, non
|
|
110
|
-
infringement, or the absence of latent or other defects, accuracy, or
|
|
111
|
-
the present or absence of errors, whether or not discoverable, all to
|
|
112
|
-
the greatest extent permissible under applicable law.
|
|
113
|
-
c. Affirmer disclaims responsibility for clearing rights of other persons
|
|
114
|
-
that may apply to the Work or any use thereof, including without
|
|
115
|
-
limitation any person's Copyright and Related Rights in the Work.
|
|
116
|
-
Further, Affirmer disclaims responsibility for obtaining any necessary
|
|
117
|
-
consents, permissions or other rights required for any use of the
|
|
118
|
-
Work.
|
|
119
|
-
d. Affirmer understands and acknowledges that Creative Commons is not a
|
|
120
|
-
party to this document and has no duty or obligation with respect to
|
|
121
|
-
this CC0 or use of the Work.
|
package/dist/checkly.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},_createClass=function(){function c(d,e){for(var k,h=0;h<e.length;h++)k=e[h],k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(d,k.key,k)}return function(d,e,h){return e&&c(d.prototype,e),h&&c(d,h),d}}();function _classCallCheck(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}var Checkly=function(){function c(){_classCallCheck(this,c),this._passed=!0,this._lastCheckPassed=!0,this._errors=[]}return _createClass(c,null,[{key:"str",value:function str(G){return"string"==typeof G}},{key:"num",value:function num(G){return"number"==typeof G&&!1===isNaN(G)}},{key:"obj",value:function obj(G){return"object"===("undefined"==typeof G?"undefined":_typeof(G))&&!1===Array.isArray(G)&&null!==G&&!0===!!G.__proto__&&G.__proto__!==Map.prototype&&G.__proto__!==Set.prototype}},{key:"arr",value:function arr(G){return!0===Array.isArray(G)}},{key:"und",value:function und(G){return"undefined"==typeof G}},{key:"nul",value:function nul(G){return null===G}},{key:"nan",value:function nan(G){return!0===isNaN(G)&&"function"!=typeof G&&"object"!==("undefined"==typeof G?"undefined":_typeof(G))&&"undefined"!=typeof G}},{key:"map",value:function map(G){return"object"===("undefined"==typeof G?"undefined":_typeof(G))&&null!==G&&!0===!!G.__proto__&&G.__proto__===Map.prototype}},{key:"set",value:function set(G){return"object"===("undefined"==typeof G?"undefined":_typeof(G))&&null!==G&&!0===!!G.__proto__&&G.__proto__===Set.prototype}},{key:"fnc",value:function fnc(G){return"function"==typeof G}},{key:"emp",value:function emp(G){this;return"string"==typeof G?""===G:"object"===("undefined"==typeof G?"undefined":_typeof(G))&&null!==G?G.__proto__===Map.prototype||G.__proto__===Set.prototype?0===G.size:0===Object.keys(G).length:!0===Array.isArray(G)?0===G.length:void 0}},{key:"ti",value:function ti(){for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];return parseInt.apply(null,G)}},{key:"tf",value:function tf(){for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];return parseFloat.apply(null,G)}},{key:"ts",value:function ts(G){if(!1===c.nul(G)&&!1===c.und(G))return G.toString()}},{key:"g",value:function g(G,H){return!0===c.num(G)&&!0===c.num(H)&&G>H}},{key:"l",value:function l(G,H){return!0===c.num(G)&&!0===c.num(H)&&G<H}},{key:"ge",value:function ge(G,H){return!0===c.num(G)&&!0===c.num(H)&&G>=H}},{key:"le",value:function le(G,H){return!0===c.num(G)&&!0===c.num(H)&&G<=H}},{key:"pairwise",value:function pairwise(G){for(var H=Array(G.length*(G.length-1)/2),I=0,J=0;J<G.length;J++)for(var K=J+1;K<G.length;K++)H[I++]=[G[J],G[K]];return H}},{key:"equal",value:function(G){function H(){return G.apply(this,arguments)}return H.toString=function(){return G.toString()},H}(function(G,H){var I=Array.isArray,J=Object.keys,K=Object.prototype.hasOwnProperty;if(G===H)return!0;var N,O,P,L=I(G),M=I(H);if(L&&M){if(O=G.length,O!=H.length)return!1;for(N=0;N<O;N++)if(!equal(G[N],H[N]))return!1;return!0}if(L!=M)return!1;var Q=G instanceof Date,R=H instanceof Date;if(Q!=R)return!1;if(Q&&R)return G.getTime()==H.getTime();var S=G instanceof RegExp,T=H instanceof RegExp;if(S!=T)return!1;if(S&&T)return G.toString()==H.toString();if(G instanceof Object&&H instanceof Object){var U=J(G);if(O=U.length,O!==J(H).length)return!1;for(N=0;N<O;N++)if(!K.call(H,U[N]))return!1;for(N=0;N<O;N++)if(P=U[N],!equal(G[P],H[P]))return!1;return!0}return!1})}]),_createClass(c,[{key:"t",value:function t(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];return G.map(function(K){!1===!!K&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"f",value:function f(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];return G.map(function(K){!0===!!K&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"eq",value:function eq(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];var K=c.pairwise(G);return K.map(function(L){!1===c.equal.apply(null,L)&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"ineq",value:function ineq(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];var K=c.pairwise(G);return K.map(function(L){!0===c.equal.apply(null,L)&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"g",value:function g(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];var K=c.pairwise(G);return K.map(function(L){!1===c.g.apply(null,L)&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"l",value:function l(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];var K=c.pairwise(G);return K.map(function(L){!1===c.l.apply(null,L)&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"ge",value:function ge(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];var K=c.pairwise(G);return K.map(function(L){!1===c.ge.apply(null,L)&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"le",value:function le(){var J=this;J._lastCheckPassed=!0;for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];var K=c.pairwise(G);return K.map(function(L){!1===c.le.apply(null,L)&&(J._passed=!1,J._lastCheckPassed=!1)}),this}},{key:"err",value:function err(){var J=this;if(!1===this._passed&&!1===this._lastCheckPassed){for(var H=arguments.length,G=Array(H),I=0;I<H;I++)G[I]=arguments[I];G.map(function(K){return J._errors.push(K)})}return this}},{key:"pass",value:function pass(G){return this._passFn=G,this}},{key:"fail",value:function fail(G){return this._failFn=G,this}},{key:"check",value:function check(){if(!0===this._passed){if(!0===!!this._passFn)return this._passFn.apply(null,[]);}else if(!0===!!this._failFn)return this._failFn.apply(null,[this._errors])}},{key:"errors",get:function get(){return this._errors}},{key:"lastError",get:function get(){return this._errors[this._errors.length-1]}},{key:"firstError",get:function get(){return this._errors[0]}}]),c}();"undefined"==typeof window?"undefined"!=typeof module&&(module.exports=Checkly):Window.Checkly=Checkly;
|
package/index.js
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
class Checkly {
|
|
2
|
-
static str(arg) {
|
|
3
|
-
return typeof arg === "string";
|
|
4
|
-
}
|
|
5
|
-
static num(arg) {
|
|
6
|
-
return typeof arg === "number" && isNaN(arg) === false;
|
|
7
|
-
}
|
|
8
|
-
static obj(arg) {
|
|
9
|
-
if (typeof arg === "object" && Array.isArray(arg) === false && arg !== null) {
|
|
10
|
-
if (Boolean(arg.__proto__) === true) {
|
|
11
|
-
return arg.__proto__ !== Map.prototype && arg.__proto__ !== Set.prototype;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
static arr(arg) {
|
|
17
|
-
return Array.isArray(arg) === true;
|
|
18
|
-
}
|
|
19
|
-
static und(arg) {
|
|
20
|
-
return typeof arg === "undefined";
|
|
21
|
-
}
|
|
22
|
-
static nul(arg) {
|
|
23
|
-
return arg === null;
|
|
24
|
-
}
|
|
25
|
-
static nan(arg) {
|
|
26
|
-
return isNaN(arg) === true && typeof arg !== "function" && typeof arg !== "object" && typeof arg !== "undefined";
|
|
27
|
-
}
|
|
28
|
-
static map(arg) {
|
|
29
|
-
if (typeof arg === "object" && arg !== null) {
|
|
30
|
-
if (Boolean(arg.__proto__) === true) {
|
|
31
|
-
return arg.__proto__ === Map.prototype;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
static set(arg) {
|
|
37
|
-
if (typeof arg === "object" && arg !== null) {
|
|
38
|
-
if (Boolean(arg.__proto__) === true) {
|
|
39
|
-
return arg.__proto__ === Set.prototype;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
static fnc(arg) {
|
|
45
|
-
return typeof arg === "function";
|
|
46
|
-
}
|
|
47
|
-
static emp(arg) {
|
|
48
|
-
let instance = this;
|
|
49
|
-
if (typeof arg === "string") {
|
|
50
|
-
return arg === "";
|
|
51
|
-
}
|
|
52
|
-
if (typeof arg === "object" && arg !== null) {
|
|
53
|
-
if (arg.__proto__ === Map.prototype || arg.__proto__ === Set.prototype) {
|
|
54
|
-
return arg.size === 0;
|
|
55
|
-
}
|
|
56
|
-
return Object.keys(arg).length === 0;
|
|
57
|
-
}
|
|
58
|
-
if (Array.isArray(arg) === true) {
|
|
59
|
-
return arg.length === 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
static ti(...args) {
|
|
63
|
-
return parseInt.apply(null, args);
|
|
64
|
-
}
|
|
65
|
-
static tf(...args) {
|
|
66
|
-
return parseFloat.apply(null, args);
|
|
67
|
-
}
|
|
68
|
-
static ts(arg) {
|
|
69
|
-
if (Checkly.nul(arg) === false && Checkly.und(arg) === false) {
|
|
70
|
-
return arg.toString();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
static g(a, b) {
|
|
74
|
-
if (Checkly.num(a) === true && Checkly.num(b) === true) {
|
|
75
|
-
return a > b;
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
static l(a, b) {
|
|
80
|
-
if (Checkly.num(a) === true && Checkly.num(b) === true) {
|
|
81
|
-
return a < b;
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
static ge(a, b) {
|
|
86
|
-
if (Checkly.num(a) === true && Checkly.num(b) === true) {
|
|
87
|
-
return a >= b;
|
|
88
|
-
}
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
static le(a, b) {
|
|
92
|
-
if (Checkly.num(a) === true && Checkly.num(b) === true) {
|
|
93
|
-
return a <= b;
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
static pairwise(list) {
|
|
98
|
-
// https://codereview.stackexchange.com/a/75667
|
|
99
|
-
let pairs = new Array(list.length * (list.length - 1) / 2);
|
|
100
|
-
let pos = 0;
|
|
101
|
-
for (let i = 0; i < list.length; i++) {
|
|
102
|
-
for (let j = i + 1; j < list.length; j++) {
|
|
103
|
-
pairs[pos++] = [list[i], list[j]];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return pairs;
|
|
107
|
-
}
|
|
108
|
-
static equal(a, b) {
|
|
109
|
-
// https://github.com/epoberezkin/fast-deep-equal
|
|
110
|
-
let isArray = Array.isArray;
|
|
111
|
-
let keyList = Object.keys;
|
|
112
|
-
let hasProp = Object.prototype.hasOwnProperty;
|
|
113
|
-
if (a === b) return true;
|
|
114
|
-
let arrA = isArray(a),
|
|
115
|
-
arrB = isArray(b),
|
|
116
|
-
i,
|
|
117
|
-
length,
|
|
118
|
-
key;
|
|
119
|
-
if (arrA && arrB) {
|
|
120
|
-
length = a.length;
|
|
121
|
-
if (length != b.length) return false;
|
|
122
|
-
for (i = 0; i < length; i++) if (!equal(a[i], b[i])) return false;
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
if (arrA != arrB) return false;
|
|
126
|
-
let dateA = a instanceof Date,
|
|
127
|
-
dateB = b instanceof Date;
|
|
128
|
-
if (dateA != dateB) return false;
|
|
129
|
-
if (dateA && dateB) return a.getTime() == b.getTime();
|
|
130
|
-
let regexpA = a instanceof RegExp,
|
|
131
|
-
regexpB = b instanceof RegExp;
|
|
132
|
-
if (regexpA != regexpB) return false;
|
|
133
|
-
if (regexpA && regexpB) return a.toString() == b.toString();
|
|
134
|
-
if (a instanceof Object && b instanceof Object) {
|
|
135
|
-
let keys = keyList(a);
|
|
136
|
-
length = keys.length;
|
|
137
|
-
if (length !== keyList(b).length) return false;
|
|
138
|
-
for (i = 0; i < length; i++) if (!hasProp.call(b, keys[i])) return false;
|
|
139
|
-
for (i = 0; i < length; i++) {
|
|
140
|
-
key = keys[i];
|
|
141
|
-
if (!equal(a[key], b[key])) return false;
|
|
142
|
-
}
|
|
143
|
-
return true;
|
|
144
|
-
}
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
constructor() {
|
|
148
|
-
this._passed = true;
|
|
149
|
-
this._lastCheckPassed = true;
|
|
150
|
-
this._errors = [];
|
|
151
|
-
}
|
|
152
|
-
t(...args) {
|
|
153
|
-
let instance = this;
|
|
154
|
-
instance._lastCheckPassed = true;
|
|
155
|
-
args.map(arg => {
|
|
156
|
-
if (Boolean(arg) === false) {
|
|
157
|
-
instance._passed = false;
|
|
158
|
-
instance._lastCheckPassed = false;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
return this;
|
|
162
|
-
}
|
|
163
|
-
f(...args) {
|
|
164
|
-
let instance = this;
|
|
165
|
-
instance._lastCheckPassed = true;
|
|
166
|
-
args.map(arg => {
|
|
167
|
-
if (Boolean(arg) === true) {
|
|
168
|
-
instance._passed = false;
|
|
169
|
-
instance._lastCheckPassed = false;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
return this;
|
|
173
|
-
}
|
|
174
|
-
eq(...args) {
|
|
175
|
-
let instance = this;
|
|
176
|
-
instance._lastCheckPassed = true;
|
|
177
|
-
let pairs = Checkly.pairwise(args);
|
|
178
|
-
pairs.map(pair => {
|
|
179
|
-
if (Checkly.equal.apply(null, pair) === false) {
|
|
180
|
-
instance._passed = false;
|
|
181
|
-
instance._lastCheckPassed = false;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
return this;
|
|
185
|
-
}
|
|
186
|
-
ineq(...args) {
|
|
187
|
-
let instance = this;
|
|
188
|
-
instance._lastCheckPassed = true;
|
|
189
|
-
let pairs = Checkly.pairwise(args);
|
|
190
|
-
pairs.map(pair => {
|
|
191
|
-
if (Checkly.equal.apply(null, pair) === true) {
|
|
192
|
-
instance._passed = false;
|
|
193
|
-
instance._lastCheckPassed = false;
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
return this;
|
|
197
|
-
}
|
|
198
|
-
g(...args) {
|
|
199
|
-
let instance = this;
|
|
200
|
-
instance._lastCheckPassed = true;
|
|
201
|
-
let pairs = Checkly.pairwise(args);
|
|
202
|
-
pairs.map(pair => {
|
|
203
|
-
if (Checkly.g.apply(null, pair) === false) {
|
|
204
|
-
instance._passed = false;
|
|
205
|
-
instance._lastCheckPassed = false;
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
return this;
|
|
209
|
-
}
|
|
210
|
-
l(...args) {
|
|
211
|
-
let instance = this;
|
|
212
|
-
instance._lastCheckPassed = true;
|
|
213
|
-
let pairs = Checkly.pairwise(args);
|
|
214
|
-
pairs.map(pair => {
|
|
215
|
-
if (Checkly.l.apply(null, pair) === false) {
|
|
216
|
-
instance._passed = false;
|
|
217
|
-
instance._lastCheckPassed = false;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
return this;
|
|
221
|
-
}
|
|
222
|
-
ge(...args) {
|
|
223
|
-
let instance = this;
|
|
224
|
-
instance._lastCheckPassed = true;
|
|
225
|
-
let pairs = Checkly.pairwise(args);
|
|
226
|
-
pairs.map(pair => {
|
|
227
|
-
if (Checkly.ge.apply(null, pair) === false) {
|
|
228
|
-
instance._passed = false;
|
|
229
|
-
instance._lastCheckPassed = false;
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
return this;
|
|
233
|
-
}
|
|
234
|
-
le(...args) {
|
|
235
|
-
let instance = this;
|
|
236
|
-
instance._lastCheckPassed = true;
|
|
237
|
-
let pairs = Checkly.pairwise(args);
|
|
238
|
-
pairs.map(pair => {
|
|
239
|
-
if (Checkly.le.apply(null, pair) === false) {
|
|
240
|
-
instance._passed = false;
|
|
241
|
-
instance._lastCheckPassed = false;
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
return this;
|
|
245
|
-
}
|
|
246
|
-
err (...args) {
|
|
247
|
-
if (this._passed === false && this._lastCheckPassed === false) {
|
|
248
|
-
args.map((arg) => this._errors.push(arg));
|
|
249
|
-
}
|
|
250
|
-
return this;
|
|
251
|
-
}
|
|
252
|
-
pass(fn) {
|
|
253
|
-
this._passFn = fn;
|
|
254
|
-
return this;
|
|
255
|
-
}
|
|
256
|
-
fail(fn) {
|
|
257
|
-
this._failFn = fn;
|
|
258
|
-
return this;
|
|
259
|
-
}
|
|
260
|
-
check() {
|
|
261
|
-
if (this._passed === true) {
|
|
262
|
-
if (Boolean(this._passFn) === true) {
|
|
263
|
-
return this._passFn.apply(null, []);
|
|
264
|
-
}
|
|
265
|
-
} else {
|
|
266
|
-
if (Boolean(this._failFn) === true) {
|
|
267
|
-
return this._failFn.apply(null, [this._errors]);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
get errors () {
|
|
272
|
-
return this._errors;
|
|
273
|
-
}
|
|
274
|
-
get lastError () {
|
|
275
|
-
return this._errors[this._errors.length - 1];
|
|
276
|
-
}
|
|
277
|
-
get firstError () {
|
|
278
|
-
return this._errors[0];
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
if (typeof window !== 'undefined') {
|
|
282
|
-
Window.Checkly = Checkly;
|
|
283
|
-
} else if (typeof module !== 'undefined') {
|
|
284
|
-
module.exports = Checkly;
|
|
285
|
-
}
|
package/logo.png
DELETED
|
Binary file
|