From dbb5dcc2a50dacc9e67933983bb6d17fdb78ada0 Mon Sep 17 00:00:00 2001 From: alexandercerutti Date: Tue, 28 Aug 2018 01:48:19 +0200 Subject: [PATCH] Added nfc method to push nfc properties to be patched --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index 6ee0434..5f7a043 100644 --- a/index.js +++ b/index.js @@ -401,6 +401,18 @@ class Pass { return this; } + nfc(...data) { + if (data.length === 1 && data[0] instanceof Array) { + data = data[0]; + } + + let valid = data.filter(d => d instanceof Object && schema.isValid(d, schema.constants.nfcDict)); + + this.props["nfc"] = valid; + + return this; + } + /** * Checks if pass model type is one of the supported ones *