Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
30 lines
547 B
Plaintext
30 lines
547 B
Plaintext
'use strict';
|
|
|
|
var Type = require('../type');
|
|
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
|
function resolveYamlSet(data) {
|
|
if (data === null) return true;
|
|
|
|
var key, object = data;
|
|
|
|
for (key in object) {
|
|
if (_hasOwnProperty.call(object, key)) {
|
|
if (object[key] !== null) return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
function constructYamlSet(data) {
|
|
return data !== null ? data : {};
|
|
}
|
|
|
|
module.exports = new Type('tag:yaml.org,2002:set', {
|
|
kind: 'mapping',
|
|
resolve: resolveYamlSet,
|
|
construct: constructYamlSet
|
|
});
|