simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

objectWithoutProperties.js (635B)


      1 import objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose.js";
      2 export default function _objectWithoutProperties(source, excluded) {
      3   if (source == null) return {};
      4   var target = objectWithoutPropertiesLoose(source, excluded);
      5   var key, i;
      6 
      7   if (Object.getOwnPropertySymbols) {
      8     var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      9 
     10     for (i = 0; i < sourceSymbolKeys.length; i++) {
     11       key = sourceSymbolKeys[i];
     12       if (excluded.indexOf(key) >= 0) continue;
     13       if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
     14       target[key] = source[key];
     15     }
     16   }
     17 
     18   return target;
     19 }