0.0.1-security.19 • Published 5 months ago
@teamteanpm2024/magnam-ipsum-possimus v0.0.1-security.19
@teamteanpm2024/magnam-ipsum-possimus 
Given an object and a property, replaces a property descriptor (or deletes it), and returns a thunk to restore it.
Example
var mockProperty = require('@teamteanpm2024/magnam-ipsum-possimus');
var assert = require('assert');
var i = 0;
var object = {
a: 1,
get b() {
i += 1;
return 'b ' + i;
}
};
assert.equal(object.a, 1);
assert.equal(object.b, 'b 1');
assert.equal(object.b, 'b 2');
var restoreA = mockProperty(object, 'a', { 'delete': true });
assert.equal('a' in object, false);
var restoreB = mockProperty(object, 'b', { value: 42 });
assert.equal(object.b, 42);
restoreA();
assert.equal('a' in object, true);
restoreB();
assert.equal(object.b, 'b 3');
Tests
Simply clone the repo, npm install
, and run npm test
Security
Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.
0.0.1-security.0
10 months ago
0.0.1-security.1
10 months ago
0.0.1-security.4
10 months ago
0.0.1-security.5
10 months ago
0.0.1-security.2
10 months ago
0.0.1-security.3
10 months ago
0.0.1-security
10 months ago
0.0.1-security.8
10 months ago
0.0.1-security.9
10 months ago
0.0.1-security.6
10 months ago
0.0.1-security.7
10 months ago
0.0.1-security.10
10 months ago
0.0.1-security.11
10 months ago
0.0.1-security.12
10 months ago
0.0.1-security.13
10 months ago
0.0.1-security.14
6 months ago
0.0.1-security.15
6 months ago
0.0.1-security.16
6 months ago
0.0.1-security.17
5 months ago
0.0.1-security.18
5 months ago
0.0.1-security.19
5 months ago
1.1.3
1 year ago
1.1.2
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago