update
This commit is contained in:
+10
-3
@@ -5,8 +5,15 @@
|
||||
|
||||
"rules": {
|
||||
"id-length": [2, { "min": 1, "max": 35 }],
|
||||
"max-lines-per-function": [2, 100],
|
||||
"max-params": [2, 4],
|
||||
"max-statements": [2, 13]
|
||||
}
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"max-lines-per-function": 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/define-properties
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
+19
@@ -1,3 +1,22 @@
|
||||
1.1.4 / 2022-04-14
|
||||
=================
|
||||
* [Refactor] use `has-property-descriptors`
|
||||
* [readme] add github actions/codecov badges
|
||||
* [Docs] fix header parsing; remove testling
|
||||
* [Deps] update `object-keys`
|
||||
* [meta] use `prepublishOnly` script for npm 7+
|
||||
* [meta] add `funding` field; create FUNDING.yml
|
||||
* [actions] add "Allow Edits" workflow; automatic rebasing / merge commit blocking
|
||||
* [actions] reuse common workflows
|
||||
* [actions] update codecov uploader
|
||||
* [actions] use `node/install` instead of `node/run`; use `codecov` action
|
||||
* [Tests] migrate tests to Github Actions
|
||||
* [Tests] run `nyc` on all tests; use `tape` runner
|
||||
* [Tests] use shared travis-ci config
|
||||
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
|
||||
* [Tests] remove `jscs`
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape`; add `aud`, `safe-publish-latest`
|
||||
|
||||
1.1.3 / 2018-08-14
|
||||
=================
|
||||
* [Refactor] use a for loop instead of `foreach` to make for smaller bundle sizes
|
||||
|
||||
+11
-13
@@ -1,6 +1,7 @@
|
||||
#define-properties <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
# define-properties <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![Build Status][travis-svg]][travis-url]
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][deps-svg]][deps-url]
|
||||
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
||||
[![License][license-image]][license-url]
|
||||
@@ -8,8 +9,6 @@
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
[![browser support][testling-svg]][testling-url]
|
||||
|
||||
Define multiple non-enumerable properties at once. Uses `Object.defineProperty` when available; falls back to standard assignment in older engines.
|
||||
Existing properties are not overridden. Accepts a map of property names to a predicate that, when true, force-overrides.
|
||||
|
||||
@@ -69,18 +68,17 @@ if (define.supportsDescriptors) {
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.org/package/define-properties
|
||||
[npm-version-svg]: http://versionbadg.es/ljharb/define-properties.svg
|
||||
[travis-svg]: https://travis-ci.org/ljharb/define-properties.svg
|
||||
[travis-url]: https://travis-ci.org/ljharb/define-properties
|
||||
[npm-version-svg]: https://versionbadg.es/ljharb/define-properties.svg
|
||||
[deps-svg]: https://david-dm.org/ljharb/define-properties.svg
|
||||
[deps-url]: https://david-dm.org/ljharb/define-properties
|
||||
[dev-deps-svg]: https://david-dm.org/ljharb/define-properties/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/ljharb/define-properties#info=devDependencies
|
||||
[testling-svg]: https://ci.testling.com/ljharb/define-properties.png
|
||||
[testling-url]: https://ci.testling.com/ljharb/define-properties
|
||||
[npm-badge-png]: https://nodei.co/npm/define-properties.png?downloads=true&stars=true
|
||||
[license-image]: http://img.shields.io/npm/l/define-properties.svg
|
||||
[license-image]: https://img.shields.io/npm/l/define-properties.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: http://img.shields.io/npm/dm/define-properties.svg
|
||||
[downloads-url]: http://npm-stat.com/charts.html?package=define-properties
|
||||
|
||||
[downloads-image]: https://img.shields.io/npm/dm/define-properties.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=define-properties
|
||||
[codecov-image]: https://codecov.io/gh/ljharb/define-properties/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/ljharb/define-properties/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-properties
|
||||
[actions-url]: https://github.com/ljharb/define-properties/actions
|
||||
|
||||
+4
-15
@@ -11,20 +11,9 @@ var isFunction = function (fn) {
|
||||
return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
|
||||
};
|
||||
|
||||
var arePropertyDescriptorsSupported = function () {
|
||||
var obj = {};
|
||||
try {
|
||||
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
|
||||
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
|
||||
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
|
||||
return false;
|
||||
}
|
||||
return obj.x === obj;
|
||||
} catch (e) { /* this is IE 8. */
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
|
||||
var hasPropertyDescriptors = require('has-property-descriptors')();
|
||||
|
||||
var supportsDescriptors = origDefineProperty && hasPropertyDescriptors;
|
||||
|
||||
var defineProperty = function (object, name, value, predicate) {
|
||||
if (name in object && (!isFunction(predicate) || !predicate())) {
|
||||
@@ -38,7 +27,7 @@ var defineProperty = function (object, name, value, predicate) {
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
object[name] = value;
|
||||
object[name] = value; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+35
-33
@@ -1,63 +1,68 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"define-properties@1.1.3",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"define-properties@1.1.4",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "define-properties@1.1.3",
|
||||
"_id": "define-properties@1.1.3",
|
||||
"_from": "define-properties@1.1.4",
|
||||
"_id": "define-properties@1.1.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
|
||||
"_integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==",
|
||||
"_location": "/define-properties",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "define-properties@1.1.3",
|
||||
"raw": "define-properties@1.1.4",
|
||||
"name": "define-properties",
|
||||
"escapedName": "define-properties",
|
||||
"rawSpec": "1.1.3",
|
||||
"rawSpec": "1.1.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.3"
|
||||
"fetchSpec": "1.1.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/array-includes",
|
||||
"/array.prototype.flat",
|
||||
"/html-webpack-plugin/util.promisify",
|
||||
"/is-nan",
|
||||
"/object-is",
|
||||
"/array.prototype.reduce",
|
||||
"/function.prototype.name",
|
||||
"/object.assign",
|
||||
"/object.getownpropertydescriptors",
|
||||
"/object.values",
|
||||
"/regexp.prototype.flags",
|
||||
"/string.prototype.trimend",
|
||||
"/string.prototype.trimstart",
|
||||
"/util.promisify"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
||||
"_spec": "1.1.3",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz",
|
||||
"_spec": "1.1.4",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Jordan Harband"
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/define-properties/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"object-keys": "^1.0.12"
|
||||
"has-property-descriptors": "^1.0.0",
|
||||
"object-keys": "^1.1.1"
|
||||
},
|
||||
"description": "Define multiple non-enumerable properties at once. Uses `Object.defineProperty` when available; falls back to standard assignment in older engines.",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^13.0.0",
|
||||
"covert": "^1.1.0",
|
||||
"eslint": "^5.3.0",
|
||||
"jscs": "^3.0.7",
|
||||
"nsp": "^3.2.1",
|
||||
"tape": "^4.9.0"
|
||||
"@ljharb/eslint-config": "^21.0.0",
|
||||
"aud": "^2.0.0",
|
||||
"eslint": "=8.8.0",
|
||||
"nyc": "^10.3.2",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.5.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/define-properties#readme",
|
||||
"keywords": [
|
||||
"Object.defineProperty",
|
||||
@@ -76,16 +81,13 @@
|
||||
"url": "git://github.com/ljharb/define-properties.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "covert test/*.js",
|
||||
"coverage-quiet": "covert test/*.js --quiet",
|
||||
"eslint": "eslint test/*.js *.js",
|
||||
"jscs": "jscs test/*.js *.js",
|
||||
"lint": "npm run --silent jscs && npm run --silent eslint",
|
||||
"posttest": "npm run --silent security",
|
||||
"pretest": "npm run --silent lint",
|
||||
"security": "nsp check",
|
||||
"test": "npm run --silent tests-only",
|
||||
"tests-only": "node test/index.js"
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"posttest": "aud --production",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run tests-only",
|
||||
"tests-only": "nyc tape 'test/**/*.js'"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/index.js",
|
||||
@@ -105,5 +107,5 @@
|
||||
"android-browser/4.2"
|
||||
]
|
||||
},
|
||||
"version": "1.1.3"
|
||||
"version": "1.1.4"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user