From 459ff4c5e6c976bc4ef590cfa5df1be2cb6c1f13 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sat, 8 Aug 2020 18:54:19 +0200 Subject: [PATCH] Initial commit --- .gitignore | 1 + README.md | 7 ++++ index.js | 10 ++++++ package.json | 20 +++++++++++ yarn.lock | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 131 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 index.js create mode 100644 package.json create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/README.md new file mode 100644 index 0000000..0081b2c --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# @modular-matrix/is-session + +[Validatem](https://validatem.cryto.net/) validator that checks whether a given value is a Modular Matrix session. + +--- + +Documentation for this module has not been written yet. By the time it reaches 1.0.0, it will have full documentation. diff --git a/index.js b/index.js new file mode 100644 index 0000000..220394b --- /dev/null +++ b/index.js @@ -0,0 +1,10 @@ +"use strict"; + +const allowExtraProperties = require("@validatem/allow-extra-properties"); +const isValue = require("@validatem/is-value"); +const wrapError = require("@validatem/wrap-error"); +const required = require("@validatem/required"); + +module.exports = wrapError("Must be a Modular Matrix session", "modular-matrix.is-session", [ + allowExtraProperties({ _modularMatrixSession: [ required, isValue(true) ] }) +]); diff --git a/package.json b/package.json new file mode 100644 index 0000000..c5a7df3 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "@modular-matrix/is-session", + "description": "Validatem validator for verifying that a value is a Modular Matrix session", + "keywords": [ + "validatem", + "validator" + ], + "version": "0.1.0", + "main": "index.js", + "repository": "http://git.cryto.net/modular-matrix/is-session.git", + "author": "Sven Slootweg ", + "license": "WTFPL OR CC0-1.0", + "dependencies": { + "@validatem/allow-extra-properties": "^0.1.0", + "@validatem/is-value": "^0.1.0", + "@validatem/required": "^0.1.1", + "@validatem/wrap-error": "^0.3.0" + }, + "devDependencies": {} +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..3c246b5 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,93 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@validatem/allow-extra-properties@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@validatem/allow-extra-properties/-/allow-extra-properties-0.1.0.tgz#e8c434818d6fd74b8cb237cfaa4d548295de13c1" + integrity sha512-9jihpYxw1vp4FdjnbN0bTVZMLYv//9OjFNTsVLG5OV4xHESwtgkgQEF5/N5rY1iBwoH/pcKuRl44MBZ8eMdrKw== + dependencies: + "@validatem/with-context" "^0.1.0" + +"@validatem/combinator@^0.1.1": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@validatem/combinator/-/combinator-0.1.2.tgz#eab893d55f1643b9c6857eaf6ff7ed2a728e89ff" + integrity sha512-vE8t1tNXknmN62FlN6LxQmA2c6TwVKZ+fl/Wit3H2unFdOhu7SZj2kRPGjAXdK/ARh/3svYfUBeD75pea0j1Sw== + +"@validatem/error@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@validatem/error/-/error-1.1.0.tgz#bef46e7066c39761b494ebe3eec2ecdc7348f4ed" + integrity sha512-gZJEoZq1COi/8/5v0fVKQ9uX54x5lb5HbV7mzIOhY6dqjmLNfxdQmpECZPQrCAOpcRkRMJ7zaFhq4UTslpY9yA== + +"@validatem/is-value@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@validatem/is-value/-/is-value-0.1.0.tgz#b4c7481818a88d7c24400b9b587f83b388b37d56" + integrity sha512-FrwC6AP4W8dN6GCJEX02qNphoRUaN2JtdbIU2ztwPpLFUSgaJ+zvUrIPYDr8f+8YfrI/QIHm+uiY2TNEjQq/iQ== + dependencies: + "@validatem/error" "^1.0.0" + +"@validatem/match-validation-error@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@validatem/match-validation-error/-/match-validation-error-0.1.0.tgz#fa87f5f1836e7c1d9bf6b75b2addf0a5b21e4c1e" + integrity sha512-6akGTk7DdulOreyqDiGdikwRSixQz/AlvARSX18dcWaTFc79KxCLouL2hyoFcor9IIUhu5RTY4/i756y4T1yxA== + dependencies: + "@validatem/match-versioned-special" "^0.1.0" + +"@validatem/match-versioned-special@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@validatem/match-versioned-special/-/match-versioned-special-0.1.0.tgz#2eacc48debecdbbe7e3d02f0c0a665afaea9bedf" + integrity sha512-xoOTY0bdA2ELj+ntcDVJ8YyMEFIJpjZ4HNPL9lGcbnRFwJBhQcHUAhUpZwkMxu02zH9wkNM1FvYGHxPz40745Q== + +"@validatem/required@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@validatem/required/-/required-0.1.1.tgz#64f4a87333fc5955511634036b7f8948ed269170" + integrity sha512-vI4NzLfay4RFAzp7xyU34PHb8sAo6w/3frrNh1EY9Xjnw2zxjY5oaxwmbFP1jVevBE6QQEnKogtzUHz/Zuvh6g== + +"@validatem/validation-result@^0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@validatem/validation-result/-/validation-result-0.1.2.tgz#4e75cfd87305fc78f8d05ac84921a2c99a0348e0" + integrity sha512-okmP8JarIwIgfpaVcvZGuQ1yOsLKT3Egt49Ynz6h1MAeGsP/bGHXkkXtbiWOVsk5Tzku5vDVFSrFnF+5IEHKxw== + dependencies: + default-value "^1.0.0" + +"@validatem/with-context@^0.1.0": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@validatem/with-context/-/with-context-0.1.2.tgz#3645c04897664f70995104961277e07b61b4f615" + integrity sha512-noAWf4CsmU+BCz+KOg3GPq9+R9BQLWOQnOgWVfkYHFdLnnbLhl8w/ONdzvFzUYGHIZGKZwsWVCp+Kwz/tAfMnA== + dependencies: + "@validatem/combinator" "^0.1.1" + +"@validatem/wrap-error@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@validatem/wrap-error/-/wrap-error-0.3.0.tgz#f8d170e79b6fdd68321d82c60581ad345be7d6b9" + integrity sha512-km5v6F/Xm7j8W/tmCmht2BTzxMLSpBUJ5MdhJD7ABEut/fdO0tNca1u1imTnWCULCJcdDHbNtpSmDMvXFg3E7Q== + dependencies: + "@validatem/combinator" "^0.1.1" + "@validatem/error" "^1.0.0" + "@validatem/match-validation-error" "^0.1.0" + "@validatem/validation-result" "^0.1.2" + as-expression "^1.0.0" + default-value "^1.0.0" + split-filter-n "^1.1.2" + +as-expression@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/as-expression/-/as-expression-1.0.0.tgz#7bc620ca4cb2fe0ee90d86729bd6add33b8fd831" + integrity sha512-Iqh4GxNUfxbJdGn6b7/XMzc8m1Dz2ZHouBQ9DDTzyMRO3VPPIAXeoY/sucRxxxXKbUtzwzWZSN6jPR3zfpYHHA== + +default-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-value/-/default-value-1.0.0.tgz#8c6f52a5a1193fe78fdc9f86eb71d16c9757c83a" + integrity sha1-jG9SpaEZP+eP3J+G63HRbJdXyDo= + dependencies: + es6-promise-try "0.0.1" + +es6-promise-try@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/es6-promise-try/-/es6-promise-try-0.0.1.tgz#10f140dad27459cef949973e5d21a087f7274b20" + integrity sha1-EPFA2tJ0Wc75SZc+XSGgh/cnSyA= + +split-filter-n@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/split-filter-n/-/split-filter-n-1.1.2.tgz#268be1ec9c4d93dfb27b030c06165ac1b6f70f66" + integrity sha512-+hXSQYpKe1uyXPXI4zQtAJAlaF2EzEc+BaF2goMeNL5oUD5YLqrVcpjxELJxpomXfwMCUaYLAszEbdY9gKVdHQ==