From f3ebe0a8e528cf79458b816c3b2f61dba5b6ce48 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 15 May 2020 22:46:10 +0200 Subject: [PATCH] Initial commit --- .gitignore | 1 + README.md | 5 +++++ example.js | 11 +++++++++++ index.js | 10 ++++++++++ package.json | 12 ++++++++++++ yarn.lock | 8 ++++++++ 6 files changed, 47 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 example.js 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..cda1edc --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# @validatem/match-virtual-property + +Documentation for this module has not been written yet. By the time it reaches 1.0.0, it will have full documentation. + +In the meantime, check out the `example.js` file in the repository for a usage demonstration. diff --git a/example.js b/example.js new file mode 100644 index 0000000..407f865 --- /dev/null +++ b/example.js @@ -0,0 +1,11 @@ +"use strict"; + +const matchVirtualProperty = require("./"); +const virtualProperty = require("@validatem/virtual-property"); + +let propertyA = virtualProperty("foo"); +let propertyB = "bar"; + +console.log(matchVirtualProperty(propertyA)); // true +console.log(matchVirtualProperty(propertyB)); // false + diff --git a/index.js b/index.js new file mode 100644 index 0000000..c29781e --- /dev/null +++ b/index.js @@ -0,0 +1,10 @@ +"use strict"; + +const createVersionedSpecialCheck = require("@validatem/match-versioned-special"); + +module.exports = createVersionedSpecialCheck({ + markerProperty: "___validatem_isVirtualProperty", + versionProperty: "___validatem_virtualPropertyVersion", + friendlyName: "a virtual property", + expectedVersions: [ 1 ] +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..b5d7aef --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "@validatem/match-virtual-property", + "description": "Utility for checking whether something is a virtual property", + "version": "0.1.0", + "main": "index.js", + "repository": "http://git.cryto.net/validatem/match-virtual-property.git", + "author": "Sven Slootweg ", + "license": "WTFPL OR CC0-1.0", + "devDependencies": { + "@validatem/virtual-property": "^0.1.0" + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..eaf9d31 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@validatem/virtual-property@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@validatem/virtual-property/-/virtual-property-0.1.0.tgz#880540dfd149f98ecf1095d93912e34443381fe4" + integrity sha512-JUUvWtdqoSkOwlsl20oB3qFHYIL05a/TAfdY4AJcs55QeVTiX5iI1b8IoQW644sIWWooBuLv+XwoxjRsQFczlQ==