Small help with immutable types...
// private readonly int _age;
// public int Age { get { return _age; } }
public int Age { get; }| //+ Jonas Raoni Soares Silva | |
| //@ http://raoni.org | |
| export default class ServerTime { | |
| constructor ({http = new Error('http parameter is required'), url = new Error('url is required'), thresholdDelay = 300, autoSynchronizeProbes = 0}) { | |
| Object.assign(this, { | |
| http, | |
| url, | |
| thresholdDelay, | |
| best: null |
| //+ Jonas Raoni Soares Silva | |
| //@ http://raoni.org | |
| const signalR = require('@aspnet/signalR'); | |
| export default class Hub { | |
| constructor (url, autoReloadTimeout = 1000) { | |
| Object.assign(this, { | |
| url, | |
| autoReloadTimeout, |
| /(["'`])(?:\\.|(?!\1).)*?\1/ |
| //+ Jonas Raoni Soares Silva | |
| //@ http://raoni.org | |
| function tree(items) { | |
| const tree = []; | |
| const map = new Map; | |
| for (const item of items) { | |
| const placeholder = map.get(item.id); | |
| item.children = placeholder ? placeholder.children : []; | |
| map.set(item.id, item); |
| //+ Jonas Raoni Soares Silva | |
| //@ http://raoni.org | |
| // NOTES: | |
| // 1. The vnode is provided by the directive callbacks | |
| // 2. If eval sounds scary to you, you might replace it by any function that provides "navigation" from a string like "array[0].property" (that's what you get from the "expression") =] | |
| getValue (vnode) { | |
| //standard v-model | |
| if (vnode.data.model) { |
| //+ Jonas Raoni Soares Silva | |
| //@ http://raoni.org | |
| export default class NumericDirective { | |
| constructor(input, binding) { | |
| Object.assign(this, { | |
| input, | |
| binding | |
| }); | |
| input.addEventListener('keydown', this); |
| '1234567890.123'.replace(/\d(?=(\d{3})+(?:$|\.))/g, '$& '); |
| registry=https://artifactory.example.com/api/npm/proxy_of_npm/ | |
| //artifactory.example.com/api/npm/proxy_of_npm/:_authToken=SUPER_SECRET_KEY | |
| //artifactory.example.com/api/npm/proxy_of_npm/:always-auth=true | |
| //artifactory.example.com/api/npm/YOUR_PERSONAL_REPOSITORY/:_authToken=SUPER_SECRET_KEY | |
| //artifactory.example.com/api/npm/YOUR_PERSONAL_REPOSITORY/:always-auth=true |
| //+ Jonas Raoni Soares Silva | |
| //@ http://raoni.org | |
| <template lang="pug"> | |
| span.field(@click.stop="") | |
| input.is-checkradio( | |
| v-bind="$attrs" | |
| type="checkbox" | |
| ref="checkbox" | |
| :indeterminate.prop="status === null" |