Bug#1033929: marked as done (unblock: node-interpret/2.2.0-3) (2/2)
From
Debian Bug Tracking System@21:1/5 to
All on Tue Apr 4 23:40:02 2023
[continued from previous message]
- * - a constructor function, for comparing using instanceof
- * - a regular expression, to compare with the error message
- * - a string, to find in the error message
- */
-var functionThrows = exports.functionThrows = function functionThrows(fn, context, args, value) {
- try {
- fn.apply(context, args);
- } catch (error) {
- if (value == null) return true;
-
- if (isFunction(value) && error instanceof value) return true;
-
- var message = error.message || error;
-
- if (typeof message === 'string') {
- if ((0, _isRegex2.default)(value) && value.test(error.message)) return true;
-
- if (typeof value === 'string' && message.indexOf(value) !== -1) return true;
- }
- }
-
- return false;
-};
-
-/**
- * Returns true if the given array contains the value, false
- * otherwise. The compareValues function must return false to
- * indicate a non-match.
- */
-var arrayContains = exports.arrayContains = function arrayContains(array, value, compareValues) {
- return array.some(function (item) {
- return compareValues(item, value) !== false;
- });
-};
-
-var ownEnumerableKeys = function ownEnumerableKeys(object) {
- if ((typeof Reflect === 'undefined' ? 'undefined' : _typeof(Reflect)) === 'object' && typeof Reflect.ownKeys === 'function') {
- return Reflect.ownKeys(object).filter(function (key) {
- return Object.getOwnPropertyDescriptor(object, key).enumerable;
- });
- }
-
- if (typeof Object.getOwnPropertySymbols === 'function') {
- return Object.getOwnPropertySymbols(object).filter(function (key) {
- return Object.getOwnPropertyDescriptor(object, key).enumerable;
- }).concat((0, _objectKeys2.default)(object));
- }
-
- return (0, _objectKeys2.default)(object);
-};
-
-/**
- * Returns true if the given object contains the value, false
- * otherwise. The compareValues function must return false to
- * indicate a non-match.
- */
-var objectContains = exports.objectContains = function objectContains(object, value, compareValues) {
- return ownEnumerableKeys(value).every(function (k) {
- if (isObject(object[k]) && isObject(value[k])) return objectContains(object[k], value[k], compareValues);
-
- return compareValues(object[k], value[k]);
- });
-};
-
-/**
- * Returns true if the given string contains the value, false otherwise.
- */
-var stringContains = exports.stringContains = function stringContains(string, value) {
- return string.indexOf(value) !== -1;
-};
\ No newline at end of file
diff --git a/debian/tests/test_modules/expect/lib/assert.js b/debian/tests/test_modules/expect/lib/assert.js
deleted file mode 100644
index 9c1a80c..0000000
--- a/debian/tests/test_modules/expect/lib/assert.js
+++ /dev/null
@@ -1,32 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _objectInspect = require('object-inspect');
-
-var _objectInspect2 = _interopRequireDefault(_objectInspect);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var formatString = function formatString(string, args) {
- var index = 0;
- return string.replace(/%s/g, function () {
- return (0, _objectInspect2.default)(args[index++]);
- });
-};
-
-var assert = function assert(condition, createMessage) {
- for (var _len = arguments.length, extraArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- extraArgs[_key - 2] = arguments[_key];
- }
-
- if (condition) return;
-
- var message = typeof createMessage === 'string' ? formatString(createMessage, extraArgs) : createMessage(extraArgs);
-
- throw new Error(message);
-};
-
-exp