1/** 2 * Copyright 2014, Facebook, Inc. 3 * All rights reserved. 4 * 5 * This source code is licensed under the BSD-style license found in the 6 * LICENSE file in the root directory of this source tree. An additional grant 7 * of patent rights can be found in the PATENTS file in the same directory. 8 * 9 * @providesModule monitorCodeUse 10 */ 11 12"use strict"; 13 14var invariant = require('invariant'); 15 16/** 17 * Provides open-source compatible instrumentation for monitoring certain API 18 * uses before we're ready to issue a warning or refactor. It accepts an event 19 * name which may only contain the characters [a-z0-9_] and an optional data 20 * object with further information. 21 */ 22 23function monitorCodeUse(eventName, data) { 24 invariant( 25 eventName && !/[^a-z0-9_]/.test(eventName), 26 'You must provide an eventName using only the characters [a-z0-9_]' 27 ); 28} 29 30module.exports = monitorCodeUse; 31 32